bgo#662814 - Don't print a g_warning() when GtkRecentManager can't find a file

Also, *do* add the file to the recently-used list, even if the file does not
exist yet.  This is used from the Save dialog, so even shitty apps which don't
add the file to GtkRecentManager, will get the file added from the Save dialog.
Signed-off-by: Federico Mena Quintero's avatarFederico Mena Quintero <>
parent 92e64441
......@@ -730,20 +730,10 @@ gtk_recent_manager_add_item_query_info (GObject *source_object,
GtkRecentData recent_data;
GFileInfo *file_info;
gchar *uri;
GError *error;
uri = g_file_get_uri (file);
error = NULL;
file_info = g_file_query_info_finish (file, res, &error);
if (error)
g_warning ("Unable to retrieve the file info for `%s': %s",
g_error_free (error);
goto out;
file_info = g_file_query_info_finish (file, res, NULL); /* NULL-GError */
recent_data.display_name = NULL;
recent_data.description = NULL;
......@@ -763,7 +753,7 @@ gtk_recent_manager_add_item_query_info (GObject *source_object,
g_object_unref (file_info);
recent_data.mime_type = g_strdup (GTK_RECENT_DEFAULT_MIME);
recent_data.mime_type = g_strdup (GTK_RECENT_DEFAULT_MIME); /* FIXME: maybe we should make up the MIME type from the filename's extension */
recent_data.app_name = g_strdup (g_get_application_name ());
recent_data.app_exec = g_strjoin (" ", g_get_prgname (), "%u", NULL);
......@@ -785,7 +775,6 @@ gtk_recent_manager_add_item_query_info (GObject *source_object,
g_free (recent_data.app_name);
g_free (recent_data.app_exec);
g_object_unref (manager);
g_free (uri);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment