[gtksourceview/wip/encodings] Make gtk_source_encoding_get_default_candidates() private
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/wip/encodings] Make gtk_source_encoding_get_default_candidates() private
- Date: Tue, 12 Aug 2014 20:11:48 +0000 (UTC)
commit 647fa9d6499578acc8179aba647bc78e649c9c74
Author: Sébastien Wilmet <swilmet gnome org>
Date: Tue Aug 12 22:07:05 2014 +0200
Make gtk_source_encoding_get_default_candidates() private
It is currently not used in gedit. Let's wait the next development
cycle to see if it is really needed to make the function public.
gtksourceview/gtksourceencoding-private.h | 8 ++++++--
gtksourceview/gtksourceencoding.c | 6 +++---
gtksourceview/gtksourceencoding.h | 3 ---
gtksourceview/gtksourcefileloader.c | 6 ++++--
4 files changed, 13 insertions(+), 10 deletions(-)
---
diff --git a/gtksourceview/gtksourceencoding-private.h b/gtksourceview/gtksourceencoding-private.h
index 133042b..f26476c 100644
--- a/gtksourceview/gtksourceencoding-private.h
+++ b/gtksourceview/gtksourceencoding-private.h
@@ -43,8 +43,12 @@ typedef enum _GtkSourceEncodingDuplicates
} GtkSourceEncodingDuplicates;
G_GNUC_INTERNAL
-GSList * _gtk_source_encoding_remove_duplicates (GSList *encodings,
- GtkSourceEncodingDuplicates removal_type);
+GSList * _gtk_source_encoding_remove_duplicates (GSList
*encodings,
+ GtkSourceEncodingDuplicates
removal_type);
+
+G_GNUC_INTERNAL
+GSList * _gtk_source_encoding_get_default_candidates (void);
+
G_END_DECLS
diff --git a/gtksourceview/gtksourceencoding.c b/gtksourceview/gtksourceencoding.c
index acf9e7b..daabb20 100644
--- a/gtksourceview/gtksourceencoding.c
+++ b/gtksourceview/gtksourceencoding.c
@@ -606,8 +606,8 @@ _gtk_source_encoding_remove_duplicates (GSList *encodings,
g_return_val_if_reached (encodings);
}
-/**
- * gtk_source_encoding_get_default_candidates:
+/*
+ * _gtk_source_encoding_get_default_candidates:
*
* Gets the list of default candidate encodings to try when loading a file. See
* gtk_source_file_loader_set_candidate_encodings().
@@ -621,7 +621,7 @@ _gtk_source_encoding_remove_duplicates (GSList *encodings,
* Since: 3.14
*/
GSList *
-gtk_source_encoding_get_default_candidates (void)
+_gtk_source_encoding_get_default_candidates (void)
{
const gchar *encodings_str;
GVariant *encodings_variant;
diff --git a/gtksourceview/gtksourceencoding.h b/gtksourceview/gtksourceencoding.h
index d3bad55..fdd773a 100644
--- a/gtksourceview/gtksourceencoding.h
+++ b/gtksourceview/gtksourceencoding.h
@@ -60,9 +60,6 @@ const GtkSourceEncoding *gtk_source_encoding_get_current (void);
void gtk_source_encoding_foreach (GtkSourceEncodingForeachFunc func,
gpointer user_data);
-GSList *gtk_source_encoding_get_default_candidates
- (void);
-
/* These should not be used, they are just to make python bindings happy */
GtkSourceEncoding *gtk_source_encoding_copy (const GtkSourceEncoding *enc);
void gtk_source_encoding_free (GtkSourceEncoding *enc);
diff --git a/gtksourceview/gtksourcefileloader.c b/gtksourceview/gtksourcefileloader.c
index 0193a01..4a63d26 100644
--- a/gtksourceview/gtksourcefileloader.c
+++ b/gtksourceview/gtksourcefileloader.c
@@ -270,7 +270,7 @@ set_default_candidate_encodings (GtkSourceFileLoader *loader)
* GtkSourceFile's encoding has been set by a FileLoader or FileSaver,
* put it at the beginning of the list.
*/
- list = gtk_source_encoding_get_default_candidates ();
+ list = _gtk_source_encoding_get_default_candidates ();
if (loader->priv->file == NULL)
{
@@ -884,7 +884,9 @@ gtk_source_file_loader_new_from_stream (GtkSourceBuffer *buffer,
*
* By default the candidate encodings are (in that order):
* 1. If set, the #GtkSourceFile's encoding. See gtk_source_file_get_encoding().
- * 2. The list returned by gtk_source_encoding_get_default_candidates().
+ * 2. Depending on the current locale (language and country), a list of common
+ * encodings are added. The UTF-8 encoding and the current locale encoding are
+ * always present.
*
* Since: 3.14
*/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]