From 29aaea2d80a9eb1715b6cddfac2d2aacf76358bd Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Thu, 11 Feb 2016 23:55:16 +0100 Subject: launchpad ~mzanetti/rockwork/trunk r87 --- rockworkd/core.cpp | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 rockworkd/core.cpp (limited to 'rockworkd/core.cpp') 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 + +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); +} + -- cgit v1.2.3