Replace wrong macro GLIB_CHECK_VERSION with GTK_CHECK_VERSION and remove deprecated

Desktop / LXDE / LXpanel - Andriy Grytsenko [rep.kiev.ua] - 23 February 2014 14:41 UTC



###

diff --git a/src/plugins/cpufreq/cpufreq.c b/src/plugins/cpufreq/cpufreq.c
index d2a44d5..565d4b1 100644
--- a/src/plugins/cpufreq/cpufreq.c
+++ b/src/plugins/cpufreq/cpufreq.c
@@ -363,12 +363,7 @@ cpufreq_constructor(Plugin *p, char** fp)
cf->main = p->pwid;
cf->tip = gtk_tooltips_new();

-#if GLIB_CHECK_VERSION( 2, 10, 0 )
g_object_ref_sink( cf->tip );
-#else
- g_object_ref( cf->tip );
- gtk_object_sink( cf->tip );
-#endif

g_signal_connect (G_OBJECT (p->pwid), "button-press-event", G_CALLBACK (clicked), (gpointer) p);

diff --git a/src/plugins/launchbar.c b/src/plugins/launchbar.c
index ffc4216..549c94a 100644
--- a/src/plugins/launchbar.c
+++ b/src/plugins/launchbar.c
@@ -204,7 +204,7 @@ static void launchbutton_build_bootstrap(LaunchbarPlugin * lb)
/* Create an event box. */
GtkWidget * event_box = gtk_event_box_new();
gtk_container_set_border_width(GTK_CONTAINER(event_box), 0);
-#if GLIB_CHECK_VERSION(2,18,0)
+#if GTK_CHECK_VERSION(2,18,0)
gtk_widget_set_can_focus (event_box, FALSE);
#else
GTK_WIDGET_UNSET_FLAGS(event_box, GTK_CAN_FOCUS);
@@ -249,7 +249,7 @@ static LaunchButton *launchbutton_for_file_info(LaunchbarPlugin * lb, FmFileInfo
button = lxpanel_button_new_for_fm_icon(lb->panel, fm_file_info_get_icon(fi),
NULL, NULL);
btn->widget = button;
-#if GLIB_CHECK_VERSION(2,18,0)
+#if GTK_CHECK_VERSION(2,18,0)
gtk_widget_set_can_focus(button, FALSE);
#else
GTK_WIDGET_UNSET_FLAGS(button, GTK_CAN_FOCUS);
@@ -434,7 +434,7 @@ static GtkWidget *launchbar_constructor(Panel *panel, config_setting_t *settings
/* Allocate top level widget and set into Plugin widget pointer. */
lb->plugin = p = gtk_event_box_new();
lxpanel_plugin_set_data(p, lb, launchbar_destructor);
-#if GLIB_CHECK_VERSION(2,18,0)
+#if GTK_CHECK_VERSION(2,18,0)
gtk_widget_set_has_window(p, FALSE);
#else
GTK_WIDGET_SET_FLAGS(p, GTK_NO_WINDOW);
diff --git a/src/plugins/netstat/statusicon.c b/src/plugins/netstat/statusicon.c
index b0f80d2..3d273f1 100644
--- a/src/plugins/netstat/statusicon.c
+++ b/src/plugins/netstat/statusicon.c
@@ -57,12 +57,7 @@ struct statusicon *create_statusicon(GtkWidget *box, const char *filename,

/* tooltip */
newicon->tooltips = gtk_tooltips_new();
-#if GLIB_CHECK_VERSION( 2, 10, 0 )
g_object_ref_sink(newicon->tooltips);
-#else
- g_object_ref(newicon->tooltips);
- gtk_object_sink(newicon->tooltips);
-#endif
gtk_tooltips_set_tip(newicon->tooltips, newicon->main, tooltips, NULL);

return newicon;
diff --git a/src/plugins/netstatus/netstatus-icon.c b/src/plugins/netstatus/netstatus-icon.c
index af7eb67..ca754b7 100644
--- a/src/plugins/netstatus/netstatus-icon.c
+++ b/src/plugins/netstatus/netstatus-icon.c
@@ -474,14 +474,6 @@ netstatus_icon_destroy (GtkObject *widget)
icon->priv->wireless_changed_id = 0;
icon->priv->signal_changed_id = 0;

-#if GLIB_CHECK_VERSION(2,12,0)
-/* not needed with GTKTooltip API*/
-#else
- if (icon->priv->tooltips)
- g_object_unref (icon->priv->tooltips);
- icon->priv->tooltips = NULL;
-#endif
-
icon->priv->image = NULL;

GTK_OBJECT_CLASS (parent_class)->destroy (widget);
@@ -884,14 +876,6 @@ netstatus_icon_instance_init (NetstatusIcon *icon,
gtk_container_add (GTK_CONTAINER (icon), icon->priv->signal_image);
gtk_widget_hide (icon->priv->signal_image);

-#if GLIB_CHECK_VERSION(2,12,0)
-/* not needed with GTKTooltip API*/
-#else
- icon->priv->tooltips = gtk_tooltips_new ();
- g_object_ref (icon->priv->tooltips);
- gtk_object_sink (GTK_OBJECT (icon->priv->tooltips));
-#endif
-
gtk_widget_add_events (GTK_WIDGET (icon),
GDK_BUTTON_PRESS_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK);
}
@@ -1079,15 +1063,6 @@ netstatus_icon_set_tooltips_enabled (NetstatusIcon *icon,
{
icon->priv->tooltips_enabled = enabled;

-#if GLIB_CHECK_VERSION(2,12,0)
-/* not needed with GTKTooltip API*/
-#else
- if (enabled)
- gtk_tooltips_enable (icon->priv->tooltips);
- else
- gtk_tooltips_disable (icon->priv->tooltips);
-#endif
-
g_object_notify (G_OBJECT (icon), "tooltips-enabled");
}
}

19a0e72 Replace wrong macro GLIB_CHECK_VERSION with GTK_CHECK_VERSION and remove deprecated.
src/plugins/cpufreq/cpufreq.c | 5 -----
src/plugins/launchbar.c | 6 +++---
src/plugins/netstat/statusicon.c | 5 -----
src/plugins/netstatus/netstatus-icon.c | 25 -------------------------
4 files changed, 3 insertions(+), 38 deletions(-)

Upstream: lxde.git.sourceforge.net


  • Share