[gnome-clocks] Use Glib functions instead of the deprecated GObject ones



commit ac9bc63ca1700ce20c696ae0605cec6084ec022c
Author: Paolo Borelli <pborelli gnome org>
Date:   Sat Oct 27 14:06:11 2012 +0200

    Use Glib functions instead of the deprecated GObject ones

 gnomeclocks/alarm.py     |    2 +-
 gnomeclocks/stopwatch.py |    8 ++++----
 gnomeclocks/timer.py     |    6 +++---
 gnomeclocks/world.py     |    2 +-
 4 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/gnomeclocks/alarm.py b/gnomeclocks/alarm.py
index b08939e..44fe3a9 100644
--- a/gnomeclocks/alarm.py
+++ b/gnomeclocks/alarm.py
@@ -321,7 +321,7 @@ class Alarm(Clock):
         self.load_alarms()
         self.show_all()
 
-        self.timeout_id = GObject.timeout_add(1000, self._check_alarms)
+        self.timeout_id = GLib.timeout_add(1000, self._check_alarms)
 
     def _check_alarms(self):
         for i in self.liststore:
diff --git a/gnomeclocks/stopwatch.py b/gnomeclocks/stopwatch.py
index 3b0140d..119e8ed 100644
--- a/gnomeclocks/stopwatch.py
+++ b/gnomeclocks/stopwatch.py
@@ -17,7 +17,7 @@
 # Author: Seif Lotfy <seif lotfy collabora co uk>
 
 import time
-from gi.repository import Gtk, GObject
+from gi.repository import GLib, Gtk
 from clocks import Clock
 
 
@@ -170,17 +170,17 @@ class Stopwatch(Clock):
             curr = time.time()
             self.start_time = curr
             self.lap_start_time = curr
-            self.timeout_id = GObject.timeout_add(100, self.count)
+            self.timeout_id = GLib.timeout_add(100, self.count)
 
     def stop(self):
-        GObject.source_remove(self.timeout_id)
+        GLib.source_remove(self.timeout_id)
         self.timeout_id = 0
         curr = time.time()
         self.time_diff = self.time_diff + (curr - self.start_time)
         self.lap_time_diff = self.lap_time_diff + (curr - self.lap_start_time)
 
     def reset(self):
-        GObject.source_remove(self.timeout_id)
+        GLib.source_remove(self.timeout_id)
         self.timeout_id = 0
         self.time_diff = 0
         self.lap_time_diff = 0
diff --git a/gnomeclocks/timer.py b/gnomeclocks/timer.py
index b31be34..83ecb90 100644
--- a/gnomeclocks/timer.py
+++ b/gnomeclocks/timer.py
@@ -17,7 +17,7 @@
 # Author: Seif Lotfy <seif lotfy collabora co uk>
 
 import time
-from gi.repository import GObject, Gtk
+from gi.repository import GLib, Gtk
 from clocks import Clock
 from utils import Alert
 from widgets import Spinner
@@ -186,11 +186,11 @@ class Timer(Clock):
         self.notebook.set_current_page(1)
 
     def _add_timeout(self):
-        self.timeout_id = GObject.timeout_add(250, self.count)
+        self.timeout_id = GLib.timeout_add(250, self.count)
 
     def _remove_timeout(self):
         if self.timeout_id != 0:
-            GObject.source_remove(self.timeout_id)
+            GLib.source_remove(self.timeout_id)
         self.timeout_id = 0
 
     def start(self):
diff --git a/gnomeclocks/world.py b/gnomeclocks/world.py
index 743177b..e6748d2 100644
--- a/gnomeclocks/world.py
+++ b/gnomeclocks/world.py
@@ -279,7 +279,7 @@ class World(Clock):
         self.load_clocks()
         self.show_all()
 
-        self.timeout_id = GObject.timeout_add(1000, self._update_clocks)
+        self.timeout_id = GLib.timeout_add(1000, self._update_clocks)
 
     def _update_clocks(self):
         for c in self.clocks:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]