From a359b0691231ad17416f1d7afd3369f88093a08a Mon Sep 17 00:00:00 2001
From: Yann Leboulanger <asterix@lagaule.org>
Date: Sat, 24 Apr 2010 09:21:09 +0200
Subject: [PATCH] [Dicson] try to run geoclue service id it's not running.
 Fixes #5715

---
 src/common/location_listener.py | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/src/common/location_listener.py b/src/common/location_listener.py
index f37ac99aee..1495538232 100644
--- a/src/common/location_listener.py
+++ b/src/common/location_listener.py
@@ -38,19 +38,22 @@ class LocationListener:
 
     def get_data(self):
         bus = dbus.SessionBus()
-        if 'org.freedesktop.Geoclue.Master' not in bus.list_names():
+        try:
+            # Initializes Geoclue.
+            obj = bus.get_object('org.freedesktop.Geoclue.Master',
+                    '/org/freedesktop/Geoclue/Master')
+            # get MasterClient path
+            path = obj.Create()
+            # get MasterClient
+            cli = bus.get_object('org.freedesktop.Geoclue.Master', path)
+            cli.SetRequirements(1, 0, True, 1023)
+    
+            self._get_address(cli)
+            self._get_position(cli)
+        except:
             self._on_geoclue_position_changed()
             return
-        obj = bus.get_object('org.freedesktop.Geoclue.Master',
-                '/org/freedesktop/Geoclue/Master')
-        # get MasterClient path
-        path = obj.Create()
-        # get MasterClient
-        cli = bus.get_object('org.freedesktop.Geoclue.Master', path)
-        cli.SetRequirements(1, 0, True, 1023)
-
-        self._get_address(cli)
-        self._get_position(cli)
+        
 
     def _get_address(self, cli):
         bus = dbus.SessionBus()
-- 
GitLab