[Xfce4-commits] <xfce4-weather-plugin:master> Remove checks for old GTK and GLIB versions.

Harald Judt noreply at xfce.org
Mon Aug 13 22:04:02 CEST 2012


Updating branch refs/heads/master
         to 8db935f6804ad23b363611904ab3317ade056563 (commit)
       from cb9a40e6b65cf9a47483c54de7739c5580afd7ab (commit)

commit 8db935f6804ad23b363611904ab3317ade056563
Author: Harald Judt <h.judt at gmx.at>
Date:   Mon Aug 13 21:40:05 2012 +0200

    Remove checks for old GTK and GLIB versions.
    
    Since XFCE-4.8 is required now, we don't have to check for
    older GTK+ and GLIB versions anymore.

 panel-plugin/weather-config.c |    8 --------
 panel-plugin/weather-search.c |    4 ----
 panel-plugin/weather.c        |   35 ++---------------------------------
 panel-plugin/weather.h        |    4 ----
 4 files changed, 2 insertions(+), 49 deletions(-)

diff --git a/panel-plugin/weather-config.c b/panel-plugin/weather-config.c
index fad0773..30e5583 100644
--- a/panel-plugin/weather-config.c
+++ b/panel-plugin/weather-config.c
@@ -371,7 +371,6 @@ option_i(const data_types opt)
 }
 
 
