summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--daemon/logger.cpp10
-rw-r--r--daemon/logger.h4
2 files changed, 14 insertions, 0 deletions
diff --git a/daemon/logger.cpp b/daemon/logger.cpp
index ff62ff6..56d1c3c 100644
--- a/daemon/logger.cpp
+++ b/daemon/logger.cpp
@@ -26,6 +26,12 @@
Logger::Logger(QObject *parent) :
QObject(parent){
+ if(!QDBusConnection::sessionBus().registerService("org.asteroid.sensorlogd.logger")) qDebug() << "failed to register service";
+ if(!QDBusConnection::sessionBus().registerObject("/org/asteroid/sensorlogd/logger", this, QDBusConnection::ExportAllContents)) qDebug() << "failed to register object";
+ this->setup();
+}
+
+void Logger::setup() {
m_iface = new QDBusInterface("com.nokia.mce","/com/nokia/mce/signal", "com.nokia.mce.signal", QDBusConnection::systemBus());
settings = new QSettings;
@@ -52,6 +58,10 @@ Logger::Logger(QObject *parent) :
qDebug() << "healthd sensors logger initialised";
}
+void Logger::resetup() {
+ this->setup();
+}
+
void Logger::displayOn(QString displayState) {
if (displayState == "off")
return;
diff --git a/daemon/logger.h b/daemon/logger.h
index d9b418d..6047a04 100644
--- a/daemon/logger.h
+++ b/daemon/logger.h
@@ -18,6 +18,7 @@
#include <QTimer>
#include <QString>
#include <QSettings>
+#include <QDBusAbstractAdaptor>
#include "sensorPlugins/stepCounter.h"
#include "sensorPlugins/heartrateSensor.h"
@@ -28,6 +29,9 @@ class Logger : public QObject
public:
explicit Logger(QObject *parent = 0);
virtual ~Logger() {};
+public slots:
+ void setup();
+ void resetup();
private slots:
void displayOn(QString displayState);