[gedit] Rename uri_has_file_scheme to location_has_file_scheme in snippets



commit e0b5b61f1d219a57ae63b132fc9c20270ff9de69
Author: Jesse van den Kieboom <jessevdk gnome org>
Date:   Fri Apr 30 00:50:36 2010 +0200

    Rename uri_has_file_scheme to location_has_file_scheme in snippets

 plugins/snippets/snippets/Document.py |    6 +++---
 plugins/snippets/snippets/Manager.py  |    5 +++--
 2 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/plugins/snippets/snippets/Document.py b/plugins/snippets/snippets/Document.py
index da16666..7c275da 100644
--- a/plugins/snippets/snippets/Document.py
+++ b/plugins/snippets/snippets/Document.py
@@ -452,7 +452,7 @@ class Document:
 
                         documents_path = [location.get_path()
                                           for location in documents_location
-                                          if gedit.utils.uri_has_file_scheme(location.get_uri())]
+                                          if gedit.utils.location_has_file_scheme(location)]
                 else:
                         documents_path = []
                 
@@ -865,11 +865,11 @@ class Document:
                 dirname = ''
                 ruri = ''
 
-                if gedit.utils.uri_has_file_scheme(uri):
+                if gedit.utils.location_has_file_scheme(gfile):
                         pathname = gfile.get_path()
                         dirname = gfile.get_parent().get_path()
 
-                name = os.path.basename(uri)
+                name = gfile.get_basename()
                 scheme = gfile.get_uri_scheme()
 
                 os.environ['GEDIT_DROP_DOCUMENT_URI'] = uri
diff --git a/plugins/snippets/snippets/Manager.py b/plugins/snippets/snippets/Manager.py
index 8c9f2f1..8c0524c 100644
--- a/plugins/snippets/snippets/Manager.py
+++ b/plugins/snippets/snippets/Manager.py
@@ -765,11 +765,12 @@ class Manager:
                 success = True
                 
                 for filename in filenames:
-                        if not gedit.utils.uri_has_file_scheme(filename):
+                        gfile = gio.File(filename)
+
+                        if not gedit.utils.location_has_file_scheme(gfile):
                                 continue
 
                         # Remove file://
-                        gfile = gio.File(filename)
                         filename = gfile.get_path()
 
                         importer = Importer(filename)



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