~mvo/software-center/lp970342

« back to all changes in this revision

Viewing changes to softwarecenter/ui/gtk3/widgets/apptreeview.py

  • Committer: Kiwinote
  • Date: 2012-03-30 13:26:42 UTC
  • mfrom: (2935.2.1 trunk)
  • Revision ID: kiwinote@gmail.com-20120330132642-w11m5k0z6d35dkd0
* lp:~mvo/software-center/lp969050:
 - disconnect the view when the model is cleared to avoid a furry of
   cursor_changed signals as the rows get removed (LP: #969050)

Show diffs side-by-side

added added

removed removed

Lines of Context:
134
134
        self.expanded_path = None
135
135
        self._needs_collapse = []
136
136
        if self.appmodel:
137
 
            self.appmodel.clear()
 
137
            # before clearing the model, disconnect it from the view. this
 
138
            # avoids that the model gets a "cursor_changed" signal for each
 
139
            # removed row and consequently that _update_selected_row is called
 
140
            # for rows that are not really selected (LP: #969050)
 
141
            model = self.get_model()
 
142
            self.set_model(None)
 
143
            model.clear()
 
144
            self.set_model(model)
138
145
 
139
146
    def expand_path(self, path):
140
147
        if path is not None and not isinstance(path, Gtk.TreePath):