mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-17 14:30:15 +00:00
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 <federico@gnome.org>
This commit is contained in:
parent
92e6444163
commit
e8be9ec01f
@ -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",
|
||||
uri,
|
||||
error->message);
|
||||
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);
|
||||
}
|
||||
else
|
||||
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);
|
||||
|
||||
out:
|
||||
g_object_unref (manager);
|
||||
g_free (uri);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user