mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-18 09:00:34 +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
4eae58ab43
commit
400e53c568
@ -893,20 +893,10 @@ gtk_recent_manager_add_item_query_info (GObject *source_object,
|
|||||||
GtkRecentData recent_data;
|
GtkRecentData recent_data;
|
||||||
GFileInfo *file_info;
|
GFileInfo *file_info;
|
||||||
gchar *uri;
|
gchar *uri;
|
||||||
GError *error;
|
|
||||||
|
|
||||||
uri = g_file_get_uri (file);
|
uri = g_file_get_uri (file);
|
||||||
|
|
||||||
error = NULL;
|
file_info = g_file_query_info_finish (file, res, NULL); /* NULL-GError */
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
recent_data.display_name = NULL;
|
recent_data.display_name = NULL;
|
||||||
recent_data.description = NULL;
|
recent_data.description = NULL;
|
||||||
@ -926,7 +916,7 @@ gtk_recent_manager_add_item_query_info (GObject *source_object,
|
|||||||
g_object_unref (file_info);
|
g_object_unref (file_info);
|
||||||
}
|
}
|
||||||
else
|
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_name = g_strdup (g_get_application_name ());
|
||||||
recent_data.app_exec = g_strjoin (" ", g_get_prgname (), "%u", NULL);
|
recent_data.app_exec = g_strjoin (" ", g_get_prgname (), "%u", NULL);
|
||||||
@ -948,7 +938,6 @@ gtk_recent_manager_add_item_query_info (GObject *source_object,
|
|||||||
g_free (recent_data.app_name);
|
g_free (recent_data.app_name);
|
||||||
g_free (recent_data.app_exec);
|
g_free (recent_data.app_exec);
|
||||||
|
|
||||||
out:
|
|
||||||
g_object_unref (manager);
|
g_object_unref (manager);
|
||||||
g_free (uri);
|
g_free (uri);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user