Package: xfce4-weather-plugin
Version: 0.10.0-1
Tags: patch

A logic error causes the time the Moon sets not to be displayed if the Moon
doesn't also rise on the same day. Patch tested on 0.8.11, applies cleanly
to tip of upstream master branch.
Treat moon_never_rises and moon_never_sets independently of each other.

Unlike the Sun perhaps, the Moon may set but not rise on certain days.
Prior to this patch, the moonset time would be suppressed on no-moonrise days.
Index: xfce4-weather-plugin-0.8.11/panel-plugin/weather-summary.c
===================================================================
--- xfce4-weather-plugin-0.8.11.orig/panel-plugin/weather-summary.c	2019-03-24 13:08:29.000000000 +0100
+++ xfce4-weather-plugin-0.8.11/panel-plugin/weather-summary.c	2019-12-19 09:26:57.061048252 +0100
@@ -466,16 +466,17 @@
             value =
                 g_strdup(_("\tMoonrise:\tThe moon never rises today.\n"));
             APPEND_TEXT_ITEM_REAL(value);
-        } else if (data->current_astro->moon_never_sets) {
-            value =
-                g_strdup(_("\tMoonset:\tThe moon never sets today.\n"));
-            APPEND_TEXT_ITEM_REAL(value);
         } else {
             moonrise = format_date(data->current_astro->moonrise, NULL, FALSE);
             value = g_strdup_printf(_("\tMoonrise:\t%s\n"), moonrise);
             g_free(moonrise);
             APPEND_TEXT_ITEM_REAL(value);
-
+        }
+        if (data->current_astro->moon_never_sets) {
+            value =
+                g_strdup(_("\tMoonset:\tThe moon never sets today.\n"));
+            APPEND_TEXT_ITEM_REAL(value);
+        } else {
             moonset = format_date(data->current_astro->moonset, NULL, FALSE);
             value = g_strdup_printf(_("\tMoonset:\t%s\n"), moonset);
             g_free(moonset);

Reply via email to