on xenial help sign in
Put the data in the wrong object
commit78f0d77ada1e0970d95cf8c76dbd09361cec447f authorTed Gould <ted@gould.cx> dateWed 7 Aug 2013, 10:11 (13 years ago) parente5e440d
2 files changed+25−28
plugins/Unity/Indicators/indicatorsmanager.cpp+22−28 plugins/Unity/Indicators/indicatorsmanager.h+3
plugins/Unity/Indicators/indicatorsmanager.cpp+22−28
@@ -21,7 +21,6 @@
2121#include <QSettings>
2222#include <QDebug>
2323
24−#include <upstart.h>
2524#include <nih/alloc.h>
2625
2726#include "paths.h"
@@ -34,32 +33,7 @@ public:
3433 : m_name(name)
3534 , m_fileInfo(fileInfo)
3635 , m_verified (true)
37− , m_upstart (NULL)
3836 {
39− auto upstartsession = qgetenv("UPSTART_SESSION");
40− if (!upstartsession.isNull()) {
41− DBusConnection * conn = NULL;
42− conn = dbus_connection_open(upstartsession.constData(), NULL);
43− if (conn != NULL) {
44− m_upstart = nih_dbus_proxy_new(NULL, conn,
45− NULL,
46− DBUS_PATH_UPSTART,
47− NULL, NULL);
48− dbus_connection_unref(conn);
49− }
50− }
51−
52− if (m_upstart != NULL) {
53− m_upstart->auto_start = FALSE;
54− }
55− }
56−
57− ~IndicatorData ()
58− {
59− if (m_upstart != NULL) {
60− nih_unref(m_upstart, NULL);
61− m_upstart = NULL;
62− }
6337 }
6438
6539 QString m_name;
@@ -67,19 +41,39 @@ public:
6741
6842 bool m_verified;
6943 Indicator::Ptr m_indicator;
70−
71− NihDBusProxy * m_upstart;
7244};
7345
7446IndicatorsManager::IndicatorsManager(QObject* parent)
7547 : QObject(parent)
7648 , m_loaded(false)
49+ , m_upstart(NULL)
7750{
51+ auto upstartsession = qgetenv("UPSTART_SESSION");
52+ if (!upstartsession.isNull()) {
53+ DBusConnection * conn = NULL;
54+ conn = dbus_connection_open(upstartsession.constData(), NULL);
55+ if (conn != NULL) {
56+ m_upstart = nih_dbus_proxy_new(NULL, conn,
57+ NULL,
58+ DBUS_PATH_UPSTART,
59+ NULL, NULL);
60+ dbus_connection_unref(conn);
61+ }
62+ }
63+
64+ if (m_upstart != NULL) {
65+ m_upstart->auto_start = FALSE;
66+ }
7867}
7968
8069IndicatorsManager::~IndicatorsManager()
8170{
8271 unload();
72+
73+ if (m_upstart != NULL) {
74+ nih_unref(m_upstart, NULL);
75+ m_upstart = NULL;
76+ }
8377}
8478
8579void IndicatorsManager::load()
plugins/Unity/Indicators/indicatorsmanager.h+3
@@ -28,6 +28,8 @@
2828#include <QHash>
2929#include <QSharedPointer>
3030
31+#include <upstart.h>
32+
3133class UNITYINDICATORS_EXPORT IndicatorsManager : public QObject
3234{
3335 Q_OBJECT
@@ -69,6 +71,7 @@ private:
6971 QHash<QString, IndicatorData*> m_indicatorsData;
7072 QSharedPointer<QFileSystemWatcher> m_fsWatcher;
7173 bool m_loaded;
74+ NihDBusProxy * m_upstart;
7275};
7376
7477#endif // INDICATORS_MANAGER_H