[nautilus/wip/antoniof/experimental-gtk4-build: 29/52] filechooser API




commit 8f7e671ccfd46f93137f3091b5df4a4beb0b6041
Author: António Fernandes <antoniof gnome org>
Date:   Fri Dec 24 01:07:44 2021 +0000

    filechooser API

 src/nautilus-files-view.c        |  6 ++----
 src/nautilus-properties-window.c | 10 ++++++----
 2 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index b5ef98f8f..1989e7a55 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -5886,7 +5886,6 @@ copy_or_move_selection (NautilusFilesView *view,
                                           _("_Cancel"), GTK_RESPONSE_CANCEL,
                                           _("_Select"), GTK_RESPONSE_OK,
                                           NULL);
-    gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (dialog), FALSE);
 
     gtk_dialog_set_default_response (GTK_DIALOG (dialog),
                                      GTK_RESPONSE_OK);
@@ -5913,7 +5912,7 @@ copy_or_move_selection (NautilusFilesView *view,
         location = nautilus_directory_get_location (priv->model);
     }
 
-    gtk_file_chooser_set_current_folder_file (GTK_FILE_CHOOSER (dialog), location, NULL);
+    gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), location, NULL);
     g_signal_connect (dialog, "response",
                       G_CALLBACK (on_destination_dialog_response),
                       copy_data);
@@ -6334,7 +6333,6 @@ extract_files_to_chosen_location (NautilusFilesView *view,
                                           _("_Cancel"), GTK_RESPONSE_CANCEL,
                                           _("_Select"), GTK_RESPONSE_OK,
                                           NULL);
-    gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (dialog), FALSE);
 
     gtk_dialog_set_default_response (GTK_DIALOG (dialog),
                                      GTK_RESPONSE_OK);
@@ -6360,7 +6358,7 @@ extract_files_to_chosen_location (NautilusFilesView *view,
         location = nautilus_directory_get_location (priv->model);
     }
 
-    gtk_file_chooser_set_current_folder_file (GTK_FILE_CHOOSER (dialog), location, NULL);
+    gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), location, NULL);
 
     data->view = view;
     data->files = nautilus_file_list_copy (files);
diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c
index bcd3b2076..d3718434d 100644
--- a/src/nautilus-properties-window.c
+++ b/src/nautilus-properties-window.c
@@ -5229,14 +5229,16 @@ select_image_button_callback (GtkWidget                *widget,
 
     if (dialog == NULL)
     {
+        g_autoptr (GFile) pictures_location = NULL;
         dialog = gtk_file_chooser_dialog_new (_("Select Custom Icon"), GTK_WINDOW (self),
                                               GTK_FILE_CHOOSER_ACTION_OPEN,
                                               _("_Revert"), GTK_RESPONSE_NO,
                                               _("_Cancel"), GTK_RESPONSE_CANCEL,
                                               _("_Open"), GTK_RESPONSE_OK,
                                               NULL);
+        pictures_location = g_file_new_for_path (g_get_user_special_dir (G_USER_DIRECTORY_PICTURES));
         gtk_file_chooser_add_shortcut_folder (GTK_FILE_CHOOSER (dialog),
-                                              g_get_user_special_dir (G_USER_DIRECTORY_PICTURES),
+                                              pictures_location,
                                               NULL);
         gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE);
         gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
@@ -5264,9 +5266,9 @@ select_image_button_callback (GtkWidget                *widget,
 
             if (image_location != NULL)
             {
-                gtk_file_chooser_set_current_folder_file (GTK_FILE_CHOOSER (dialog),
-                                                          image_location,
-                                                          NULL);
+                gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog),
+                                                     image_location,
+                                                     NULL);
             }
         }
     }


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