[gedit] gedit_document_get_location still used by Python plugins



commit 655bae0848173b3236939f5e2a041f93917798db
Author: Jordi Mas <jmas softcatala org>
Date:   Sun Apr 14 15:31:47 2019 +0200

    gedit_document_get_location still used by Python plugins

 docs/reference/gedit-sections.txt |  1 +
 gedit/gedit-document.c            | 26 ++++++++++++++++++++++++++
 gedit/gedit-document.h            |  2 ++
 3 files changed, 29 insertions(+)
---
diff --git a/docs/reference/gedit-sections.txt b/docs/reference/gedit-sections.txt
index 9077c4400..ca3b17aef 100644
--- a/docs/reference/gedit-sections.txt
+++ b/docs/reference/gedit-sections.txt
@@ -55,6 +55,7 @@ gedit_commands_save_all_documents
 GeditDocument
 gedit_document_new
 gedit_document_get_file
+gedit_document_get_location
 gedit_document_get_uri_for_display
 gedit_document_get_short_name_for_display
 gedit_document_set_short_name_for_display
diff --git a/gedit/gedit-document.c b/gedit/gedit-document.c
index a252e1e31..f3ffafd21 100644
--- a/gedit/gedit-document.c
+++ b/gedit/gedit-document.c
@@ -1016,6 +1016,32 @@ set_content_type (GeditDocument *doc,
        }
 }
 
+/**
+ * gedit_document_get_location:
+ * @doc: a #GeditDocument
+ *
+ * Returns: (allow-none) (transfer full): a copy of the internal #GFile
+ *
+ * Deprecated: 3.14: use gtk_source_file_get_location() instead. Attention,
+ * gedit_document_get_location() has a transfer full for the return value, while
+ * gtk_source_file_get_location() has a transfer none.
+ */
+GFile *
+gedit_document_get_location (GeditDocument *doc)
+{
+       GeditDocumentPrivate *priv;
+       GFile *location;
+
+       priv = gedit_document_get_instance_private (doc);
+
+       g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), NULL);
+
+       location = gtk_source_file_get_location (priv->file);
+
+       return location != NULL ? g_object_ref (location) : NULL;
+}
+
+
 /**
  * gedit_document_get_uri_for_display:
  * @doc: a #GeditDocument.
diff --git a/gedit/gedit-document.h b/gedit/gedit-document.h
index 37f55d563..9bf4fcc2c 100644
--- a/gedit/gedit-document.h
+++ b/gedit/gedit-document.h
@@ -52,6 +52,8 @@ GeditDocument   *gedit_document_new                           (void);
 
 GtkSourceFile  *gedit_document_get_file                        (GeditDocument       *doc);
 
+G_DEPRECATED_FOR (gtk_source_file_get_location)
+GFile          *gedit_document_get_location            (GeditDocument       *doc);
 
 gchar          *gedit_document_get_uri_for_display             (GeditDocument       *doc);
 


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