-#if GTK_CHECK_VERSION(2,12,0)
 static void
 set_location_tooltip(xfceweather_dialog *dialog,
                      const gchar *lat,
@@ -392,7 +391,6 @@ set_location_tooltip(xfceweather_dialog *dialog,
     gtk_widget_set_tooltip_text(dialog->txt_loc_name, text);
     g_free(text);
 }
-#endif
 
 
 static void
@@ -409,9 +407,7 @@ auto_locate_cb(const gchar *loc_name,
         gtk_entry_set_text(GTK_ENTRY(dialog->txt_lon), lon);
         gtk_entry_set_text(GTK_ENTRY(dialog->txt_loc_name), loc_name);
         gtk_widget_set_sensitive(dialog->txt_loc_name, TRUE);
-#if GTK_CHECK_VERSION(2,12,0)
         set_location_tooltip(dialog, lat, lon);
-#endif
     } else {
         gtk_entry_set_text(GTK_ENTRY(dialog->txt_lat), "");
         gtk_entry_set_text(GTK_ENTRY(dialog->txt_lon), "");
@@ -453,9 +449,7 @@ cb_findlocation(GtkButton *button,
         gtk_entry_set_text(GTK_ENTRY(dialog->txt_loc_name), loc_name);
         g_free(loc_name);
         gtk_widget_set_sensitive(dialog->txt_loc_name, TRUE);
-#if GTK_CHECK_VERSION(2,12,0)
         set_location_tooltip(dialog, sdialog->result_lat, sdialog->result_lon);
-#endif
     }
     free_search_dialog(sdialog);
     gtk_widget_set_sensitive(GTK_WIDGET(button), TRUE);
@@ -528,9 +522,7 @@ create_config_dialog(xfceweather_data *data,
     else
         gtk_entry_set_text(GTK_ENTRY(dialog->txt_loc_name), _("Unset"));
     gtk_entry_set_max_length(GTK_ENTRY(dialog->txt_loc_name), LOC_NAME_MAX_LEN);
-#if GTK_CHECK_VERSION(2,12,0)
     set_location_tooltip(dialog, dialog->wd->lat, dialog->wd->lon);
-#endif
     if ((dialog->wd->lat == NULL || dialog->wd->lon == NULL) ||
         (! strlen(dialog->wd->lat) || ! strlen(dialog->wd->lon)))
         start_auto_locate(dialog);
diff --git a/panel-plugin/weather-search.c b/panel-plugin/weather-search.c
index 06fdc14..065e17d 100644
--- a/panel-plugin/weather-search.c
+++ b/panel-plugin/weather-search.c
@@ -230,11 +230,7 @@ create_search_dialog(GtkWindow *parent,
                                       GTK_RESPONSE_ACCEPT, FALSE);
     gtk_window_set_icon_name(GTK_WINDOW(dialog->dialog), GTK_STOCK_FIND);
 
-#if GTK_CHECK_VERSION(2,14,0)
     dialog_vbox = gtk_dialog_get_content_area(GTK_DIALOG(dialog->dialog));
-#else
-    dialog_vbox = GTK_DIALOG(dialog->dialog)->vbox;
-#endif
 
     vbox = gtk_vbox_new(FALSE, BORDER);
     gtk_container_set_border_width(GTK_CONTAINER(vbox), 6);
diff --git a/panel-plugin/weather.c b/panel-plugin/weather.c
index cce9b9c..b4b60a6 100644
--- a/panel-plugin/weather.c
+++ b/panel-plugin/weather.c
@@ -42,11 +42,6 @@
 #define BORDER 8
 
 
-#if !GLIB_CHECK_VERSION(2,14,0)
-#define g_timeout_add_seconds(t, c, d) g_timeout_add((t) * 1000, (c), (d))
-#endif
-
-
 #define DATA_AND_UNIT(var, item)                            \
     value = get_data(conditions, data->unit_system, item);  \
     unit = get_unit(data->unit_system, item);               \
@@ -103,7 +98,7 @@ check_envproxy(gchar **proxy_host,
 static const gchar *
 get_label_size(const xfceweather_data *data)
 {
-#if LIBXFCE4PANEL_CHECK_VERSION (4,9,0)
+#if LIBXFCE4PANEL_CHECK_VERSION(4,9,0)
     /* use small label with low number of columns in deskbar mode */
     if (data->panel_orientation == XFCE_PANEL_PLUGIN_MODE_DESKBAR)
         if (data->panel_size > 99)
@@ -244,7 +239,7 @@ set_icon_error(xfceweather_data *data)
 
     gtk_widget_get_size_request(data->scrollbox, NULL, &height);
 
-#if LIBXFCE4PANEL_CHECK_VERSION (4,9,0)
+#if LIBXFCE4PANEL_CHECK_VERSION(4,9,0)
     /* make icon double-size in deskbar mode */
     if (data->panel_orientation == XFCE_PANEL_PLUGIN_MODE_DESKBAR &&
         data->size != data->panel_size)
@@ -262,11 +257,6 @@ set_icon_error(xfceweather_data *data)
 
     if (G_LIKELY(icon))
         g_object_unref(G_OBJECT(icon));
-
-#if !GTK_CHECK_VERSION(2,12,0)
-    gtk_tooltips_set_tip(data->tooltips, data->tooltipbox,
-                         _("Cannot update weather data"), NULL);
-#endif
 }
 
 
@@ -317,14 +307,6 @@ set_icon_current(xfceweather_data *data)
 
     if (G_LIKELY(icon))
         g_object_unref(G_OBJECT(icon));
-
-#if !GTK_CHECK_VERSION(2,12,0)
-    str = get_data(conditions, data->unit_system, SYMBOL);
-    gtk_tooltips_set_tip(data->tooltips, data->tooltipbox,
-                         translate_desc(str, data->night_time),
-                         NULL);
-    g_free(str);
-#endif
 }
 
 
@@ -1048,11 +1030,6 @@ xfceweather_create_control(XfcePanelPlugin *plugin)
     data->animation_transitions = FALSE;
     data->forecast_days = DEFAULT_FORECAST_DAYS;
 
-#if !GTK_CHECK_VERSION(2,12,0)
-    data->tooltips = gtk_tooltips_new();
-    g_object_ref(data->tooltips);
-    gtk_object_sink(GTK_OBJECT(data->tooltips));
-#endif
     data->scrollbox = gtk_scrollbox_new();
 
     data->size = xfce_panel_plugin_get_size(plugin);
@@ -1083,12 +1060,10 @@ xfceweather_create_control(XfcePanelPlugin *plugin)
     gtk_event_box_set_visible_window(GTK_EVENT_BOX(data->tooltipbox), FALSE);
     gtk_widget_show_all(data->tooltipbox);
 
-#if GTK_CHECK_VERSION(2,12,0)
     g_object_set(G_OBJECT(data->tooltipbox), "has-tooltip", TRUE, NULL);
     g_signal_connect(G_OBJECT(data->tooltipbox), "query-tooltip",
                      G_CALLBACK(weather_get_tooltip_cb),
                      data);
-#endif
     xfce_panel_plugin_add_action_widget(plugin, data->tooltipbox);
 
     g_signal_connect(G_OBJECT(data->tooltipbox), "button-press-event",
@@ -1166,12 +1141,6 @@ xfceweather_free(XfcePanelPlugin *plugin,
 
     xmlCleanupParser();
 
-    /* free tooltip */
-#if !GTK_CHECK_VERSION(2,12,0)
-    gtk_tooltips_set_tip(data->tooltips, data->tooltipbox, NULL, NULL);
-    g_object_unref(G_OBJECT(data->tooltips));
-#endif
-
     /* free chars */
     g_free(data->lat);
     g_free(data->lon);
diff --git a/panel-plugin/weather.h b/panel-plugin/weather.h
index 872606c..91030d5 100644
--- a/panel-plugin/weather.h
+++ b/panel-plugin/weather.h
@@ -29,10 +29,6 @@ G_BEGIN_DECLS
 typedef struct {
     XfcePanelPlugin *plugin;
 
-#if !GTK_CHECK_VERSION(2,12,0)
-    GtkTooltips *tooltips;
-#endif
-
     GtkWidget *top_vbox;
     GtkWidget *top_hbox;
     GtkWidget *vbox_center_scrollbox;


More information about the Xfce4-commits mailing list