Merge lp:~mvo/software-center/lp846204 into lp:software-center

Proposed by Michael Vogt on 2012-03-29
Status: Merged
Merged at revision: 2931
Proposed branch: lp:~mvo/software-center/lp846204
Merge into: lp:software-center
Diff against target: 103 lines (+26/-5)
3 files modified
softwarecenter/ui/gtk3/models/appstore2.py (+6/-0)
softwarecenter/ui/gtk3/panes/installedpane.py (+12/-0)
softwarecenter/ui/gtk3/widgets/apptreeview.py (+8/-5)
To merge this branch: bzr merge lp:~mvo/software-center/lp846204
Reviewer Review Type Date Requested Status
Gary Lasker (community) 2012-03-29 Approve on 2012-03-30
Review via email: mp+99919@code.launchpad.net

Description of the change

This branch fixes bug #846204 the right way by disconnecting the treemodel from the view before
rebuilding the installtreeview. It also re-enables error reporting in expand_cursor.

To post a comment you must log in.
lp:~mvo/software-center/lp846204 updated on 2012-03-29
2931. By Michael Vogt on 2012-03-29

pep8 fixes

Gary Lasker (gary-lasker) wrote :

Very nice! Thanks mvo.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'softwarecenter/ui/gtk3/models/appstore2.py'
2--- softwarecenter/ui/gtk3/models/appstore2.py 2012-03-16 10:44:05 +0000
3+++ softwarecenter/ui/gtk3/models/appstore2.py 2012-03-29 12:29:19 +0000
4@@ -61,6 +61,9 @@
5 self.pkg_count = pkg_count
6 self.vis_count = pkg_count
7
8+ def __repr__(self):
9+ return "[CategoryRowReference: name=%s]" % self.untranslated_name
10+
11
12 class UncategorisedRowRef(CategoryRowReference):
13
14@@ -75,6 +78,9 @@
15 display_name,
16 None, pkg_count)
17
18+ def __repr__(self):
19+ return "[UncategorizedRowReference: name=%s]" % self.untranslated_name
20+
21
22 class AppPropertiesHelper(GObject.GObject):
23 """ Baseclass that contains common functions for our
24
25=== modified file 'softwarecenter/ui/gtk3/panes/installedpane.py'
26--- softwarecenter/ui/gtk3/panes/installedpane.py 2012-03-27 22:55:49 +0000
27+++ softwarecenter/ui/gtk3/panes/installedpane.py 2012-03-29 12:29:19 +0000
28@@ -335,6 +335,10 @@
29 window.set_cursor(self.busy_cursor)
30 self.show_installed_view_spinner()
31
32+ # disconnect the model to avoid e.g. updates of "cursor-changed"
33+ # AppTreeView.expand_path while the model is in rebuild-flux
34+ self.app_view.set_model(None)
35+
36 model = self.base_model # base model not treefilter
37 model.clear()
38
39@@ -410,6 +414,8 @@
40 self.app_view._append_appcount(self.installed_count,
41 mode=AppView.INSTALLED_MODE)
42
43+ self.app_view.set_model(self.treefilter)
44+
45 # hide the local spinner
46 self.hide_installed_view_spinner()
47
48@@ -434,6 +440,10 @@
49 window.set_cursor(self.busy_cursor)
50 self.show_installed_view_spinner()
51
52+ # disconnect the model to avoid e.g. updates of "cursor-changed"
53+ # AppTreeView.expand_path while the model is in rebuild-flux
54+ self.app_view.set_model(None)
55+
56 model = self.base_model # base model not treefilter
57 model.clear()
58
59@@ -518,6 +528,8 @@
60 self.app_view._append_appcount(self.installed_count,
61 mode=AppView.DIFF_MODE)
62
63+ self.app_view.set_model(self.treefilter)
64+
65 # hide the local spinner
66 self.hide_installed_view_spinner()
67
68
69=== modified file 'softwarecenter/ui/gtk3/widgets/apptreeview.py'
70--- softwarecenter/ui/gtk3/widgets/apptreeview.py 2012-03-22 23:32:06 +0000
71+++ softwarecenter/ui/gtk3/widgets/apptreeview.py 2012-03-29 12:29:19 +0000
72@@ -20,6 +20,9 @@
73 AppGenericStore, CategoryRowReference)
74
75
76+LOG = logging.getLogger(__name__)
77+
78+
79 class AppTreeView(Gtk.TreeView):
80
81 """Treeview based view component that takes a AppStore and displays it"""
82@@ -144,16 +147,16 @@
83
84 if old is not None:
85 start, end = self.get_visible_range() or (None, None)
86- if (start and start.compare(old) != -1) or \
87- (end and end.compare(old) != 1):
88+ if ((start and start.compare(old) != -1) or
89+ (end and end.compare(old) != 1)):
90 self._needs_collapse.append(old)
91 else:
92 try: # try... a lazy solution to Bug #846204
93 model.row_changed(old, model.get_iter(old))
94 except:
95- msg = ("apptreeview.expand_path: Supplied 'old' "
96- "path is an invalid tree path: '%s'" % old)
97- logging.debug(msg)
98+ LOG.exception(
99+ "apptreeview.expand_path: Supplied 'old' "
100+ "path is an invalid tree path: '%s'" % old)
101
102 if path == None:
103 return

Subscribers

People subscribed via source and target branches