After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 611532 - geoclue plugin matches all devices having just SP
geoclue plugin matches all devices having just SP
Status: RESOLVED FIXED
Product: gnome-bluetooth
Classification: Core
Component: plugins
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-bluetooth-general-maint@gnome.bugs
gnome-bluetooth-general-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2010-03-01 22:51 UTC by Daniele Forsi
Modified: 2010-03-02 10:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix getting device properties in geoclue plugin (1.11 KB, patch)
2010-03-02 10:55 UTC, Bastien Nocera
committed Details | Review

Description Daniele Forsi 2010-03-01 22:51:37 UTC
In lib/plugins/geoclue.c the get_name_and_type function iterates the adapters, not the devices, because it calls bluetooth_client_get_model(), as a consequence it can't find the device and it returns a type value of 0 which later code interprets as BLUETOOTH_TYPE_ANY which is assumed to be a GPS.

Easiest fix would be to use bluetooth_client_get_device_model() but passing the GtkTreeIter to has_config_widget() instead of address and uuids would make writing plugins easier.
Comment 1 Bastien Nocera 2010-03-02 10:55:06 UTC
The problem is that the iter depends on the model it's in. You can't have a GtkTreeIter represent anything other than a location in a GtkTreeModel, and it would be invalid as soon as you modify the tree.

The best way would probably to have a helper function to get the properties of a particular device.
Comment 2 Bastien Nocera 2010-03-02 10:55:20 UTC
Created attachment 155020 [details] [review]
Fix getting device properties in geoclue plugin
Comment 3 Bastien Nocera 2010-03-02 10:55:37 UTC
Attachment 155020 [details] pushed as 0df28fa - Fix getting device properties in geoclue plugin