From c31e25203052576a90ec1978c939424fafd132c2 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Tue, 15 Apr 2008 22:31:01 +0000 Subject: [PATCH] Emit the ::changed signal at the end of the asynchronous MIME type query. 2008-04-15 Emmanuele Bassi * gtk/gtkrecentmanager.c: (gtk_recent_manager_add_item_query_info), (gtk_recent_manager_add_item): Emit the ::changed signal at the end of the asynchronous MIME type query. svn path=/trunk/; revision=20005 --- ChangeLog | 7 ++++++ gtk/gtkrecentmanager.c | 55 ++++++++++++++++++++++-------------------- 2 files changed, 36 insertions(+), 26 deletions(-) diff --git a/ChangeLog b/ChangeLog index a205dbd939..c9b6234000 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-04-15 Emmanuele Bassi + + * gtk/gtkrecentmanager.c: + (gtk_recent_manager_add_item_query_info), + (gtk_recent_manager_add_item): Emit the ::changed signal + at the end of the asynchronous MIME type query. + 2008-04-15 Emmanuele Bassi Bug 487375 – gtkrecent apps poll ~/.recently-used.xbel diff --git a/gtk/gtkrecentmanager.c b/gtk/gtkrecentmanager.c index 9d2b23f132..1cbd9bd342 100644 --- a/gtk/gtkrecentmanager.c +++ b/gtk/gtkrecentmanager.c @@ -115,28 +115,28 @@ enum PROP_SIZE }; -static void gtk_recent_manager_dispose (GObject *object); -static void gtk_recent_manager_finalize (GObject *object); -static void gtk_recent_manager_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec); -static void gtk_recent_manager_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec); -static void gtk_recent_manager_add_item_query_info_cb (GObject *source_object, - GAsyncResult *res, - gpointer user_data); -static void gtk_recent_manager_monitor_changed (GFileMonitor *monitor, - GFile *file, - GFile *other_file, - GFileMonitorEvent event_type, - gpointer user_data); -static void gtk_recent_manager_changed (GtkRecentManager *manager); -static void gtk_recent_manager_real_changed (GtkRecentManager *manager); -static void gtk_recent_manager_set_filename (GtkRecentManager *manager, - const gchar *filename); +static void gtk_recent_manager_dispose (GObject *object); +static void gtk_recent_manager_finalize (GObject *object); +static void gtk_recent_manager_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec); +static void gtk_recent_manager_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec); +static void gtk_recent_manager_add_item_query_info (GObject *source_object, + GAsyncResult *res, + gpointer user_data); +static void gtk_recent_manager_monitor_changed (GFileMonitor *monitor, + GFile *file, + GFile *other_file, + GFileMonitorEvent event_type, + gpointer user_data); +static void gtk_recent_manager_changed (GtkRecentManager *manager); +static void gtk_recent_manager_real_changed (GtkRecentManager *manager); +static void gtk_recent_manager_set_filename (GtkRecentManager *manager, + const gchar *filename); static void build_recent_items_list (GtkRecentManager *manager); static void purge_recent_items_list (GtkRecentManager *manager, @@ -701,9 +701,9 @@ gtk_recent_manager_get_limit (GtkRecentManager *manager) } static void -gtk_recent_manager_add_item_query_info_cb (GObject *source_object, - GAsyncResult *res, - gpointer user_data) +gtk_recent_manager_add_item_query_info (GObject *source_object, + GAsyncResult *res, + gpointer user_data) { GFile *file = G_FILE (source_object); GtkRecentManager *manager = user_data; @@ -745,6 +745,9 @@ gtk_recent_manager_add_item_query_info_cb (GObject *source_object, * fields are set */ gtk_recent_manager_add_full (manager, uri, &recent_data); + manager->priv->is_dirty = TRUE; + gtk_recent_manager_changed (manager); + g_free (recent_data.mime_type); g_free (recent_data.app_name); g_free (recent_data.app_exec); @@ -790,7 +793,7 @@ gtk_recent_manager_add_item (GtkRecentManager *manager, G_PRIORITY_DEFAULT, G_FILE_QUERY_INFO_NONE, NULL, - gtk_recent_manager_add_item_query_info_cb, + gtk_recent_manager_add_item_query_info, g_object_ref (manager)); g_object_unref (file);