[Goodies-commits] r7267 - in xfce4-clipman-plugin/trunk: . panel-plugin

Mike Massonnet mmassonnet at xfce.org
Tue Apr 21 21:57:00 CEST 2009


Author: mmassonnet
Date: 2009-04-21 19:57:00 +0000 (Tue, 21 Apr 2009)
New Revision: 7267

Modified:
   xfce4-clipman-plugin/trunk/ChangeLog
   xfce4-clipman-plugin/trunk/panel-plugin/main.c
Log:
Refixing the last two commits with the right function calls

Modified: xfce4-clipman-plugin/trunk/ChangeLog
===================================================================
--- xfce4-clipman-plugin/trunk/ChangeLog	2009-04-21 19:39:47 UTC (rev 7266)
+++ xfce4-clipman-plugin/trunk/ChangeLog	2009-04-21 19:57:00 UTC (rev 7267)
@@ -1,4 +1,11 @@
 2009-04-21	Mike Massonnet
+Refixing the last two commits with the right function calls
+
+	- panel-plugin/main.c:
+		Use g_markup_printf_escaped() instead of in-between variables
+		being set with g_markup_escape_text().
+
+2009-04-21	Mike Massonnet
 Same commit for the regex and the command that are also displayed
 
 2009-04-21	Mike Massonnet

Modified: xfce4-clipman-plugin/trunk/panel-plugin/main.c
===================================================================
--- xfce4-clipman-plugin/trunk/panel-plugin/main.c	2009-04-21 19:39:47 UTC (rev 7266)
+++ xfce4-clipman-plugin/trunk/panel-plugin/main.c	2009-04-21 19:57:00 UTC (rev 7267)
@@ -1040,7 +1040,6 @@
   GtkTreeModel *model;
   GtkTreeIter iter;
   gchar *title;
-  gchar *action_name_escaped, *regex_escaped;
 
   model = gtk_tree_view_get_model (treeview);
   gtk_list_store_clear (GTK_LIST_STORE (model));
@@ -1050,14 +1049,10 @@
     {
       entry = entries->data;
 
-      action_name_escaped = g_markup_escape_text (entry->action_name, -1);
-      regex_escaped = g_markup_escape_text (g_regex_get_pattern (entry->regex), -1);
-      title = g_strdup_printf ("<b>%s</b>\n<small>%s</small>",
-                               action_name_escaped, regex_escaped);
+      title = g_markup_printf_escaped ("<b>%s</b>\n<small>%s</small>",
+                                       entry->action_name, g_regex_get_pattern (entry->regex));
       gtk_list_store_append (GTK_LIST_STORE (model), &iter);
       gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, entry, 1, title, -1);
-      g_free (action_name_escaped);
-      g_free (regex_escaped);
       g_free (title);
     }
 }
@@ -1321,7 +1316,6 @@
   GtkTreeModel *model;
   GtkTreeIter iter;
   gchar *title;
-  gchar *command_name_escaped, *command_escaped;
 
   command_name = glade_xml_get_widget (plugin->gxml, "command-name");
   command = glade_xml_get_widget (plugin->gxml, "command");
@@ -1330,17 +1324,14 @@
       || gtk_entry_get_text (GTK_ENTRY (command))[0] == '\0')
     return;
 
-  command_name_escaped = g_markup_escape_text (gtk_entry_get_text (GTK_ENTRY (command_name)), -1);
-  command_escaped = g_markup_escape_text (gtk_entry_get_text (GTK_ENTRY (command)), -1);
-  title = g_strdup_printf ("<b>%s</b>\n<small>%s</small>",
-                           command_name_escaped, command_escaped);
+  title = g_markup_printf_escaped ("<b>%s</b>\n<small>%s</small>",
+                                   gtk_entry_get_text (GTK_ENTRY (command_name)),
+                                   gtk_entry_get_text (GTK_ENTRY (command)));
   model = gtk_tree_view_get_model (GTK_TREE_VIEW (glade_xml_get_widget (plugin->gxml, "commands")));
   gtk_list_store_append (GTK_LIST_STORE (model), &iter);
   gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, title,
                       1, gtk_entry_get_text (GTK_ENTRY (command_name)),
                       2, gtk_entry_get_text (GTK_ENTRY (command)), -1);
-  g_free (command_name_escaped);
-  g_free (command_escaped);
   g_free (title);
 
   gtk_entry_set_text (GTK_ENTRY (command_name), "");
@@ -1358,7 +1349,6 @@
   GtkWidget *command_name;
   GtkWidget *command;
   gchar *title;
-  gchar *command_name_escaped, *command_escaped;
 
   command_name = glade_xml_get_widget (plugin->gxml, "command-name");
   command = glade_xml_get_widget (plugin->gxml, "command");
@@ -1375,15 +1365,12 @@
       return;
     }
 
-  command_name_escaped = g_markup_escape_text (gtk_entry_get_text (GTK_ENTRY (command_name)), -1);
-  command_escaped = g_markup_escape_text (gtk_entry_get_text (GTK_ENTRY (command)), -1);
   title = g_strdup_printf ("<b>%s</b>\n<small>%s</small>",
-                           command_name_escaped, command_escaped);
+                           gtk_entry_get_text (GTK_ENTRY (command_name)),
+                           gtk_entry_get_text (GTK_ENTRY (command)));
   gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, title,
                       1, gtk_entry_get_text (GTK_ENTRY (command_name)),
                       2, gtk_entry_get_text (GTK_ENTRY (command)), -1);
-  g_free (command_name_escaped);
-  g_free (command_escaped);
   g_free (title);
 
   gtk_tree_selection_unselect_all (selection);




More information about the Goodies-commits mailing list