diff options
| author | Tomasz Sterna <tomek@xiaoka.com> | 2014-06-26 00:27:21 +0200 |
|---|---|---|
| committer | Tomasz Sterna <tomek@xiaoka.com> | 2014-06-26 00:27:21 +0200 |
| commit | c1a2a4ccc49ebba2e99348ee4021cab26fcd450e (patch) | |
| tree | 97af3b6e5a2f67ba0646f1ea8871e72d8ecc4bb0 /daemon/dbusconnector.cpp | |
| parent | a52656164da956cc13b52fa4a99d4c475c68d4c8 (diff) | |
Resolve number to contact name in notification
Diffstat (limited to 'daemon/dbusconnector.cpp')
| -rw-r--r-- | daemon/dbusconnector.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/daemon/dbusconnector.cpp b/daemon/dbusconnector.cpp index 78992f9..8cf5713 100644 --- a/daemon/dbusconnector.cpp +++ b/daemon/dbusconnector.cpp @@ -40,38 +40,38 @@ bool DBusConnector::findPebble() return false; } - QDBusReply<QHash<QString,QVariant>> AdapterPropertiesReply = system.call(QDBusMessage::createMethodCall("org.bluez", - adapters.at(0).path(), - "org.bluez.Adapter", - "GetProperties")); + QDBusReply<QVariantMap> AdapterPropertiesReply = system.call(QDBusMessage::createMethodCall("org.bluez", + adapters[0].path(), + "org.bluez.Adapter", + "GetProperties")); if (not AdapterPropertiesReply.isValid()) { qWarning() << AdapterPropertiesReply.error().message(); return false; } QList<QDBusObjectPath> devices; - AdapterPropertiesReply.value().value("Devices").value<QDBusArgument>() >> devices; + AdapterPropertiesReply.value()["Devices"].value<QDBusArgument>() >> devices; QString name; QString address; foreach (QDBusObjectPath path, devices) { - QDBusReply<QHash<QString,QVariant>> DevicePropertiesReply = system.call(QDBusMessage::createMethodCall("org.bluez", - path.path(), - "org.bluez.Device", - "GetProperties")); + QDBusReply<QVariantMap> DevicePropertiesReply = system.call(QDBusMessage::createMethodCall("org.bluez", + path.path(), + "org.bluez.Device", + "GetProperties")); if (not DevicePropertiesReply.isValid()) { qWarning() << DevicePropertiesReply.error().message(); continue; } - const QHash<QString,QVariant> &dict = DevicePropertiesReply.value(); + const QVariantMap &dict = DevicePropertiesReply.value(); - QString tmp = dict.value("Name").toString(); + QString tmp = dict["Name"].toString(); qDebug() << "Found BT device:" << tmp; if (tmp.startsWith("Pebble")) { name = tmp; - address = dict.value("Address").toString(); + address = dict["Address"].toString(); qDebug() << "Found Pebble:" << name << address; } } |
