Index: gtk/gtkrecentmanager.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkrecentmanager.c,v
retrieving revision 1.9
diff -p -a -u -r1.9 gtkrecentmanager.c
--- gtk/gtkrecentmanager.c	16 Apr 2006 03:55:07 -0000	1.9
+++ gtk/gtkrecentmanager.c	3 May 2006 11:22:22 -0000
@@ -110,6 +110,7 @@ struct _GtkRecentManagerPrivate
   
   time_t last_mtime;
   guint poll_timeout;
+  guint is_frozen : 1;
 };
 
 enum
@@ -1438,6 +1439,127 @@ static void
 gtk_recent_manager_changed (GtkRecentManager *recent_manager)
 {
   g_signal_emit (recent_manager, signal_changed, 0);
+}
+
+/**
+ * gtk_recent_manager_freeze:
+ * @recent_manager: a #GtkRecentManager
+ *
+ * Freezes @recent_manager: all the updates of the recently
+ * used resources list from the file will be blocked until
+ * @recent_manager will be thawed using gtk_recent_manager_thaw().
+ * You can force an update of the list using
+ * gtk_recent_manager_force_update().
+ *
+ * It's important to notice that only the reads from the storage
+ * file will be blocked: the storage file will be updated if an
+ * item is added/moved/removed or if the list is purged.
+ *
+ * Since: 2.10
+ */
+void
+gtk_recent_manager_freeze (GtkRecentManager *recent_manager)
+{
+  GtkRecentManagerPrivate *priv;
+  
+  g_return_if_fail (GTK_IS_RECENT_MANAGER (recent_manager));
+  priv = recent_manager->priv;
+
+  if (!priv->is_frozen)
+    {
+      if (priv->poll_timeout)
+        {
+          g_source_remove (priv->poll_timeout);
+	  priv->poll_timeout = 0;
+	}
+
+      priv->is_frozen = TRUE;
+    }
+}
+
+/**
+ * gtk_recent_manager_thaw:
+ * @recent_manager: a #GtkRecentManager
+ *
+ * Thaws @recent_manager if it was frozen using gtk_recent_manager_freeze().
+ * This will enable the polling on the recently used resources
+ * list storage file.
+ *
+ * Since: 2.10
+ */
+void
+gtk_recent_manager_thaw (GtkRecentManager *recent_manager)
+{
+  GtkRecentManagerPrivate *priv;
+
+  g_return_if_fail (GTK_IS_RECENT_MANAGER (recent_manager));
+  priv = recent_manager->priv;
+
+  if (priv->is_frozen)
+    {
+      g_assert (priv->poll_timeout == 0);
+
+      priv->poll_timeout = g_timeout_add (POLL_DELTA,
+		      			  gtk_recent_manager_poll_timeout,
+					  recent_manager);
+
+      priv->is_dirty = FALSE;
+      build_recent_items_list (recent_manager);
+    }
+}
+
+/**
+ * gtk_recent_manager_force_update:
+ * @recent_manager: a #GtkRecentManager
+ * @error: return location for a #GError or %NULL
+ *
+ * Forces an update of the recently used resources list held
+ * by @recent_manager from the storage file.
+ *
+ * Return value: %TRUE if the update was successful.
+ *
+ * Since: 2.10
+ */
+gboolean
+gtk_recent_manager_force_update (GtkRecentManager  *recent_manager,
+				 GError           **error)
+{
+  GtkRecentManagerPrivate *priv;
+  struct stat stat_buf;
+  int stat_res;
+
+  g_return_val_if_fail (GTK_IS_RECENT_MANAGER (recent_manager), FALSE);
+  priv = recent_manager->priv;
+
+  /* if we have a read/write in progress then we return */
+  if (priv->write_in_progress || priv->read_in_progress)
+    return TRUE;
+
+  stat_res = g_stat (priv->filename, &stat_buf);
+  if (stat_res < 0)
+    {
+      /* the file does not exist, yet, so we wait */
+      if (errno == ENOENT)
+        return TRUE;
+
+      g_set_error (error, GTK_RECENT_MANAGER_ERROR,
+		   GTK_RECENT_MANAGER_ERROR_READ,
+		   "Unable to stat() the recently used resources file "
+		   "at `%s': %s.",
+		   priv->filename,
+		   g_strerror (errno));
+      
+      return FALSE;
+    }
+
+  /* the file didn't change from the last poll(), so we bail out */
+  if (stat_buf.st_mtime == priv->last_mtime)
+    return TRUE;
+
+  /* the file has been changed, hence we emit the "changed" signal */
+  gtk_recent_manager_changed (manager);
+
+  return TRUE;
 }
 
 /*****************
Index: gtk/gtkrecentmanager.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkrecentmanager.h,v
retrieving revision 1.2
diff -p -a -u -r1.2 gtkrecentmanager.h
--- gtk/gtkrecentmanager.h	30 Mar 2006 21:30:37 -0000	1.2
+++ gtk/gtkrecentmanager.h	3 May 2006 11:22:22 -0000
@@ -170,6 +170,10 @@ GList *           gtk_recent_manager_get
 gint              gtk_recent_manager_purge_items    (GtkRecentManager     *manager,
 						     GError              **error);
 
+void              gtk_recent_manager_freeze         (GtkRecentManager     *manager);
+void              gtk_recent_manager_thaw           (GtkRecentManager     *manager);
+gboolean          gtk_recent_manager_force_update   (GtkRecentManager     *manager,
+						     GError              **error);
 
 GType	              gtk_recent_info_get_type             (void) G_GNUC_CONST;
 
