[nautilus/wip/antoniof/switch-to-gtk4: 23/36] general: Adapt to GtkFileChooser API changes




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

    general: Adapt to GtkFileChooser API changes
    
    The API is GFIle-only now, and as such always supports non-local URIs.

 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 b64ad81a8..c7a464066 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -5896,7 +5896,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);
@@ -5923,7 +5922,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);
@@ -6344,7 +6343,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);
@@ -6370,7 +6368,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 9e82bb1b3..e6a2a4e24 100644
--- a/src/nautilus-properties-window.c
+++ b/src/nautilus-properties-window.c
@@ -5232,14 +5232,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);
@@ -5267,9 +5269,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]