summaryrefslogtreecommitdiff
path: root/rockworkd/core.cpp
blob: 38a25c528e70ae5e4b7a644062bab7cbebccf2c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include "core.h"

#include "pebblemanager.h"
#include "dbusinterface.h"

#include "platformintegration/ubuntu/ubuntuplatform.h"
#ifdef ENABLE_TESTING
#include "platformintegration/testing/testingplatform.h"
#endif

#include <QDebug>

Core* Core::s_instance = nullptr;

Core *Core::instance()
{
    if (!s_instance) {
        s_instance = new Core();
    }
    return s_instance;
}

PebbleManager *Core::pebbleManager()
{
    return m_pebbleManager;
}

PlatformInterface *Core::platform()
{
    return m_platform;
}

Core::Core(QObject *parent):
    QObject(parent)
{
}

void Core::init()
{
    // Platform integration
#ifdef ENABLE_TESTING
    m_platform = new TestingPlatform(this);
#else
    m_platform = new UbuntuPlatform(this);
#endif

    m_pebbleManager = new PebbleManager(this);

    m_dbusInterface = new DBusInterface(this);
}