mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 19:00:08 +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
02cbc516eb
commit
bbd0e73c1b
@ -253,13 +253,21 @@ output_file_from_settings (GtkPrintSettings *settings,
|
||||
|
||||
if (locale_name != NULL)
|
||||
{
|
||||
gchar *current_dir = g_get_current_dir ();
|
||||
path = g_build_filename (current_dir, locale_name, NULL);
|
||||
g_free (locale_name);
|
||||
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 (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