Changeset 9599

Show
Ignore:
Timestamp:
05/09/08 00:09:43 (7 months ago)
Author:
steve-e
Message:

Some random roster cleanups:

  • remove unused code
  • use self.model directly when obvious
  • cleanup some FIXME comments
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/roster_window.py

    r9598 r9599  
    742742 
    743743 
    744         #FIXME: Better never even remove.... 
     744        #FIXME:  
     745        # We need to define a generic way to keep contacts in roster 
     746        # as long as they have pending events or as we 
     747        # still chat with them 
    745748        def _readd_contact_to_roster_if_needed(self, contact, account): 
    746                 # FIXME What am I REALLY needed for 
    747749                need_readd = False 
    748750                if len(gajim.events.get_events(account, contact.jid)): 
     
    17201722 
    17211723        def set_connecting_state(self, account): 
    1722                 model = self.modelfilter 
    1723                 child_model = model.get_model() 
    1724                 IterA = self._get_account_iter(account) 
    1725                 if IterA: 
    1726                         child_iterA = model.convert_iter_to_child_iter(IterA) 
    1727                         child_model[child_iterA][0] = \ 
     1724                child_iterA = self._get_account_iter(account, self.model) 
     1725                if child_iterA: 
     1726                        self.model[child_iterA][0] = \ 
    17281727                                gajim.interface.jabber_state_images['16']['connecting'] 
    17291728                if gajim.interface.systray_enabled: 
     
    17311730 
    17321731        def send_status(self, account, status, txt, auto = False, to = None): 
    1733                 model = self.modelfilter 
    1734                 child_model = model.get_model() 
    1735                 iterA = self._get_account_iter(account) 
     1732                child_iterA = self._get_account_iter(account, self.model) 
    17361733                if status != 'offline': 
    17371734                        if gajim.connections[account].connected < 2: 
     
    17491746                                        passphrase, save = w.run() 
    17501747                                        if passphrase == -1: 
    1751                                                 if iterA: 
    1752                                                         child_iterA = model.convert_iter_to_child_iter(iterA) 
    1753                                                         child_model[child_iterA][0] = gajim.interface.jabber_state_images[ 
     1748                                                if child_iterA: 
     1749                                                        self.model[child_iterA][0] = gajim.interface.jabber_state_images[ 
    17541750                                                                '16']['offline'] 
    17551751                                                if gajim.interface.systray_enabled: 
     
    20542050                gajim.events.add_event(account, fjid, event) 
    20552051                if popup: 
    2056                         # FIXME: What is happening here. 
    2057                         # What does "OR he is not in the roster at all" mean 
    20582052                        if not ctrl: 
    20592053                                gajim.interface.new_chat(contact, account, \ 
     
    20612055                                if path and not self.dragging and gajim.config.get( 
    20622056                                'scroll_roster_to_last_message'): 
    2063                                         # we curently see contact in our roster OR he 
    2064                                         # is not in the roster at all. 
     2057                                        # we curently see contact in our roster 
    20652058                                        # show and select his line in roster 
    20662059                                        # do not change selection while DND'ing 
     
    30243017                                if x > x_min and x < x_min + 27 and type_ == 'contact' and \ 
    30253018                                model.iter_has_child(titer): 
    3026                                         # FIXME: Expand all meta contacts or only the current one? 
    3027                                         #account = model[path][C_ACCOUNT].decode('utf-8') 
    3028                                         #jid = model[path][C_JID].decode('utf-8') 
    3029                                         # first cell in 1st column (the arrow SINGLE clicked) 
    3030                                         #iters = self._get_contact_iter(jid, account) 
    3031                                         #for titer in iters: 
    3032                                         #       path = model.get_path(titer) 
    30333019                                        if (self.tree.row_expanded(path)): 
    30343020                                                self.tree.collapse_row(path) 
     
    30493035 
    30503036                                elif type_ == 'contact' and x > x_min and x < x_min + 27: 
    3051                                         # FIXME: Expand all meta contacts or only the current one? 
    3052                                         #account = model[path][C_ACCOUNT].decode('utf-8') 
    3053                                         #jid = model[path][C_JID].decode('utf-8') 
    3054                                         # first cell in 1st column (the arrow SINGLE clicked) 
    3055                                         #iters = self._get_contact_iter(jid, account) 
    3056                                         #for titer in iters: 
    3057                                         #       path = model.get_path(titer) 
    30583037                                        if (self.tree.row_expanded(path)): 
    30593038                                                self.tree.collapse_row(path) 
     
    39753954        def set_account_status_icon(self, account): 
    39763955                status = gajim.connections[account].connected 
    3977                 model = self.modelfilter 
    3978                 child_model = model.get_model() 
    3979                 iterA = self._get_account_iter(account) 
    3980                 if not iterA: 
    3981                         return 
    3982                 child_iterA = model.convert_iter_to_child_iter(iterA) 
     3956                child_iterA = self._get_account_iter(account, self.model) 
     3957                if not child_iterA: 
     3958                        return 
    39833959                if not self.regroup: 
    39843960                        show = gajim.SHOW_LIST[status] 
    39853961                else:   # accounts merged 
    39863962                        show = helpers.get_global_show() 
    3987                 child_model[child_iterA][C_IMG] = gajim.interface.jabber_state_images['16'][show]        
     3963                self.model[child_iterA][C_IMG] = gajim.interface.jabber_state_images['16'][show]         
    39883964 
    39893965################################################################################ 
     
    40264002 
    40274003        def change_roster_style(self, option): 
    4028                 model = self.modelfilter 
    4029                 child_model = model.get_model() 
    4030                 child_model.foreach(self._change_style, option) 
     4004                self.model.foreach(self._change_style, option) 
    40314005                for win in gajim.interface.msg_win_mgr.windows(): 
    40324006                        win.repaint_themed_widgets()