[gedit] Fix quickopen plugin to use GFile instead of uris



commit 45a63633e5cd69c33f5e1d17f4067c71ac9f2def
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Thu Apr 1 13:40:33 2010 +0200

    Fix quickopen plugin to use GFile instead of uris

 plugins/quickopen/quickopen/popup.py        |   16 ++++++----------
 plugins/quickopen/quickopen/windowhelper.py |    2 +-
 2 files changed, 7 insertions(+), 11 deletions(-)
---
diff --git a/plugins/quickopen/quickopen/popup.py b/plugins/quickopen/quickopen/popup.py
index a80caf3..dcfe098 100644
--- a/plugins/quickopen/quickopen/popup.py
+++ b/plugins/quickopen/quickopen/popup.py
@@ -416,17 +416,13 @@ class Popup(gtk.Dialog):
 
         def _direct_file(self):
                 uri = self._entry.get_text()
-                gfile = None
-
-                if gedit.utils.uri_is_valid(uri):
-                        gfile = gio.File(uri)
-                elif os.path.isabs(uri):
-                        f = gio.File(uri)
-
-                        if f.query_exists():
-                                gfile = f
+                gfile = gio.File(uri)
 
-                return gfile
+                if gedit.utils.location_is_valid(gfile) or \
+                   (os.path.isabs(uri) and gfile.query_exists()):
+                        return gfile
+                else:
+                        return None
 
         def _activate(self):
                 model, rows = self._treeview.get_selection().get_selected_rows()
diff --git a/plugins/quickopen/quickopen/windowhelper.py b/plugins/quickopen/quickopen/windowhelper.py
index 70ea26f..603acf5 100644
--- a/plugins/quickopen/quickopen/windowhelper.py
+++ b/plugins/quickopen/quickopen/windowhelper.py
@@ -192,7 +192,7 @@ class WindowHelper:
                 self._popup = None
 
         def on_activated(self, gfile):
-                gedit.commands.load_uri(self._window, gfile.get_uri(), None, -1)
+                gedit.commands.load_location(self._window, gfile, None, -1)
                 return True
 
 # ex:ts=8:et:



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