[Xfce4-commits] <xfce4-clipman-plugin:master> Remove deprecated CHECK_VERSION precompilation code

Mike Massonnet noreply at xfce.org
Thu Oct 20 11:42:05 CEST 2011


Updating branch refs/heads/master
         to 9c3e50458e90eed6c6ce1edda384f398ea7a50db (commit)
       from c239358133414d0207ec38403755fc07c853655a (commit)

commit 9c3e50458e90eed6c6ce1edda384f398ea7a50db
Author: Mike Massonnet <mmassonnet at xfce.org>
Date:   Wed Oct 19 11:00:12 2011 +0200

    Remove deprecated CHECK_VERSION precompilation code

 panel-plugin/actions.c                |   60 ---------------------------------
 panel-plugin/main-panel-plugin.c      |    2 -
 panel-plugin/xfce4-clipman-settings.c |   33 +-----------------
 3 files changed, 1 insertions(+), 94 deletions(-)

diff --git a/panel-plugin/actions.c b/panel-plugin/actions.c
index ccebe81..06da812 100644
--- a/panel-plugin/actions.c
+++ b/panel-plugin/actions.c
@@ -71,14 +71,6 @@ static gint           __clipman_actions_entry_compare       (gpointer a,
 static gint           __clipman_actions_entry_compare_name  (gpointer a,
                                                              gpointer b);
 static void           __clipman_actions_entry_free          (ClipmanActionsEntry *entry);
-#if !GLIB_CHECK_VERSION (2,16,0)
-static void           __foreach_command_create_mi           (gpointer key,
-                                                             gpointer value,
-                                                             gpointer user_data);
-static void           __foreach_command_write_xml           (gpointer key,
-                                                             gpointer value,
-                                                             gpointer user_data);
-#endif
 
 /*
  * Callbacks declarations
@@ -430,49 +422,6 @@ __clipman_actions_entry_free (ClipmanActionsEntry *entry)
   g_slice_free (ClipmanActionsEntry, entry);
 }
 
-#if !GLIB_CHECK_VERSION (2,16,0)
-static void
-__foreach_command_create_mi (gpointer key,
-                             gpointer value,
-                             gpointer user_data)
-{
-  gchar *command_name = key;
-  gchar *command = value;
-  GtkWidget *menu = user_data;
-  GtkWidget *mi;
-
-  mi = gtk_menu_item_new_with_label (command_name);
-  g_object_set_data (G_OBJECT (mi), "text", g_object_get_data (G_OBJECT (menu), "text"));
-  g_object_set_data (G_OBJECT (mi), "command", command);
-  g_object_set_data (G_OBJECT (mi), "regex", g_object_get_data (G_OBJECT (menu), "regex"));
-  gtk_container_add (GTK_CONTAINER (menu), mi);
-  g_signal_connect (mi, "activate", G_CALLBACK (cb_entry_activated), NULL);
-}
-
-static void
-__foreach_command_write_xml (gpointer key,
-                             gpointer value,
-                             gpointer user_data)
-{
-  gchar *command_name = key;
-  gchar *command = value;
-  GString *output = user_data;
-  gchar *tmp;
-
-  g_string_append (output, "\t\t\t<command>\n");
-
-  tmp = g_markup_escape_text (command_name, -1);
-  g_string_append_printf (output, "\t\t\t\t<name>%s</name>\n", tmp);
-  g_free (tmp);
-
-  tmp = g_markup_escape_text (command, -1);
-  g_string_append_printf (output, "\t\t\t\t<exec>%s</exec>\n", tmp);
-  g_free (tmp);
-
-  g_string_append (output, "\t\t\t</command>\n");
-}
-#endif
-
 /*
  * Public methods
  */
@@ -750,7 +699,6 @@ clipman_actions_match_with_menu (ClipmanActions *actions,
       mi = gtk_separator_menu_item_new ();
       gtk_container_add (GTK_CONTAINER (actions->priv->menu), mi);
 
-#if GLIB_CHECK_VERSION (2,16,0)
         {
           GHashTableIter iter;
           gpointer key, value;
@@ -765,10 +713,6 @@ clipman_actions_match_with_menu (ClipmanActions *actions,
               g_signal_connect (mi, "activate", G_CALLBACK (cb_entry_activated), NULL);
             }
         }
-#else
-      g_object_set_data (G_OBJECT (actions->priv->menu), "regex", entry->regex);
-      g_hash_table_foreach (entry->commands, (GHFunc)__foreach_command_create_mi, actions->priv->menu);
-#endif
 
       mi = gtk_separator_menu_item_new ();
       gtk_container_add (GTK_CONTAINER (actions->priv->menu), mi);
@@ -864,7 +808,6 @@ clipman_actions_save (ClipmanActions *actions)
 
       g_string_append (output, "\t\t<commands>\n");
 
-#if GLIB_CHECK_VERSION (2,16,0)
         {
           GHashTableIter iter;
           gpointer key, value;
@@ -884,9 +827,6 @@ clipman_actions_save (ClipmanActions *actions)
               g_string_append (output, "\t\t\t</command>\n");
             }
         }
-#else
-      g_hash_table_foreach (entry->commands, (GHFunc)__foreach_command_write_xml, output);
-#endif
 
       g_string_append (output, "\t\t</commands>\n");
 
diff --git a/panel-plugin/main-panel-plugin.c b/panel-plugin/main-panel-plugin.c
index d5cfb77..98ea080 100644
--- a/panel-plugin/main-panel-plugin.c
+++ b/panel-plugin/main-panel-plugin.c
@@ -67,9 +67,7 @@ panel_plugin_register (XfcePanelPlugin *panel_plugin)
 
   /* Panel Plugin */
   plugin->panel_plugin = panel_plugin;
-#if GTK_CHECK_VERSION (2,12,0)
   gtk_widget_set_tooltip_text (GTK_WIDGET (panel_plugin), _("Clipman"));
-#endif
 
   /* Panel Button */
   plugin->button = xfce_create_panel_toggle_button ();
diff --git a/panel-plugin/xfce4-clipman-settings.c b/panel-plugin/xfce4-clipman-settings.c
index 413c4c5..a9958c9 100644
--- a/panel-plugin/xfce4-clipman-settings.c
+++ b/panel-plugin/xfce4-clipman-settings.c
@@ -52,11 +52,6 @@ static void             cb_delete_action                (GtkButton *button);
 static void             cb_reset_actions                (GtkButton *button);
 static void             setup_commands_treeview         (GtkTreeView *treeview);
 static void             entry_dialog_cleanup            ();
-#if !GLIB_CHECK_VERSION(2,16,0)
-static void           __foreach_command_fill_commands   (gpointer key,
-                                                         gpointer value,
-                                                         gpointer user_data);
-#endif
 static void             cb_commands_selection_changed   (GtkTreeSelection *selection);
 static void             cb_add_command                  (GtkButton *button);
 static void             cb_refresh_command              (GtkButton *button);
@@ -402,7 +397,7 @@ cb_actions_row_activated (GtkTreeView *treeview,
   gtk_tree_model_get (actions_model, &iter, 0, &entry, -1);
 
   commands_model = gtk_tree_view_get_model (GTK_TREE_VIEW (gtk_builder_get_object (builder, "commands")));
-#if GLIB_CHECK_VERSION (2,16,0)
+
     {
       GHashTableIter hiter;
       gpointer key, value;
@@ -415,9 +410,6 @@ cb_actions_row_activated (GtkTreeView *treeview,
           g_free (title);
         }
     }
-#else
-  g_hash_table_foreach (entry->commands, (GHFunc)__foreach_command_fill_commands, commands_model);
-#endif
 
   gtk_entry_set_text (GTK_ENTRY (gtk_builder_get_object (builder, "action-name")), entry->action_name);
   gtk_entry_set_text (GTK_ENTRY (gtk_builder_get_object (builder, "regex")), entry->pattern);
@@ -520,23 +512,6 @@ entry_dialog_cleanup (void)
   gtk_list_store_clear (GTK_LIST_STORE (model));
 }
 
-#if !GLIB_CHECK_VERSION(2,16,0)
-static void
-__foreach_command_fill_commands (gpointer key,
-                                 gpointer value,
-                                 gpointer user_data)
-{
-  GtkTreeModel *model = user_data;
-  GtkTreeIter iter;
-  gchar *title;
-
-  title = g_markup_printf_escaped ("<b>%s</b>\n<small>%s</small>", (gchar *)key, (gchar *)value);
-  gtk_list_store_append (GTK_LIST_STORE (_model), &iter);
-  gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, title, 1, key, 2, value, -1);
-  g_free (title);
-}
-#endif
-
 static void
 cb_commands_selection_changed (GtkTreeSelection *selection)
 {
@@ -704,11 +679,9 @@ cb_test_regex (GtkButton *button)
 static void 
 cb_test_regex_changed (GtkWidget *widget)
 {
-#if GTK_CHECK_VERSION (2, 16, 0)
   if (test_regex_changed_timeout == 0)
     gtk_entry_set_icon_from_stock (GTK_ENTRY (gtk_builder_get_object (builder, "regex-entry")),
                                    GTK_ENTRY_ICON_SECONDARY, GTK_STOCK_REFRESH);
-#endif
 
   if (test_regex_changed_timeout > 0)
     g_source_remove (test_regex_changed_timeout);
@@ -750,14 +723,10 @@ update_test_regex_textview_tags (void)
   regex = g_regex_new (pattern, G_REGEX_CASELESS|G_REGEX_MULTILINE, 0, NULL);
   if (regex == NULL)
     {
-#if GTK_CHECK_VERSION (2, 16, 0)
       gtk_entry_set_icon_from_stock (GTK_ENTRY (entry), GTK_ENTRY_ICON_SECONDARY, GTK_STOCK_DIALOG_ERROR);
-#endif
       return;
     }
-#if GTK_CHECK_VERSION (2, 16, 0)
   gtk_entry_set_icon_from_stock (GTK_ENTRY (entry), GTK_ENTRY_ICON_SECONDARY, GTK_STOCK_APPLY);
-#endif
 
   text = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
   if (!g_regex_match (regex, text, 0, &match_info))


More information about the Xfce4-commits mailing list