From ba82c09a4fad2c258eee6198c2c460fce28afd7b Mon Sep 17 00:00:00 2001 From: Diego Escalante Urrelo Date: Wed, 3 Jan 2007 08:08:12 +0000 Subject: Utilize GLib's new g_timeout_add_seconds to reduce context switches and 2007-01-03 Diego Escalante Urrelo * embed/ephy-favicon-cache.c: (ephy_favicon_cache_init): * embed/ephy-history.c: (ephy_history_init): * lib/Makefile.am: * lib/ephy-glib-compat.h: * src/bookmarks/ephy-bookmarks.c: (ephy_bookmarks_save_delayed): * src/ephy-dbus.c: (session_filter_func), (system_filter_func): * src/ephy-extensions-manager.c: (reload_cb): * src/ephy-session.c: (confirm_shutdown_cb): Utilize GLib's new g_timeout_add_seconds to reduce context switches and improve CPU/power efficiency. Patch by Chris Wilson. svn path=/trunk/; revision=6783 --- src/bookmarks/ephy-bookmarks.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/bookmarks') diff --git a/src/bookmarks/ephy-bookmarks.c b/src/bookmarks/ephy-bookmarks.c index 51c234627..6c36c08f1 100644 --- a/src/bookmarks/ephy-bookmarks.c +++ b/src/bookmarks/ephy-bookmarks.c @@ -38,6 +38,7 @@ #include "ephy-marshal.h" #include "ephy-signal-accumulator.h" #include "ephy-stock-icons.h" +#include "ephy-glib-compat.h" #include "eel-gconf-extensions.h" @@ -50,7 +51,7 @@ #define EPHY_BOOKMARKS_XML_ROOT "ephy_bookmarks" #define EPHY_BOOKMARKS_XML_VERSION "1.03" -#define BOOKMARKS_SAVE_DELAY (3 * 1000) /* ms */ +#define BOOKMARKS_SAVE_DELAY 3 /* seconds */ #define MAX_FAVORITES_NUM 10 #define UPDATE_URI_DATA_KEY "updated-uri" #define SD_RESOLVE_TIMEOUT 0 /* ms; 0 means no timeout */ @@ -289,7 +290,7 @@ ephy_bookmarks_save_delayed (EphyBookmarks *bookmarks, int delay) if (delay > 0) { bookmarks->priv->save_timeout_id = - g_timeout_add (BOOKMARKS_SAVE_DELAY, + g_timeout_add_seconds (BOOKMARKS_SAVE_DELAY, (GSourceFunc) save_bookmarks_delayed, bookmarks); } -- cgit v1.2.3