/* the file where we store the recently used items */
#define GTK_RECENTLY_USED_FILE ".recently-used.xbel"
-/* a poll per second should be enough */
-#define POLL_DELTA 1000
+/* a poll every two seconds should be enough */
+#define POLL_DELTA 2000
/* return all items by default */
#define DEFAULT_LIMIT -1
GTK_TYPE_RECENT_MANAGER);
manager->priv = priv;
- priv->filename = g_build_filename (g_get_home_dir (),
- GTK_RECENTLY_USED_FILE,
- NULL);
-
priv->limit = DEFAULT_LIMIT;
priv->size = 0;
priv->screen = NULL;
+ priv->filename = g_build_filename (g_get_home_dir (),
+ GTK_RECENTLY_USED_FILE,
+ NULL);
+ priv->poll_timeout = g_timeout_add (POLL_DELTA,
+ gtk_recent_manager_poll_timeout,
+ manager);
+
build_recent_items_list (manager);
}
g_bookmark_file_to_file (priv->recent_items,
priv->filename,
&write_error);
+
if (write_error)
{
filename_warning ("Attempting to store changes into `%s', "
g_error_free (write_error);
}
+ priv->write_in_progress = FALSE;
+
/* we have sync'ed our list with the storage file, so we
* update the file mtime in order to skip the timed check
* and spare us from a re-read.
priv->filename,
g_strerror (errno));
- priv->write_in_progress = FALSE;
-
g_object_thaw_notify (G_OBJECT (manager));
return;
* about the resource pointed by @uri, or %NULL if the URI was
* not registered in the recently used resources list. Free with
* gtk_recent_info_unref().
- **/
+ *
+ * Since: 2.10
+ */
GtkRecentInfo *
gtk_recent_manager_lookup_item (GtkRecentManager *manager,
const gchar *uri,
if (count)
*count = ai->count;
- if (time)
+ if (time_)
*time_ = ai->stamp;
return TRUE;