Commit 9f372807 authored by Milian Wolff's avatar Milian Wolff

Fix warning: No such signal org::freedesktop::UPower::Device...

Backport of commit d5f6f40eb8b6a420520cb7c726959048593d2cab in
the frameworks repository of solid.

The signature change can be detected at runtime using Qt's QMetaObject
introspection mechanism. That prevents us from emitting the two
pesky warnings at runtime, polluting our konsoles.

Google is full of that warning, and there is also:
https://bugzilla.redhat.com/show_bug.cgi?id=1056769

REVIEW: 121007
parent db2240fb
......@@ -64,16 +64,18 @@ UPowerManager::UPowerManager(QObject *parent)
}
if (serviceFound) {
connect(&m_manager, SIGNAL(DeviceAdded(QString)),
this, SIGNAL(deviceAdded(QString)));
connect(&m_manager, SIGNAL(DeviceRemoved(QString)),
this, SIGNAL(deviceRemoved(QString)));
// for UPower >= 0.99.0, changed signature :o/
connect(&m_manager, SIGNAL(DeviceAdded(QDBusObjectPath)),
this, SLOT(onDeviceAdded(QDBusObjectPath)));
connect(&m_manager, SIGNAL(DeviceRemoved(QDBusObjectPath)),
this, SLOT(onDeviceRemoved(QDBusObjectPath)));
if (m_manager.metaObject()->indexOfSignal("DeviceAdded(QDBusObjectPath)") != -1) {
// for UPower >= 0.99.0, changed signature :o/
connect(&m_manager, SIGNAL(DeviceAdded(QDBusObjectPath)),
this, SLOT(onDeviceAdded(QDBusObjectPath)));
connect(&m_manager, SIGNAL(DeviceRemoved(QDBusObjectPath)),
this, SLOT(onDeviceRemoved(QDBusObjectPath)));
} else {
connect(&m_manager, SIGNAL(DeviceAdded(QString)),
this, SIGNAL(deviceAdded(QString)));
connect(&m_manager, SIGNAL(DeviceRemoved(QString)),
this, SIGNAL(deviceRemoved(QString)));
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment