[gedit] commands-file: change behavior for remembering FileChooserOpen folder



commit 51937d873138880c24df3a31fd2b509a575278b6
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 beb5dc8e6..443812fdf 100644
--- a/gedit/gedit-commands-file.c
+++ b/gedit/gedit-commands-file.c
@@ -428,30 +428,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]