[gedit] Port plugins to gtk_source_file_is_local()



commit 76360ca5746f3989f7c76a8da1e8163ca40b564b
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sun Jun 14 15:20:21 2015 +0200

    Port plugins to gtk_source_file_is_local()
    
    And to gtk_source_file_get_location().

 plugins/externaltools/tools/filelookup.py        |    8 ++++----
 plugins/externaltools/tools/windowactivatable.py |    4 ++--
 plugins/quickopen/quickopen/__init__.py          |    4 ++--
 3 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/plugins/externaltools/tools/filelookup.py b/plugins/externaltools/tools/filelookup.py
index f51583d..f256eea 100644
--- a/plugins/externaltools/tools/filelookup.py
+++ b/plugins/externaltools/tools/filelookup.py
@@ -131,8 +131,8 @@ class OpenDocumentRelPathFileLookupProvider(FileLookupProvider):
             return None
 
         for doc in Gio.Application.get_default().get_documents():
-            if doc.is_local():
-                location = doc.get_location()
+            if doc.get_file().is_local():
+                location = doc.get_file().get_location()
                 if location:
                     rel_path = location.get_parent().get_path()
                     joined_path = os.path.join(rel_path, path)
@@ -156,8 +156,8 @@ class OpenDocumentFileLookupProvider(FileLookupProvider):
             return None
 
         for doc in Gio.Application.get_default().get_documents():
-            if doc.is_local():
-                location = doc.get_location()
+            if doc.get_file().is_local():
+                location = doc.get_file().get_location()
                 if location and location.get_uri().endswith(path):
                     return location
         return None
diff --git a/plugins/externaltools/tools/windowactivatable.py 
b/plugins/externaltools/tools/windowactivatable.py
index 946c82e..f4d25d4 100644
--- a/plugins/externaltools/tools/windowactivatable.py
+++ b/plugins/externaltools/tools/windowactivatable.py
@@ -75,8 +75,8 @@ class ToolActions(object):
             remote = False
             language = None
         else:
-            titled = document.get_location() is not None
-            remote = not document.is_local()
+            titled = document.get_file().get_location() is not None
+            remote = not document.get_file().is_local()
             language = document.get_language()
 
         states = {
diff --git a/plugins/quickopen/quickopen/__init__.py b/plugins/quickopen/quickopen/__init__.py
index b808adb..6cff2d1 100644
--- a/plugins/quickopen/quickopen/__init__.py
+++ b/plugins/quickopen/quickopen/__init__.py
@@ -73,8 +73,8 @@ class QuickOpenPlugin(GObject.Object, Gedit.WindowActivatable):
         doc = self.window.get_active_document()
 
         # Current document directory
-        if doc and doc.is_local():
-            gfile = doc.get_location()
+        if doc and doc.get_file().is_local():
+            gfile = doc.get_file().get_location()
             paths.append(gfile.get_parent())
 
         # File browser root directory


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