on xenial help sign in
Get the upstart proxy in the private data
9a701bcTed Gould
plugins/Unity/Indicators/indicatorsmanager.cpp+23−1
@@ -21,6 +21,8 @@
21#include <QSettings>
21#include <QSettings>
22#include <QDebug>
22#include <QDebug>
23
23
24+#include <upstart.h>
25+
24#include "paths.h"
26#include "paths.h"
25
27
26
28
@@ -31,13 +33,33 @@ public:
31 : m_name(name)
33 : m_name(name)
32 , m_fileInfo(fileInfo)
34 , m_fileInfo(fileInfo)
33 , m_verified (true)
35 , m_verified (true)
36+ , m_upstart (NULL)
34− {}
37+ {
38+ auto upstartsession = qgetenv("UPSTART_SESSION");
39+ if (!upstartsession.isNull()) {
40+ DBusConnection * conn = NULL;
41+ conn = dbus_connection_open(upstartsession.constData(), NULL);
42+ if (conn != NULL) {
43+ m_upstart = nih_dbus_proxy_new(NULL, conn,
44+ NULL,
45+ DBUS_PATH_UPSTART,
46+ NULL, NULL);
47+ dbus_connection_unref(conn);
48+ }
49+ }
50+
51+ if (m_upstart != NULL) {
52+ m_upstart->auto_start = FALSE;
53+ }
54+ }
35
55
36 QString m_name;
56 QString m_name;
37 QFileInfo m_fileInfo;
57 QFileInfo m_fileInfo;
38
58
39 bool m_verified;
59 bool m_verified;
40 Indicator::Ptr m_indicator;
60 Indicator::Ptr m_indicator;
61+
62+ NihDBusProxy * m_upstart;
41};
63};
42
64
43IndicatorsManager::IndicatorsManager(QObject* parent)
65IndicatorsManager::IndicatorsManager(QObject* parent)