From e809fa441c94a1bcdf0394a4d4c3ddb02e9c2c63 Mon Sep 17 00:00:00 2001 From: Albert Vaca Date: Mon, 11 Aug 2014 18:56:11 +0200 Subject: [PATCH] Added a refresh button to KCM, just in case. We already have a refresh button on Android. --- kcm/kcm.cpp | 9 ++++++++- kcm/kcm.h | 1 + kcm/kcm.ui | 10 +++++++--- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/kcm/kcm.cpp b/kcm/kcm.cpp index 746c7c8c8..2eff3cdad 100644 --- a/kcm/kcm.cpp +++ b/kcm/kcm.cpp @@ -75,7 +75,8 @@ KdeConnectKcm::KdeConnectKcm(QWidget *parent, const QVariantList&) this, SLOT(unpair())); connect(kcmUi->ping_button, SIGNAL(pressed()), this, SLOT(sendPing())); - + connect(kcmUi->refresh_button,SIGNAL(pressed()), + this, SLOT(refresh())); } KdeConnectKcm::~KdeConnectKcm() @@ -83,6 +84,12 @@ KdeConnectKcm::~KdeConnectKcm() } +void KdeConnectKcm::refresh() +{ + QDBusMessage msg = QDBusMessage::createMethodCall("org.kde.kdeconnect", "/modules/kdeconnect", "org.kde.kdeconnect.daemon", "forceOnNetworkChange"); + QDBusConnection::sessionBus().call(msg); +} + void KdeConnectKcm::resetSelection() { kcmUi->deviceList->selectionModel()->setCurrentIndex(sortProxyModel->mapFromSource(currentIndex), QItemSelectionModel::ClearAndSelect); diff --git a/kcm/kcm.h b/kcm/kcm.h index 91ecdc718..92f123de8 100644 --- a/kcm/kcm.h +++ b/kcm/kcm.h @@ -61,6 +61,7 @@ private Q_SLOTS: void pairingSuccesful(); void pairingFailed(const QString& error); void unpaired(); + void refresh(); private: Ui::KdeConnectKcmUi* kcmUi; diff --git a/kcm/kcm.ui b/kcm/kcm.ui index a92d283f8..63ca38795 100644 --- a/kcm/kcm.ui +++ b/kcm/kcm.ui @@ -32,12 +32,16 @@ - - 0 - + + + + Refresh + + +