So, for the life of me, I can't get my object to connect to the session bus. So, I'm trying to connect "wakeup" of "my_obj" to the dBus signal "profileChanged". But, even though I'm sure (via qbusviewer) that this signal is being emitted, "wakeup" will not run. Here is a snippet of my code:
const QString service = "org.kde.Solid.PowerManagement";
const QString path = "/org/kde/Solid/PowerManagement";
const QString interface = "org.kde.Solid.PowerManagement";
QDBusConnection bus = QDBusConnection::sessionBus();
if (!bus.isConnected())
{
qDebug() << "Can't connect to the D-Bus session bus.\n";
}
class my_wake_up_class : public QObject
{
Q_OBJECT
public slots:
void wakeup(QString); //Does not run!
};
my_wake_up_class my_obj;
bool conn = bus.connect(service, path, interface, "profileChanged", &my_obj, SLOT(wakeup(QString)));
if (!conn) qDebug() << "not connected";
qDBus shows that "profileChanged" has the form "void (QString)" and I'm not getting any errors nor warnings. Here is the qdbus output for that particular signal:
signal void org.kde.Solid.PowerManagement.profileChanged(QString)
So, I'd think this would work. I'm sure I'm missing some minute detail that's buried deep within some documentation. Would anybody know where I'm going wrong?