From da6638d44b367136542b57bb64930e18f2bf78ab Mon Sep 17 00:00:00 2001 From: js Date: Thu, 2 Oct 2008 19:56:00 +0000 Subject: [PATCH] Better checking for which IdleQueue we use. It's a bad idea to check against NT everywhere. Someone might just change the creation of the IdleQueue, but forget to change the other two places. With this, it's safe to only change the creation. --- src/gajim.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/gajim.py b/src/gajim.py index 4a8563aaf..408c6f156 100755 --- a/src/gajim.py +++ b/src/gajim.py @@ -2861,12 +2861,10 @@ class Interface: gajim.idlequeue.process() except: # Otherwise, an exception will stop our loop - if os.name == 'nt': - gobject.timeout_add(200, - self.process_connections) + if gajim.idlequeue.__class__ == GlibIdleQueue: + gobject.timeout_add_seconds(2, self.process_connections) else: - gobject.timeout_add_seconds(2, - self.process_connections) + gobject.timeout_add(200, self.process_connections) raise return True # renew timeout (loop for ever) @@ -3279,10 +3277,10 @@ class Interface: self.last_ftwindow_update = 0 gobject.timeout_add(100, self.autoconnect) - if os.name == 'nt': - gobject.timeout_add(200, self.process_connections) - else: + if gajim.idlequeue.__class__ == GlibIdleQueue: gobject.timeout_add_seconds(2, self.process_connections) + else: + gobject.timeout_add(200, self.process_connections) gobject.timeout_add_seconds(gajim.config.get( 'check_idle_every_foo_seconds'), self.read_sleepy)