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 574033 - Use g_timeout_add_seconds where appropiate
Use g_timeout_add_seconds where appropiate
Product: nautilus
Classification: Core
Component: general
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
: 574206 (view as bug list)
Depends on:
Reported: 2009-03-04 09:18 UTC by Nelson Benitez
Modified: 2011-02-25 20:37 UTC
See Also:
GNOME target: ---
GNOME version: ---

Use g_timeout_add_seconds instead of g_timeout_add where appropiate (8.93 KB, patch)
2009-03-04 09:29 UTC, Nelson Benitez
committed Details | Review

Description Nelson Benitez 2009-03-04 09:18:06 UTC
According to (and of course according to
the gtk docs) using g_timeout_add_seconds is preferred over g_timeout_add if a
timeout in seconds is desired.

I grepped nautilus trunk and found several calls that could be improved in this regard, patch attached.
Comment 1 Nelson Benitez 2009-03-04 09:29:13 UTC
Created attachment 129999 [details] [review]
Use g_timeout_add_seconds instead of g_timeout_add where appropiate
Comment 2 Cosimo Cecchi 2009-03-04 14:46:11 UTC
Looks good, please commit after we branch for 2.27.
Comment 3 Nelson Benitez 2009-03-04 22:39:42 UTC
(In reply to comment #2)
> Looks good, please commit after we branch for 2.27.

Ok, thank you!.
Comment 4 Cosimo Cecchi 2009-03-05 11:10:55 UTC
*** Bug 574206 has been marked as a duplicate of this bug. ***
Comment 5 Cosimo Cecchi 2009-04-21 13:39:26 UTC
Fixed in master.

commit 60e58366e06f42b03072e06a19f8adeece0ded6a
Author: Nelson Benitez <>
Date:   Tue Apr 21 15:37:34 2009 +0200

    Use g_timeout_add_seconds where appropriate
    Use g_timeout_add_seconds instead of g_timeout_add where appropriate.
    Fix bug #574033.
    Signed-off-by: Cosimo Cecchi <>
Comment 6 Allison Karlitskaya (desrt) 2009-08-22 18:07:59 UTC
many of the "fixes" in this patch are regressions.  a specific instance: the audio preview timeout.  another (less serious): the save-window-geometry timeout.  maybe others.

timeout_add_seconds() should only be used when you don't care about accuracy and you want to save power by not waking up on a recurrent timer too frequently.  in both of the mentioned cases, accuracy is important (particularly in the sound preview case) and it's not a recurrent timeout.

the upshot for the example is that the audio preview timeout is somewhat non-deterministic (and, really, no power is being saved here).

these ought to be reviewed on a case-by-case basis and some of them reversed.