summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrius Štikonas <andrius@stikonas.eu>2016-06-12 01:22:08 (GMT)
committerAndrius Štikonas <andrius@stikonas.eu>2016-06-12 01:22:08 (GMT)
commitce73e76861579826d2dc1f132fe548ffe1d1ff7d (patch)
treeeca50ed7970be6b89b30bbe775617764ef802017
parent3c117f274438fe2a33306d7d13316d535d93f174 (diff)
Port to QNetworkConfigurationManager.
-rw-r--r--keysmanager.cpp22
-rw-r--r--keysmanager.h18
2 files changed, 13 insertions, 27 deletions
diff --git a/keysmanager.cpp b/keysmanager.cpp
index cc8c0db..7b7c234 100644
--- a/keysmanager.cpp
+++ b/keysmanager.cpp
@@ -92,6 +92,7 @@
#include <QList>
#include <QMenu>
#include <QMetaObject>
+#include <QNetworkConfigurationManager>
#include <QPainter>
#include <QPrintDialog>
#include <QPrinter>
@@ -105,7 +106,6 @@
#include <kio/global.h>
#include <kjobtrackerinterface.h>
#include <ktip.h>
-#include <solid/networking.h>
using namespace KgpgCore;
@@ -466,11 +466,10 @@ KeysManager::KeysManager(QWidget *parent)
connect(this, SIGNAL(fontChanged(QFont)), s_kgpgEditor, SLOT(slotSetFont(QFont)));
- m_netnote = Solid::Networking::notifier();
- connect(m_netnote, SIGNAL(shouldConnect()), SLOT(slotNetworkUp()));
- connect(m_netnote, SIGNAL(shouldDisconnect()), SLOT(slotNetworkDown()));
+ m_netnote = new QNetworkConfigurationManager;
+ connect(m_netnote, &QNetworkConfigurationManager::onlineStateChanged, this, &KeysManager::toggleNetworkActions);
- toggleNetworkActions(Solid::Networking::status() == Solid::Networking::Unknown || Solid::Networking::status() == Solid::Networking::Connected);
+ toggleNetworkActions(m_netnote->isOnline());
importSignatureKey->setEnabled(false);
stateChanged("empty_list");
@@ -480,6 +479,7 @@ KeysManager::KeysManager(QWidget *parent)
KeysManager::~KeysManager()
{
+ delete m_netnote;
}
void KeysManager::slotGenerateKey()
@@ -2628,18 +2628,6 @@ KGpgItemModel *KeysManager::getModel()
}
void
-KeysManager::slotNetworkUp()
-{
- toggleNetworkActions(true);
-}
-
-void
-KeysManager::slotNetworkDown()
-{
- toggleNetworkActions(false);
-}
-
-void
KeysManager::toggleNetworkActions(bool online)
{
m_online = online;
diff --git a/keysmanager.h b/keysmanager.h
index e541642..79e27c8 100644
--- a/keysmanager.h
+++ b/keysmanager.h
@@ -23,21 +23,22 @@
#include <KDialog>
#include <KToggleAction>
-#include <QUrl>
#include <KXmlGuiWindow>
+
#include <QClipboard>
#include <QSet>
-#include <solid/networking.h>
+#include <QUrl>
class KJob;
-class QEvent;
class KSelectAction;
-class QMenu;
-class QLineEdit;
+
class QAction;
-class KJob;
+class QEvent;
class QKeySequence;
+class QLineEdit;
+class QNetworkConfigurationManager;
+class QMenu;
class KeyServer;
class KgpgEditor;
@@ -224,9 +225,6 @@ private slots:
void slotSetClip(int result);
void slotOpenKeyUrl();
- void slotNetworkUp();
- void slotNetworkDown();
-
private:
KGpgItemModel *imodel;
KeyListProxyModel *iproxy;
@@ -293,7 +291,7 @@ private:
// react to network status changes
bool m_online;
- Solid::Networking::Notifier *m_netnote;
+ QNetworkConfigurationManager *m_netnote;
void toggleNetworkActions(bool online);
KStatusNotifierItem *m_trayicon;