From 12fdaf2d7725243ce1e11adf043b16aeec6ccd72 Mon Sep 17 00:00:00 2001 From: Micke Prag Date: Thu, 27 Oct 2011 16:06:35 +0200 Subject: [PATCH] Send sensor events as QDateTime instead of just an int --- telldus-gui/Plugins/TelldusCore/tellduscoreobject.cpp | 2 +- telldus-gui/Plugins/TelldusCore/tellduscoreobject.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/telldus-gui/Plugins/TelldusCore/tellduscoreobject.cpp b/telldus-gui/Plugins/TelldusCore/tellduscoreobject.cpp index 3362fb8b..5500bbf0 100644 --- a/telldus-gui/Plugins/TelldusCore/tellduscoreobject.cpp +++ b/telldus-gui/Plugins/TelldusCore/tellduscoreobject.cpp @@ -160,6 +160,6 @@ void WINAPI TelldusCoreObject::deviceEventCallback(int deviceId, int method, con void WINAPI TelldusCoreObject::sensorEventCallback(const char *protocol, const char *model, int id, int dataType, const char *value, int timestamp, int callbackId, void *context) { TelldusCoreObject *parent = static_cast(context); if (parent) { - emit parent->sensorEvent(QString::fromUtf8(protocol), QString::fromUtf8(model), id, dataType, QString::fromUtf8(value), timestamp); + emit parent->sensorEvent(QString::fromUtf8(protocol), QString::fromUtf8(model), id, dataType, QString::fromUtf8(value), QDateTime::fromTime_t(timestamp)); } } diff --git a/telldus-gui/Plugins/TelldusCore/tellduscoreobject.h b/telldus-gui/Plugins/TelldusCore/tellduscoreobject.h index 98a7f842..a7bac7ee 100644 --- a/telldus-gui/Plugins/TelldusCore/tellduscoreobject.h +++ b/telldus-gui/Plugins/TelldusCore/tellduscoreobject.h @@ -3,6 +3,7 @@ #include #include +#include #include class TelldusCoreObject : public QObject @@ -15,7 +16,7 @@ public: signals: void deviceChange( int deviceId, int eventId ); void deviceEvent( int deviceId, int method, const QString &data ); - void sensorEvent( const QString &protocol, const QString &model, int id, int dataType, const QString &value, int timestamp); + void sensorEvent( const QString &protocol, const QString &model, int id, int dataType, const QString &value, const QDateTime timestamp); void errorOccurred( int deviceId, int errorId, const QString &errorString ); public slots: