[Xfce4-commits] <xfce4-mailwatch-plugin:master> Delete unnecessary #if/#else/#endif code

Ján Sučan noreply at xfce.org
Fri Aug 30 11:58:01 CEST 2013


Updating branch refs/heads/master
         to 4b2e4b73cc33f8f4a9010556f6e4ac67094723d9 (commit)
       from 5c2ae425668949686670f6b695ee20dadb588f49 (commit)

commit 4b2e4b73cc33f8f4a9010556f6e4ac67094723d9
Author: Ján Sučan <sucan at runbox.com>
Date:   Fri Aug 30 11:45:07 2013 +0200

    Delete unnecessary #if/#else/#endif code
    
    Gtk >= 2.18.0 is required to compile the sources. This makes these
    statements needless because the same block is compiled every time.

 libmailwatch-core/mailwatch-mailbox-imap.c |   27 +--------------------------
 libmailwatch-core/mailwatch.c              |    4 ----
 panel-plugin/mailwatch-plugin.c            |   21 ---------------------
 3 files changed, 1 insertion(+), 51 deletions(-)

diff --git a/libmailwatch-core/mailwatch-mailbox-imap.c b/libmailwatch-core/mailwatch-mailbox-imap.c
index 8ffce3d..91ca4c7 100644
--- a/libmailwatch-core/mailwatch-mailbox-imap.c
+++ b/libmailwatch-core/mailwatch-mailbox-imap.c
@@ -1444,36 +1444,11 @@ imap_config_newmailfolders_btn_clicked_cb(GtkWidget *w, gpointer user_data)
     
     render = gtk_cell_renderer_pixbuf_new();
     gtk_tree_view_column_pack_start(col, render, FALSE);
-#if GTK_CHECK_VERSION(2, 6, 0)
     g_object_set(G_OBJECT(render),
                  "stock-id", GTK_STOCK_DIRECTORY,
                  "stock-size", GTK_ICON_SIZE_MENU,
                  NULL);
-#else
-    {
-        gint iw, ih;
-        GdkPixbuf *pix;
-        GList *icons = NULL;
-        GdkScreen *gscreen = gtk_widget_get_screen(treeview);
-        XfceIconTheme *itheme = xfce_icon_theme_get_for_screen(gscreen);
-        
-        icons = g_list_prepend(icons, "stock_open");
-        icons = g_list_prepend(icons, "stock_folder");
-        icons = g_list_prepend(icons, "stock_directory");
-        icons = g_list_prepend(icons, "gnome-fs-directory");
-        icons = g_list_prepend(icons, "folder");
-        
-        gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &iw, &ih);
-        pix = xfce_icon_theme_load_list(itheme, icons, iw);
-        if(pix) {
-            g_object_set(G_OBJECT(render), "pixbuf", pix, NULL);
-            g_object_unref(G_OBJECT(pix));
-        }
-        
-        g_list_free(icons);
-    }
-#endif
-    
+
     imailbox->render = render = gtk_cell_renderer_text_new();
     gtk_tree_view_column_pack_start(col, render, TRUE);
     gtk_tree_view_column_set_attributes(col, render,
diff --git a/libmailwatch-core/mailwatch.c b/libmailwatch-core/mailwatch.c
index 76a35f9..1a51400 100644
--- a/libmailwatch-core/mailwatch.c
+++ b/libmailwatch-core/mailwatch.c
@@ -49,10 +49,6 @@
 
 #define BORDER          8
 
-#if !GTK_CHECK_VERSION(2, 6, 0)
-#define GTK_STOCK_EDIT GTK_STOCK_PROPERTIES
-#endif
-
 typedef struct
 {
     XfceMailwatchMailbox *mailbox;
diff --git a/panel-plugin/mailwatch-plugin.c b/panel-plugin/mailwatch-plugin.c
index e69a937..ff6c52b 100644
--- a/panel-plugin/mailwatch-plugin.c
+++ b/panel-plugin/mailwatch-plugin.c
@@ -56,10 +56,6 @@ typedef struct
     GdkPixbuf *pix_normal;
     GdkPixbuf *pix_newmail;
     
-#if !GTK_CHECK_VERSION(2, 12, 0)
-    GtkTooltips *tooltip;
-#endif
-    
     gchar *click_command;
     gchar *new_messages_command;
     
@@ -107,12 +103,8 @@ mailwatch_new_messages_changed_cb(XfceMailwatch *mailwatch, gpointer arg,
         mailwatch_set_size(mwp->plugin,
                            xfce_panel_plugin_get_size(mwp->plugin),
                            mwp);
-#if GTK_CHECK_VERSION(2, 12, 0)
         gtk_widget_set_tooltip_text(mwp->button, _("No new mail"));
         gtk_widget_trigger_tooltip_query(mwp->button);
-#else
-        gtk_tooltips_set_tip(mwp->tooltip, mwp->button, _("No new mail"), NULL);
-#endif
     } else if(new_messages > 0) {
         if(!mwp->newmail_icon_visible) {
             mwp->newmail_icon_visible = TRUE;
@@ -147,12 +139,8 @@ mailwatch_new_messages_changed_cb(XfceMailwatch *mailwatch, gpointer arg,
             g_strfreev(mailbox_names);
             g_free(new_message_counts);
             
-#if GTK_CHECK_VERSION(2, 12, 0)
             gtk_widget_set_tooltip_text(mwp->button, ttip_str->str);
             gtk_widget_trigger_tooltip_query(mwp->button);
-#else
-            gtk_tooltips_set_tip(mwp->tooltip, mwp->button, ttip_str->str, NULL);
-#endif
             g_string_free(ttip_str, TRUE);
             
             if(mwp->new_messages_command)
@@ -430,12 +418,7 @@ mailwatch_create(XfcePanelPlugin *plugin)
     g_signal_connect(mwp->button, "button-release-event",
             G_CALLBACK(mailwatch_button_release_cb), mwp);
     
-#if GTK_CHECK_VERSION(2, 12, 0)
     gtk_widget_set_tooltip_text(mwp->button, _("No new mail"));
-#else
-    mwp->tooltip = gtk_tooltips_new();
-    gtk_tooltips_set_tip(mwp->tooltip, mwp->button, _("No new mail"), NULL);
-#endif
     
     xfce_panel_plugin_add_action_widget(plugin, mwp->button);
     
@@ -1028,10 +1011,6 @@ mailwatch_free(XfcePanelPlugin *plugin, XfceMailwatchPlugin *mwp)
 
     g_object_unref(G_OBJECT(mwp->loglist));
     
-#if !GTK_CHECK_VERSION(2, 12, 0)
-    gtk_object_sink(GTK_OBJECT(mwp->tooltip));
-#endif
-    
     g_free(mwp);
 }
 


More information about the Xfce4-commits mailing list