Hello community,

here is the log from the commit of package xfce4-panel-plugin-weather for 
openSUSE:Factory checked in at 2014-10-22 16:22:42
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/xfce4-panel-plugin-weather (Old)
 and      /work/SRC/openSUSE:Factory/.xfce4-panel-plugin-weather.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "xfce4-panel-plugin-weather"

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/xfce4-panel-plugin-weather/xfce4-panel-plugin-weather.changes
    2014-06-25 21:20:39.000000000 +0200
+++ 
/work/SRC/openSUSE:Factory/.xfce4-panel-plugin-weather.new/xfce4-panel-plugin-weather.changes
       2014-10-22 16:22:44.000000000 +0200
@@ -1,0 +2,9 @@
+Tue Oct 21 18:59:59 UTC 2014 - g...@opensuse.org
+
+- Add xfce4-panel-plugin-weather-fix-panel-icon-size.patch in order
+  to fix the size of the panel icon (backported from upstream git)
+- Add xfce4-panel-plugin-weather-use-locationforecast-1.2-api.patch
+  Switch to met.no locationforecast-1.2 API (bxo#10916, bnc#901944,
+  backported from upstream git)
+
+-------------------------------------------------------------------

New:
----
  xfce4-panel-plugin-weather-fix-panel-icon-size.patch
  xfce4-panel-plugin-weather-use-locationforecast-1.2-api.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ xfce4-panel-plugin-weather.spec ++++++
--- /var/tmp/diff_new_pack.rY9Azu/_old  2014-10-22 16:22:45.000000000 +0200
+++ /var/tmp/diff_new_pack.rY9Azu/_new  2014-10-22 16:22:45.000000000 +0200
@@ -31,6 +31,10 @@
 Patch0:         
xfce4-panel-plugin-weather-fix-no-return-in-nonvoid-function.patch
 # PATCH-FIX-UPSTREAM xfce4-panel-plugin-weather-upower-0.99.patch bxo#10922 
g...@opensuse.org -- Support upower-0.99 (backported from upstream git)
 Patch1:         xfce4-panel-plugin-weather-upower-0.99.patch
+# PATCH-FIX-UPSTREAM xfce4-panel-plugin-weather-fix-panel-icon-size.patch 
g...@opensuse.org -- Fix the size of the panel icon (backported from upstream 
git)
+Patch2:         xfce4-panel-plugin-weather-fix-panel-icon-size.patch
+# PATCH-FIX-UPSTREAM 
xfce4-panel-plugin-weather-use-locationforecast-1.2-api.patch bxo#10916 
bnc#901944 g...@opensuse.org -- Switch to met.no locationforecast-1.2 API 
(backported from upstream git)
+Patch3:         xfce4-panel-plugin-weather-use-locationforecast-1.2-api.patch
 BuildRequires:  fdupes
 BuildRequires:  intltool
 BuildRequires:  pkgconfig(gthread-2.0)
@@ -56,6 +60,8 @@
 %setup -q -n %{plugin_name}-%{version}
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
+%patch3 -p1
 
 %build
 %configure --disable-static

++++++ xfce4-panel-plugin-weather-fix-panel-icon-size.patch ++++++
>From d1f9e9ab06231f876a1d6b607660d36d8a0fb902 Mon Sep 17 00:00:00 2001
From: Harald Judt <h.j...@gmx.at>
Date: Mon, 25 Feb 2013 22:52:08 +0100
Subject: Fix panel icon size.

Since the toggle button has been added, or maybe even before that,
the icon is cut off at the borders. Fix this by subtracting two pixels
from the icon size.

diff --git a/panel-plugin/weather.c b/panel-plugin/weather.c
index 4a2e3c3..2e15565 100644
--- a/panel-plugin/weather.c
+++ b/panel-plugin/weather.c
@@ -295,6 +295,8 @@ update_icon(plugin_data *data)
         data->size != data->panel_size)
         size *= 2;
 #endif
+    /* take into account the border of the toggle button */
+    size -= 2;
 
     /* set panel icon according to current weather conditions */
     conditions = get_current_conditions(data->weatherdata);
-- 
cgit v0.10.1

++++++ xfce4-panel-plugin-weather-use-locationforecast-1.2-api.patch ++++++
>From 1ff71669644a0b824a8a5ba9b40771ee4fb8a76b Mon Sep 17 00:00:00 2001
From: Harald Judt <h.j...@gmx.at>
Date: Wed, 28 May 2014 20:08:02 +0200
Subject: Make plugin ready for met.no locationforecast-1.2 API (bug #10916).

http://api.yr.no/weatherapi/locationforecastlts/1.1/documentation#version_1_2___2014_05_20

The updated API version uses CamelCase symbol names instead of UPPERCASE
ones and has added some new names (like 'Drizzle'), which unfortunately
have not been documented (yet?).

What's more, the typo 'celcius' has been replaced by the fixed 'celsius',
but luckily the plugin will not be affected by that change.

What's a bit more unfortunate is that the existing icon themes do not
cover the new symbol names, so one would have to create quite a lot of
new icons. Also, new translations would have to be added for the symbols,
and maybe existing ones would have to be altered. To prevent this, we're
simply going to map the new symbols to existing ones as good as possible.
This should be good enough for the time being.

Index: xfce4-weather-plugin-0.8.3/panel-plugin/weather-parsers.c
===================================================================
--- xfce4-weather-plugin-0.8.3.orig/panel-plugin/weather-parsers.c
+++ xfce4-weather-plugin-0.8.3/panel-plugin/weather-parsers.c
@@ -28,6 +28,7 @@
 #define _XOPEN_SOURCE
 #define _XOPEN_SOURCE_EXTENDED 1
 #include "weather-parsers.h"
+#include "weather-translate.h"
 #include "weather-debug.h"
 
 #include <time.h>
@@ -196,8 +197,8 @@ parse_location(xmlNode *cur_node,
         }
         if (NODE_IS_TYPE(child_node, "symbol")) {
             g_free(loc->symbol);
-            loc->symbol = PROP(child_node, "id");
             loc->symbol_id = strtol(PROP(child_node, "number"), NULL, 10);
+            loc->symbol = g_strdup(get_symbol_for_id(loc->symbol_id));
         }
     }
 
