From e50af3571543b5f5f18b2fc89c5a272c7c473fb1 Mon Sep 17 00:00:00 2001 From: Michael Webster Date: Wed, 13 Mar 2013 20:24:32 -0400 Subject: [PATCH] Fix GObject deprecations --- usr/lib/linuxmint/mintMenu/keybinding.py | 2 +- .../linuxmint/mintMenu/plugins/applications.py | 18 +++++++++--------- .../linuxmint/mintMenu/plugins/filemonitor.py | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/usr/lib/linuxmint/mintMenu/keybinding.py b/usr/lib/linuxmint/mintMenu/keybinding.py index e1d36f1..52cd31c 100644 --- a/usr/lib/linuxmint/mintMenu/keybinding.py +++ b/usr/lib/linuxmint/mintMenu/keybinding.py @@ -96,7 +96,7 @@ class GlobalKeyBinding(GObject.GObject, threading.Thread): return False def activate(self): - GObject.idle_add(self.run) + GLib.idle_add(self.run) def run(self): self.running = True diff --git a/usr/lib/linuxmint/mintMenu/plugins/applications.py b/usr/lib/linuxmint/mintMenu/plugins/applications.py index a96ba87..33cbe2e 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/applications.py +++ b/usr/lib/linuxmint/mintMenu/plugins/applications.py @@ -3,7 +3,7 @@ import gi gi.require_version("Gtk", "2.0") -from gi.repository import Gtk, GObject, Pango, Gdk, Gio +from gi.repository import Gtk, Pango, Gdk, Gio, GLib import os #import mateconf @@ -586,7 +586,7 @@ class pluginclass( object ): def buildButtonList( self ): if self.buildingButtonList: self.stopBuildingButtonList = True - GObject.timeout_add( 100, self.buildButtonList ) + GLib.timeout_add( 100, self.buildButtonList ) return self.stopBuildingButtonList = False @@ -600,12 +600,12 @@ class pluginclass( object ): def StartFilter( self, widget, category ): # if there is a timer for a different category running stop it if self.filterTimer: - GObject.source_remove( self.filterTimer ) - self.filterTimer = GObject.timeout_add( self.categoryhoverdelay, self.Filter, widget, category ) + GLib.source_remove( self.filterTimer ) + self.filterTimer = GLib.timeout_add( self.categoryhoverdelay, self.Filter, widget, category ) def StopFilter( self, widget ): if self.filterTimer: - GObject.source_remove( self.filterTimer ) + GLib.source_remove( self.filterTimer ) self.filterTimer = None def add_search_suggestions(self, text): @@ -813,11 +813,11 @@ class pluginclass( object ): #if (len(self.current_results) > 0): #self.add_apt_filter_results_sync(self.current_results, text) #else: - GObject.timeout_add (300, self.add_apt_filter_results, text) + GLib.timeout_add (300, self.add_apt_filter_results, text) else: self.current_results = [] self.add_search_suggestions(text) - GObject.timeout_add (300, self.add_apt_filter_results, text) + GLib.timeout_add (300, self.add_apt_filter_results, text) self.current_suggestion = text else: @@ -1567,9 +1567,9 @@ class pluginclass( object ): def menuChanged( self, x, y ): # wait some miliseconds because there a multiple events send at the same time and we don't want to rebuild the menu for each if self.menuChangedTimer: - GObject.source_remove( self.menuChangedTimer ) + GLib.source_remove( self.menuChangedTimer ) - self.menuChangedTimer = GObject.timeout_add( 100, self.updateBoxes, True ) + self.menuChangedTimer = GLib.timeout_add( 100, self.updateBoxes, True ) def updateBoxes( self, menu_has_changed ): # FIXME: This is really bad! diff --git a/usr/lib/linuxmint/mintMenu/plugins/filemonitor.py b/usr/lib/linuxmint/mintMenu/plugins/filemonitor.py index feba791..30fe021 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/filemonitor.py +++ b/usr/lib/linuxmint/mintMenu/plugins/filemonitor.py @@ -2,7 +2,7 @@ import os import os.path import threading import time -from gi.repository import GObject +from gi.repository import GLib try: import pyinotify @@ -42,9 +42,9 @@ if hasInotify: # print event.path callback = self.callbacks[event.wd] if callback[1]: - GObject.idle_add( callback[0], callback[1] ) + GLib.idle_add( callback[0], callback[1] ) else: - GObject.idle_add( callback[0] ) + GLib.idle_add( callback[0] ) else: @@ -114,9 +114,9 @@ else: for monitored in self.monitoredFiles: if monitored.hasChanged(): if monitored.args: - GObject.idle_add( monitored.callback, monitored.args ) + GLib.idle_add( monitored.callback, monitored.args ) else: - GObject.idle_add( monitored.callback ) + GLib.idle_add( monitored.callback ) monitor = FileMonitor()