*When a devicefound event with a new name string return, we reports it to the upper...
authorKai Chai <Kai Chai@windriver.com>
Thu, 14 Jul 2011 04:18:00 +0000 (12:18 +0800)
committerKevron Rees <kevron_m_rees@linux.intel.com>
Fri, 15 Jul 2011 22:11:17 +0000 (15:11 -0700)
Revised for fixing sometimes unable to display bluetooth device name bug.

bluetooth-qt/nearbydevicesmodel.cpp

index 455c78c..1fd2fc0 100644 (file)
@@ -121,9 +121,13 @@ void NearbyDevicesModel::deviceCreated(QString hwaddy, QVariantMap properties)
        {
                if(path->address() == hwaddy)
                {
+                       bool nameUpdated = false;
+                       if((path->name() == "") && (properties["Name"].toString() != "")) nameUpdated = true;
                        path->setName(properties["Name"].toString());
                        path->setAlias(properties["Alias"].toString());
                        path->setIcon(properties["Icon"].toString());
+
+                       if(nameUpdated) emit nearbyDeviceFound(devices.indexOf(path));
                        return;
                }
        }