Index: xfce4-weather-plugin-0.8.3/panel-plugin/weather-translate.c
===================================================================
--- xfce4-weather-plugin-0.8.3.orig/panel-plugin/weather-translate.c
+++ xfce4-weather-plugin-0.8.3/panel-plugin/weather-translate.c
@@ -29,6 +29,7 @@
 #include "weather-translate.h"
 
 #define DAY_LOC_N (sizeof(gchar) * 100)
+#define NODATA "NODATA"
 
 
 static const gchar *wdirs[] = {
@@ -169,7 +170,7 @@ static const symbol_desc symbol_to_desc[
 
     { 15, "FOG",                 N_("Fog"),                        N_("Fog")   
                     },
 
-    /* Symbols 16-19 are used for polar days */
+    /* Symbols 16-19 are used for polar days (unused beginning with API 
version 1.2) */
     { 16, "SUN",                 N_("Sunny"),                      N_("Clear") 
                     },
     { 17, "LIGHTCLOUD",          N_("Lightly cloudy"),             N_("Lightly 
cloudy")             },
     { 18, "LIGHTRAINSUN",        N_("Rain showers"),               N_("Rain 
showers")               },
@@ -185,6 +186,73 @@ static const symbol_desc symbol_to_desc[
 #define NUM_SYMBOLS (sizeof(symbol_to_desc) / sizeof(symbol_to_desc[0]))
 
 
+/*
+ * API version 1.2, published in May 2014, introduced new symbols. We
+ * try to match these with existing symbols, in order to be compatible
+ * with existing icon themes and to maintain translation completeness.
+ *
+ * See http://api.met.no/weatherapi/weathericon/1.1/documentation
+ * for a list of symbols. For a list of symbols with descriptions,
+ * see http://om.yr.no/forklaring/symbol.
+ */
+gint
+replace_symbol_id(gint id)
+{
+    /* Symbol ids greater than 100 are used for indicating polar
+     * night. These ids are over the ordinary id + 100. Since we
+     * don't support polar icons, we can simply subtract 100 to
+     * get the non-polar symbol ids.
+     */
+    if (id > 100)
+        id -= 100;
+
+    switch (id) {
+    case 24: return 22; /* Light rain showers and thunder */
+    case 25: return 6;  /* Heavy rain showers and thunder */
+    case 26: return 20; /* Light sleet showers and thunder */
+    case 27: return 20; /* Heavy sleet showers and thunder */
+    case 28: return 21; /* Light snow showers and thunder */
+    case 29: return 21; /* Heavy snow showers and thunder */
+    case 30: return 22; /* Light rain and thunder */
+    case 31: return 23; /* Light sleet and thunder */
+    case 32: return 23; /* Heavy sleet and thunder */
+    case 33: return 14; /* Light snow and thunder */
+    case 34: return 14; /* Heavy snow and thunder */
+
+    /* symbols 35-39 are unused */
+
+    case 40: return 5;  /* Light rain showers */
+    case 41: return 5;  /* Heavy rain showers */
+    case 42: return 7;  /* Light sleet showers */
+    case 43: return 7;  /* Heavy sleet showers */
+    case 44: return 8;  /* Light snow showers */
+    case 45: return 8;  /* Heavy snow showers */
+    case 46: return 9;  /* Light rain */
+    case 47: return 12; /* Light sleet */
+    case 48: return 12; /* Heavy sleet */
+    case 49: return 13; /* Light snow */
+    case 50: return 13; /* Heavy snow */
+    default: return id;
+    }
+}
+
+
+const gchar *
+get_symbol_for_id(gint id)
+{
+    if (G_UNLIKELY(id < 1))
+        return NODATA;
+
+    if (id >= NUM_SYMBOLS)
+        id = replace_symbol_id(id);
+
+    if (id < NUM_SYMBOLS)
+        return symbol_to_desc[id-1].symbol;
+
+    return NODATA;
+}
+
+
 const gchar *
 translate_desc(const gchar *desc,
                const gboolean nighttime)
Index: xfce4-weather-plugin-0.8.3/panel-plugin/weather-translate.h
===================================================================
--- xfce4-weather-plugin-0.8.3.orig/panel-plugin/weather-translate.h
+++ xfce4-weather-plugin-0.8.3/panel-plugin/weather-translate.h
@@ -24,6 +24,8 @@
 
 G_BEGIN_DECLS
 
+const gchar *get_symbol_for_id(gint id);
+
 const gchar *translate_desc(const gchar *desc,
                             gboolean nighttime);
 
Index: xfce4-weather-plugin-0.8.3/panel-plugin/weather.c
===================================================================
--- xfce4-weather-plugin-0.8.3.orig/panel-plugin/weather.c
+++ xfce4-weather-plugin-0.8.3/panel-plugin/weather.c
@@ -640,7 +640,7 @@ update_handler(plugin_data *data)
         /* build url */
         url =
             g_strdup_printf("http://api.yr.no/weatherapi";
-                            "/locationforecastlts/1.1/?lat=%s;lon=%s;msl=%d",
+                            "/locationforecastlts/1.2/?lat=%s;lon=%s;msl=%d",
                             data->lat, data->lon, data->msl);
 
         /* start receive thread */
-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to