From 82d036265c1201cc197ea500d2a7b3516fc65c9a Mon Sep 17 00:00:00 2001 From: Albert Vaca Date: Fri, 11 Sep 2015 07:19:07 -0700 Subject: [PATCH] Acquire the discovery mode when refreshing the KCM, in case it's not there --- kcm/kcm.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kcm/kcm.cpp b/kcm/kcm.cpp index a2ac58089..db225d1d3 100644 --- a/kcm/kcm.cpp +++ b/kcm/kcm.cpp @@ -44,6 +44,8 @@ K_PLUGIN_FACTORY(KdeConnectKcmFactory, registerPlugin();) +static QString createId() { return QStringLiteral("kcm")+QString::number(QCoreApplication::applicationPid()); } + KdeConnectKcm::KdeConnectKcm(QWidget *parent, const QVariantList&) : KCModule(KAboutData::pluginData("kdeconnect-kcm"), parent) , kcmUi(new Ui::KdeConnectKcmUi()) @@ -103,6 +105,8 @@ KdeConnectKcm::KdeConnectKcm(QWidget *parent, const QVariantList&) this, SLOT(renameDone())); connect(kcmUi->renameShow_button,SIGNAL(clicked()), this, SLOT(renameShow())); + + daemon->acquireDiscoveryMode(createId()); } void KdeConnectKcm::renameShow() @@ -132,11 +136,13 @@ void KdeConnectKcm::setRenameMode(bool b) { KdeConnectKcm::~KdeConnectKcm() { + daemon->releaseDiscoveryMode(createId()); delete kcmUi; } void KdeConnectKcm::refresh() { + daemon->acquireDiscoveryMode(createId()); daemon->forceOnNetworkChange(); }