Changeset 9324

Show
Ignore:
Timestamp:
02/13/08 08:14:06 (8 months ago)
Author:
asterix
Message:

[Goedson] use timeout_add_seconds instead of timeout_add, more efficient. fixes #3734

Location:
trunk/src
Files:
8 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/chat_control.py

    r9310 r9324  
    11351135 
    11361136        def _schedule_activity_timers(self): 
    1137                 self.possible_paused_timeout_id = gobject.timeout_add(5000, 
     1137                self.possible_paused_timeout_id = gobject.timeout_add_seconds(5, 
    11381138                        self.check_for_possible_paused_chatstate, None) 
    1139                 self.possible_inactive_timeout_id = gobject.timeout_add(30000, 
     1139                self.possible_inactive_timeout_id = gobject.timeout_add_seconds(30, 
    11401140                        self.check_for_possible_inactive_chatstate, None) 
    11411141 
  • trunk/src/common/zeroconf/connection_zeroconf.py

    r9281 r9324  
    278278                # refresh all contacts data every five seconds 
    279279                self.call_resolve_timeout = True 
    280                 gobject.timeout_add(5000, self._on_resolve_timeout) 
     280                gobject.timeout_add_seconds(5, self._on_resolve_timeout) 
    281281                return True 
    282282 
  • trunk/src/dialogs.py

    r9311 r9324  
    19431943                xml.signal_autoconnect(self) 
    19441944                self.window.show_all() 
    1945                 timeout = gajim.config.get('notification_timeout') * 1000 # make it ms 
    1946                 gobject.timeout_add(timeout, self.on_timeout) 
     1945                timeout = gajim.config.get('notification_timeout') 
     1946                gobject.timeout_add_seconds(timeout, self.on_timeout) 
    19471947 
    19481948        def on_close_button_clicked(self, widget): 
  • trunk/src/disco.py

    r9204 r9324  
    153153                        gobject.source_remove(item.source) 
    154154                if self.lifetime: 
    155                         source = gobject.timeout_add(self.lifetime, self._expire_timeout, key) 
     155                        source = gobject.timeout_add_seconds(self.lifetime/1000, self._expire_timeout, key) 
    156156                        item.source = source 
    157157 
     
    13651365                        if self._progress >= self._total_items: 
    13661366                                # We show the progressbar for just a bit before hiding it. 
    1367                                 id = gobject.timeout_add(1500, self._hide_progressbar_cb) 
     1367                                id = gobject.timeout_add_seconds(2, self._hide_progressbar_cb) 
    13681368                                self._progressbar_sourceid = id 
    13691369                        else: 
    13701370                                self.window.progressbar.show() 
    13711371                                # Hide the progressbar if we're timing out anyways. (20 secs) 
    1372                                 id = gobject.timeout_add(20000, self._hide_progressbar_cb) 
     1372                                id = gobject.timeout_add_seconds(20, self._hide_progressbar_cb) 
    13731373                                self._progressbar_sourceid = id 
    13741374                self.window.progressbar.set_fraction(fraction) 
  • trunk/src/gajim.py

    r9319 r9324  
    534534                        # this prevents from getting the roster items as 'just signed in' 
    535535                        # contacts. 30 seconds should be enough time 
    536                         gobject.timeout_add(30000, self.unblock_signed_in_notifications, account) 
     536                        gobject.timeout_add_seconds(30, self.unblock_signed_in_notifications, account) 
    537537                        # sensitivity for this menuitem 
    538538                        model[self.roster.status_message_menuitem_iter][3] = True 
     
    649649                                        if contact1.jid in gajim.to_be_removed[account]: 
    650650                                                gajim.to_be_removed[account].remove(contact1.jid) 
    651                                         gobject.timeout_add(5000, self.roster.remove_newly_added, 
     651                                        gobject.timeout_add_seconds(5, self.roster.remove_newly_added, 
    652652                                                contact1.jid, account) 
    653653                                elif old_show > 1 and new_show == 0 and gajim.connections[account].\ 
     
    658658                                                gajim.newly_added[account].remove(contact1.jid) 
    659659                                        self.roster.draw_contact(contact1.jid, account) 
    660                                         gobject.timeout_add(5000, self.roster.really_remove_contact, 
     660                                        gobject.timeout_add_seconds(5, self.roster.really_remove_contact, 
    661661                                                contact1, account) 
    662662                        contact1.show = array[1] 
     
    685685                                account_ji = account + '/' + ji 
    686686                                gajim.block_signed_in_notifications[account_ji] = True 
    687                                 gobject.timeout_add(30000, self.unblock_signed_in_notifications, 
     687                                gobject.timeout_add_seconds(30, self.unblock_signed_in_notifications, 
    688688                                        account_ji) 
    689689                        locations = (self.instances, self.instances[account]) 
     
    29492949                        gobject.timeout_add(200, self.process_connections) 
    29502950                else: 
    2951                         gobject.timeout_add(2000, self.process_connections) 
    2952                 gobject.timeout_add(10000, self.read_sleepy) 
     2951                        gobject.timeout_add_seconds(2, self.process_connections) 
     2952                gobject.timeout_add_seconds(10, self.read_sleepy) 
    29532953 
    29542954if __name__ == '__main__': 
  • trunk/src/music_track_listener.py

    r9191 r9324  
    8888                        self.banshee_paused_before = False 
    8989                        self.banshee_is_here = False 
    90                         gobject.timeout_add(10000, self._check_if_banshee_bus) 
     90                        gobject.timeout_add_seconds(10, self._check_if_banshee_bus) 
    9191                        if self.dubus_methods.NameHasOwner('org.gnome.Banshee'): 
    9292                                self._get_banshee_bus() 
     
    9494                        # Otherwise, it opens Banshee! 
    9595                        self.banshee_props ={} 
    96                         gobject.timeout_add(1000, self._banshee_check_track_status) 
     96                        gobject.timeout_add_seconds(1, self._banshee_check_track_status) 
    9797 
    9898        def _check_if_banshee_bus(self): 
  • trunk/src/profile_window.py

    r8953 r9324  
    249249                        self.message_id = self.statusbar.push(self.context_id, 
    250250                                _('Information received')) 
    251                         self.remove_statusbar_timeout_id = gobject.timeout_add(3000, 
     251                        self.remove_statusbar_timeout_id = gobject.timeout_add_seconds(3, 
    252252                                self.remove_statusbar, self.message_id) 
    253253                        gobject.source_remove(self.update_progressbar_timeout_id) 
     
    345345                self.message_id = self.statusbar.push(self.context_id, 
    346346                        _('Information NOT published')) 
    347                 self.remove_statusbar_timeout_id = gobject.timeout_add(3000, 
     347                self.remove_statusbar_timeout_id = gobject.timeout_add_seconds(3, 
    348348                        self.remove_statusbar, self.message_id) 
    349349                if self.update_progressbar_timeout_id is not None: 
  • trunk/src/roster_window.py

    r9305 r9324  
    56215621                        st = gajim.config.get('set_status_msg_from_current_music_track') 
    56225622                        if st: 
    5623                                 gobject.timeout_add(1000, 
     5623                                gobject.timeout_add_seconds(1, 
    56245624                                        self.enable_syncing_status_msg_from_current_music_track, st) 
    56255625                        else: 
    5626                                 gobject.timeout_add(1000, 
     5626                                gobject.timeout_add_seconds(1, 
    56275627                                        self.enable_syncing_status_msg_from_lastfm, 
    56285628                                        gajim.config.get('set_status_msg_from_lastfm'))