Merge branch 'master' of https://github.com/hellman/mintmenu into hellman-master

Conflicts:
	usr/lib/linuxmint/mintMenu/plugins/places.py
This commit is contained in:
Clement Lefebvre 2013-11-25 12:42:36 +00:00
commit 79cadefca8

View File

@ -222,24 +222,27 @@ class pluginclass( object ):
currentbutton.show() currentbutton.show()
self.placesBtnHolder.pack_start( currentbutton, False, False, 0) self.placesBtnHolder.pack_start( currentbutton, False, False, 0)
def do_gtk_bookmarks( self ): def do_gtk_bookmarks( self ):
if self.showGTKBookmarks: if self.showGTKBookmarks:
if not os.path.exists(os.path.expanduser('~/.gtk-bookmarks')): if not os.path.exists(os.path.expanduser('~/.gtk-bookmarks')):
return return
bookmarks = {} bookmarks = []
with open(os.path.expanduser('~/.gtk-bookmarks'), 'r') as f: with open(os.path.expanduser('~/.gtk-bookmarks'), 'r') as f:
for line in f: for line in f:
#line = line.replace('file://', '') #line = line.replace('file://', '')
line = line.rstrip() line = line.rstrip()
parts = line.split(' ') if not line:
continue
parts = line.split(' ', 1)
if len(parts) == 2: if len(parts) == 2:
bookmarks[parts[1]] = parts[0] path, name = parts
elif len(parts) == 1: elif len(parts) == 1:
junk = os.path.split(parts[0]) path = parts[0]
bookmarks[junk[len(junk) - 1]] = parts[0] name = os.path.basename(os.path.normpath(path))
bookmarks.append((name, path))
for name, path in bookmarks.iteritems():
for name, path in bookmarks:
name = unquote(name) name = unquote(name)
currentbutton = easyButton( "folder", self.iconsize, [name], -1, -1 ) currentbutton = easyButton( "folder", self.iconsize, [name], -1, -1 )
currentbutton.connect( "clicked", self.launch_gtk_bookmark, path ) currentbutton.connect( "clicked", self.launch_gtk_bookmark, path )