Acquire the discovery mode when refreshing the KCM, in case it's not there

This commit is contained in:
Albert Vaca 2015-09-11 07:19:07 -07:00
parent 89afa5b9af
commit 82d036265c

View file

@ -44,6 +44,8 @@
K_PLUGIN_FACTORY(KdeConnectKcmFactory, registerPlugin<KdeConnectKcm>();) K_PLUGIN_FACTORY(KdeConnectKcmFactory, registerPlugin<KdeConnectKcm>();)
static QString createId() { return QStringLiteral("kcm")+QString::number(QCoreApplication::applicationPid()); }
KdeConnectKcm::KdeConnectKcm(QWidget *parent, const QVariantList&) KdeConnectKcm::KdeConnectKcm(QWidget *parent, const QVariantList&)
: KCModule(KAboutData::pluginData("kdeconnect-kcm"), parent) : KCModule(KAboutData::pluginData("kdeconnect-kcm"), parent)
, kcmUi(new Ui::KdeConnectKcmUi()) , kcmUi(new Ui::KdeConnectKcmUi())
@ -103,6 +105,8 @@ KdeConnectKcm::KdeConnectKcm(QWidget *parent, const QVariantList&)
this, SLOT(renameDone())); this, SLOT(renameDone()));
connect(kcmUi->renameShow_button,SIGNAL(clicked()), connect(kcmUi->renameShow_button,SIGNAL(clicked()),
this, SLOT(renameShow())); this, SLOT(renameShow()));
daemon->acquireDiscoveryMode(createId());
} }
void KdeConnectKcm::renameShow() void KdeConnectKcm::renameShow()
@ -132,11 +136,13 @@ void KdeConnectKcm::setRenameMode(bool b) {
KdeConnectKcm::~KdeConnectKcm() KdeConnectKcm::~KdeConnectKcm()
{ {
daemon->releaseDiscoveryMode(createId());
delete kcmUi; delete kcmUi;
} }
void KdeConnectKcm::refresh() void KdeConnectKcm::refresh()
{ {
daemon->acquireDiscoveryMode(createId());
daemon->forceOnNetworkChange(); daemon->forceOnNetworkChange();
} }