projects
/
gigfinder
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
21d9f51
)
Stop using a MainLoop
author
jon
<jon@spandexmini.localdomain>
Wed, 9 Jun 2010 21:40:34 +0000
(22:40 +0100)
committer
jon
<jon@spandexmini.localdomain>
Wed, 9 Jun 2010 21:40:34 +0000
(22:40 +0100)
src/opt/gigfinder/locator.py
patch
|
blob
|
history
diff --git
a/src/opt/gigfinder/locator.py
b/src/opt/gigfinder/locator.py
index
deab13e
..
5621faa
100644
(file)
--- a/
src/opt/gigfinder/locator.py
+++ b/
src/opt/gigfinder/locator.py
@@
-6,15
+6,14
@@
class LocationUpdater:
def __init__(self):
self.lat = None
self.long = None
def __init__(self):
self.lat = None
self.long = None
- self.loop = gobject.MainLoop()
self.control = location.GPSDControl.get_default()
self.control.set_properties(preferred_method=location\
.METHOD_USER_SELECTED,
preferred_interval=location\
.INTERVAL_DEFAULT)
self.control = location.GPSDControl.get_default()
self.control.set_properties(preferred_method=location\
.METHOD_USER_SELECTED,
preferred_interval=location\
.INTERVAL_DEFAULT)
- self.control.connect("error-verbose", self.on_error, self.loop)
- self.control.connect("gpsd-stopped", self.on_stop, self.loop)
+ self.control.connect("error-verbose", self.on_error, self.control)
+ self.control.connect("gpsd-stopped", self.on_stop, None)
self.device = location.GPSDevice()
self.device.connect("changed", self.on_changed, self.control)
self.device = location.GPSDevice()
self.device.connect("changed", self.on_changed, self.control)
@@
-23,7
+22,6
@@
class LocationUpdater:
""" Run the loop and update lat and long """
self.reset()
gobject.idle_add(self.start_location, self.control)
""" Run the loop and update lat and long """
self.reset()
gobject.idle_add(self.start_location, self.control)
- self.loop.run()
def on_error(self, control, error, data):
""" Handle errors """
def on_error(self, control, error, data):
""" Handle errors """
@@
-43,7
+41,7
@@
class LocationUpdater:
def on_stop(self, control, data):
""" Stop the location service """
def on_stop(self, control, data):
""" Stop the location service """
- data.quit()
+ control.stop()
def start_location(self, data):
""" Start the location service """
def start_location(self, data):
""" Start the location service """