From 38d01643b7c8da04e68ac77681bba9aa0cf9a535 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sat, 8 Jul 2023 07:04:30 +0300 Subject: [PATCH] kinfocenter: remove unused bits Signed-off-by: Ivailo Monev --- kinfocenter/Modules/devinfo/devicelisting.cpp | 15 ------ kinfocenter/Modules/devinfo/devicelisting.h | 6 --- kinfocenter/Modules/devinfo/nicsignals.cpp | 42 --------------- kinfocenter/Modules/devinfo/nicsignals.h | 52 ------------------- .../Modules/devinfo/soldevicetypes.cpp | 3 +- 5 files changed, 1 insertion(+), 117 deletions(-) delete mode 100644 kinfocenter/Modules/devinfo/nicsignals.cpp delete mode 100644 kinfocenter/Modules/devinfo/nicsignals.h diff --git a/kinfocenter/Modules/devinfo/devicelisting.cpp b/kinfocenter/Modules/devinfo/devicelisting.cpp index 7bf77aac..2ab36d43 100644 --- a/kinfocenter/Modules/devinfo/devicelisting.cpp +++ b/kinfocenter/Modules/devinfo/devicelisting.cpp @@ -27,10 +27,6 @@ DeviceListing::DeviceListing(QWidget *parent, InfoPanel *info, DevInfoPlugin *stat) : QTreeWidget(parent), iPanel(info), status(stat) { -// // Check nic changes -// nicSig = new NicSignals(); -// connect(nicSig,SIGNAL(nicActivatedOrDisconnected()),this,SLOT(networkingChangedSlot())); -// // Check if clicked connect(this,SIGNAL(itemActivated(QTreeWidgetItem*,int)),this,SLOT(itemActivatedSlot(QTreeWidgetItem*,int))); @@ -237,14 +233,3 @@ void DeviceListing::showRelevantDevicesSlot() { populateListing(RELEVANT); } - -void DeviceListing::networkingChangedSlot() -{ - QTreeWidgetItemIterator treeWidget(this); - while (*treeWidget) - { - SolDevice *item = static_cast(*treeWidget); - if(item->deviceType() == Solid::DeviceInterface::NetworkInterface) item->refreshName(); - ++treeWidget; - } -} diff --git a/kinfocenter/Modules/devinfo/devicelisting.h b/kinfocenter/Modules/devinfo/devicelisting.h index eec5040f..3e19be3a 100644 --- a/kinfocenter/Modules/devinfo/devicelisting.h +++ b/kinfocenter/Modules/devinfo/devicelisting.h @@ -29,7 +29,6 @@ #include #include #include -#include //QT #include @@ -44,14 +43,12 @@ #include "soldevicetypes.h" #include "devinfo.h" #include "solidhelper.h" -//#include "nicsignals.h" //Kde #include class InfoPanel; class DevInfoPlugin; -//class NicSignals; class DeviceListing : public QTreeWidget { @@ -86,8 +83,6 @@ class DeviceListing : public QTreeWidget InfoPanel *iPanel; QAction *colAct, *expAct, *allAct, *relAct; DevInfoPlugin *status; - Solid::Networking::Notifier *network; - //NicSignals *nicSig; public slots: void itemActivatedSlot(QTreeWidgetItem *,const int); @@ -97,7 +92,6 @@ class DeviceListing : public QTreeWidget void expandAllDevicesSlot(); void showAllDevicesSlot(); void showRelevantDevicesSlot(); - void networkingChangedSlot(); }; #endif //DEVICELISTING diff --git a/kinfocenter/Modules/devinfo/nicsignals.cpp b/kinfocenter/Modules/devinfo/nicsignals.cpp deleted file mode 100644 index 27787ff5..00000000 --- a/kinfocenter/Modules/devinfo/nicsignals.cpp +++ /dev/null @@ -1,42 +0,0 @@ - -/* nicsignals.cpp - * - * Copyright (C) 2009 David Hubner - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "nicsignals.h" - -NicSignals::NicSignals() -{ - connectToNicSignals(); -} - -void NicSignals::connectToNicSignals() -{ - const QList nicList = Solid::Control::NetworkManager::networkInterfaces(); - - foreach(const Solid::Control::NetworkInterface *nic, nicList) { - connect(nic,SIGNAL(connectionStateChanged(int,int,int)),this,SLOT(nicChangedSignal(int,int,int))); - } -} - -void NicSignals::nicChangedSignal(const int &ns,const int &os,const int &reason) -{ - Q_UNUSED(os); Q_UNUSED(reason); - if(ns==8 || ns==2) emit nicActivatedOrDisconnected(); -} diff --git a/kinfocenter/Modules/devinfo/nicsignals.h b/kinfocenter/Modules/devinfo/nicsignals.h deleted file mode 100644 index 6142dd87..00000000 --- a/kinfocenter/Modules/devinfo/nicsignals.h +++ /dev/null @@ -1,52 +0,0 @@ - -/* - * nicsignals.h - * - * Copyright (C) 2009 David Hubner - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef NICSIGNALS -#define NICSIGNALS - -//Qt -#include - -//KDE -#include -#include -#include - -class NicSignals : public QObject -{ - Q_OBJECT - - public: - NicSignals(); - - private: - void connectToNicSignals(); - - signals: - void nicActivatedOrDisconnected(); - - public slots: - void nicChangedSignal(const int &,const int &,const int &); - -}; - -#endif //NICSIGNALS diff --git a/kinfocenter/Modules/devinfo/soldevicetypes.cpp b/kinfocenter/Modules/devinfo/soldevicetypes.cpp index eb4e56a6..e0cda356 100644 --- a/kinfocenter/Modules/devinfo/soldevicetypes.cpp +++ b/kinfocenter/Modules/devinfo/soldevicetypes.cpp @@ -208,8 +208,7 @@ void SolNetworkDevice::setDefaultListing(const Solid::DeviceInterface::Type &typ } void SolNetworkDevice::setDefaultDeviceText() -{ - QString actTog = i18n("Connected"); +{ const Solid::NetworkInterface *netdev = interface(); if(!netdev) return;