kinfocenter: implement exporting of information for currently selected device item from usbview module

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-04-27 18:29:44 +03:00
parent ead5eb7e5b
commit 11bb4bf6d3

View file

@ -17,6 +17,7 @@
#include <QList>
#include <QTreeWidget>
#include <QHeaderView>
#include <QDebug>
#include <kaboutdata.h>
#include <kdialog.h>
@ -33,6 +34,7 @@ USBViewer::USBViewer(QWidget *parent, const QVariantList &) :
KCModule(USBFactory::componentData(), parent) {
setQuickHelp(i18n("This module allows you to see the devices attached to your USB bus(es)."));
setButtons(KCModule::Help | KCModule::Export);
QHBoxLayout *mainLayout = new QHBoxLayout(this);
mainLayout->setMargin(0);
@ -158,6 +160,10 @@ void USBViewer::refresh() {
if (_devices->selectedItems().isEmpty() == true) {
selectionChanged(_devices->topLevelItem(0));
}
// TODO: export all devices information
setExportText(_details->toPlainText());
// qDebug() << Q_FUNC_INFO << _details->toPlainText();
}
void USBViewer::selectionChanged(QTreeWidgetItem *item) {