on xenial help sign in
Make test pass under chroot+adt-run
6e12f1bAlbert Astals Cid
plugins/Wizard/System.cpp+8−2
@@ -35,7 +35,7 @@ System::System()
35 m_fsWatcher.addPath(wizardEnabledPath());
35 m_fsWatcher.addPath(wizardEnabledPath());
36 }
36 }
37 connect(&m_fsWatcher, SIGNAL(fileChanged(const QString &)),
37 connect(&m_fsWatcher, SIGNAL(fileChanged(const QString &)),
38− this, SIGNAL(wizardEnabledChanged()));
38+ this, SLOT(watcherFileChanged()));
39}
39}
40
40
41QString System::wizardEnabledPath()
41QString System::wizardEnabledPath()
@@ -60,10 +60,16 @@ void System::setWizardEnabled(bool enabled)
60 QDir(wizardEnabledPath()).mkpath("..");
60 QDir(wizardEnabledPath()).mkpath("..");
61 QFile(wizardEnabledPath()).open(QIODevice::WriteOnly);
61 QFile(wizardEnabledPath()).open(QIODevice::WriteOnly);
62 m_fsWatcher.addPath(wizardEnabledPath());
62 m_fsWatcher.addPath(wizardEnabledPath());
63− wizardEnabledChanged();
63+ Q_EMIT wizardEnabledChanged();
64 }
64 }
65}
65}
66
66
67+void System::watcherFileChanged()
68+{
69+ Q_EMIT wizardEnabledChanged();
70+ m_fsWatcher.removePath(wizardEnabledPath());
71+}
72+
67void System::setSessionVariable(const QString &variable, const QString &value)
73void System::setSessionVariable(const QString &variable, const QString &value)
68{
74{
69 // We need to update both upstart's and DBus's environment
75 // We need to update both upstart's and DBus's environment
plugins/Wizard/System.h+3
@@ -38,6 +38,9 @@ public Q_SLOTS:
38Q_SIGNALS:
38Q_SIGNALS:
39 void wizardEnabledChanged();
39 void wizardEnabledChanged();
40
40
41+private Q_SLOTS:
42+ void watcherFileChanged();
43+
41private:
44private:
42 Q_DISABLE_COPY(System)
45 Q_DISABLE_COPY(System)
43
46