~ubuntu-branches/ubuntu/trusty/libusermetrics/trusty-proposed

« back to all changes in this revision

Viewing changes to src/libusermetricsinput/MetricManager.cpp

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release, Pete Woods, Ubuntu daily release
  • Date: 2013-07-02 02:02:52 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20130702020252-53yuhnlabsq1cq8x
Tags: 1.0.1+13.10.20130702-0ubuntu1
[ Pete Woods ]
* Implement most of storage service and wire up input API.
* Wire up the output API to the storage service.

[ Ubuntu daily release ]
* Automatic snapshot from revision 80

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 */
18
18
 
19
19
#include <libusermetricsinput/MetricManagerImpl.h>
 
20
#include <libusermetricscommon/DBusPaths.h>
 
21
#include <QtDBus/QtDBus>
20
22
 
 
23
using namespace UserMetricsCommon;
21
24
using namespace UserMetricsInput;
22
25
 
23
26
MetricManager::MetricManager() {
28
31
}
29
32
 
30
33
MetricManagerPtr MetricManager::getInstance() {
31
 
        return MetricManagerPtr(new MetricManagerImpl());
 
34
        QDBusConnection dbusConnection(QDBusConnection::systemBus());
 
35
 
 
36
        QDBusConnectionInterface* interface = dbusConnection.interface();
 
37
        if (!interface->isServiceRegistered(DBusPaths::serviceName())) {
 
38
                QDBusReply<void> reply(
 
39
                                interface->startService(DBusPaths::serviceName()));
 
40
        }
 
41
 
 
42
        return MetricManagerPtr(new MetricManagerImpl(dbusConnection));
32
43
}