[gedit/zbrown/deteplification-src: 391/633] commands-file: change behavior for remembering FileChooserOpen folder




commit 44640658f8d0a4dd9a6ed353fbb1dc91873d89d5
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sun Jun 7 02:21:44 2020 +0200

    commands-file: change behavior for remembering FileChooserOpen folder
    
    Before this commit, the FileChooser for opening files was configured to
    show the folder of the current document. So depending on the active tab,
    opening files with the FileChooser shows different folders.
    
    With this commit, it changes the behavior to simply remember the folder
    of the FileChooser, without taking into account the current document.
    This requires still a few commits to get things right in that area, to
    correctly remember to open files from the Recent list (or not), without
    losing the current folder of the 'Save As' FileChooser.

 gedit/gedit-commands-file.c | 20 +-------------------
 1 file changed, 1 insertion(+), 19 deletions(-)
---
diff --git a/gedit/gedit-commands-file.c b/gedit/gedit-commands-file.c
index 16307bce1..ecfa4002e 100644
--- a/gedit/gedit-commands-file.c
+++ b/gedit/gedit-commands-file.c
@@ -425,30 +425,12 @@ _gedit_cmd_file_open (GSimpleAction *action,
 
        if (window != NULL)
        {
-               GeditDocument *doc;
                GFile *default_folder = NULL;
 
                _gedit_file_chooser_open_set_transient_for (file_chooser, GTK_WINDOW (window));
 
                /* Set the current folder */
-               doc = gedit_window_get_active_document (window);
-
-               if (doc != NULL)
-               {
-                       GtkSourceFile *file = gedit_document_get_file (doc);
-                       GFile *location = gtk_source_file_get_location (file);
-
-                       if (location != NULL)
-                       {
-                               default_folder = g_file_get_parent (location);
-                       }
-               }
-
-               if (default_folder == NULL)
-               {
-                       default_folder = _gedit_window_get_default_location (window);
-               }
-
+               default_folder = _gedit_window_get_default_location (window);
                if (default_folder != NULL)
                {
                        gchar *default_folder_uri;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]