Updating branch refs/heads/master
         to 343889631bfe521de7f36a3edca3581ef6745985 (commit)
       from c91a9b1ae3df6397ff119bc10de7c967499c7521 (commit)

commit 343889631bfe521de7f36a3edca3581ef6745985
Author: Harald Judt <h.j...@gmx.at>
Date:   Fri Jul 6 08:37:38 2012 +0200

    Check for exact match in find_timeslice.
    
    When I rewrote find_timeslice before committing the code to git,
    I forgot to check for an exact match, as this was previously
    handled in the calling function. What's more, it even worked
    without these lines and that's probably why no one noticed
    before that this obvious check was missing.

 panel-plugin/weather-data.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/panel-plugin/weather-data.c b/panel-plugin/weather-data.c
index 9a9a5eb..223d22a 100644
--- a/panel-plugin/weather-data.c
+++ b/panel-plugin/weather-data.c
@@ -259,6 +259,10 @@ find_timeslice(xml_weather *data, struct tm tm_start, 
struct tm tm_end)
     while (interval <= interval_limit) {
         hours = 0;
         while (hours <= hours_limit) {
+            /* try to find exact match */
+            if (has_timeslice(data, start_t, end_t))
+                return get_timeslice(data, start_t, end_t);
+
             /* check with previous hours */
             start_t = time_calc_hour(tm_start, 0 - hours);
             end_t = time_calc_hour(tm_end, 0 - hours - interval);
_______________________________________________
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits

Reply via email to