[nautilus] Set rate limit to the file monitor.



commit 5d84350777a40f53ae3970f2acbafb5846cb1c94
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Mon Apr 12 03:34:23 2010 +0200

    Set rate limit to the file monitor.

 src/nautilus-bookmark-list.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/nautilus-bookmark-list.c b/src/nautilus-bookmark-list.c
index 67be610..25885d9 100644
--- a/src/nautilus-bookmark-list.c
+++ b/src/nautilus-bookmark-list.c
@@ -164,6 +164,8 @@ nautilus_bookmark_list_init (NautilusBookmarkList *bookmarks)
 
 	file = nautilus_bookmark_list_get_file ();
 	bookmarks->monitor = g_file_monitor_file (file, 0, NULL, NULL);
+	g_file_monitor_set_rate_limit (bookmarks->monitor, 1000);
+
 	g_signal_connect (bookmarks->monitor, "changed",
 			  G_CALLBACK (bookmark_monitor_changed_cb), bookmarks);
 
@@ -604,8 +606,12 @@ error:
 	if (error)
 		g_error_free (error);
 
+	if (out)
+		g_object_unref (out);
+
 	/* re-enable bookmark file monitoring */
 	bookmarks->monitor = g_file_monitor_file (file, 0, NULL, NULL);
+	g_file_monitor_set_rate_limit (bookmarks->monitor, 1000);
 	g_signal_connect (bookmarks->monitor, "changed",
 			  G_CALLBACK (bookmark_monitor_changed_cb), bookmarks);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]