[gedit-plugins/gnome-2-32] Use uri instead of location



commit e60600fea4e9856ad47ca0747b18fe8567b3b355
Author: Jesse van den Kieboom <jesse vandenkieboom epfl ch>
Date:   Mon Aug 30 08:34:45 2010 +0200

    Use uri instead of location
    
    Location API is not yet available in gedit stable

 plugins/commander/modules/edit.py |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/plugins/commander/modules/edit.py b/plugins/commander/modules/edit.py
index a6163c2..e6c4799 100644
--- a/plugins/commander/modules/edit.py
+++ b/plugins/commander/modules/edit.py
@@ -35,13 +35,15 @@ def __default__(filename, view):
 
 	if matches:
 		for match in matches:
-			files.append(gio.File(match))
+			f = gio.File(match)
+			files.append(f.get_uri())
 	else:
-		files.append(gio.File(filename))
+		f = gio.File(filename)
+		files.append(f.get_uri())
 
 	if files:
 		window = view.get_toplevel()
-		gedit.commands.load_locations(window, files)
+		gedit.commands.load_uris(window, files)
 
 	return commander.commands.result.HIDE
 
@@ -54,7 +56,7 @@ def rename(view, newfile):
 
 	doc = view.get_buffer()
 
-	if not hasattr(doc, 'set_location'):
+	if not hasattr(doc, 'set_uri'):
 		raise commander.commands.exceptions.Execute('Your version of gedit does not support this action')
 
 	if doc.is_untitled():
@@ -101,7 +103,7 @@ def rename(view, newfile):
 	try:
 		f.move(dest, _dummy_cb, flags=gio.FILE_COPY_OVERWRITE)
 
-		doc.set_location(dest)
+		doc.set_uri(dest.get_uri())
 		yield commander.commands.result.HIDE
 	except Exception, e:
 		raise commander.commands.exceptions.Execute('Could not move file: %s' % (e,))
@@ -119,7 +121,7 @@ def _edit_command(view, mod, func=None):
 		return False
 
 	if not func:
-		gedit.commands.load_location(view.get_toplevel(), location)
+		gedit.commands.load_uri(view.get_toplevel(), location.get_uri())
 	else:
 		try:
 			lines = inspect.getsourcelines(func)
@@ -127,7 +129,7 @@ def _edit_command(view, mod, func=None):
 		except:
 			line = 0
 
-		gedit.commands.load_location(view.get_toplevel(), location, None, line)
+		gedit.commands.load_uri(view.get_toplevel(), location.get_uri(), None, line)
 
 	return True
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]