[file-roller/wip/jtojnar/gtk4: 4/7] Fix callback argument types with the help of tartan




commit b8c6b9ba19be949382f48d903cf02c2407c04ccd
Author: Jan Tojnar <jtojnar gmail com>
Date:   Tue Dec 21 01:53:41 2021 +0100

    Fix callback argument types with the help of tartan

 src/dlg-add.c                     | 12 ++++++------
 src/dlg-ask-password.c            |  2 +-
 src/dlg-delete.c                  |  4 ++--
 src/dlg-extract.c                 |  2 +-
 src/dlg-password.c                |  2 +-
 src/dlg-update.c                  |  2 +-
 src/fr-file-selector-dialog.c     |  6 +++---
 src/fr-window-actions-callbacks.c |  2 +-
 src/fr-window.c                   | 28 +++++++++++++---------------
 src/test-server.c                 |  4 ++--
 10 files changed, 31 insertions(+), 33 deletions(-)
---
diff --git a/src/dlg-add.c b/src/dlg-add.c
index 688a2737..bc8a3514 100644
--- a/src/dlg-add.c
+++ b/src/dlg-add.c
@@ -47,7 +47,7 @@ typedef struct {
 
 
 static void
-file_selector_destroy_cb (GtkWidget  *widget,
+file_selector_destroy_cb (FrFileSelectorDialog *dialog,
                          DialogData *data)
 {
        g_object_unref (data->builder);
@@ -61,7 +61,7 @@ static void dlg_add_folder_save_last_options (DialogData *data);
 
 
 static void
-file_selector_response_cb (GtkWidget    *widget,
+file_selector_response_cb (FrFileSelectorDialog *dialog,
                           int           response,
                           DialogData   *data)
 {
@@ -224,11 +224,11 @@ dlg_add (FrWindow *window)
 
        /* signals */
 
-       g_signal_connect (GTK_DIALOG (data->dialog),
+       g_signal_connect (FR_FILE_SELECTOR_DIALOG (data->dialog),
                          "destroy",
                          G_CALLBACK (file_selector_destroy_cb),
                          data);
-       g_signal_connect (GTK_DIALOG (data->dialog),
+       g_signal_connect (FR_FILE_SELECTOR_DIALOG (data->dialog),
                          "response",
                          G_CALLBACK (file_selector_response_cb),
                          data);
@@ -594,7 +594,7 @@ aod_destroy_cb (GtkWidget             *widget,
 
 
 static void
-aod_apply_cb (GtkWidget *widget,
+aod_apply_cb (GtkButton *button,
              gpointer   callback_data)
 {
        LoadOptionsDialogData *aod_data = callback_data;
@@ -682,7 +682,7 @@ aod_update_option_list (LoadOptionsDialogData *aod_data)
 
 
 static void
-aod_remove_cb (GtkWidget             *widget,
+aod_remove_cb (GtkButton *button,
               LoadOptionsDialogData *aod_data)
 {
        GtkTreeSelection *selection;
diff --git a/src/dlg-ask-password.c b/src/dlg-ask-password.c
index 081d5ab3..a67066f0 100644
--- a/src/dlg-ask-password.c
+++ b/src/dlg-ask-password.c
@@ -58,7 +58,7 @@ destroy_cb (GtkWidget  *widget,
 
 
 static void
-ask_password__response_cb (GtkWidget  *dialog,
+ask_password__response_cb (GtkDialog  *dialog,
                           int         response_id,
                           DialogData *data)
 {
diff --git a/src/dlg-delete.c b/src/dlg-delete.c
index d0a123a7..d4307a6d 100644
--- a/src/dlg-delete.c
+++ b/src/dlg-delete.c
@@ -51,7 +51,7 @@ destroy_cb (GtkWidget  *widget,
 
 /* called when the dialog is dismissed. */
 static void
-response_cb (GtkWidget  *widget,
+response_cb (GtkDialog  *widget,
                        int         response_id,
                        DialogData *data)
 {
@@ -96,7 +96,7 @@ response_cb (GtkWidget  *widget,
 
 
 static void
-entry_changed_cb (GtkWidget  *widget,
+entry_changed_cb (GtkEditable *widget,
                  DialogData *data)
 {
        if (! gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (data->d_files_radio)))
diff --git a/src/dlg-extract.c b/src/dlg-extract.c
index 17fad232..1defe0af 100644
--- a/src/dlg-extract.c
+++ b/src/dlg-extract.c
@@ -290,7 +290,7 @@ file_selector_response_cb (GtkWidget    *widget,
 
 
 static void
-files_entry_changed_cb (GtkWidget  *widget,
+files_entry_changed_cb (GtkEditable  *widget,
                        DialogData *data)
 {
        if (! gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (GET_WIDGET ("file_pattern_radiobutton"))))
diff --git a/src/dlg-password.c b/src/dlg-password.c
index c4808dda..a7664203 100644
--- a/src/dlg-password.c
+++ b/src/dlg-password.c
@@ -50,7 +50,7 @@ destroy_cb (GtkWidget  *widget,
 
 
 static void
-response_cb (GtkWidget  *dialog,
+response_cb (GtkDialog  *dialog,
             int         response_id,
             DialogData *data)
 {
diff --git a/src/dlg-update.c b/src/dlg-update.c
index c7cac194..05527950 100644
--- a/src/dlg-update.c
+++ b/src/dlg-update.c
@@ -250,7 +250,7 @@ n_selected (DialogData *data)
 
 static void
 is_selected_toggled (GtkCellRendererToggle *cell,
-                    char                  *path_string,
+                    const char            *path_string,
                     gpointer               callback_data)
 {
        DialogData   *data  = callback_data;
diff --git a/src/fr-file-selector-dialog.c b/src/fr-file-selector-dialog.c
index c75c3dcd..c99df840 100644
--- a/src/fr-file-selector-dialog.c
+++ b/src/fr-file-selector-dialog.c
@@ -482,7 +482,7 @@ _update_sensitivity (FrFileSelectorDialog *self)
 
 static void
 is_selected_cellrenderertoggle_toggled_cb (GtkCellRendererToggle *cell_renderer,
-                                          gchar                 *path,
+                                          const gchar           *path,
                                           gpointer               user_data)
 {
        FrFileSelectorDialog *self = user_data;
@@ -561,13 +561,13 @@ go_up_button_clicked_cb (GtkButton *button,
 
 static void
 places_sidebar_open_location_cb (GtkPlacesSidebar  *sidebar,
-                                GObject           *location,
+                                GFile             *location,
                                 GtkPlacesOpenFlags open_flags,
                                 gpointer           user_data)
 {
        FrFileSelectorDialog *self = user_data;
 
-       fr_file_selector_dialog_set_current_folder (self, G_FILE (location));
+       fr_file_selector_dialog_set_current_folder (self, location);
 }
 
 
diff --git a/src/fr-window-actions-callbacks.c b/src/fr-window-actions-callbacks.c
index 62b1a8fc..c02e8d79 100644
--- a/src/fr-window-actions-callbacks.c
+++ b/src/fr-window-actions-callbacks.c
@@ -246,7 +246,7 @@ window_archive_loaded_cb (FrWindow  *window,
 
 
 static void
-open_file_response_cb (GtkWidget *w,
+open_file_response_cb (GtkDialog *dialog,
                       int        response,
                       GtkWidget *file_sel)
 {
diff --git a/src/fr-window.c b/src/fr-window.c
index acead7f0..a6b36aaa 100644
--- a/src/fr-window.c
+++ b/src/fr-window.c
@@ -2719,16 +2719,16 @@ fr_archive_progress_cb (FrArchive *archive,
 
 static void
 fr_window_close_confirmation_dialog (FrWindow  *window,
-                                    GtkWidget *dialog)
+                                    GtkDialog *dialog)
 {
-       gtk_widget_destroy (dialog);
+       gtk_widget_destroy (GTK_WIDGET (dialog));
        if (window->priv->batch_mode && window->priv->destroy_with_confirmation_dialog)
                _fr_window_close_after_notification (window);
 }
 
 
 static void
-confirmation_dialog_response (GtkWidget *dialog,
+confirmation_dialog_response (GtkDialog *dialog,
                              int        response_id,
                              FrWindow  *window)
 {
@@ -2768,44 +2768,42 @@ confirmation_dialog_delete_event (GtkWidget *dialog,
                                  GdkEvent  *event,
                                  FrWindow  *window)
 {
-       fr_window_close_confirmation_dialog (window, dialog);
+       fr_window_close_confirmation_dialog (window, GTK_DIALOG (dialog));
        return TRUE;
 }
 
 
 static void
 fr_window_show_confirmation_dialog (FrWindow  *window,
-                                   GtkWidget *dialog)
+                                   GtkDialog *dialog)
 {
        close_progress_dialog (window, TRUE);
 
-       g_signal_connect (GTK_DIALOG (dialog),
+       g_signal_connect (dialog,
                          "response",
                          G_CALLBACK (confirmation_dialog_response),
                          window);
-       g_signal_connect (GTK_DIALOG (dialog),
+       g_signal_connect (dialog,
                          "delete_event",
                          G_CALLBACK (confirmation_dialog_delete_event),
                          window);
 
-       gtk_widget_show (dialog);
+       gtk_widget_show (GTK_WIDGET (dialog));
 }
 
 
 static void
 fr_window_show_confirmation_dialog_with_open_destination (FrWindow *window)
 {
-       GtkWidget *dialog;
-
-       dialog = _gtk_message_dialog_new (GTK_WINDOW (window),
+       GtkDialog *dialog = GTK_DIALOG (_gtk_message_dialog_new (GTK_WINDOW (window),
                                          GTK_DIALOG_MODAL,
                                          _("Extraction completed successfully"),
                                          NULL,
                                          _GTK_LABEL_CLOSE, GTK_RESPONSE_CLOSE,
                                          _("_Show the Files"), DIALOG_RESPONSE_OPEN_DESTINATION_FOLDER,
-                                         NULL);
+                                         NULL));
 
-       gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE);
+       gtk_dialog_set_default_response (dialog, GTK_RESPONSE_CLOSE);
        fr_window_show_confirmation_dialog (window, dialog);
 }
 
@@ -2830,7 +2828,7 @@ fr_window_show_confirmation_dialog_with_open_archive (FrWindow *window)
                                          NULL);
 
        gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE);
-       fr_window_show_confirmation_dialog (window, dialog);
+       fr_window_show_confirmation_dialog (window, GTK_DIALOG (dialog));
 
        g_free (message);
        g_free (basename);
@@ -5413,7 +5411,7 @@ fr_window_activate_filter (FrWindow *window)
 
 
 static void
-filter_entry_search_changed_cb (GtkEntry *entry,
+filter_entry_search_changed_cb (GtkSearchEntry *entry,
                                FrWindow *window)
 {
        fr_window_activate_filter (window);
diff --git a/src/test-server.c b/src/test-server.c
index 22efa172..2992575d 100644
--- a/src/test-server.c
+++ b/src/test-server.c
@@ -118,8 +118,8 @@ fileroller_addtoarchive_ready_cb (GObject      *source_object,
 
 static void
 on_signal (GDBusProxy *proxy,
-          char       *sender_name,
-          char       *signal_name,
+          const char *sender_name,
+          const char *signal_name,
           GVariant   *parameters,
           gpointer    user_data)
 {


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