Merge lp:~dobey/rhythmbox-ubuntuone/update-from-trunk into lp:rhythmbox-ubuntuone/stable-3-0

Proposed by dobey on 2012-04-03
Status: Merged
Approved by: dobey on 2012-04-03
Approved revision: 117
Merged at revision: 117
Proposed branch: lp:~dobey/rhythmbox-ubuntuone/update-from-trunk
Merge into: lp:rhythmbox-ubuntuone/stable-3-0
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/update-from-trunk
Reviewer Review Type Date Requested Status
Eric Casteleijn (community) 2012-04-03 Approve on 2012-04-03
Review via email: mp+100666@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.
Eric Casteleijn (thisfred) wrote :

Will the kludges to remove the non-uri/unescaped uri be there forever? If not, I'd like to see XXX/TODO comments there, preferably with a bug number.

review: Approve
dobey (dobey) wrote :

Probably. I don't see any particular reason to remove them in the next 5 years, and that's close enough to forever that it might as well be marriage. :)

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-04-03 18:21:17 +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

to all changes: