After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 688069 - DigitalClock: Set last_sunrise/sunset on update
DigitalClock: Set last_sunrise/sunset on update
Status: RESOLVED FIXED
Product: gnome-clocks
Classification: Applications
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Clocks maintainer(s)
Clocks maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2012-11-11 00:12 UTC by Volker Sobek (weld)
Modified: 2012-11-12 22:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
DigitalClock: Set last_sunrise/sunset on update (1.07 KB, patch)
2012-11-11 00:16 UTC, Volker Sobek (weld)
rejected Details | Review
DigitalClock: Set last_sunrise/sunset on update (3.15 KB, patch)
2012-11-11 14:28 UTC, Volker Sobek (weld)
none Details | Review
[PATCH] DigitalClock: Set last_sunrise/sunset on update (3.19 KB, patch)
2012-11-11 23:01 UTC, Volker Sobek (weld)
none Details | Review
DigitalClock: Set last_sunrise/sunset on update (2.99 KB, patch)
2012-11-12 22:01 UTC, Volker Sobek (weld)
reviewed Details | Review
DigitalClock: Set last_sunrise/sunset on update (2.94 KB, patch)
2012-11-12 22:16 UTC, Volker Sobek (weld)
none Details | Review

Description Volker Sobek (weld) 2012-11-11 00:12:11 UTC
This had been forgotten, resulting in a complete update of every world
clock, every second. This was the cause of the pretty high CPU usage when using a few world clocks.
Comment 1 Volker Sobek (weld) 2012-11-11 00:16:30 UTC
Created attachment 228668 [details] [review]
DigitalClock: Set last_sunrise/sunset on update
Comment 2 Volker Sobek (weld) 2012-11-11 00:58:20 UTC
Review of attachment 228668 [details] [review]:

I think last_sunrise/sunset are just updated in the wrong place, so I can remove these lines, will have a closer look tomorrow  ...
Comment 3 Volker Sobek (weld) 2012-11-11 01:01:04 UTC
Review of attachment 228668 [details] [review]:

I think last_sunrise/sunset are just updated in the wrong place, so I can probably remove these lines, will have a closer look tomorrow  ...
Comment 4 Volker Sobek (weld) 2012-11-11 01:01:05 UTC
Review of attachment 228668 [details] [review]:

I think last_sunrise/sunset are just updated in the wrong place, so I can probably remove these lines, will have a closer look tomorrow  ...
Comment 5 Volker Sobek (weld) 2012-11-11 01:01:05 UTC
Review of attachment 228668 [details] [review]:

I think last_sunrise/sunset are just updated in the wrong place, so I can probably remove these lines, will have a closer look tomorrow  ...
Comment 6 Volker Sobek (weld) 2012-11-11 01:02:06 UTC
Review of attachment 228668 [details] [review]:

Wow, bugzilla is crazy ...
Comment 7 Volker Sobek (weld) 2012-11-11 14:28:11 UTC
Created attachment 228696 [details] [review]
DigitalClock: Set last_sunrise/sunset on update

DigitalClock: Set last_sunrise/sunset on update
    
    This was done in the wrong place, resulting in a complete update of
    every world clock, every second. This caused a pretty high
    CPU usage when using a few world clocks.
    
    Also use a new _needs_update attribute for StandaloneClock instances
    to ensure a full DigitalClock update after a StandaloneClock has been
    added. (This prevents an empty StandaloneClock until the next full
    update. This wasn't necessary before, as the bug already caused the
    DigitalClock to be completely updated on every update call.)
    
    https://bugzilla.gnome.org/show_bug.cgi?id=688069
Comment 8 Volker Sobek (weld) 2012-11-11 23:01:04 UTC
Created attachment 228741 [details] [review]
[PATCH] DigitalClock: Set last_sunrise/sunset on update

Small change
Comment 9 Volker Sobek (weld) 2012-11-12 22:01:30 UTC
Created attachment 228834 [details] [review]
DigitalClock: Set last_sunrise/sunset on update

    DigitalClock: Set last_sunrise/sunset on update
    
    This was done in the wrong place, resulting in a complete update of
    every world clock, every second. This caused a pretty high
    CPU usage when using a few world clocks.
    
    Also use a new _standalone_is_new attribute for DigitalClock instances
    to ensure a full DigitalClock update after a StandaloneClock has been
    added. (This prevents an empty StandaloneClock until the next full
    update. This wasn't necessary before, as the bug already caused the
    DigitalClock to be completely updated on every update call.)
Comment 10 Paolo Borelli 2012-11-12 22:11:25 UTC
Review of attachment 228834 [details] [review]:

Just a tiny comment...

::: gnomeclocks/world.py
@@ -184,2 +186,4 @@
             if self.standalone:
                 self.standalone.update(img, t, self.sunrise, self.sunset)
+                if self._standalone_is_new:
+                    self._standalone_is_new = False

Just set it to False, one less line :)
Comment 11 Volker Sobek (weld) 2012-11-12 22:16:14 UTC
Created attachment 228835 [details] [review]
DigitalClock: Set last_sunrise/sunset on update

Fixed.
Comment 12 Paolo Borelli 2012-11-12 22:25:08 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.