! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Old labels are not cleared on conditions update
Status:
CLOSED: FIXED
Product:
Xfce4-weather-plugin
Component:
General

Comments

Description Andrzej Kośnikowski 2012-08-13 11:16:01 CEST
Created attachment 4588 
clear labels before updating conditions.patch

When updating current conditions (that is, switching to a new data point in already downloaded data), currently shown labels are not cleared before adding labels referring to the new conditions.

It's easiest to see if only one label is configured and "Animate transitions between labels" is enabled - as the first data point is usually (always?) in the future, the first condition update does not actually change any values.

Steps to reproduce:
 1. Configure exactly one label, for example temperature, and enable option
    "Animate transitions between labels".
 2. Wait until the hour changes (this is when conditions update occurs).

Expected result: there is a single label displayed, not animating.

Actual result: there are two temperature labels displayed, with animation between them. Both show the same value. After another hour there are three labels - two with the old value and one with the new.


The attached patch fixes the issue for me, but as it's years since I did any programming in C there's probably a better way to do it. It applies cleanly on version 0.8.1.
Comment 1 Harald Judt 2012-08-13 19:26:36 CEST
I've committed the first part of your patch to git: http://git.xfce.org/panel-plugins/xfce4-weather-plugin/commit/?id=5e7df6a521a09301becc2448553b306af57a3d49

On a night/day change the scrollbox stays untouched, only the icon needs to be updated. A night/day change will occur at sunrise/sunset time, not at a specific hour, except when sunrise/sunset data is not available.

Thanks for your report and the patch.
Comment 2 Harald Judt 2012-08-13 21:03:01 CEST
Ok, I verified that the second part of the patch is necessary too. In my opinion, set_icon_current and set_icon_error shouldn't do anything else than changing the icon, so I'm thinking of rewriting these parts of the code. Bad thing is those functions are used in various places, so I'll need to investigate more thoroughly before making any changes here.
Comment 3 Harald Judt 2012-08-16 12:18:45 CEST
Current git should fix all remaining widget updating issues.

Bug #9210

Reported by:
Andrzej Kośnikowski
Reported on: 2012-08-13
Last modified on: 2012-09-12

People

Assignee:
Harald Judt
CC List:
1 user

Version

Attachments

clear labels before updating conditions.patch (947 bytes, patch)
2012-08-13 11:16 CEST , Andrzej Kośnikowski
no flags

Additional information