[file-roller/wip/jtojnar/gtk4: 1/7] Use specific casts for g_signal_connect




commit 90752e72139bb86fa5e8416c85272d4e7f9d8b83
Author: Jan Tojnar <jtojnar gmail com>
Date:   Sun Dec 19 23:38:59 2021 +0100

    Use specific casts for g_signal_connect
    
    It is a macro so G_OBJECT cast is pointless. Or rather harmful since
    it will prevent Tartan from properly checking the handler type:
    
        Could not find GObject subclass for expression when connecting
        to signal ‘…’. To improve static analysis, add a typecast
        to the GObject parameter of g_signal_connect_data()
        to the specific class defining the signal.
    
    The casts were stripped using https://gitlab.gnome.org/jtojnar/glib-refactoring
    and then I manually added more specific casts based on instructions from Tartan.

 src/dlg-add.c                     | 16 ++++----
 src/dlg-ask-password.c            |  4 +-
 src/dlg-batch-add.c               |  2 +-
 src/dlg-delete.c                  | 10 ++---
 src/dlg-extract.c                 | 52 ++++++++++++-------------
 src/dlg-open-with.c               |  2 +-
 src/dlg-package-installer.c       |  2 +-
 src/dlg-password.c                |  4 +-
 src/dlg-prop.c                    |  2 +-
 src/dlg-update.c                  | 10 ++---
 src/eggtreemultidnd.c             |  8 ++--
 src/fr-application.c              | 16 ++++----
 src/fr-command.c                  |  2 +-
 src/fr-file-selector-dialog.c     | 10 ++---
 src/fr-new-archive-dialog.c       |  8 ++--
 src/fr-window-actions-callbacks.c |  4 +-
 src/fr-window.c                   | 80 +++++++++++++++++++--------------------
 src/gtk-utils.c                   |  6 +--
 18 files changed, 117 insertions(+), 121 deletions(-)
---
diff --git a/src/dlg-add.c b/src/dlg-add.c
index 3a1adb39..d6881d22 100644
--- a/src/dlg-add.c
+++ b/src/dlg-add.c
@@ -229,11 +229,11 @@ dlg_add (FrWindow *window)
 
        /* signals */
 
