[gnome-terminal] profile: Remove 'current' encoding
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-terminal] profile: Remove 'current' encoding
- Date: Wed, 2 Apr 2014 20:38:53 +0000 (UTC)
commit 501fbb45f4c9a80e522f7a1efc6c82f5ba86478f
Author: Christian Persch <chpe gnome org>
Date: Wed Apr 2 22:37:54 2014 +0200
profile: Remove 'current' encoding
Doesn't make much sense since it's the server's locale's encoding. Which is
always UTF-8 anyway.
src/org.gnome.Terminal.gschema.xml | 10 ++++------
src/profile-editor.c | 7 +------
src/terminal-app.c | 12 +++---------
src/terminal-encoding.c | 20 +-------------------
src/terminal-window.c | 2 +-
5 files changed, 10 insertions(+), 41 deletions(-)
---
diff --git a/src/org.gnome.Terminal.gschema.xml b/src/org.gnome.Terminal.gschema.xml
index 94eeae9..9038fe0 100644
--- a/src/org.gnome.Terminal.gschema.xml
+++ b/src/org.gnome.Terminal.gschema.xml
@@ -254,7 +254,6 @@
</key>
<key name="encoding" type="s">
<choices>
- <choice value="current" />
<choice value="ISO-8859-1" />
<choice value="ISO-8859-2" />
<choice value="ISO-8859-3" />
@@ -323,7 +322,7 @@
<choice value="WINDOWS-1257" />
<choice value="WINDOWS-1258" />
</choices>
- <default>'current'</default>
+ <default>'UTF-8'</default>
<summary>Which encoding to use</summary>
</key>
</schema>
@@ -610,18 +609,17 @@
<key name="encodings" type="as">
<!-- Translators: Please note that this has to be a list of
valid encodings (which are to be taken from the list in src/encoding.c).
- It has to include UTF-8 and the word 'current', which is not to be
+ It has to include UTF-8 the list entries themselves are not to be
translated. This is provided for customization of the default encoding
menu; see bug 144810 for an use case. In most cases, this should be
left alone.
-->
- <default>["UTF-8", "current"]</default>
+ <default>["UTF-8"]</default>
<summary>List of available encodings</summary>
<description>
A subset of possible encodings are presented in
the Encoding submenu. This is a list of encodings
- to appear there. The special encoding name "current"
- means to display the encoding of the current locale.
+ to appear there.
</description>
</key>
diff --git a/src/profile-editor.c b/src/profile-editor.c
index 40eabcb..3f7bd8d 100644
--- a/src/profile-editor.c
+++ b/src/profile-editor.c
@@ -478,13 +478,13 @@ init_encodings_combo (GtkWidget *widget)
GHashTableIter ht_iter;
gpointer key, value;
gs_unref_object GtkListStore *store;
- GtkTreeIter iter;
store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING);
g_hash_table_iter_init (&ht_iter, terminal_app_get_encodings (terminal_app_get ()));
while (g_hash_table_iter_next (&ht_iter, &key, &value)) {
TerminalEncoding *encoding = value;
+ GtkTreeIter iter;
gs_free char *name;
name = g_markup_printf_escaped ("%s <span size=\"small\">%s</span>",
@@ -496,11 +496,6 @@ init_encodings_combo (GtkWidget *widget)
-1);
}
- gtk_list_store_insert_with_values (store, &iter, -1,
- ENCODINGS_COLUMN_MARKUP, _("Default"),
- ENCODINGS_COLUMN_ID, "current",
- -1);
-
/* Now turn on sorting */
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (store),
ENCODINGS_COLUMN_MARKUP,
diff --git a/src/terminal-app.c b/src/terminal-app.c
index aa939c8..fa7a68e 100644
--- a/src/terminal-app.c
+++ b/src/terminal-app.c
@@ -228,17 +228,11 @@ terminal_app_encoding_list_notify_cb (GSettings *settings,
/* Mark all as non-active, then re-enable the active ones */
g_hash_table_foreach (app->encodings, (GHFunc) encoding_mark_active, GUINT_TO_POINTER (FALSE));
- /* First add the locale's charset */
- encoding = g_hash_table_lookup (app->encodings, "current");
- g_assert (encoding);
- if (terminal_encoding_is_valid (encoding))
- encoding->is_active = TRUE;
-
/* Also always make UTF-8 available */
encoding = g_hash_table_lookup (app->encodings, "UTF-8");
g_assert (encoding);
- if (terminal_encoding_is_valid (encoding))
- encoding->is_active = TRUE;
+ g_assert (terminal_encoding_is_valid (encoding));
+ encoding->is_active = TRUE;
g_settings_get (settings, key, "^as", &encodings);
for (i = 0; encodings[i] != NULL; ++i) {
@@ -643,7 +637,7 @@ terminal_app_ensure_encoding (TerminalApp *app,
{
TerminalEncoding *encoding;
- encoding = g_hash_table_lookup (app->encodings, charset ? charset : "current");
+ encoding = g_hash_table_lookup (app->encodings, charset ? charset : "UTF-8");
if (encoding == NULL)
{
encoding = terminal_encoding_new (charset,
diff --git a/src/terminal-encoding.c b/src/terminal-encoding.c
index 83d8429..d96de55 100644
--- a/src/terminal-encoding.c
+++ b/src/terminal-encoding.c
@@ -141,7 +141,7 @@ terminal_encoding_new (const char *charset,
encoding->refcount = 1;
encoding->id = g_strdup (charset);
encoding->name = g_strdup (display_name);
- encoding->valid = encoding->validity_checked = force_valid;
+ encoding->valid = encoding->validity_checked = force_valid || g_str_equal (charset, "UTF-8");
encoding->is_custom = is_custom;
encoding->is_active = FALSE;
@@ -181,14 +181,6 @@ terminal_encoding_get_charset (TerminalEncoding *encoding)
{
g_return_val_if_fail (encoding != NULL, NULL);
- if (strcmp (encoding->id, "current") == 0)
- {
- const char *charset;
-
- g_get_charset (&charset);
- return charset;
- }
-
return encoding->id;
}
@@ -267,16 +259,6 @@ terminal_encodings_get_builtins (void)
NULL,
(GDestroyNotify) terminal_encoding_unref);
-
- /* Placeholder entry for the current locale's charset */
- encoding = terminal_encoding_new ("current",
- _("Current Locale"),
- FALSE,
- TRUE);
- g_hash_table_insert (encodings_hashtable,
- (gpointer) terminal_encoding_get_id (encoding),
- encoding);
-
for (i = 0; i < G_N_ELEMENTS (encodings); ++i)
{
encoding = terminal_encoding_new (encodings[i].charset,
diff --git a/src/terminal-window.c b/src/terminal-window.c
index 731f68a..55e270d 100644
--- a/src/terminal-window.c
+++ b/src/terminal-window.c
@@ -1599,7 +1599,7 @@ terminal_window_update_encoding_menu (TerminalWindow *window)
if (priv->active_screen)
charset = vte_terminal_get_encoding (VTE_TERMINAL (priv->active_screen));
else
- charset = "current";
+ charset = "UTF-8";
app = terminal_app_get ();
active_encoding = terminal_app_ensure_encoding (app, charset);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]