summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfujiwarat <takao.fujiwara1@gmail.com>2013-03-14 17:43:22 +0900
committerfujiwarat <takao.fujiwara1@gmail.com>2013-03-14 17:43:22 +0900
commita0066d98c5340bcfa202beaf967702a74484a122 (patch)
tree5baead9058df501959b8f750210fc450b75c29a5
parent18415352643a88e4609d466eb0ba00739b3b5f87 (diff)
downloadibus-anthy-a0066d98c5340bcfa202beaf967702a74484a122.tar.gz
Removed deprecated GObject.
-rw-r--r--engine/engine.py16
-rw-r--r--engine/main.py4
-rw-r--r--setup/main.py6
3 files changed, 14 insertions, 12 deletions
diff --git a/engine/engine.py b/engine/engine.py
index 9b276fa..d90f62f 100644
--- a/engine/engine.py
+++ b/engine/engine.py
@@ -34,7 +34,7 @@ try:
except:
pass
-from gi.repository import GObject
+from gi.repository import GLib
from gi.repository import IBus
try:
@@ -174,7 +174,7 @@ class Engine(IBus.EngineSimple):
self._RMM = 0
self._RSS = 0
if self.__idle_id != 0:
- GObject.source_remove(self.__idle_id)
+ GLib.source_remove(self.__idle_id)
self.__idle_id = 0
def __init_props(self):
@@ -973,7 +973,7 @@ class Engine(IBus.EngineSimple):
def do_destroy(self):
if self.__idle_id != 0:
- GObject.source_remove(self.__idle_id)
+ GLib.source_remove(self.__idle_id)
self.__idle_id = 0
self.__remove_dict_files()
# It seems the parent do_destroy and destroy are different.
@@ -1118,8 +1118,8 @@ class Engine(IBus.EngineSimple):
def __invalidate(self):
if self.__idle_id != 0:
return
- self.__idle_id = GObject.idle_add(self.__update,
- priority = GObject.PRIORITY_LOW)
+ self.__idle_id = GLib.idle_add(self.__update,
+ priority = GLib.PRIORITY_LOW)
# def __get_preedit(self):
def __get_preedit(self, commit=False):
@@ -1870,11 +1870,13 @@ class Engine(IBus.EngineSimple):
self._H = None
def start(t):
- self._H = GObject.timeout_add(t, on_timeout, keyval)
+ self._H = GLib.timeout_add_full(GLib.PRIORITY_DEFAULT,
+ t, on_timeout, keyval,
+ None)
def stop():
if self._H:
- GObject.source_remove(self._H)
+ GLib.source_remove(self._H)
self._H = None
return True
return False
diff --git a/engine/main.py b/engine/main.py
index 478f4ce..5ee236f 100644
--- a/engine/main.py
+++ b/engine/main.py
@@ -28,7 +28,7 @@ import getopt
import locale
import xml.dom.minidom
-from gi.repository import GObject
+from gi.repository import GLib
from gi.repository import IBus
import _config as config
@@ -56,7 +56,7 @@ class IMApp:
symbol=config.SYMBOL_CHAR,
rank=99)
self.__component.add_engine(engine)
- self.__mainloop = GObject.MainLoop()
+ self.__mainloop = GLib.MainLoop()
self.__bus = IBus.Bus()
self.__bus.connect('disconnected', self.__bus_disconnected_cb)
self.__factory = factory.EngineFactory(self.__bus)
diff --git a/setup/main.py b/setup/main.py
index 338ad15..12e975e 100644
--- a/setup/main.py
+++ b/setup/main.py
@@ -33,10 +33,10 @@ try:
except:
getpreferredencoding = None
+from gi.repository import GLib
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import GdkX11
-from gi.repository import GObject
from gi.repository import Pango
from gi.repository import IBus
@@ -195,8 +195,8 @@ class AnthySetup(object):
tv.set_model(ls)
self.__keymap = None
- GObject.idle_add(self.__update_keymap_label,
- priority = GObject.PRIORITY_LOW)
+ GLib.idle_add(self.__update_keymap_label,
+ priority = GLib.PRIORITY_LOW)
self.__thumb_kb_layout_mode = builder.get_object('thumb:keyboard_layout_mode')
self.__thumb_kb_layout = builder.get_object('thumb:keyboard_layout')