[gedit] commands-file: 'Save As' file chooser: default to home dir
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] commands-file: 'Save As' file chooser: default to home dir
- Date: Sat, 6 Jun 2020 13:32:36 +0000 (UTC)
commit 212dc1fdd95e978f931d637642fcf9682873faf6
Author: Sébastien Wilmet <swilmet gnome org>
Date: Sat Jun 6 15:19:21 2020 +0200
commands-file: 'Save As' file chooser: default to home dir
See the comment in the code.
gedit/gedit-commands-file.c | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
---
diff --git a/gedit/gedit-commands-file.c b/gedit/gedit-commands-file.c
index 80deff8fd..ab2afa7da 100644
--- a/gedit/gedit-commands-file.c
+++ b/gedit/gedit-commands-file.c
@@ -861,23 +861,26 @@ save_as_tab_async (GeditTab *tab,
}
else
{
- GFile *default_path;
+ GFile *default_folder;
gchar *docname;
- default_path = _gedit_window_get_default_location (window);
- docname = gedit_document_get_short_name_for_display (doc);
-
- if (default_path != NULL)
+ default_folder = _gedit_window_get_default_location (window);
+ if (default_folder == NULL)
{
- gedit_file_chooser_dialog_set_current_folder (save_dialog,
- default_path);
-
- g_object_unref (default_path);
+ /* It's logical to take the home dir by default, and it fixes
+ * a problem on MS Windows (hang in C:\windows\system32).
+ *
+ * FIXME: it would be better to use GtkFileChooserNative
+ * to permanently fix the hang problem on MS Windows.
+ */
+ default_folder = g_file_new_for_path (g_get_home_dir ());
}
- gedit_file_chooser_dialog_set_current_name (save_dialog,
- docname);
+ gedit_file_chooser_dialog_set_current_folder (save_dialog, default_folder);
+ g_object_unref (default_folder);
+ docname = gedit_document_get_short_name_for_display (doc);
+ gedit_file_chooser_dialog_set_current_name (save_dialog, docname);
g_free (docname);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]