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
=== modified file 'umusicstore/__init__.py'
--- umusicstore/__init__.py 2010-02-19 12:22:35 +0000
+++ umusicstore/__init__.py 2010-02-21 11:45:26 +0000
@@ -113,6 +113,7 @@
113 """Add the U1 library if not listed in RB and re-add if changed."""113 """Add the U1 library if not listed in RB and re-add if changed."""
114 client = gconf.client_get_default()114 client = gconf.client_get_default()
115 self._add_u1_library_if_not_present(client)115 self._add_u1_library_if_not_present(client)
116 self._remove_old_u1_library_if_present(client)
116 # Watch for changes to the gconf key and re-add the library117 # Watch for changes to the gconf key and re-add the library
117 client.notify_add(RB_LIBRARY_LOCATIONS, 118 client.notify_add(RB_LIBRARY_LOCATIONS,
118 self._add_u1_library_if_not_present)119 self._add_u1_library_if_not_present)
@@ -124,6 +125,14 @@
124 libraries.append(U1LIBRARYPATH)125 libraries.append(U1LIBRARYPATH)
125 client.set_list(RB_LIBRARY_LOCATIONS, gconf.VALUE_STRING, libraries)126 client.set_list(RB_LIBRARY_LOCATIONS, gconf.VALUE_STRING, libraries)
126127
128 def _remove_old_u1_library_if_present(self, client, *args, **kwargs):
129 """Check for the old U1 library and remove it from libraries list."""
130 libraries = client.get_list(RB_LIBRARY_LOCATIONS, gconf.VALUE_STRING)
131 old_path = "file://%s" % os.path.expanduser("~/.ubuntuone/musicstore")
132 if old_path in libraries:
133 libraries.remove(old_path)
134 client.set_list(RB_LIBRARY_LOCATIONS, gconf.VALUE_STRING, libraries)
135
127class U1Source(rb.Source):136class U1Source(rb.Source):
128 """A Rhythmbox source widget for the U1 Music Store."""137 """A Rhythmbox source widget for the U1 Music Store."""
129 # gproperties required so that rb.Source is instantiable138 # gproperties required so that rb.Source is instantiable

Subscribers

People subscribed via source and target branches

to all changes: