[Xfce4-commits] [panel-plugins/xfce4-weather-plugin] 03/03: Support upower-0.99 (bug #10922).
noreply at xfce.org
noreply at xfce.org
Mon Jun 9 19:47:44 CEST 2014
This is an automated email from the git hooks/post-receive script.
hjudt pushed a commit to branch master
in repository panel-plugins/xfce4-weather-plugin.
commit d51c1ea939ffeecac6f9f5cd136d35628b585e73
Author: Eric Koegel <eric at xfce.org>
Date: Tue Jun 3 20:44:16 2014 +0200
Support upower-0.99 (bug #10922).
upower-0.99 changed from the "changed" signal to "notify" as well as
the function signature. This patch adds that while still supporting
the previous versions of upower.
---
panel-plugin/weather.c | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/panel-plugin/weather.c b/panel-plugin/weather.c
index 63451fd..e8866ee 100644
--- a/panel-plugin/weather.c
+++ b/panel-plugin/weather.c
@@ -1553,8 +1553,14 @@ proxy_auth(SoupSession *session,
#ifdef HAVE_UPOWER_GLIB
static void
+#if UP_CHECK_VERSION(0, 99, 0)
upower_changed_cb(UpClient *client,
+ GParamSpec *pspec,
plugin_data *data)
+#else /* UP_CHECK_VERSION < 0.99 */
+upower_changed_cb(UpClient *client,
+ plugin_data *data)
+#endif /* UP_CHECK_VERSION */
{
gboolean on_battery;
@@ -1576,7 +1582,7 @@ upower_changed_cb(UpClient *client,
schedule_next_wakeup(data);
}
}
-#endif
+#endif /* HAVE_UPOWER_GLIB */
static void
@@ -2171,10 +2177,16 @@ weather_construct(XfcePanelPlugin *plugin)
G_CALLBACK(xfceweather_show_about), data);
#ifdef HAVE_UPOWER_GLIB
- if (data->upower)
- g_signal_connect(data->upower, "changed",
- G_CALLBACK(upower_changed_cb), data);
-#endif
+ if (data->upower) {
+#if UP_CHECK_VERSION(0, 99, 0)
+ g_signal_connect (data->upower, "notify",
+ G_CALLBACK(upower_changed_cb), data);
+#else /* UP_CHECK_VERSION < 0.99 */
+ g_signal_connect (data->upower, "changed",
+ G_CALLBACK(upower_changed_cb), data);
+#endif /* UP_CHECK_VERSION */
+ }
+#endif /* HAVE_UPOWER_GLIB */
weather_dump(weather_dump_plugindata, data);
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list