1 diff --git a/bluetooth-qt/bluetoothdevicemodel.cpp b/bluetooth-qt/bluetoothdevicemodel.cpp
2 index 24015a5..4fdd2b4 100644
3 --- a/bluetooth-qt/bluetoothdevicemodel.cpp
4 +++ b/bluetooth-qt/bluetoothdevicemodel.cpp
5 @@ -31,6 +31,8 @@ BluetoothDevicesModel::BluetoothDevicesModel(QObject *parent) :
6 roles[i]=properties.property(i).name();
9 + roles[roles.keys().count()+1] = "bluetoothDevice";
14 @@ -49,6 +51,11 @@ QVariant BluetoothDevicesModel::data(const QModelIndex &index, int role) const
15 return QVariant(); ///this is retarded but it has to be done.
18 + if(roleNames()[role] == "bluetoothDevice")
20 + return QVariant::fromValue<QObject*>((QObject*)m_devices[index.row()]);
23 QString roleName = roleNames()[role];
24 QMetaObject object = BluetoothDevice::staticMetaObject;
26 @@ -131,8 +138,15 @@ void BluetoothDevicesModel::setDiscoverableTimeout(int timeout)
30 - bool success = adapter->setProperty("DiscoverableTimeout", timeout);
31 - qDebug()<<"Setting discoverable timeout to "<<timeout<<": "<<success;
32 + QDBusReply<void> reply = adapter->SetProperty("DiscoverableTimeout", QDBusVariant((uint)timeout));
33 + if(!reply.isValid())
35 + qDebug()<<"error setting discoverable timeout: "<<reply.error().message();
39 + qDebug()<<"Setting discoverable timeout to "<<timeout;
44 diff --git a/bluetooth-qt/nearbydevicesmodel.cpp b/bluetooth-qt/nearbydevicesmodel.cpp
45 index 455c78c..1e6d4fc 100644
46 --- a/bluetooth-qt/nearbydevicesmodel.cpp
47 +++ b/bluetooth-qt/nearbydevicesmodel.cpp
48 @@ -121,9 +121,13 @@ void NearbyDevicesModel::deviceCreated(QString hwaddy, QVariantMap properties)
50 if(path->address() == hwaddy)
52 + bool nameUpdated = false;
53 + if((path->name() == "") && (properties["Name"].toString() != "")) nameUpdated = true;
54 path->setName(properties["Name"].toString());
55 path->setAlias(properties["Alias"].toString());
56 path->setIcon(properties["Icon"].toString());
58 + emit dataChanged(createIndex(devices.indexOf(path),0),createIndex(devices.indexOf(path),0));