on xenial help sign in
Make test pass under chroot+adt-run
commit6e12f1b18fe7c6f7ccf14984536326df6dfdb073 authorAlbert Astals Cid <albert.astals@canonical.com> dateThu 21 May 2015, 18:05 (11 years ago) parentb15004a
2 files changed+11−2
plugins/Wizard/System.cpp+8−2 plugins/Wizard/System.h+3
plugins/Wizard/System.cpp+8−2
@@ -35,7 +35,7 @@ System::System()
3535 m_fsWatcher.addPath(wizardEnabledPath());
3636 }
3737 connect(&m_fsWatcher, SIGNAL(fileChanged(const QString &)),
38− this, SIGNAL(wizardEnabledChanged()));
38+ this, SLOT(watcherFileChanged()));
3939}
4040
4141QString System::wizardEnabledPath()
@@ -60,10 +60,16 @@ void System::setWizardEnabled(bool enabled)
6060 QDir(wizardEnabledPath()).mkpath("..");
6161 QFile(wizardEnabledPath()).open(QIODevice::WriteOnly);
6262 m_fsWatcher.addPath(wizardEnabledPath());
63− wizardEnabledChanged();
63+ Q_EMIT wizardEnabledChanged();
6464 }
6565}
6666
67+void System::watcherFileChanged()
68+{
69+ Q_EMIT wizardEnabledChanged();
70+ m_fsWatcher.removePath(wizardEnabledPath());
71+}
72+
6773void System::setSessionVariable(const QString &variable, const QString &value)
6874{
6975 // We need to update both upstart's and DBus's environment
plugins/Wizard/System.h+3
@@ -38,6 +38,9 @@ public Q_SLOTS:
3838Q_SIGNALS:
3939 void wizardEnabledChanged();
4040
41+private Q_SLOTS:
42+ void watcherFileChanged();
43+
4144private:
4245 Q_DISABLE_COPY(System)
4346