diff options
Diffstat (limited to 'rockworkd/core.cpp')
| -rw-r--r-- | rockworkd/core.cpp | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/rockworkd/core.cpp b/rockworkd/core.cpp new file mode 100644 index 0000000..38a25c5 --- /dev/null +++ b/rockworkd/core.cpp @@ -0,0 +1,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); +} + |
