Author: jim++ Date: 2008-04-30 02:28:34 +0200 (Wed, 30 Apr 2008) New Revision: 9546
Modified: trunk/src/roster_window.py Log: Some little on_model_row_has_child_toggled() speedups
Modified: trunk/src/roster_window.py =================================================================== --- trunk/src/roster_window.py 2008-04-29 23:50:44 UTC (rev 9545) +++ trunk/src/roster_window.py 2008-04-30 00:28:34 UTC (rev 9546) @@ -3475,23 +3475,24 @@ return
account = account.decode('utf-8') - child_iter = model.convert_iter_to_child_iter(iter) - - if type_ == 'account': + + if type_ == 'contact': + child_iter = model.convert_iter_to_child_iter(iter) + if self.model.iter_has_child(child_iter): + # we are a bigbrother metacontact + # redraw us to show/hide expand icon + if self.filtering: + # Prevent endless loops + jid = model[iter][C_JID].decode('utf-8') + gobject.idle_add(self.draw_contact, jid, account) + elif type_ == 'group': + group = model[iter][C_JID].decode('utf-8') + self._adjust_group_expand_collapse_state(group, account) + elif type_ == 'account': if not self.filtering: # We just added the account to roster and it got its first contacts # Restore expand collapse state self._adjust_account_expand_collapse_state(account) - elif type_ == 'contact' and self.model.iter_has_child(child_iter): - # we are a bigbrother metacontact - # redraw us to show/hide expand icon - if self.filtering: - # Prevent endless loops - jid = model[iter][C_JID].decode('utf-8') - gobject.idle_add(self.draw_contact, jid, account) - elif type_ == 'group': - group = model[iter][C_JID].decode('utf-8') - self._adjust_group_expand_collapse_state(group, account)
def on_treeview_selection_changed(self, selection): '''Called when selection in TreeView has changed.