diff options
author | rbuj <[email protected]> | 2021-10-27 13:12:46 +0200 |
---|---|---|
committer | Luke from DC <[email protected]> | 2022-01-21 02:50:58 +0000 |
commit | 26cd61275d4b626ea663abfeb2d4a6befd1e8b1f (patch) | |
tree | 21dac68a9a459030d573d3a107ee794d36a6010c /gsearchtool | |
parent | b798b5bf8cea1fd33abb62dfc45346f74e0515b1 (diff) | |
download | mate-utils-26cd61275d4b626ea663abfeb2d4a6befd1e8b1f.tar.bz2 mate-utils-26cd61275d4b626ea663abfeb2d4a6befd1e8b1f.tar.xz |
Unnecessary G_OBJECT cast when calling signal connect function
Diffstat (limited to 'gsearchtool')
-rw-r--r-- | gsearchtool/src/gsearchtool-callbacks.c | 65 | ||||
-rw-r--r-- | gsearchtool/src/gsearchtool.c | 137 |
2 files changed, 98 insertions, 104 deletions
diff --git a/gsearchtool/src/gsearchtool-callbacks.c b/gsearchtool/src/gsearchtool-callbacks.c index 35ee55bc..b43429bb 100644 --- a/gsearchtool/src/gsearchtool-callbacks.c +++ b/gsearchtool/src/gsearchtool-callbacks.c @@ -197,9 +197,9 @@ click_help_cb (GtkWidget * widget, gtk_container_set_border_width (GTK_CONTAINER (dialog), 5); gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 14); - g_signal_connect (G_OBJECT (dialog), - "response", - G_CALLBACK (gtk_widget_destroy), NULL); + g_signal_connect (dialog, "response", + G_CALLBACK (gtk_widget_destroy), + NULL); gtk_widget_show (dialog); g_error_free (error); @@ -403,9 +403,9 @@ display_dialog_could_not_open_file (GtkWidget * window, gtk_container_set_border_width (GTK_CONTAINER (dialog), 5); gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 14); - g_signal_connect (G_OBJECT (dialog), - "response", - G_CALLBACK (gtk_widget_destroy), NULL); + g_signal_connect (dialog, "response", + G_CALLBACK (gtk_widget_destroy), + NULL); gtk_widget_show (dialog); g_free (primary); @@ -432,9 +432,9 @@ display_dialog_could_not_open_folder (GtkWidget * window, gtk_container_set_border_width (GTK_CONTAINER (dialog), 5); gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 14); - g_signal_connect (G_OBJECT (dialog), - "response", - G_CALLBACK (gtk_widget_destroy), NULL); + g_signal_connect (dialog, "response", + G_CALLBACK (gtk_widget_destroy), + NULL); gtk_widget_show (dialog); g_free (primary); @@ -735,9 +735,9 @@ display_dialog_could_not_move_to_trash (GtkWidget * window, gtk_container_set_border_width (GTK_CONTAINER (dialog), 5); gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 14); - g_signal_connect (G_OBJECT (dialog), - "response", - G_CALLBACK (gtk_widget_destroy), NULL); + g_signal_connect (dialog, "response", + G_CALLBACK (gtk_widget_destroy), + NULL); gtk_widget_show (dialog); g_free (primary); } @@ -813,9 +813,9 @@ display_dialog_could_not_delete (GtkWidget * window, gtk_container_set_border_width (GTK_CONTAINER (dialog), 5); gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 14); - g_signal_connect (G_OBJECT (dialog), - "response", - G_CALLBACK (gtk_widget_destroy), NULL); + g_signal_connect (dialog, "response", + G_CALLBACK (gtk_widget_destroy), + NULL); gtk_widget_show (dialog); g_free (primary); } @@ -1143,8 +1143,7 @@ build_popup_menu_for_file (GSearchWindow * gsearch, gtk_container_add (GTK_CONTAINER (gsearch->search_results_popup_menu), new1); gtk_widget_show (new1); - g_signal_connect (G_OBJECT (new1), - "activate", + g_signal_connect (new1, "activate", G_CALLBACK (open_file_cb), (gpointer) gsearch); } @@ -1169,8 +1168,7 @@ build_popup_menu_for_file (GSearchWindow * gsearch, gtk_container_add (GTK_CONTAINER (gsearch->search_results_popup_menu), new1); gtk_widget_show (new1); - g_signal_connect (G_OBJECT (new1), - "activate", + g_signal_connect (new1, "activate", G_CALLBACK (open_file_cb), (gpointer) gsearch); } @@ -1257,7 +1255,8 @@ build_popup_menu_for_file (GSearchWindow * gsearch, on the parent menu item. Since submenus in gtk+ are automatically displayed when the user hovers over them, most will never click on the parent menu item. The work-around is to connect to "button-press-event". */ - g_signal_connect (G_OBJECT(new1), "button-press-event", G_CALLBACK (open_file_event_cb), + g_signal_connect (new1, "button-press-event", + G_CALLBACK (open_file_event_cb), (gpointer) gsearch); } else { @@ -1299,8 +1298,7 @@ build_popup_menu_for_file (GSearchWindow * gsearch, gtk_container_add (GTK_CONTAINER (gsearch->search_results_popup_menu), new1); gtk_widget_show (new1); - g_signal_connect (G_OBJECT (new1), - "activate", + g_signal_connect (new1, "activate", G_CALLBACK (open_folder_cb), (gpointer) gsearch); @@ -1310,8 +1308,7 @@ build_popup_menu_for_file (GSearchWindow * gsearch, gtk_container_add (GTK_CONTAINER (gsearch->search_results_popup_menu), new1); gtk_widget_show (new1); - g_signal_connect (G_OBJECT (new1), - "activate", + g_signal_connect (new1, "activate", G_CALLBACK (copy_path_cb), (gpointer) gsearch); } @@ -1330,8 +1327,7 @@ build_popup_menu_for_file (GSearchWindow * gsearch, gtk_container_add (GTK_CONTAINER (gsearch->search_results_popup_menu), new1); gtk_widget_show (new1); - g_signal_connect (G_OBJECT (new1), - "activate", + g_signal_connect (new1, "activate", G_CALLBACK (move_to_trash_cb), (gpointer) gsearch); @@ -1348,8 +1344,7 @@ build_popup_menu_for_file (GSearchWindow * gsearch, gtk_widget_set_sensitive (gsearch->search_results_save_results_as_item, FALSE); } - g_signal_connect (G_OBJECT (gsearch->search_results_save_results_as_item), - "activate", + g_signal_connect (gsearch->search_results_save_results_as_item, "activate", G_CALLBACK (show_file_selector_cb), (gpointer) gsearch); } @@ -1730,7 +1725,7 @@ show_file_selector_cb (GtkAction * action, gsearch->save_results_as_default_filename); } - g_signal_connect (G_OBJECT (file_chooser), "response", + g_signal_connect (file_chooser, "response", G_CALLBACK (save_results_cb), gsearch); gtk_window_set_modal (GTK_WINDOW (file_chooser), TRUE); @@ -1761,9 +1756,9 @@ display_dialog_could_not_save_no_name (GtkWidget * window) gtk_container_set_border_width (GTK_CONTAINER (dialog), 5); gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 14); - g_signal_connect (G_OBJECT (dialog), - "response", - G_CALLBACK (gtk_widget_destroy), NULL); + g_signal_connect (dialog, "response", + G_CALLBACK (gtk_widget_destroy), + NULL); gtk_widget_show (dialog); g_free (primary); g_free (secondary); @@ -1793,9 +1788,9 @@ display_dialog_could_not_save_to (GtkWidget * window, gtk_container_set_border_width (GTK_CONTAINER (dialog), 5); gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 14); - g_signal_connect (G_OBJECT (dialog), - "response", - G_CALLBACK (gtk_widget_destroy), NULL); + g_signal_connect (dialog, "response", + G_CALLBACK (gtk_widget_destroy), + NULL); gtk_widget_show (dialog); g_free (primary); } diff --git a/gsearchtool/src/gsearchtool.c b/gsearchtool/src/gsearchtool.c index f3b8ca69..3d6a3669 100644 --- a/gsearchtool/src/gsearchtool.c +++ b/gsearchtool/src/gsearchtool.c @@ -494,9 +494,9 @@ display_dialog_character_set_conversion_error (GtkWidget * window, gtk_container_set_border_width (GTK_CONTAINER (dialog), 5); gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 14); - g_signal_connect (G_OBJECT (dialog), - "response", - G_CALLBACK (gtk_widget_destroy), NULL); + g_signal_connect (dialog, "response", + G_CALLBACK (gtk_widget_destroy), + NULL); gtk_widget_show (dialog); } @@ -1771,9 +1771,9 @@ handle_search_command_stderr_io (GIOChannel * ioc, gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), hbox, FALSE, FALSE, 0); gtk_widget_show_all (hbox); - g_signal_connect (G_OBJECT (dialog), - "response", - G_CALLBACK (gtk_widget_destroy), NULL); + g_signal_connect (dialog, "response", + G_CALLBACK (gtk_widget_destroy), + NULL); gtk_widget_show (dialog); } @@ -1822,9 +1822,9 @@ handle_search_command_stderr_io (GIOChannel * ioc, gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, GTK_RESPONSE_OK); gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK); - g_signal_connect (G_OBJECT (dialog), - "response", - G_CALLBACK (disable_quick_search_cb), (gpointer) gsearch); + g_signal_connect (dialog, "response", + G_CALLBACK (disable_quick_search_cb), + (gpointer) gsearch); gtk_widget_show (dialog); } @@ -2041,11 +2041,12 @@ create_constraint_box (GSearchWindow * gsearch, gtk_label_set_mnemonic_widget (GTK_LABEL (label), GTK_WIDGET (entry)); - g_signal_connect (G_OBJECT (entry), "changed", - G_CALLBACK (constraint_update_info_cb), opt); + g_signal_connect (entry, "changed", + G_CALLBACK (constraint_update_info_cb), + opt); - g_signal_connect (G_OBJECT (entry), "activate", - G_CALLBACK (constraint_activate_cb), + g_signal_connect (entry, "activate", + G_CALLBACK (constraint_activate_cb), (gpointer) gsearch); /* add text field */ @@ -2082,7 +2083,7 @@ create_constraint_box (GSearchWindow * gsearch, list = g_list_append (list, (gpointer) gsearch); list = g_list_append (list, (gpointer) opt); - g_signal_connect (G_OBJECT (button), "clicked", + g_signal_connect (button, "clicked", G_CALLBACK (remove_constraint_cb), (gpointer) list); @@ -2229,8 +2230,9 @@ create_additional_constraint_section (GSearchWindow * gsearch) gsearch->available_options_button_size_group = gtk_size_group_new (GTK_SIZE_GROUP_BOTH); gtk_size_group_add_widget (gsearch->available_options_button_size_group, gsearch->available_options_add_button); - g_signal_connect (G_OBJECT (gsearch->available_options_add_button),"clicked", - G_CALLBACK (add_constraint_cb), (gpointer) gsearch); + g_signal_connect (gsearch->available_options_add_button, "clicked", + G_CALLBACK (add_constraint_cb), + (gpointer) gsearch); if (gsearch->is_window_accessible) { add_atk_namedesc (GTK_WIDGET (gsearch->available_options_add_button), _("Add search option"), @@ -2379,43 +2381,35 @@ create_search_results_section (GSearchWindow * gsearch) GSearchDndTable, GSearchTotalDnds, GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_ASK); - g_signal_connect (G_OBJECT (gsearch->search_results_tree_view), - "drag_data_get", - G_CALLBACK (drag_file_cb), - (gpointer) gsearch); + g_signal_connect (gsearch->search_results_tree_view, "drag_data_get", + G_CALLBACK (drag_file_cb), + (gpointer) gsearch); - g_signal_connect (G_OBJECT (gsearch->search_results_tree_view), - "drag_begin", - G_CALLBACK (drag_begin_file_cb), - (gpointer) gsearch); + g_signal_connect (gsearch->search_results_tree_view, "drag_begin", + G_CALLBACK (drag_begin_file_cb), + (gpointer) gsearch); - g_signal_connect (G_OBJECT (gsearch->search_results_tree_view), - "event_after", - G_CALLBACK (file_event_after_cb), - (gpointer) gsearch); + g_signal_connect (gsearch->search_results_tree_view, "event_after", + G_CALLBACK (file_event_after_cb), + (gpointer) gsearch); - g_signal_connect (G_OBJECT (gsearch->search_results_tree_view), - "button_release_event", - G_CALLBACK (file_button_release_event_cb), - (gpointer) gsearch); + g_signal_connect (gsearch->search_results_tree_view, "button_release_event", + G_CALLBACK (file_button_release_event_cb), + (gpointer) gsearch); - g_signal_connect (G_OBJECT (gsearch->search_results_tree_view), - "button_press_event", - G_CALLBACK (file_button_press_event_cb), - (gpointer) gsearch->search_results_tree_view); + g_signal_connect (gsearch->search_results_tree_view, "button_press_event", + G_CALLBACK (file_button_press_event_cb), + (gpointer) gsearch->search_results_tree_view); - g_signal_connect (G_OBJECT (gsearch->search_results_tree_view), - "key_press_event", + g_signal_connect (gsearch->search_results_tree_view, "key_press_event", G_CALLBACK (file_key_press_event_cb), (gpointer) gsearch); - g_signal_connect (G_OBJECT (gsearch->search_results_tree_view), - "motion_notify_event", + g_signal_connect (gsearch->search_results_tree_view, "motion_notify_event", G_CALLBACK (file_motion_notify_cb), (gpointer) gsearch); - g_signal_connect (G_OBJECT (gsearch->search_results_tree_view), - "leave_notify_event", + g_signal_connect (gsearch->search_results_tree_view, "leave_notify_event", G_CALLBACK (file_leave_notify_cb), (gpointer) gsearch); @@ -2499,8 +2493,7 @@ create_search_results_section (GSearchWindow * gsearch) gsearchtool_set_columns_order (gsearch->search_results_tree_view); - g_signal_connect (G_OBJECT (gsearch->search_results_tree_view), - "columns-changed", + g_signal_connect (gsearch->search_results_tree_view, "columns-changed", G_CALLBACK (columns_changed_cb), (gpointer) gsearch); return vbox; @@ -2784,7 +2777,7 @@ gsearch_app_create (GSearchWindow * gsearch) gsearch->window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gsearch->is_window_maximized = g_settings_get_boolean (gsearch->mate_search_tool_settings, "default-window-maximized"); - g_signal_connect (G_OBJECT (gsearch->window), "size-allocate", + g_signal_connect (gsearch->window, "size-allocate", G_CALLBACK (gsearch_window_size_allocate), gsearch); gsearch->command_details = g_slice_new0 (GSearchCommandDetails); @@ -2835,7 +2828,7 @@ gsearch_app_create (GSearchWindow * gsearch) add_atk_namedesc (gsearch->name_contains_entry, NULL, _("Enter a filename or partial filename with or without wildcards.")); add_atk_namedesc (entry, _("Name contains"), _("Enter a filename or partial filename with or without wildcards.")); } - g_signal_connect (G_OBJECT (gsearch_history_entry_get_entry (GSEARCH_HISTORY_ENTRY (gsearch->name_contains_entry))), "activate", + g_signal_connect (gsearch_history_entry_get_entry (GSEARCH_HISTORY_ENTRY (gsearch->name_contains_entry)), "activate", G_CALLBACK (name_contains_activate_cb), (gpointer) gsearch); @@ -2850,9 +2843,9 @@ gsearch_app_create (GSearchWindow * gsearch) gtk_widget_set_hexpand (gsearch->look_in_folder_button, TRUE); gtk_grid_attach (GTK_GRID (gsearch->name_and_folder_table), gsearch->look_in_folder_button, 1, 1, 1, 1); - g_signal_connect (G_OBJECT (gsearch->look_in_folder_button), "current-folder-changed", + g_signal_connect (gsearch->look_in_folder_button, "current-folder-changed", G_CALLBACK (look_in_folder_changed_cb), - (gpointer) gsearch); + (gpointer) gsearch); if (gsearch->is_window_accessible) { add_atk_namedesc (GTK_WIDGET (gsearch->look_in_folder_button), _("Look in folder"), _("Select the folder or device from which you want to begin the search.")); @@ -2875,8 +2868,9 @@ gsearch_app_create (GSearchWindow * gsearch) gsearch->show_more_options_expander = gtk_expander_new_with_mnemonic (_("Select more _options")); gtk_box_pack_start (GTK_BOX (container), gsearch->show_more_options_expander, FALSE, FALSE, 0); - g_signal_connect (G_OBJECT (gsearch->show_more_options_expander), "notify::expanded", - G_CALLBACK (click_expander_cb), (gpointer) gsearch); + g_signal_connect (gsearch->show_more_options_expander, "notify::expanded", + G_CALLBACK (click_expander_cb), + (gpointer) gsearch); create_additional_constraint_section (gsearch); gtk_box_pack_start (GTK_BOX (container), GTK_WIDGET (gsearch->available_options_vbox), FALSE, FALSE, 0); @@ -2909,8 +2903,9 @@ gsearch_app_create (GSearchWindow * gsearch) gtk_widget_set_can_default (button, TRUE); gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (hbox), button, TRUE); - g_signal_connect (G_OBJECT (button), "clicked", - G_CALLBACK (click_help_cb), (gpointer) gsearch->window); + g_signal_connect (button, "clicked", + G_CALLBACK (click_help_cb), + (gpointer) gsearch->window); if (gsearch->is_window_accessible) { add_atk_namedesc (GTK_WIDGET (button), NULL, _("Click to display the help manual.")); } @@ -2922,8 +2917,9 @@ gsearch_app_create (GSearchWindow * gsearch) NULL)); gtk_widget_set_can_default (button, TRUE); - g_signal_connect (G_OBJECT (button), "clicked", - G_CALLBACK (click_close_cb), (gpointer) gsearch); + g_signal_connect (button, "clicked", + G_CALLBACK (click_close_cb), + (gpointer) gsearch); if (gsearch->is_window_accessible) { add_atk_namedesc (GTK_WIDGET (button), NULL, _("Click to close \"Search for Files\".")); } @@ -2952,12 +2948,15 @@ gsearch_app_create (GSearchWindow * gsearch) gtk_widget_set_sensitive (gsearch->stop_button, FALSE); gtk_widget_set_sensitive (gsearch->find_button, TRUE); - g_signal_connect (G_OBJECT (gsearch->find_button), "clicked", - G_CALLBACK (click_find_cb), (gpointer) gsearch); - g_signal_connect (G_OBJECT (gsearch->find_button), "size_allocate", - G_CALLBACK (size_allocate_cb), (gpointer) gsearch->available_options_add_button); - g_signal_connect (G_OBJECT (gsearch->stop_button), "clicked", - G_CALLBACK (click_stop_cb), (gpointer) gsearch); + g_signal_connect (gsearch->find_button, "clicked", + G_CALLBACK (click_find_cb), + (gpointer) gsearch); + g_signal_connect (gsearch->find_button, "size_allocate", + G_CALLBACK (size_allocate_cb), + (gpointer) gsearch->available_options_add_button); + g_signal_connect (gsearch->stop_button, "clicked", + G_CALLBACK (click_stop_cb), + (gpointer) gsearch); if (gsearch->is_window_accessible) { add_atk_namedesc (GTK_WIDGET (gsearch->find_button), NULL, _("Click to perform a search.")); @@ -3084,15 +3083,15 @@ main (int argc, gtk_window_set_resizable (GTK_WINDOW (gsearch->window), TRUE); - g_signal_connect (G_OBJECT (gsearch->window), "delete_event", - G_CALLBACK (quit_cb), - (gpointer) gsearch); - g_signal_connect (G_OBJECT (gsearch->window), "key_press_event", - G_CALLBACK (key_press_cb), - (gpointer) gsearch); - g_signal_connect (G_OBJECT (gsearch->window), "window_state_event", - G_CALLBACK (window_state_event_cb), - (gpointer) gsearch); + g_signal_connect (gsearch->window, "delete_event", + G_CALLBACK (quit_cb), + (gpointer) gsearch); + g_signal_connect (gsearch->window, "key_press_event", + G_CALLBACK (key_press_cb), + (gpointer) gsearch); + g_signal_connect (gsearch->window, "window_state_event", + G_CALLBACK (window_state_event_cb), + (gpointer) gsearch); if ((client = egg_sm_client_get ()) != NULL) { g_signal_connect (client, "save_state", |