Merge lp:~ralsina/ubuntuone-windows-installer/empty-folder-list into lp:ubuntuone-windows-installer

Proposed by Roberto Alsina
Status: Merged
Approved by: Roberto Alsina
Approved revision: 76
Merged at revision: 58
Proposed branch: lp:~ralsina/ubuntuone-windows-installer/empty-folder-list
Merge into: lp:ubuntuone-windows-installer
Prerequisite: lp:~ralsina/ubuntuone-windows-installer/back-is-wrong
Diff against target: 30 lines (+9/-0)
2 files modified
ubuntuone_installer/gui/qt/local_folders.py (+1/-0)
ubuntuone_installer/gui/qt/tests/test_local_folders.py (+8/-0)
To merge this branch: bzr merge lp:~ralsina/ubuntuone-windows-installer/empty-folder-list
Reviewer Review Type Date Requested Status
Natalia Bidart (community) Approve
Diego Sarmentero (community) Approve
Review via email: mp+75043@code.launchpad.net

Commit message

Clean the items dict when cleaning the item list.

Description of the change

Clean the items dict when cleaning the item list.

To post a comment you must log in.
Revision history for this message
Diego Sarmentero (diegosarmentero) wrote :

+1

review: Approve
Revision history for this message
Natalia Bidart (nataliabidart) wrote :

Can you please add a test case validating this change? Thanks!

review: Needs Fixing
Revision history for this message
Roberto Alsina (ralsina) wrote :

> Can you please add a test case validating this change? Thanks!

I will try, but it's really tricky!

Revision history for this message
Roberto Alsina (ralsina) wrote :

Turns out it was not tricky at all :-)

Test added in revno 76

Revision history for this message
Natalia Bidart (nataliabidart) wrote :

Looks good!

review: Approve
Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ubuntuone_installer/gui/qt/local_folders.py'
--- ubuntuone_installer/gui/qt/local_folders.py 2011-09-12 17:38:00 +0000
+++ ubuntuone_installer/gui/qt/local_folders.py 2011-09-12 17:38:01 +0000
@@ -144,6 +144,7 @@
144 if volume[u'type'] == u"UDF":144 if volume[u'type'] == u"UDF":
145 self.folders_info.append(volume)145 self.folders_info.append(volume)
146 self.ui.folder_list.clear()146 self.ui.folder_list.clear()
147 self.items = {}
147 for folder in self.folders_info:148 for folder in self.folders_info:
148 if folder['subscribed']:149 if folder['subscribed']:
149 item = yield self.add_folder(150 item = yield self.add_folder(
150151
=== modified file 'ubuntuone_installer/gui/qt/tests/test_local_folders.py'
--- ubuntuone_installer/gui/qt/tests/test_local_folders.py 2011-09-12 17:38:00 +0000
+++ ubuntuone_installer/gui/qt/tests/test_local_folders.py 2011-09-12 17:38:01 +0000
@@ -284,6 +284,14 @@
284 self.assertNotIn('shared', self.ui.items)284 self.assertNotIn('shared', self.ui.items)
285285
286 @defer.inlineCallbacks286 @defer.inlineCallbacks
287 def test_get_info_twice(self):
288 """Calling initialize twice should be invariant."""
289 yield self.ui.get_info()
290 self.assertEqual(self.ui.ui.folder_list.topLevelItemCount(), 4)
291 yield self.ui.get_info()
292 self.assertEqual(self.ui.ui.folder_list.topLevelItemCount(), 4)
293
294 @defer.inlineCallbacks
287 def test_subscribed_udf_checked(self):295 def test_subscribed_udf_checked(self):
288 """Check that subscribed UDF items are created correctly."""296 """Check that subscribed UDF items are created correctly."""
289 yield self.ui.get_info()297 yield self.ui.get_info()

Subscribers

People subscribed via source and target branches