summaryrefslogtreecommitdiff
path: root/sowatchd/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sowatchd/main.cpp')
-rw-r--r--sowatchd/main.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/sowatchd/main.cpp b/sowatchd/main.cpp
index 1fd1789..6bd502b 100644
--- a/sowatchd/main.cpp
+++ b/sowatchd/main.cpp
@@ -4,14 +4,9 @@
#include <QtDBus/QDBusConnection>
#include <sowatch.h>
-#include "global.h"
+#include "daemon.h"
#include "daemonadaptor.h"
-namespace sowatch
-{
- Daemon* daemon;
-}
-
using namespace sowatch;
static void setupLocalization(QApplication *app)
@@ -48,16 +43,20 @@ int main(int argc, char *argv[])
QApplication::setApplicationName("sowatchd");
QApplication::setQuitOnLastWindowClosed(false);
+ // Load translators
setupLocalization(&app);
- sowatch::daemon = new Daemon(&app);
- new DaemonAdaptor(sowatch::daemon);
+ // Create the daemon object and D-Bus adaptor
+ Daemon daemon;
+ DaemonAdaptor adaptor(&daemon);
+
+ Q_UNUSED(adaptor);
QDBusConnection connection = QDBusConnection::sessionBus();
if (!connection.registerService("com.javispedro.sowatchd")) {
qCritical("Could not register D-Bus service");
}
- if (!connection.registerObject("/com/javispedro/sowatch/daemon", sowatch::daemon)) {
+ if (!connection.registerObject("/com/javispedro/sowatch/daemon", &daemon)) {
qCritical("Could not register daemon object");
}