GNOME Bugzilla – Bug 573834
g_timeout_add_seconds should be preferred to g_timeout_add
Last modified: 2009-03-16 17:55:07 UTC
Please describe the problem: Although it is done correctly most of the time, g_timeout_add is used twice where g_timeout_add_seconds could be used instead (and correcting this might save the world: https://wiki.ubuntu.com/SavingTheWorld ) Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information: Patch is coming up...
Created attachment 129897 [details] [review] substitute g_timeout_add by g_timeout_add_seconds
The patch is not complete. There are more calls to g_timeout_add in the code.
Hi Ivan, Ok, it seems I missed one call in trackerd/tracker-processor.c Note that there are more calls - but I did not see any with multiples of 1000 - the patch is conservative in the sense that I do not want to decide wheter a g_timeout_add(500,...) should be replaced by g_timeout_add_seconds(1,...). I also excluded files in the tests directory. $ svn update At revision 3031. $ find . -name '*.c'| xargs grep -E "g_timeout_add\ ?\(" ./src/trackerd/tracker-main.c: g_timeout_add (seconds * 1000, start_cb, NULL); ./src/trackerd/tracker-processor.c: g_timeout_add (ITEMS_QUEUE_PROCESS_INTERVAL, ./src/trackerd/tracker-daemon.c: g_timeout_add (500, (GSourceFunc) tracker_shutdown, NULL); ./src/tracker-indexer/tracker-indexer.c: priv->cleanup_task_id = g_timeout_add (500, cleanup_task_func, indexer); ./src/tracker-applet/tracker-applet.c: g_timeout_add (1000, ./tests/trackerd/xesam/gtestextensions.c: g_timeout_add (millis, (GSourceFunc)gtx_quit_main_loop, recursive_main); ./tests/trackerd/xesam/gtestextensions.c: max_timeout_id = g_timeout_add (max_wait_ms, (GSourceFunc)gtx_quit_main_loop, ./tests/trackerd/xesam/gtestextensions.c: * and failing; passed directly to g_timeout_add().
Created attachment 130213 [details] [review] substitute g_timeout_add by g_timeout_add_seconds The patch now includes tracker-processor.c
Thanks for the patch, committed! :)