-       g_signal_connect (G_OBJECT (data->dialog),
+       g_signal_connect (GTK_DIALOG (data->dialog),
                          "destroy",
                          G_CALLBACK (file_selector_destroy_cb),
                          data);
-       g_signal_connect (G_OBJECT (data->dialog),
+       g_signal_connect (GTK_DIALOG (data->dialog),
                          "response",
                          G_CALLBACK (file_selector_response_cb),
                          data);
@@ -768,23 +768,23 @@ load_options_activate_cb (GSimpleAction *action,
 
        /* Set the signals handlers. */
 
-       g_signal_connect (G_OBJECT (aod_data->dialog),
+       g_signal_connect (GTK_DIALOG (aod_data->dialog),
                          "destroy",
                          G_CALLBACK (aod_destroy_cb),
                          aod_data);
-       g_signal_connect (G_OBJECT (aod_data->aod_treeview),
+       g_signal_connect (GTK_TREE_VIEW (aod_data->aod_treeview),
                          "row_activated",
                          G_CALLBACK (aod_activated_cb),
                          aod_data);
-       g_signal_connect_swapped (G_OBJECT (cancel_button),
+       g_signal_connect_swapped (GTK_BUTTON (cancel_button),
                                  "clicked",
                                  G_CALLBACK (gtk_widget_destroy),
-                                 G_OBJECT (aod_data->dialog));
-       g_signal_connect (G_OBJECT (ok_button),
+                                 aod_data->dialog);
+       g_signal_connect (GTK_BUTTON (ok_button),
                          "clicked",
                          G_CALLBACK (aod_apply_cb),
                          aod_data);
-       g_signal_connect (G_OBJECT (remove_button),
+       g_signal_connect (GTK_BUTTON (remove_button),
                          "clicked",
                          G_CALLBACK (aod_remove_cb),
                          aod_data);
diff --git a/src/dlg-ask-password.c b/src/dlg-ask-password.c
index 551fd779..b7dd5864 100644
--- a/src/dlg-ask-password.c
+++ b/src/dlg-ask-password.c
@@ -166,11 +166,11 @@ dlg_ask_password__common (FrWindow       *window,
 
        /* Set the signals handlers. */
 
-       g_signal_connect (G_OBJECT (data->dialog),
+       g_signal_connect (GTK_DIALOG (data->dialog),
                          "destroy",
                          G_CALLBACK (destroy_cb),
                          data);
-       g_signal_connect (G_OBJECT (data->dialog),
+       g_signal_connect (GTK_DIALOG (data->dialog),
                          "response",
                          G_CALLBACK (ask_password__response_cb),
                          data);
diff --git a/src/dlg-batch-add.c b/src/dlg-batch-add.c
index e4095bd4..6eb37c82 100644
--- a/src/dlg-batch-add.c
+++ b/src/dlg-batch-add.c
@@ -93,7 +93,7 @@ dlg_batch_add_files (FrWindow *window,
                                            NULL);
        fr_new_archive_dialog_set_files_to_add (FR_NEW_ARCHIVE_DIALOG (dialog), file_list);
 
-       g_signal_connect (dialog,
+       g_signal_connect (GTK_DIALOG (dialog),
                          "response",
                          G_CALLBACK (dialog_response_cb),
                          window);
diff --git a/src/dlg-delete.c b/src/dlg-delete.c
index f39c29b1..5be71b25 100644
--- a/src/dlg-delete.c
+++ b/src/dlg-delete.c
@@ -160,23 +160,23 @@ dlg_delete__common (FrWindow *window,
 
        /* Set the signals handlers. */
 
-       g_signal_connect (G_OBJECT (data->dialog),
+       g_signal_connect (GTK_DIALOG (data->dialog),
                          "destroy",
                          G_CALLBACK (destroy_cb),
                          data);
-       g_signal_connect (G_OBJECT (data->dialog),
+       g_signal_connect (GTK_DIALOG (data->dialog),
                          "response",
                          G_CALLBACK (response_cb),
                          data);
-//     g_signal_connect_swapped (G_OBJECT (cancel_button),
+//     g_signal_connect_swapped (GTK_BUTTON (cancel_button),
 //                               "clicked",
 //                               G_CALLBACK (gtk_widget_destroy),
 //                               G_OBJECT (data->dialog));
-//     g_signal_connect (G_OBJECT (ok_button),
+//     g_signal_connect (GTK_BUTTON (ok_button),
 //                       "clicked",
 //                       G_CALLBACK (ok_clicked_cb),
 //                       data);
-       g_signal_connect (G_OBJECT (data->d_files_entry),
+       g_signal_connect (GTK_ENTRY (data->d_files_entry),
                          "changed",
                          G_CALLBACK (entry_changed_cb),
                          data);
diff --git a/src/dlg-extract.c b/src/dlg-extract.c
index ef643f86..a410a259 100644
--- a/src/dlg-extract.c
+++ b/src/dlg-extract.c
@@ -63,11 +63,11 @@ file_selector_destroy_cb (GtkWidget  *widget,
        g_free (data);
 }
 
-static void extract_cb_possibly_try_to_create_destination_directory (GtkWidget *w, DialogData *data);
-static void extract_cb_check_whether_preparing_destination_failed (GtkWidget *w, DialogData *data);
-static void extract_cb_check_permissions (GtkWidget *w, DialogData *data);
-static void extract_cb_start_extracting (GtkWidget *w, DialogData *data);
-static void create_destination_response_cb (GtkWidget *widget, int response, DialogData *data);
+static void extract_cb_possibly_try_to_create_destination_directory (DialogData *data);
+static void extract_cb_check_whether_preparing_destination_failed (DialogData *data);
+static void extract_cb_check_permissions (DialogData *data);
+static void extract_cb_start_extracting (DialogData *data);
+static void create_destination_response_cb (GtkDialog *dialog, int response, DialogData *data);
 
 static void
 extract_cb (GtkWidget   *w,
@@ -99,35 +99,34 @@ extract_cb (GtkWidget   *w,
                                                     NULL);
 
                        gtk_dialog_set_default_response (GTK_DIALOG (d), GTK_RESPONSE_YES);
-                       g_signal_connect (d, "response", G_CALLBACK (create_destination_response_cb), data);
+                       g_signal_connect (GTK_MESSAGE_DIALOG (d), "response", G_CALLBACK 
(create_destination_response_cb), data);
                        gtk_widget_show (d);
                } else {
-                       extract_cb_possibly_try_to_create_destination_directory (w, data);
+                       extract_cb_possibly_try_to_create_destination_directory (data);
                }
        } else {
-               extract_cb_check_whether_preparing_destination_failed (w, data);
+               extract_cb_check_whether_preparing_destination_failed (data);
        }
 }
 
 
 static void
-create_destination_response_cb (GtkWidget    *widget,
+create_destination_response_cb (GtkDialog    *dialog,
                      int           response,
                      DialogData   *data)
 {
-       gtk_widget_destroy (GTK_WIDGET (widget));
+       gtk_widget_destroy (GTK_WIDGET (dialog));
 
        if (response != GTK_RESPONSE_YES) {
                data->do_not_extract = TRUE;
        }
 
-       extract_cb_possibly_try_to_create_destination_directory (widget, data);
+       extract_cb_possibly_try_to_create_destination_directory (data);
 }
 
 
 static void
-extract_cb_possibly_try_to_create_destination_directory (GtkWidget   *w,
-           DialogData  *data)
+extract_cb_possibly_try_to_create_destination_directory (DialogData  *data)
 {
        g_autofree GError *error = NULL;
        if (! data->do_not_extract && ! _g_file_make_directory_tree (data->destination, 0755, &error)) {
@@ -139,10 +138,10 @@ extract_cb_possibly_try_to_create_destination_directory (GtkWidget   *w,
                                           _("Extraction not performed"),
                                           _("Could not create the destination folder: %s."),
                                           error->message);
-               g_signal_connect (d, "response", G_CALLBACK (gtk_widget_destroy), NULL);
+               g_signal_connect (GTK_MESSAGE_DIALOG (d), "response", G_CALLBACK (gtk_widget_destroy), NULL);
                gtk_widget_show (d);
        } else {
-               extract_cb_check_whether_preparing_destination_failed (w, data);
+               extract_cb_check_whether_preparing_destination_failed (data);
        }
 }
 
@@ -161,8 +160,7 @@ extraction_not_performed_cb (GtkWidget    *widget,
 
 
 static void
-extract_cb_check_whether_preparing_destination_failed (GtkWidget   *w,
-           DialogData  *data)
+extract_cb_check_whether_preparing_destination_failed (DialogData  *data)
 {
        if (data->do_not_extract) {
                GtkWidget *d;
@@ -174,17 +172,16 @@ extract_cb_check_whether_preparing_destination_failed (GtkWidget   *w,
                                             _GTK_LABEL_CLOSE, GTK_RESPONSE_OK,
                                             NULL);
                gtk_dialog_set_default_response (GTK_DIALOG (d), GTK_RESPONSE_OK);
-               g_signal_connect (d, "response", G_CALLBACK (extraction_not_performed_cb), data);
+               g_signal_connect (GTK_MESSAGE_DIALOG (d), "response", G_CALLBACK 
(extraction_not_performed_cb), data);
                gtk_widget_show (d);
        } else {
-               extract_cb_check_permissions (w, data);
+               extract_cb_check_permissions (data);
        }
 }
 
 
 static void
-extract_cb_check_permissions (GtkWidget   *w,
-           DialogData  *data)
+extract_cb_check_permissions (DialogData  *data)
 {
        /* check extraction directory permissions. */
 
@@ -202,17 +199,16 @@ extract_cb_check_permissions (GtkWidget   *w,
                                           _("Extraction not performed"),
                                           _("You don’t have the right permissions to extract archives in the 
folder “%s”"),
                                           utf8_path);
-               g_signal_connect (d, "response", G_CALLBACK (gtk_widget_destroy), NULL);
+               g_signal_connect (GTK_MESSAGE_DIALOG (d), "response", G_CALLBACK (gtk_widget_destroy), NULL);
                gtk_widget_show (d);
        } else {
-               extract_cb_start_extracting (w, data);
+               extract_cb_start_extracting (data);
        }
 }
 
 
 static void
-extract_cb_start_extracting (GtkWidget   *w,
-           DialogData  *data)
+extract_cb_start_extracting (DialogData  *data)
 {
        FrWindow   *window = data->window;
        GFile      *destination = data->destination;
@@ -352,15 +348,15 @@ dlg_extract__common (FrWindow *window,
 
        /* Set the signals handlers. */
 
-       g_signal_connect (G_OBJECT (data->dialog),
+       g_signal_connect (GTK_DIALOG (data->dialog),
                          "destroy",
                          G_CALLBACK (file_selector_destroy_cb),
                          data);
-       g_signal_connect (G_OBJECT (data->dialog),
+       g_signal_connect (GTK_DIALOG (data->dialog),
                          "response",
                          G_CALLBACK (file_selector_response_cb),
                          data);
-       g_signal_connect (G_OBJECT (GET_WIDGET ("file_pattern_entry")),
+       g_signal_connect (GTK_ENTRY (GET_WIDGET("file_pattern_entry")),
                          "changed",
                          G_CALLBACK (files_entry_changed_cb),
                          data);
diff --git a/src/dlg-open-with.c b/src/dlg-open-with.c
index b797c61d..7000bb57 100644
--- a/src/dlg-open-with.c
+++ b/src/dlg-open-with.c
@@ -81,7 +81,7 @@ dlg_open_with (FrWindow *window,
        app_chooser = gtk_app_chooser_dialog_new (GTK_WINDOW (window),
                                                  GTK_DIALOG_MODAL,
                                                  G_FILE (file_list->data));
-       g_signal_connect (app_chooser,
+       g_signal_connect (GTK_APP_CHOOSER_DIALOG (app_chooser),
                          "response",
                          G_CALLBACK (app_chooser_response_cb),
                          o_data);
diff --git a/src/dlg-package-installer.c b/src/dlg-package-installer.c
index 97004933..dd1e23b2 100644
--- a/src/dlg-package-installer.c
+++ b/src/dlg-package-installer.c
@@ -317,7 +317,7 @@ file_buffer_ready_cb (GObject      *source_object,
                                                  _GTK_LABEL_CANCEL, GTK_RESPONSE_NO,
                                                  _("_Search Command"), GTK_RESPONSE_YES,
                                                  NULL);
-               g_signal_connect (dialog, "response", G_CALLBACK (confirm_search_dialog_response_cb), idata);
+               g_signal_connect (GTK_MESSAGE_DIALOG (dialog), "response", G_CALLBACK 
(confirm_search_dialog_response_cb), idata);
                gtk_widget_show (dialog);
 
                g_free (secondary_text);
diff --git a/src/dlg-password.c b/src/dlg-password.c
index cc5898ec..43fb4851 100644
--- a/src/dlg-password.c
+++ b/src/dlg-password.c
@@ -125,11 +125,11 @@ dlg_password (GtkWidget *widget,
 
        /* Set the signals handlers. */
 
-       g_signal_connect ((data->dialog),
+       g_signal_connect (GTK_DIALOG (data->dialog),
                          "destroy",
                          G_CALLBACK (destroy_cb),
                          data);
-       g_signal_connect ((data->dialog),
+       g_signal_connect (GTK_DIALOG (data->dialog),
                          "response",
                          G_CALLBACK (response_cb),
                          data);
diff --git a/src/dlg-prop.c b/src/dlg-prop.c
index a1702818..60483fe3 100644
--- a/src/dlg-prop.c
+++ b/src/dlg-prop.c
@@ -168,7 +168,7 @@ dlg_prop (FrWindow *window)
 
        /* Set the signals handlers. */
 
-       g_signal_connect (G_OBJECT (data->dialog),
+       g_signal_connect (data->dialog,
                          "destroy",
                          G_CALLBACK (destroy_cb),
                          data);
diff --git a/src/dlg-update.c b/src/dlg-update.c
index c1f5ad14..eec2e1bf 100644
--- a/src/dlg-update.c
+++ b/src/dlg-update.c
@@ -337,19 +337,19 @@ dlg_update (FrWindow *window)
 
        /* Set the signals handlers. */
 
-       g_signal_connect (G_OBJECT (data->update_file_dialog),
+       g_signal_connect (GTK_DIALOG (data->update_file_dialog),
                          "destroy",
                          G_CALLBACK (update_dialog_destroy),
                          data);
-       g_signal_connect (G_OBJECT (data->update_file_dialog),
+       g_signal_connect (GTK_DIALOG (data->update_file_dialog),
                          "response",
                          G_CALLBACK (update_dialog_response),
                          data);
-       g_signal_connect (G_OBJECT (data->update_files_dialog),
+       g_signal_connect (GTK_DIALOG (data->update_files_dialog),
                          "destroy",
                          G_CALLBACK (update_dialog_destroy),
                          data);
-       g_signal_connect (G_OBJECT (data->update_files_dialog),
+       g_signal_connect (GTK_DIALOG (data->update_files_dialog),
                          "response",
                          G_CALLBACK (update_dialog_response),
                          data);
@@ -370,7 +370,7 @@ dlg_update (FrWindow *window)
        column = gtk_tree_view_column_new ();
 
        renderer = gtk_cell_renderer_toggle_new ();
-        g_signal_connect (G_OBJECT (renderer),
+        g_signal_connect (GTK_CELL_RENDERER_TOGGLE (renderer),
                           "toggled",
                           G_CALLBACK (is_selected_toggled),
                           data);
diff --git a/src/eggtreemultidnd.c b/src/eggtreemultidnd.c
index 7f3cd9d6..3c43cb2c 100644
--- a/src/eggtreemultidnd.c
+++ b/src/eggtreemultidnd.c
@@ -504,7 +504,7 @@ egg_tree_multi_drag_button_press_event (GtkWidget      *widget,
       if (priv_data->motion_notify_handler == 0)
         {
           priv_data->motion_notify_handler =
-           g_signal_connect (G_OBJECT (tree_view),
+           g_signal_connect (tree_view,
                              "motion_notify_event",
                              G_CALLBACK (egg_tree_multi_drag_motion_event),
                              NULL);
@@ -513,7 +513,7 @@ egg_tree_multi_drag_button_press_event (GtkWidget      *widget,
       if (priv_data->drag_data_get_handler == 0)
        {
          priv_data->drag_data_get_handler =
-           g_signal_connect (G_OBJECT (tree_view),
+           g_signal_connect (tree_view,
                              "drag_data_get",
                              G_CALLBACK (egg_tree_multi_drag_drag_data_get),
                              NULL);
@@ -534,11 +534,11 @@ void
 egg_tree_multi_drag_add_drag_support (GtkTreeView *tree_view)
 {
   g_return_if_fail (GTK_IS_TREE_VIEW (tree_view));
-  g_signal_connect (G_OBJECT (tree_view),
+  g_signal_connect (tree_view,
                    "button_press_event",
                    G_CALLBACK (egg_tree_multi_drag_button_press_event),
                    NULL);
-  g_signal_connect (G_OBJECT (tree_view),
+  g_signal_connect (tree_view,
                    "button_release_event",
                    G_CALLBACK (egg_tree_multi_drag_button_release_event),
                    NULL);
diff --git a/src/fr-application.c b/src/fr-application.c
index 7b4cd95a..39b8ff44 100644
--- a/src/fr-application.c
+++ b/src/fr-application.c
@@ -220,8 +220,8 @@ handle_method_call (GDBusConnection       *connection,
                window = fr_window_new ();
                fr_window_use_progress_dialog (FR_WINDOW (window), use_progress_dialog);
 
-               g_signal_connect (window, "progress", G_CALLBACK (window_progress_cb), connection);
-               g_signal_connect (window, "ready", G_CALLBACK (window_ready_cb), invocation);
+               g_signal_connect (FR_WINDOW (window), "progress", G_CALLBACK (window_progress_cb), 
connection);
+               g_signal_connect (FR_WINDOW (window), "ready", G_CALLBACK (window_ready_cb), invocation);
 
                fr_window_batch_new (FR_WINDOW (window), _("Compress"));
                fr_window_batch__add_files (FR_WINDOW (window), file, file_list);
@@ -256,8 +256,8 @@ handle_method_call (GDBusConnection       *connection,
                fr_window_use_progress_dialog (FR_WINDOW (window), use_progress_dialog);
                fr_window_set_default_dir (FR_WINDOW (window), destination, TRUE);
 
-               g_signal_connect (window, "progress", G_CALLBACK (window_progress_cb), connection);
-               g_signal_connect (window, "ready", G_CALLBACK (window_ready_cb), invocation);
+               g_signal_connect (FR_WINDOW (window), "progress", G_CALLBACK (window_progress_cb), 
connection);
+               g_signal_connect (FR_WINDOW (window), "ready", G_CALLBACK (window_ready_cb), invocation);
 
                fr_window_batch_new (FR_WINDOW (window), _("Compress"));
                fr_window_batch__add_files (FR_WINDOW (window), NULL, file_list);
@@ -292,8 +292,8 @@ handle_method_call (GDBusConnection       *connection,
                        g_object_unref (file);
                }
 
-               g_signal_connect (window, "progress", G_CALLBACK (window_progress_cb), connection);
-               g_signal_connect (window, "ready", G_CALLBACK (window_ready_cb), invocation);
+               g_signal_connect (FR_WINDOW (window), "progress", G_CALLBACK (window_progress_cb), 
connection);
+               g_signal_connect (FR_WINDOW (window), "ready", G_CALLBACK (window_ready_cb), invocation);
 
                fr_window_batch_new (FR_WINDOW (window), C_("Window title", "Extract archive"));
                fr_window_batch__extract (FR_WINDOW (window), archive, destination, use_progress_dialog);
@@ -318,8 +318,8 @@ handle_method_call (GDBusConnection       *connection,
                window = fr_window_new ();
                fr_window_use_progress_dialog (FR_WINDOW (window), use_progress_dialog);
 
-               g_signal_connect (window, "progress", G_CALLBACK (window_progress_cb), connection);
-               g_signal_connect (window, "ready", G_CALLBACK (window_ready_cb), invocation);
+               g_signal_connect (FR_WINDOW (window), "progress", G_CALLBACK (window_progress_cb), 
connection);
+               g_signal_connect (FR_WINDOW (window), "ready", G_CALLBACK (window_ready_cb), invocation);
 
                fr_window_batch_new (FR_WINDOW (window), C_("Window title", "Extract archive"));
                fr_window_batch__extract_here (FR_WINDOW (window), archive, use_progress_dialog);
diff --git a/src/fr-command.c b/src/fr-command.c
index 33783e57..1a271554 100644
--- a/src/fr-command.c
+++ b/src/fr-command.c
@@ -415,7 +415,7 @@ _fr_command_set_process (FrCommand *self,
                return;
 
        self->process = g_object_ref (process);
-       g_signal_connect (G_OBJECT (self->process),
+       g_signal_connect (FR_PROCESS (self->process),
                          "sticky_only",
                          G_CALLBACK (process_sticky_only_cb),
                          self);
diff --git a/src/fr-file-selector-dialog.c b/src/fr-file-selector-dialog.c
index fdfe8043..2e88f010 100644
--- a/src/fr-file-selector-dialog.c
+++ b/src/fr-file-selector-dialog.c
@@ -695,23 +695,23 @@ fr_file_selector_dialog_init (FrFileSelectorDialog *self)
        gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (GET_WIDGET ("files_liststore")), 
FILE_LIST_COLUMN_MODIFIED, files_modified_column_sort_func, self, NULL);
        gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (GET_WIDGET ("files_liststore")), 
FILE_LIST_COLUMN_NAME, GTK_SORT_ASCENDING);
 
-       g_signal_connect (GET_WIDGET ("is_selected_cellrenderertoggle"),
+       g_signal_connect (GTK_CELL_RENDERER_TOGGLE (GET_WIDGET ("is_selected_cellrenderertoggle")),
                          "toggled",
                          G_CALLBACK (is_selected_cellrenderertoggle_toggled_cb),
                          self);
-       g_signal_connect (GET_WIDGET ("files_treeview"),
+       g_signal_connect (GTK_TREE_VIEW (GET_WIDGET ("files_treeview")),
                          "row-activated",
                          G_CALLBACK (files_treeview_row_activated_cb),
                          self);
-       g_signal_connect (GET_WIDGET ("go_up_button"),
+       g_signal_connect (GTK_BUTTON (GET_WIDGET ("go_up_button")),
                          "clicked",
                          G_CALLBACK (go_up_button_clicked_cb),
                          self);
-       g_signal_connect (GET_WIDGET ("places_sidebar"),
+       g_signal_connect (GTK_PLACES_SIDEBAR (GET_WIDGET ("places_sidebar")),
                          "open-location",
                          G_CALLBACK (places_sidebar_open_location_cb),
                          self);
-       g_signal_connect (GET_WIDGET ("files_treeview"),
+       g_signal_connect (GTK_TREE_VIEW (GET_WIDGET ("files_treeview")),
                          "button-press-event",
                          G_CALLBACK (files_treeview_button_press_event_cb),
                          self);
diff --git a/src/fr-new-archive-dialog.c b/src/fr-new-archive-dialog.c
index a2139c86..7b23d89c 100644
--- a/src/fr-new-archive-dialog.c
+++ b/src/fr-new-archive-dialog.c
@@ -280,19 +280,19 @@ _fr_new_archive_dialog_construct (FrNewArchiveDialog *self,
 
        /* Set the signals handlers. */
 
-       g_signal_connect (GET_WIDGET ("filename_entry"),
+       g_signal_connect (GTK_ENTRY (GET_WIDGET ("filename_entry")),
                          "changed",
                          G_CALLBACK (entry_changed_cb),
                          self);
-       g_signal_connect (GET_WIDGET ("password_entry"),
+       g_signal_connect (GTK_ENTRY (GET_WIDGET ("password_entry")),
                          "changed",
                          G_CALLBACK (entry_changed_cb),
                          self);
-       g_signal_connect (GET_WIDGET ("volume_checkbutton"),
+       g_signal_connect (GTK_CHECK_BUTTON (GET_WIDGET ("volume_checkbutton")),
                          "toggled",
                          G_CALLBACK (volume_toggled_cb),
                          self);
-       g_signal_connect (GET_WIDGET ("extension_comboboxtext"),
+       g_signal_connect (GTK_COMBO_BOX_TEXT (GET_WIDGET ("extension_comboboxtext")),
                          "changed",
                          G_CALLBACK (extension_comboboxtext_changed_cb),
                          self);
diff --git a/src/fr-window-actions-callbacks.c b/src/fr-window-actions-callbacks.c
index a5319d8a..62b1a8fc 100644
--- a/src/fr-window-actions-callbacks.c
+++ b/src/fr-window-actions-callbacks.c
@@ -266,7 +266,7 @@ open_file_response_cb (GtkWidget *w,
 
        if (fr_window_archive_is_present (window))
                window = (FrWindow *) fr_window_new ();
-       g_signal_connect (G_OBJECT (window),
+       g_signal_connect (FR_WINDOW (window),
                          "archive_loaded",
                          G_CALLBACK (window_archive_loaded_cb),
                          file_sel);
@@ -314,7 +314,7 @@ fr_window_activate_open (GSimpleAction *action,
 
        g_object_set_data (G_OBJECT (file_sel), "fr_window", window);
 
-       g_signal_connect (G_OBJECT (file_sel),
+       g_signal_connect (GTK_FILE_CHOOSER_DIALOG (file_sel),
                          "response",
                          G_CALLBACK (open_file_response_cb),
                          file_sel);
diff --git a/src/fr-window.c b/src/fr-window.c
index 7bf83a51..dcd1edb1 100644
--- a/src/fr-window.c
+++ b/src/fr-window.c
@@ -627,7 +627,7 @@ fr_window_set_dialog (FrWindow   *window,
 {
        g_object_set_data (G_OBJECT (dialog), DIALOG_NAME_KEY, (gpointer) _g_str_get_static (dialog_name));
        g_hash_table_insert (window->priv->named_dialogs, (gpointer) dialog_name, dialog);
-       g_signal_connect (dialog,
+       g_signal_connect (GTK_DIALOG (dialog),
                          "destroy",
                          G_CALLBACK (unset_dialog),
                          window);
@@ -2590,11 +2590,11 @@ create_the_progress_dialog (FrWindow *window)
 
        /* signals */
 
-       g_signal_connect (G_OBJECT (window->priv->progress_dialog),
+       g_signal_connect (GTK_DIALOG (window->priv->progress_dialog),
                          "response",
                          G_CALLBACK (progress_dialog_response),
                          window);
-       g_signal_connect (G_OBJECT (window->priv->progress_dialog),
+       g_signal_connect (GTK_DIALOG (window->priv->progress_dialog),
                          "delete_event",
                          G_CALLBACK (progress_dialog_delete_event),
                          window);
@@ -2779,11 +2779,11 @@ fr_window_show_confirmation_dialog (FrWindow  *window,
 {
        close_progress_dialog (window, TRUE);
 
-       g_signal_connect (G_OBJECT (dialog),
+       g_signal_connect (GTK_DIALOG (dialog),
                          "response",
                          G_CALLBACK (confirmation_dialog_response),
                          window);
-       g_signal_connect (G_OBJECT (dialog),
+       g_signal_connect (GTK_DIALOG (dialog),
                          "delete_event",
                          G_CALLBACK (confirmation_dialog_delete_event),
                          window);
@@ -2930,7 +2930,7 @@ fr_window_show_error_dialog (FrWindow   *window,
        if (window->priv->batch_mode)
                fr_window_destroy_with_error_dialog (window);
 
-       g_signal_connect (dialog,
+       g_signal_connect (GTK_DIALOG (dialog),
                          "response",
                          G_CALLBACK (error_dialog_response_cb),
                          window);
@@ -4295,7 +4295,7 @@ fr_window_drag_data_received  (GtkWidget          *widget,
                                                                    archive_name,
                                                                    NULL);
                                gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
-                               g_signal_connect (G_OBJECT (dialog),
+                               g_signal_connect (GTK_DIALOG (dialog),
                                                  "response",
                                                  G_CALLBACK (new_archive_dialog_response_cb),
                                                  window);
@@ -5518,12 +5518,12 @@ fr_window_construct (FrWindow *window)
 
        gtk_window_set_title (GTK_WINDOW (window), _("Archive Manager"));
 
-       g_signal_connect (G_OBJECT (window),
+       g_signal_connect (window,
                          "delete_event",
                          G_CALLBACK (fr_window_delete_event_cb),
                          window);
 
-       g_signal_connect (G_OBJECT (window),
+       g_signal_connect (window,
                          "show",
                          G_CALLBACK (fr_window_show_cb),
                          window);
@@ -5538,7 +5538,7 @@ fr_window_construct (FrWindow *window)
                                     g_settings_get_int (window->priv->settings_ui, PREF_UI_WINDOW_WIDTH),
                                     g_settings_get_int (window->priv->settings_ui, PREF_UI_WINDOW_HEIGHT));
 
-       g_signal_connect (G_OBJECT (window),
+       g_signal_connect (window,
                          "key_press_event",
                          G_CALLBACK (key_press_cb),
                          window);
@@ -5642,31 +5642,31 @@ fr_window_construct (FrWindow *window)
                          "changed",
                          G_CALLBACK (selection_changed_cb),
                          window);
-       g_signal_connect (G_OBJECT (window->priv->list_view),
+       g_signal_connect (GTK_TREE_VIEW (window->priv->list_view),
                          "row_activated",
                          G_CALLBACK (row_activated_cb),
                          window);
-       g_signal_connect (G_OBJECT (window->priv->list_view),
+       g_signal_connect (GTK_TREE_VIEW (window->priv->list_view),
                          "button_press_event",
                          G_CALLBACK (file_button_press_cb),
                          window);
-       g_signal_connect (G_OBJECT (window->priv->list_view),
+       g_signal_connect (GTK_TREE_VIEW (window->priv->list_view),
                          "button_release_event",
                          G_CALLBACK (file_button_release_cb),
                          window);
-       g_signal_connect (G_OBJECT (window->priv->list_view),
+       g_signal_connect (GTK_TREE_VIEW (window->priv->list_view),
                          "motion_notify_event",
                          G_CALLBACK (file_motion_notify_callback),
                          window);
-       g_signal_connect (G_OBJECT (window->priv->list_view),
+       g_signal_connect (GTK_TREE_VIEW (window->priv->list_view),
                          "leave_notify_event",
                          G_CALLBACK (file_leave_notify_callback),
                          window);
-       g_signal_connect (G_OBJECT (window->priv->list_view),
+       g_signal_connect (GTK_TREE_VIEW (window->priv->list_view),
                          "drag_begin",
                          G_CALLBACK (file_list_drag_begin),
                          window);
-       g_signal_connect (G_OBJECT (window->priv->list_view),
+       g_signal_connect (GTK_TREE_VIEW (window->priv->list_view),
                          "drag_end",
                          G_CALLBACK (file_list_drag_end),
                          window);
@@ -5684,7 +5684,7 @@ fr_window_construct (FrWindow *window)
        filter_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
        window->priv->filter_entry = gtk_search_entry_new ();
        gtk_entry_set_width_chars (GTK_ENTRY (window->priv->filter_entry), 40);
-       g_signal_connect (G_OBJECT (window->priv->filter_entry),
+       g_signal_connect (GTK_SEARCH_ENTRY (window->priv->filter_entry),
                          "search-changed",
                          G_CALLBACK (filter_entry_search_changed_cb),
                          window);
@@ -5705,7 +5705,7 @@ fr_window_construct (FrWindow *window)
        gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (window->priv->tree_view), FALSE);
        add_dir_tree_columns (window, GTK_TREE_VIEW (window->priv->tree_view));
 
-       g_signal_connect (G_OBJECT (window->priv->tree_view),
+       g_signal_connect (GTK_TREE_VIEW (window->priv->tree_view),
                          "button_press_event",
                          G_CALLBACK (dir_tree_button_press_cb),
                          window);
@@ -5716,15 +5716,15 @@ fr_window_construct (FrWindow *window)
                          G_CALLBACK (dir_tree_selection_changed_cb),
                          window);
 
-       g_signal_connect (G_OBJECT (window->priv->tree_view),
+       g_signal_connect (GTK_TREE_VIEW (window->priv->tree_view),
                          "drag_begin",
                          G_CALLBACK (folde_tree_drag_begin),
                          window);
-       g_signal_connect (G_OBJECT (window->priv->tree_view),
+       g_signal_connect (GTK_TREE_VIEW (window->priv->tree_view),
                          "drag_end",
                          G_CALLBACK (file_list_drag_end),
                          window);
-       g_signal_connect (G_OBJECT (window->priv->tree_view),
+       g_signal_connect (GTK_TREE_VIEW (window->priv->tree_view),
                          "drag_data_get",
                          G_CALLBACK (fr_window_folder_tree_drag_data_get),
                          window);
@@ -5755,11 +5755,11 @@ fr_window_construct (FrWindow *window)
                           target_table, G_N_ELEMENTS (target_table),
                           GDK_ACTION_COPY);
 
-       g_signal_connect (G_OBJECT (window->priv->paned),
+       g_signal_connect (GTK_PANED (window->priv->paned),
                          "drag_data_received",
                          G_CALLBACK (fr_window_drag_data_received),
                          window);
-       g_signal_connect (G_OBJECT (window->priv->paned),
+       g_signal_connect (GTK_PANED (window->priv->paned),
                          "drag_motion",
                          G_CALLBACK (fr_window_drag_motion),
                          window);
@@ -5863,7 +5863,7 @@ fr_window_construct (FrWindow *window)
        gtk_entry_set_icon_from_icon_name (GTK_ENTRY (window->priv->location_entry),
                                           GTK_ENTRY_ICON_PRIMARY,
                                           "folder-symbolic");
-       g_signal_connect (G_OBJECT (window->priv->location_entry),
+       g_signal_connect (GTK_ENTRY (window->priv->location_entry),
                          "key_press_event",
                          G_CALLBACK (location_entry_key_press_event_cb),
                          window);
@@ -5962,23 +5962,23 @@ _fr_window_set_archive (FrWindow  *window,
        if (window->archive == NULL)
                return;
 
-       g_signal_connect (G_OBJECT (window->archive),
+       g_signal_connect (window->archive,
                          "progress",
                          G_CALLBACK (fr_archive_progress_cb),
                          window);
-       g_signal_connect (G_OBJECT (window->archive),
+       g_signal_connect (window->archive,
                          "message",
                          G_CALLBACK (fr_archive_message_cb),
                          window);
-       g_signal_connect (G_OBJECT (window->archive),
+       g_signal_connect (window->archive,
                          "start",
                          G_CALLBACK (fr_archive_start_cb),
                          window);
-       g_signal_connect (G_OBJECT (window->archive),
+       g_signal_connect (window->archive,
                          "stoppable",
                          G_CALLBACK (fr_archive_stoppable_cb),
                          window);
-       g_signal_connect (G_OBJECT (window->archive),
+       g_signal_connect (window->archive,
                          "working-archive",
                          G_CALLBACK (fr_window_working_archive_cb),
                          window);
@@ -6735,7 +6735,7 @@ query_info_ready_for_overwrite_dialog_cb (GObject      *source_object,
                                             _("_Replace"), _FR_RESPONSE_OVERWRITE_YES,
                                             NULL);
                gtk_dialog_set_default_response (GTK_DIALOG (d), _FR_RESPONSE_OVERWRITE_YES);
-               g_signal_connect (d,
+               g_signal_connect (GTK_MESSAGE_DIALOG (d),
                                  "response",
                                  G_CALLBACK (overwrite_dialog_response_cb),
                                  odata);
@@ -7435,7 +7435,7 @@ fr_window_action_new_archive (FrWindow *window)
                                            NULL);
        if ((fr_window_archive_is_present (window) && ! fr_window_is_batch_mode (window) ? NULL : GTK_WINDOW 
(window)))
                gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
-       g_signal_connect (G_OBJECT (dialog),
+       g_signal_connect (FR_NEW_ARCHIVE_DIALOG (dialog),
                          "response",
                          G_CALLBACK (new_archive_dialog_response_cb),
                          window);
@@ -7745,7 +7745,7 @@ fr_window_action_save_as (FrWindow *window)
                                            archive_name,
                                            window->priv->archive_file);
        gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
-       g_signal_connect (G_OBJECT (dialog),
+       g_signal_connect (FR_NEW_ARCHIVE_DIALOG (dialog),
                          "response",
                          G_CALLBACK (save_as_archive_dialog_response_cb),
                          window);
@@ -8108,12 +8108,12 @@ fr_window_view_last_output (FrWindow   *window,
 
        /* signals */
 
-       g_signal_connect (G_OBJECT (dialog),
+       g_signal_connect (GTK_DIALOG (dialog),
                          "response",
                          G_CALLBACK (gtk_widget_destroy),
                          NULL);
 
-       g_signal_connect (G_OBJECT (dialog),
+       g_signal_connect (GTK_DIALOG (dialog),
                          "unrealize",
                          G_CALLBACK (last_output_window__unrealize_cb),
                          NULL);
@@ -8777,23 +8777,23 @@ paste_from_archive_open_cb (GObject      *source_object,
                return;
        }
 
-       g_signal_connect (G_OBJECT (window->priv->copy_from_archive),
+       g_signal_connect (window->priv->copy_from_archive,
                          "progress",
                          G_CALLBACK (fr_archive_progress_cb),
                          window);
-       g_signal_connect (G_OBJECT (window->priv->copy_from_archive),
+       g_signal_connect (window->priv->copy_from_archive,
                          "message",
                          G_CALLBACK (fr_archive_message_cb),
                          window);
-       g_signal_connect (G_OBJECT (window->priv->copy_from_archive),
+       g_signal_connect (window->priv->copy_from_archive,
                          "start",
                          G_CALLBACK (fr_archive_start_cb),
                          window);
-       g_signal_connect (G_OBJECT (window->priv->copy_from_archive),
+       g_signal_connect (window->priv->copy_from_archive,
                          "stoppable",
                          G_CALLBACK (fr_archive_stoppable_cb),
                          window);
-       g_signal_connect (G_OBJECT (window->priv->copy_from_archive),
+       g_signal_connect (window->priv->copy_from_archive,
                          "working-archive",
                          G_CALLBACK (fr_window_working_archive_cb),
                          window);
diff --git a/src/gtk-utils.c b/src/gtk-utils.c
index 9400a055..b1ade2ec 100644
--- a/src/gtk-utils.c
+++ b/src/gtk-utils.c
@@ -296,7 +296,7 @@ _gtk_error_dialog_run (GtkWindow  *parent,
                                      NULL);
        g_free (message);
 
-       g_signal_connect (G_OBJECT (d), "response",
+       g_signal_connect (GTK_MESSAGE_DIALOG (d), "response",
                          G_CALLBACK (gtk_widget_destroy),
                          NULL);
 
@@ -513,7 +513,7 @@ _gtk_show_help_dialog (GtkWindow  *parent,
                                                  NULL);
                gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
 
-               g_signal_connect (G_OBJECT (dialog), "response",
+               g_signal_connect (GTK_MESSAGE_DIALOG (dialog), "response",
                                  G_CALLBACK (gtk_widget_destroy),
                                  NULL);
 
@@ -604,7 +604,7 @@ _gtk_entry_use_as_password_entry (GtkEntry *entry)
        gtk_entry_set_icon_activatable (entry, GTK_ENTRY_ICON_SECONDARY, TRUE);
        gtk_entry_set_icon_tooltip_text (entry, GTK_ENTRY_ICON_SECONDARY, _("Change password visibility"));
 
-       g_signal_connect (entry,
+       g_signal_connect (GTK_ENTRY (entry),
                          "icon-press",
                          G_CALLBACK (password_entry_icon_press_cb),
                          NULL);


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