diff --git a/usr/lib/linuxmint/mintMenu/plugins/places.py b/usr/lib/linuxmint/mintMenu/plugins/places.py --- a/usr/lib/linuxmint/mintMenu/plugins/places.py +++ b/usr/lib/linuxmint/mintMenu/plugins/places.py @@ -219,5 +219,4 @@ def do_gtk_bookmarks( self ): if self.showGTKBookmarks: - bookmarks = {} with open(os.path.expanduser('~/.gtk-bookmarks'), 'r') as f: @@ -223,2 +222,6 @@ with open(os.path.expanduser('~/.gtk-bookmarks'), 'r') as f: + #each line is either: {uri} space {label} + # or: {uri} + #spaces within {uri} escaped with %20 + #label has no escaping, spaces are kept as-is for line in f: @@ -224,3 +227,2 @@ for line in f: - #line = line.replace('file://', '') line = line.rstrip() @@ -226,4 +228,4 @@ line = line.rstrip() - parts = line.split(' ') - + parts = line.split(' ', 1) + if len(parts) == 2: @@ -229,6 +231,7 @@ if len(parts) == 2: - bookmarks[parts[1]] = parts[0] - elif len(parts) == 1: - junk = os.path.split(parts[0]) - bookmarks[junk[len(junk) - 1]] = parts[0] + uri, name = parts + else: + assert len(parts) == 1 + uri = parts[0] + name = os.path.split(uri)[-1] @@ -234,11 +237,9 @@ - for name, path in bookmarks.iteritems(): - name = unquote(name) - currentbutton = easyButton( "folder", self.iconsize, [name], -1, -1 ) - currentbutton.connect( "clicked", self.launch_gtk_bookmark, path ) - currentbutton.show() - self.placesBtnHolder.pack_start( currentbutton, False, False ) - + currentbutton = easyButton( "folder", self.iconsize, [name], -1, -1 ) + currentbutton.connect( "clicked", self.launch_gtk_bookmark, uri ) + currentbutton.show() + self.placesBtnHolder.pack_start( currentbutton, False, False ) + def launch_gtk_bookmark (self, widget, path): self.mintMenuWin.hide() os.system("xdg-open %s &" % path)