mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 10:50:10 +00:00
Print files to Documents directory by default
Set default directory to G_USER_DIRECTORY_DOCUMENTS when printing to file backend and fallback to the current directory when it is not available (#633896).
This commit is contained in:
parent
9d52a9d920
commit
0fe9e481dd
@ -252,14 +252,22 @@ output_file_from_settings (GtkPrintSettings *settings,
|
||||
g_free (name);
|
||||
|
||||
if (locale_name != NULL)
|
||||
{
|
||||
const gchar *document_dir = g_get_user_special_dir (G_USER_DIRECTORY_DOCUMENTS);
|
||||
|
||||
if (document_dir == NULL)
|
||||
{
|
||||
gchar *current_dir = g_get_current_dir ();
|
||||
path = g_build_filename (current_dir, locale_name, NULL);
|
||||
g_free (locale_name);
|
||||
g_free (current_dir);
|
||||
}
|
||||
else
|
||||
path = g_build_filename (document_dir, locale_name, NULL);
|
||||
|
||||
uri = g_filename_to_uri (path, NULL, NULL);
|
||||
|
||||
g_free (locale_name);
|
||||
g_free (path);
|
||||
g_free (current_dir);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user