[gedit/wip/loader-saver: 27/48] GeditDocument: deprecate some functions
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit/wip/loader-saver: 27/48] GeditDocument: deprecate some functions
- Date: Wed, 9 Jul 2014 11:10:17 +0000 (UTC)
commit 7da232d8be4542dccdcbf9dd272d252bf4912e4e
Author: Sébastien Wilmet <swilmet gnome org>
Date: Fri Jun 27 16:01:41 2014 +0200
GeditDocument: deprecate some functions
This commit deprecates:
gedit_document_get_location()
gedit_document_set_location()
gedit_document_get_encoding()
gedit_document_get_newline_type()
gedit_document_get_compression_type()
They have each a corresponding function in GtkSourceFile.
The code in GeditDocument is trivial, so it is not cumbersome to keep
those functions for a few development cycles. And probably
get_location() is used by lots of plugins.
gedit/gedit-document.c | 32 ++++++++++++++++++++++++++++++++
gedit/gedit-document.h | 6 ++++++
2 files changed, 38 insertions(+), 0 deletions(-)
---
diff --git a/gedit/gedit-document.c b/gedit/gedit-document.c
index 80537dc..a09bbb2 100644
--- a/gedit/gedit-document.c
+++ b/gedit/gedit-document.c
@@ -874,6 +874,10 @@ gedit_document_set_content_type (GeditDocument *doc,
* @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)
@@ -887,6 +891,13 @@ gedit_document_get_location (GeditDocument *doc)
return location != NULL ? g_object_ref (location) : NULL;
}
+/**
+ * gedit_document_set_location:
+ * @doc: a #GeditDocument.
+ * @location: the new location.
+ *
+ * Deprecated: 3.14: use gtk_source_file_set_location() instead.
+ */
void
gedit_document_set_location (GeditDocument *doc,
GFile *location)
@@ -1394,6 +1405,13 @@ gedit_document_get_language (GeditDocument *doc)
return gtk_source_buffer_get_language (GTK_SOURCE_BUFFER (doc));
}
+/**
+ * gedit_document_get_encoding:
+ * @doc: a #GeditDocument.
+ *
+ * Returns: the encoding.
+ * Deprecated: 3.14: use gtk_source_file_get_encoding() instead.
+ */
const GtkSourceEncoding *
gedit_document_get_encoding (GeditDocument *doc)
{
@@ -1416,6 +1434,13 @@ _gedit_document_get_seconds_since_last_save_or_load (GeditDocument *doc)
return (current_time.tv_sec - doc->priv->time_of_last_save_or_load.tv_sec);
}
+/**
+ * gedit_document_get_newline_type:
+ * @doc: a #GeditDocument.
+ *
+ * Returns: the newline type.
+ * Deprecated: 3.14: use gtk_source_file_get_newline_type() instead.
+ */
GtkSourceNewlineType
gedit_document_get_newline_type (GeditDocument *doc)
{
@@ -1424,6 +1449,13 @@ gedit_document_get_newline_type (GeditDocument *doc)
return gtk_source_file_get_newline_type (doc->priv->file);
}
+/**
+ * gedit_document_get_compression_type:
+ * @doc: a #GeditDocument.
+ *
+ * Returns: the compression type.
+ * Deprecated: 3.14: use gtk_source_file_get_compression_type() instead.
+ */
GtkSourceCompressionType
gedit_document_get_compression_type (GeditDocument *doc)
{
diff --git a/gedit/gedit-document.h b/gedit/gedit-document.h
index ab9c818..8e6d72b 100644
--- a/gedit/gedit-document.h
+++ b/gedit/gedit-document.h
@@ -80,7 +80,10 @@ 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);
+
+G_DEPRECATED_FOR (gtk_source_file_set_location)
void gedit_document_set_location (GeditDocument *doc,
GFile *location);
@@ -123,12 +126,15 @@ void gedit_document_set_language (GeditDocument *doc,
GtkSourceLanguage
*gedit_document_get_language (GeditDocument *doc);
+G_DEPRECATED_FOR (gtk_source_file_get_encoding)
const GtkSourceEncoding
*gedit_document_get_encoding (GeditDocument *doc);
+G_DEPRECATED_FOR (gtk_source_file_get_newline_type)
GtkSourceNewlineType
gedit_document_get_newline_type (GeditDocument *doc);
+G_DEPRECATED_FOR (gtk_source_file_get_compression_type)
GtkSourceCompressionType
gedit_document_get_compression_type (GeditDocument *doc);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]