~ubuntuone-control-tower/ubuntuone-control-panel/trunk

« back to all changes in this revision

Viewing changes to ubuntuone/controlpanel/gui/qt/folders.py

  • Committer: Tarmac
  • Author(s): Roberto Alsina
  • Date: 2012-02-29 16:32:57 UTC
  • mfrom: (266.2.2 fix-scroll)
  • Revision ID: tarmac-20120229163257-webxcwq322y2km71
- Preserved the scrollbar position when clearing/filling the folder list (LP: #942355).

Show diffs side-by-side

added added

removed removed

Lines of Context:
112
112
    @log_call(logger.debug)
113
113
    def process_info(self, info):
114
114
        """Load folders info into the tree view."""
 
115
        # FIXME: this is a bit of a hack for bug #942355
 
116
        # The correct solution is to not clear the list at all, but
 
117
        # the code would be much more complicated.
 
118
        scrollbar_position = self.ui.folders.verticalScrollBar().value()
115
119
        self.ui.folders.clear()
116
120
        self.is_processing = False
117
121
 
194
198
                self.ui.folders.setIndexWidget(model_index, button)
195
199
 
196
200
        self.ui.folders.expandAll()
 
201
        self.ui.folders.verticalScrollBar().setValue(scrollbar_position)
197
202
 
198
203
    # Invalid name "on_folders_itemActivated", "on_folders_itemChanged"
199
204
    # pylint: disable=C0103