Merge lp:~mvo/software-center/fix-server-pagination into lp:software-center

Proposed by Michael Vogt
Status: Merged
Merged at revision: 2659
Proposed branch: lp:~mvo/software-center/fix-server-pagination
Merge into: lp:software-center
Diff against target: 46 lines (+17/-1)
2 files modified
softwarecenter/ui/gtk3/views/appdetailsview.py (+3/-1)
test/gtk3/test_appdetailsview.py (+14/-0)
To merge this branch: bzr merge lp:~mvo/software-center/fix-server-pagination
Reviewer Review Type Date Requested Status
Michael Nelson Approve
Review via email: mp+88828@code.launchpad.net

Description of the change

This small branch fixes a bug in the missing reset of the server page and adds a regression test.

To post a comment you must log in.
Revision history for this message
Michael Nelson (michael.nelson) wrote :

09:29 < mvo> anyone wnats to review https://code.launchpad.net/~mvo/software-center/fix-server-pagination/+merge/88828 ? should be pretty trivial
09:29 * noodles775 looks
09:32 < noodles775> mvo: with your branch, it's intended that the _reviews_server_page is also reset if it's the same app but with force=True right?
09:35 < mvo> good point, it should be fine, but I think I will go over the code and see if we still use force at all
09:36 < mvo> and if not eliminate dead code (huuary)
09:37 < noodles775> mvo: cool.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'softwarecenter/ui/gtk3/views/appdetailsview.py'
--- softwarecenter/ui/gtk3/views/appdetailsview.py 2012-01-06 08:35:11 +0000
+++ softwarecenter/ui/gtk3/views/appdetailsview.py 2012-01-17 09:28:32 +0000
@@ -1510,7 +1510,7 @@
1510 # init data1510 # init data
1511 self.app = app1511 self.app = app
1512 self.app_details = app.get_details(self.db)1512 self.app_details = app.get_details(self.db)
1513 1513
1514 # check if app just became available and if so, force full1514 # check if app just became available and if so, force full
1515 # refresh1515 # refresh
1516 if (same_app and1516 if (same_app and
@@ -1527,6 +1527,8 @@
1527 if same_app and not force:1527 if same_app and not force:
1528 self._update_minimal(self.app_details)1528 self._update_minimal(self.app_details)
1529 else:1529 else:
1530 # reset reviews_page
1531 self._reviews_server_page = 1
1530 # update all (but skip the addons calculation if this is a1532 # update all (but skip the addons calculation if this is a
1531 # DebFileApplication as this is not useful for this case and it1533 # DebFileApplication as this is not useful for this case and it
1532 # increases the view load time dramatically)1534 # increases the view load time dramatically)
15331535
=== modified file 'test/gtk3/test_appdetailsview.py'
--- test/gtk3/test_appdetailsview.py 2012-01-16 14:42:49 +0000
+++ test/gtk3/test_appdetailsview.py 2012-01-17 09:28:32 +0000
@@ -92,6 +92,20 @@
92 view._add_where_is_it_launcher("/usr/share/applications/ubuntu-software-center.desktop")92 view._add_where_is_it_launcher("/usr/share/applications/ubuntu-software-center.desktop")
93 do_events()93 do_events()
9494
95 def test_reviews_page(self):
96 win = get_test_window_appdetails()
97 view = win.get_data("view")
98 # show s-c and click on more review
99 app = Application("", "software-center")
100 view.show_app(app)
101 self.assertEqual(view._reviews_server_page, 1)
102 view._on_more_reviews_clicked(None)
103 self.assertEqual(view._reviews_server_page, 2)
104 # show different app, ensure page is reset
105 app = Application("", "apt")
106 view.show_app(app)
107 self.assertEqual(view._reviews_server_page, 1)
108
95 def test_pkgstatus_bar(self):109 def test_pkgstatus_bar(self):
96 # make sure configure is run with the various states110 # make sure configure is run with the various states
97 # test111 # test

Subscribers

People subscribed via source and target branches