~aacid/unity8/card_optimizations

« back to all changes in this revision

Viewing changes to plugins/Unity/Indicators/indicatorsmanager.cpp

  • Committer: Albert Astals
  • Date: 2014-04-17 11:11:27 UTC
  • mfrom: (796.6.43 unity8)
  • Revision ID: albert.astals@canonical.com-20140417111127-jns8uvil2t6oen23
Merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#include <QSettings>
22
22
#include <QDebug>
23
23
 
24
 
#include <upstart.h>
25
 
#include <nih/alloc.h>
26
 
 
27
24
#include <paths.h>
28
25
 
29
26
 
216
213
    {
217
214
        m_loaded = loaded;
218
215
        Q_EMIT loadedChanged(m_loaded);
219
 
 
220
 
        auto upstartsession = qgetenv("UPSTART_SESSION");
221
 
        NihDBusProxy * upstart = NULL;
222
 
 
223
 
        if (!upstartsession.isNull()) {
224
 
            DBusConnection * conn = NULL;
225
 
            conn = dbus_connection_open(upstartsession.constData(), NULL);
226
 
            if (conn != NULL) {
227
 
                upstart = nih_dbus_proxy_new(NULL, conn,
228
 
                    NULL,
229
 
                    DBUS_PATH_UPSTART,
230
 
                    NULL, NULL);
231
 
                dbus_connection_unref(conn);
232
 
            }
233
 
        }
234
 
 
235
 
        if (upstart != NULL) {
236
 
            int event_sent = 0;
237
 
            if (m_loaded) {
238
 
                event_sent = upstart_emit_event_sync(NULL, upstart, "indicator-services-start", NULL, 0);
239
 
            } else {
240
 
                event_sent = upstart_emit_event_sync(NULL, upstart, "indicator-services-end", NULL, 0);
241
 
            }
242
 
 
243
 
            if (event_sent != 0) {
244
 
                qWarning() << "Unable to send indicator event to Upstart";
245
 
            }
246
 
            nih_unref(upstart, NULL);
247
 
            upstart = NULL;
248
 
        }
249
216
    }
250
217
}
251
218