summaryrefslogtreecommitdiff
path: root/extra/xfce4-terminal/xfce4-terminal-0.6.2-fix-up-the-encoding-menu-creation.patch
blob: dba52d2947e66f01f966f06bc5046c99fd3dc3b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
From 71bd87a532f250d6bc98d52a5d546d43056bbd99 Mon Sep 17 00:00:00 2001
From: Alistair Buxton <a.j.buxton@gmail.com>
Date: Sun, 13 Oct 2013 23:41:45 +0000
Subject: Fix up the encoding menu creation.

Don't add non-radio items to the radio item group.
Don't leak list nodes by prepending twice to the same list.
Fixes BUG #10395.
---
diff --git a/terminal/terminal-encoding-action.c b/terminal/terminal-encoding-action.c
index 83242e9..77c916c 100644
--- a/terminal/terminal-encoding-action.c
+++ b/terminal/terminal-encoding-action.c
@@ -253,7 +253,7 @@ terminal_encoding_action_menu_shown (GtkWidget              *menu,
   /* action to reset to the default */
   default_label = g_strdup_printf (_("Default (%s)"), default_charset);
   item = gtk_radio_menu_item_new_with_label (groups, default_label);
-  groups = g_slist_prepend (groups, item);
+  groups = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item));
   gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
   gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), found);
   g_signal_connect (G_OBJECT (item), "activate",
@@ -267,7 +267,6 @@ terminal_encoding_action_menu_shown (GtkWidget              *menu,
       /* category item */
       item = gtk_menu_item_new_with_label (_(terminal_encodings_names[n]));
       gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
-      groups = g_slist_prepend (groups, item);
       gtk_widget_show (item);
 
       submenu = gtk_menu_new ();
@@ -281,7 +280,7 @@ terminal_encoding_action_menu_shown (GtkWidget              *menu,
             break;
 
           item2 = gtk_radio_menu_item_new_with_label (groups, charset);
-          groups = g_slist_prepend (groups, item2);
+          groups = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item2));
           gtk_menu_shell_append (GTK_MENU_SHELL (submenu), item2);
           g_object_set_qdata (G_OBJECT (item2), encoding_action_quark, (gchar *) charset);
           gtk_widget_show (item2);
@@ -304,7 +303,7 @@ terminal_encoding_action_menu_shown (GtkWidget              *menu,
     {
       /* add an action with the unknown charset */
       item2 = gtk_radio_menu_item_new_with_label (groups, action->current);
-      groups = g_slist_prepend (groups, item2);
+      groups = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item2));
       g_object_set_qdata_full (G_OBJECT (item2), encoding_action_quark,
                                g_strdup (action->current), g_free);
       gtk_menu_shell_append (GTK_MENU_SHELL (submenu), item2);
--
cgit v0.9.2