]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkrecentmanager.c
Fix typos
[~andy/gtk] / gtk / gtkrecentmanager.c
index 371db0ff7a50c643fb096c4d252aff94720e9a02..aadeb60418647df16e6abf6daa2045769cfc5e22 100644 (file)
@@ -48,8 +48,8 @@
 /* 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
@@ -150,7 +150,7 @@ static void           gtk_recent_info_free            (GtkRecentInfo         *re
 
 static guint signal_changed = 0;
 
-G_DEFINE_TYPE (GtkRecentManager, gtk_recent_manager, G_TYPE_OBJECT);
+G_DEFINE_TYPE (GtkRecentManager, gtk_recent_manager, G_TYPE_OBJECT)
 
 static void
 filename_warning (const gchar *format, 
@@ -283,10 +283,6 @@ gtk_recent_manager_init (GtkRecentManager *manager)
                                      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;
   
@@ -297,6 +293,13 @@ gtk_recent_manager_init (GtkRecentManager *manager)
 
   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);
 }
 
@@ -399,6 +402,7 @@ gtk_recent_manager_real_changed (GtkRecentManager *manager)
       g_bookmark_file_to_file (priv->recent_items,
                               priv->filename,
                               &write_error);
+
       if (write_error)
         {
           filename_warning ("Attempting to store changes into `%s', "
@@ -408,6 +412,8 @@ gtk_recent_manager_real_changed (GtkRecentManager *manager)
          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.
@@ -419,8 +425,6 @@ gtk_recent_manager_real_changed (GtkRecentManager *manager)
                            priv->filename,
                            g_strerror (errno));
 
-         priv->write_in_progress = FALSE;
-         
          g_object_thaw_notify (G_OBJECT (manager));
 
          return;
@@ -830,7 +834,7 @@ gtk_recent_manager_get_limit (GtkRecentManager *manager)
  */
 gboolean
 gtk_recent_manager_add_item (GtkRecentManager  *manager,
-                            const gchar       *uri);
+                            const gchar       *uri)
 {
   GtkRecentData *recent_data;
   GError *add_error;
@@ -916,8 +920,7 @@ gtk_recent_manager_add_item (GtkRecentManager  *manager,
 gboolean
 gtk_recent_manager_add_full (GtkRecentManager     *manager,
                             const gchar          *uri,
-                            const GtkRecentData  *data,
-                            GError              **error)
+                            const GtkRecentData  *data)
 {
   GtkRecentManagerPrivate *priv;
   
@@ -959,7 +962,7 @@ gtk_recent_manager_add_full (GtkRecentManager     *manager,
     {
       g_warning ("Attempting to add `%s' to the list of recently used "
                 "resources, but no name of the application that is "
-                "registering it was defined"
+                "registering it was defined",
                 uri);
       return FALSE;
     }
@@ -1179,7 +1182,9 @@ build_recent_info (GBookmarkFile  *bookmarks,
  *   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,
@@ -1744,7 +1749,7 @@ recent_app_info_free (RecentAppInfo *app_info)
  * @app_name: the name of the application that has registered this item
  * @app_exec: return location for the string containing the command line
  * @count: return location for the number of times this item was registered
- * @time: return location for the timestamp this item was last registered
+ * @time_: return location for the timestamp this item was last registered
  *    for this application
  *
  * Gets the data regarding the application that has registered the resource
@@ -1764,7 +1769,7 @@ gtk_recent_info_get_application_info (GtkRecentInfo  *info,
                                      const gchar    *app_name,
                                      gchar         **app_exec,
                                      guint          *count,
-                                     time_t         *time)
+                                     time_t         *time_)
 {
   RecentAppInfo *ai;
   
@@ -1788,8 +1793,8 @@ gtk_recent_info_get_application_info (GtkRecentInfo  *info,
   if (count)
     *count = ai->count;
   
-  if (time)
-    *time = ai->stamp;
+  if (time_)
+    *time_ = ai->stamp;
 
   return TRUE;
 }