Merge lp:~sil/rhythmbox-ubuntuone/remove-old-library into lp:~sil/rhythmbox-ubuntuone/trunk

Proposed by Stuart Langridge
Status: Merged
Approved by: Stuart Langridge
Approved revision: not available
Merged at revision: not available
Proposed branch: lp:~sil/rhythmbox-ubuntuone/remove-old-library
Merge into: lp:~sil/rhythmbox-ubuntuone/trunk
Diff against target: 26 lines (+9/-0)
1 file modified
umusicstore/__init__.py (+9/-0)
To merge this branch: bzr merge lp:~sil/rhythmbox-ubuntuone/remove-old-library
Reviewer Review Type Date Requested Status
Martin Albisetti (community) Approve
Stuart Langridge Pending
Review via email: mp+19810@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Stuart Langridge (sil) wrote :

remove old library UDF

Revision history for this message
Martin Albisetti (beuno) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'umusicstore/__init__.py'
2--- umusicstore/__init__.py 2010-02-19 12:22:35 +0000
3+++ umusicstore/__init__.py 2010-02-21 11:45:26 +0000
4@@ -113,6 +113,7 @@
5 """Add the U1 library if not listed in RB and re-add if changed."""
6 client = gconf.client_get_default()
7 self._add_u1_library_if_not_present(client)
8+ self._remove_old_u1_library_if_present(client)
9 # Watch for changes to the gconf key and re-add the library
10 client.notify_add(RB_LIBRARY_LOCATIONS,
11 self._add_u1_library_if_not_present)
12@@ -124,6 +125,14 @@
13 libraries.append(U1LIBRARYPATH)
14 client.set_list(RB_LIBRARY_LOCATIONS, gconf.VALUE_STRING, libraries)
15
16+ def _remove_old_u1_library_if_present(self, client, *args, **kwargs):
17+ """Check for the old U1 library and remove it from libraries list."""
18+ libraries = client.get_list(RB_LIBRARY_LOCATIONS, gconf.VALUE_STRING)
19+ old_path = "file://%s" % os.path.expanduser("~/.ubuntuone/musicstore")
20+ if old_path in libraries:
21+ libraries.remove(old_path)
22+ client.set_list(RB_LIBRARY_LOCATIONS, gconf.VALUE_STRING, libraries)
23+
24 class U1Source(rb.Source):
25 """A Rhythmbox source widget for the U1 Music Store."""
26 # gproperties required so that rb.Source is instantiable

Subscribers

People subscribed via source and target branches

to all changes: