ssuominen    14/05/31 19:02:31

  Added:                xfce4-weather-plugin-0.8.3-upower-0.99.patch
  Log:
  Restrict -r0 to old UPower and add -r1 for compability with UPower >= 0.99
  
  (Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key 
4868F14D)

Revision  Changes    Path
1.1                  
xfce-extra/xfce4-weather-plugin/files/xfce4-weather-plugin-0.8.3-upower-0.99.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/xfce-extra/xfce4-weather-plugin/files/xfce4-weather-plugin-0.8.3-upower-0.99.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/xfce-extra/xfce4-weather-plugin/files/xfce4-weather-plugin-0.8.3-upower-0.99.patch?rev=1.1&content-type=text/plain

Index: xfce4-weather-plugin-0.8.3-upower-0.99.patch
===================================================================
http://bug-attachment.xfce.org/attachment.cgi?id=5500

>From 79887843c58ef21233a0de571474ac656f977d7c Mon Sep 17 00:00:00 2001
From: Eric Koegel <[email protected]>
Date: Fri, 30 May 2014 19:01:08 +0300
Subject: [PATCH] Update for Upower 0.99

Upower changed a singal handler.
---
 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 efa8559..30eddb3 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);
 }
-- 
1.9.3





Reply via email to