hi there;
I was trying to create a Qt application that can listen to System clock changes (i.e a user has adjusted the system clock). I found a DBus signal in libtime.h called CLOCKD_TIME_CHANGED , this signal -as described by the documentation - is sent when the time settings das been changed
I used dbus-monitor --system to verfiy if it is emitted when I change system clock and i found the following :
Everything is OK so far,Code:signal sender=:1.28 -> dest=(null destination) serial=455 path=/com/nokia/time; interface=com.nokia.time; member=changed int64 403039731056640 signal sender=:1.28 -> dest=(null destination) serial=456 path=/com/nokia/clockd; interface=com.nokia.clockd; member=time_changed int32 0 signal sender=:1.28 -> dest=(null destination) serial=467 path=/com/nokia/time; interface=com.nokia.time; member=changed int64 0 signal sender=:1.28 -> dest=(null destination) serial=468 path=/com/nokia/clockd; interface=com.nokia.clockd; member=time_changed int32 0 signal sender=:1.28 -> dest=(null destination) serial=502 path=/com/nokia/time; interface=com.nokia.time; member=changed int64 503937102774272 signal sender=:1.28 -> dest=(null destination) serial=503 path=/com/nokia/clockd; interface=com.nokia.clockd; member=time_changed int32 0 signal sender=:1.28 -> dest=(null destination) serial=513 path=/com/nokia/time; interface=com.nokia.time; member=changed int64 1265145480 signal sender=:1.28 -> dest=(null destination) serial=514 path=/com/nokia/clockd; interface=com.nokia.clockd; member=time_changed int32 1265145480 signal sender=:1.38 -> dest=(null destination) serial=54 path=/com/nokia/alarmd; interface=com.nokia.alarmd; member=queue_status_ind int32 0 int32 2147483647 int32 2147483647 int32 1265200040 signal sender=:1.38 -> dest=(null destination) serial=55 path=/com/nokia/alarmd; interface=com.nokia.alarmd; member=time_change_ind
But the problem is when I try to connect to it uding QT-dbus
the connect statement always returns false and the slot I created to handle the change is never called.
I don't know where the problem is
My .pro file has the following added to it:
in my code :Code:INCLUDEPATH += /usr/include/clockd /usr/include/dbus-1.0 usr/lib/dbus-1.0/include LIBS += -ldbus-glib-1 -ldbus-1
the program compiles and when it runs, itCode:#include "/usr/include/clockd/libtime.h" #include <time.h> #include <QDebug> #include <QDBusConnection> #include <QDBusInterface> #include <QObject> QDBusConnection m_pConnection = QDBusConnection::systemBus(); QDBusInterface* Clock_interface = new QDBusInterface(CLOCKD_SERVICE, CLOCKD_PATH, CLOCKD_INTERFACE, m_pConnection); //QDBusMessage replay = clock_interface if(QObject::connect(Clock_interface,SIGNAL(CLOCKD_TIME_CHANGED),this,SLOT(handleTimeChanged())) )qDebug(" managed to connect to dbus signal !!!!"); else qDebug("NOT CONNECTED!!!");
tells me there are missing parantheses. So, I tried the connect signal another way
at runtime, it tells meCode:if(QObject::connect(Clock_interface,SIGNAL(CLOCKD_TIME_CHANGED(int)),this,SLOT(handleTimeChanged(int)))
Object::connect: No such signal com::nokia::clockd::CLOCKD_TIME_CHANGED(int)
I don't know where I went worng. I am not sure i am doing the right thing at the first place!
Could anybody tell me what to do to make my QT app listen to the CLOCKD_TIME_CHANGED signal???
thanks in advance

Reply With Quote

