Merge lp:~dobey/rhythmbox-ubuntuone/undup-lib-entries into lp:rhythmbox-ubuntuone

Proposed by dobey
Status: Merged
Approved by: dobey
Approved revision: 116
Merged at revision: 116
Proposed branch: lp:~dobey/rhythmbox-ubuntuone/undup-lib-entries
Merge into: lp:rhythmbox-ubuntuone
Diff against target: 24 lines (+12/-2)
1 file modified
ubuntuone/ubuntuone.py (+12/-2)
To merge this branch: bzr merge lp:~dobey/rhythmbox-ubuntuone/undup-lib-entries
Reviewer Review Type Date Requested Status
Roberto Alsina (community) Approve
Review via email: mp+99085@code.launchpad.net

Commit message

Add ourselves to the libraries list as an escaped URI
Remove the old non-uri and unescaped uri path entries

To post a comment you must log in.
Revision history for this message
Roberto Alsina (ralsina) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntuone/ubuntuone.py'
2--- ubuntuone/ubuntuone.py 2012-03-20 20:26:40 +0000
3+++ ubuntuone/ubuntuone.py 2012-03-23 18:03:23 +0000
4@@ -41,8 +41,18 @@
5 def _locations_changed(self, *args, **kwargs):
6 """Handle the locations setting being changed."""
7 libraries = self.rdbconf.get_strv('locations')
8- if U1LIBRARYPATH not in libraries:
9- libraries.append(U1LIBRARYPATH)
10+ library_uri = Gio.File.new_for_path(U1LIBRARYPATH).get_uri()
11+ if library_uri not in libraries:
12+ libraries.append(library_uri)
13+ self.rdbconf.set_strv('locations', libraries)
14+ # Remove the non-uri path if it exists
15+ if U1LIBRARYPATH in libraries:
16+ libraries.remove(U1LIBRARYPATH)
17+ self.rdbconf.set_strv('locations', libraries)
18+ # Remove the unescaped uri path if it exists
19+ unescaped_path = u'file://{0}'.format(U1LIBRARYPATH)
20+ if unescaped_path in libraries:
21+ libraries.remove(unescaped_path)
22 self.rdbconf.set_strv('locations', libraries)
23
24 def do_activate(self):

Subscribers

People subscribed via source and target branches