diff options
author | Jasmine Hassan <[email protected]> | 2012-10-31 04:42:15 +0200 |
---|---|---|
committer | Jasmine Hassan <[email protected]> | 2012-11-16 09:45:51 +0200 |
commit | 2472d52a0f28dd84d362dcc5570e747a82aa8ba6 (patch) | |
tree | 3761aac83f319d8e4fb76286b0a5e1f3e2430fe9 | |
parent | ae33b1c624c008ca0818ab08735968c8d01fae1c (diff) | |
download | caja-2472d52a0f28dd84d362dcc5570e747a82aa8ba6.tar.bz2 caja-2472d52a0f28dd84d362dcc5570e747a82aa8ba6.tar.xz |
[src] don't use GtkObject (GTK3)
the ::destroy signal of GtkObject has only been moved to GtkWidget in GTK3
(after GtkObject removal): http://developer.gnome.org/gtk3/3.0/ch25s02.html
So we use conditionals in this case, to keep it working with GTK2.
A tad similar:
http://git.gnome.org/browse/nautilus/commit/?id=cc6cb51e827c0b15d4ef09f12d37b9f331ddcef8
-rw-r--r-- | src/caja-application.c | 6 | ||||
-rw-r--r-- | src/caja-bookmarks-window.c | 8 | ||||
-rw-r--r-- | src/caja-location-bar.c | 20 | ||||
-rw-r--r-- | src/caja-location-dialog.c | 19 | ||||
-rw-r--r-- | src/caja-location-entry.c | 29 | ||||
-rw-r--r-- | src/caja-main.c | 12 | ||||
-rw-r--r-- | src/caja-main.h | 6 | ||||
-rw-r--r-- | src/caja-navigation-bar.c | 9 | ||||
-rw-r--r-- | src/caja-navigation-window-menus.c | 2 | ||||
-rw-r--r-- | src/caja-navigation-window.c | 12 | ||||
-rw-r--r-- | src/caja-pathbar.c | 6 | ||||
-rw-r--r-- | src/caja-window-bookmarks.c | 2 | ||||
-rw-r--r-- | src/caja-window-manage-views.c | 4 | ||||
-rw-r--r-- | src/caja-window.c | 23 | ||||
-rw-r--r-- | src/file-manager/fm-desktop-icon-view.c | 3 | ||||
-rw-r--r-- | src/file-manager/fm-directory-view.c | 32 | ||||
-rw-r--r-- | src/file-manager/fm-icon-view.c | 18 | ||||
-rw-r--r-- | src/file-manager/fm-properties-window.c | 12 |
18 files changed, 142 insertions, 81 deletions
diff --git a/src/caja-application.c b/src/caja-application.c index a462524f..978af2d6 100644 --- a/src/caja-application.c +++ b/src/caja-application.c @@ -432,7 +432,7 @@ check_required_directories (CajaApplication *application) dialog = eel_show_error_dialog (error_string, detail_string, NULL); /* We need the main event loop so the user has a chance to see the dialog. */ - caja_main_event_loop_register (GTK_OBJECT (dialog)); + caja_main_event_loop_register (GTK_WIDGET (dialog)); g_string_free (directories_as_string, TRUE); g_free (error_string); @@ -1346,7 +1346,11 @@ caja_application_close_all_spatial_windows (void) } static void +#if GTK_CHECK_VERSION (3, 0, 0) +caja_application_destroyed_window (GtkWidget *object, CajaApplication *application) +#else caja_application_destroyed_window (GtkObject *object, CajaApplication *application) +#endif { caja_application_window_list = g_list_remove (caja_application_window_list, object); } diff --git a/src/caja-bookmarks-window.c b/src/caja-bookmarks-window.c index 2ce15aae..4b13a1ee 100644 --- a/src/caja-bookmarks-window.c +++ b/src/caja-bookmarks-window.c @@ -229,9 +229,9 @@ static void edit_bookmarks_dialog_reset_signals (gpointer data, GObject *obj) { - g_signal_handler_disconnect (GTK_OBJECT (jump_button), + g_signal_handler_disconnect (jump_button, jump_button_signal_id); - g_signal_handler_disconnect (GTK_OBJECT (bookmark_list_widget), + g_signal_handler_disconnect (bookmark_list_widget, row_activated_signal_id); jump_button_signal_id = g_signal_connect (jump_button, "clicked", @@ -415,9 +415,9 @@ void edit_bookmarks_dialog_set_signals (CajaWindow *window) { - g_signal_handler_disconnect (GTK_OBJECT (jump_button), + g_signal_handler_disconnect (jump_button, jump_button_signal_id); - g_signal_handler_disconnect (GTK_OBJECT (bookmark_list_widget), + g_signal_handler_disconnect (bookmark_list_widget, row_activated_signal_id); jump_button_signal_id = diff --git a/src/caja-location-bar.c b/src/caja-location-bar.c index 6fdc34e5..428f26a1 100644 --- a/src/caja-location-bar.c +++ b/src/caja-location-bar.c @@ -356,7 +356,11 @@ finalize (GObject *object) } static void +#if GTK_CHECK_VERSION (3, 0, 0) +destroy (GtkWidget *object) +#else destroy (GtkObject *object) +#endif { CajaLocationBar *bar; @@ -372,21 +376,25 @@ destroy (GtkObject *object) g_free (bar->details->last_location); bar->details->last_location = NULL; +#if GTK_CHECK_VERSION (3, 0, 0) + EEL_CALL_PARENT (GTK_WIDGET_CLASS, destroy, (object)); +#else EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object)); +#endif } static void caja_location_bar_class_init (CajaLocationBarClass *class) { - GObjectClass *gobject_class; - GtkObjectClass *object_class; CajaNavigationBarClass *navigation_bar_class; - gobject_class = G_OBJECT_CLASS (class); - gobject_class->finalize = finalize; + G_OBJECT_CLASS (class)->finalize = finalize; - object_class = GTK_OBJECT_CLASS (class); - object_class->destroy = destroy; +#if GTK_CHECK_VERSION (3, 0, 0) + GTK_WIDGET_CLASS (class)->destroy = destroy; +#else + GTK_OBJECT_CLASS (class)->destroy = destroy; +#endif navigation_bar_class = CAJA_NAVIGATION_BAR_CLASS (class); diff --git a/src/caja-location-dialog.c b/src/caja-location-dialog.c index 99596b87..ec102300 100644 --- a/src/caja-location-dialog.c +++ b/src/caja-location-dialog.c @@ -62,16 +62,6 @@ caja_location_dialog_finalize (GObject *object) } static void -caja_location_dialog_destroy (GtkObject *object) -{ - CajaLocationDialog *dialog; - - dialog = CAJA_LOCATION_DIALOG (object); - - EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object)); -} - -static void open_current_location (CajaLocationDialog *dialog) { GFile *location; @@ -136,14 +126,7 @@ entry_activate_callback (GtkEntry *entry, static void caja_location_dialog_class_init (CajaLocationDialogClass *class) { - GObjectClass *gobject_class; - GtkObjectClass *object_class; - - gobject_class = G_OBJECT_CLASS (class); - gobject_class->finalize = caja_location_dialog_finalize; - - object_class = GTK_OBJECT_CLASS (class); - object_class->destroy = caja_location_dialog_destroy; + G_OBJECT_CLASS (class)->finalize = caja_location_dialog_finalize; } static void diff --git a/src/caja-location-entry.c b/src/caja-location-entry.c index f23f1a9f..0a59a347 100644 --- a/src/caja-location-entry.c +++ b/src/caja-location-entry.c @@ -285,7 +285,11 @@ finalize (GObject *object) } static void +#if GTK_CHECK_VERSION (3, 0, 0) +destroy (GtkWidget *object) +#else destroy (GtkObject *object) +#endif { CajaLocationEntry *entry; @@ -301,7 +305,11 @@ destroy (GtkObject *object) g_free (entry->details->current_directory); entry->details->current_directory = NULL; +#if GTK_CHECK_VERSION (3, 0, 0) + EEL_CALL_PARENT (GTK_WIDGET_CLASS, destroy, (object)); +#else EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object)); +#endif } static void @@ -382,22 +390,17 @@ caja_location_entry_activate (GtkEntry *entry) static void caja_location_entry_class_init (CajaLocationEntryClass *class) { - GtkWidgetClass *widget_class; - GObjectClass *gobject_class; - GtkObjectClass *object_class; - GtkEntryClass *entry_class; + GTK_WIDGET_CLASS (class)->focus_in_event = caja_location_entry_focus_in; - widget_class = GTK_WIDGET_CLASS (class); - widget_class->focus_in_event = caja_location_entry_focus_in; +#if GTK_CHECK_VERSION (3, 0, 0) + GTK_WIDGET_CLASS (class)->destroy = destroy; +#else + GTK_OBJECT_CLASS (class)->destroy = destroy; +#endif - gobject_class = G_OBJECT_CLASS (class); - gobject_class->finalize = finalize; + G_OBJECT_CLASS (class)->finalize = finalize; - object_class = GTK_OBJECT_CLASS (class); - object_class->destroy = destroy; - - entry_class = GTK_ENTRY_CLASS (class); - entry_class->activate = caja_location_entry_activate; + GTK_ENTRY_CLASS (class)->activate = caja_location_entry_activate; } void diff --git a/src/caja-main.c b/src/caja-main.c index ef5714b2..3a99163f 100644 --- a/src/caja-main.c +++ b/src/caja-main.c @@ -101,7 +101,7 @@ static void eel_gtk_main_quit_all (void) g_idle_add (quit_if_in_main_loop, NULL); } -static void event_loop_unregister (GtkObject *object) +static void event_loop_unregister (GtkWidget *object) { event_loop_registrants = g_slist_remove (event_loop_registrants, object); @@ -111,13 +111,17 @@ static void event_loop_unregister (GtkObject *object) } } +#if GTK_CHECK_VERSION(3, 0, 0) +void caja_main_event_loop_register (GtkWidget *object) +#else void caja_main_event_loop_register (GtkObject *object) +#endif { g_signal_connect (object, "destroy", G_CALLBACK (event_loop_unregister), NULL); - event_loop_registrants = g_slist_prepend (event_loop_registrants, object); + event_loop_registrants = g_slist_prepend (event_loop_registrants, GTK_WIDGET (object)); } -gboolean caja_main_is_event_loop_mainstay (GtkObject *object) +gboolean caja_main_is_event_loop_mainstay (GtkWidget *object) { return g_slist_length (event_loop_registrants) == 1 && event_loop_registrants->data == object; @@ -148,7 +152,7 @@ void caja_main_event_loop_quit (gboolean explicit) } while (event_loop_registrants != NULL) { - gtk_object_destroy (event_loop_registrants->data); + gtk_widget_destroy (event_loop_registrants->data); } } diff --git a/src/caja-main.h b/src/caja-main.h index c3ddf82a..abb9e6a7 100644 --- a/src/caja-main.h +++ b/src/caja-main.h @@ -29,8 +29,12 @@ #include <gtk/gtk.h> +#if GTK_CHECK_VERSION(3, 0, 0) +void caja_main_event_loop_register (GtkWidget *object); +#else void caja_main_event_loop_register (GtkObject *object); -gboolean caja_main_is_event_loop_mainstay (GtkObject *object); +#endif +gboolean caja_main_is_event_loop_mainstay (GtkWidget *object); void caja_main_event_loop_quit (gboolean explicit); #endif /* CAJA_MAIN_H */ diff --git a/src/caja-navigation-bar.c b/src/caja-navigation-bar.c index c71d6503..89cd0e20 100644 --- a/src/caja-navigation-bar.c +++ b/src/caja-navigation-bar.c @@ -54,14 +54,11 @@ EEL_IMPLEMENT_MUST_OVERRIDE_SIGNAL (caja_navigation_bar, set_location) static void caja_navigation_bar_class_init (CajaNavigationBarClass *klass) { - GtkObjectClass *object_class; GtkBindingSet *binding_set; - object_class = GTK_OBJECT_CLASS (klass); - signals[ACTIVATE] = g_signal_new ("activate", - G_TYPE_FROM_CLASS (object_class), + G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (CajaNavigationBarClass, activate), @@ -71,7 +68,7 @@ caja_navigation_bar_class_init (CajaNavigationBarClass *klass) signals[CANCEL] = g_signal_new ("cancel", - G_TYPE_FROM_CLASS (object_class), + G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, G_STRUCT_OFFSET (CajaNavigationBarClass, cancel), @@ -81,7 +78,7 @@ caja_navigation_bar_class_init (CajaNavigationBarClass *klass) signals[LOCATION_CHANGED] = g_signal_new ("location_changed", - G_TYPE_FROM_CLASS (object_class), + G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (CajaNavigationBarClass, location_changed), diff --git a/src/caja-navigation-window-menus.c b/src/caja-navigation-window-menus.c index 22c89c28..a9214476 100644 --- a/src/caja-navigation-window-menus.c +++ b/src/caja-navigation-window-menus.c @@ -116,7 +116,7 @@ forget_history_if_yes (GtkDialog *dialog, int response, gpointer callback_data) { caja_forget_history (); } - gtk_object_destroy (GTK_OBJECT (dialog)); + gtk_widget_destroy (GTK_WIDGET (dialog)); } static void diff --git a/src/caja-navigation-window.c b/src/caja-navigation-window.c index db9cf523..3cddcb26 100644 --- a/src/caja-navigation-window.c +++ b/src/caja-navigation-window.c @@ -593,7 +593,11 @@ caja_navigation_window_button_press_event (GtkWidget *widget, } static void +#if GTK_CHECK_VERSION (3, 0, 0) +caja_navigation_window_destroy (GtkWidget *object) +#else caja_navigation_window_destroy (GtkObject *object) +#endif { CajaNavigationWindow *window; @@ -609,7 +613,11 @@ caja_navigation_window_destroy (GtkObject *object) window->details->content_paned = NULL; window->details->split_view_hpane = NULL; +#if GTK_CHECK_VERSION (3, 0, 0) + GTK_WIDGET_CLASS (parent_class)->destroy (object); +#else GTK_OBJECT_CLASS (parent_class)->destroy (object); +#endif } static void @@ -1243,7 +1251,11 @@ caja_navigation_window_class_init (CajaNavigationWindowClass *class) CAJA_WINDOW_CLASS (class)->bookmarks_placeholder = MENU_PATH_BOOKMARKS_PLACEHOLDER; G_OBJECT_CLASS (class)->finalize = caja_navigation_window_finalize; +#if GTK_CHECK_VERSION (3, 0, 0) + GTK_WIDGET_CLASS (class)->destroy = caja_navigation_window_destroy; +#else GTK_OBJECT_CLASS (class)->destroy = caja_navigation_window_destroy; +#endif GTK_WIDGET_CLASS (class)->show = caja_navigation_window_show; GTK_WIDGET_CLASS (class)->unrealize = caja_navigation_window_unrealize; GTK_WIDGET_CLASS (class)->window_state_event = caja_navigation_window_state_event; diff --git a/src/caja-pathbar.c b/src/caja-pathbar.c index dffd63ee..b5504fc9 100644 --- a/src/caja-pathbar.c +++ b/src/caja-pathbar.c @@ -361,12 +361,10 @@ static void caja_path_bar_class_init (CajaPathBarClass *path_bar_class) { GObjectClass *gobject_class; - GtkObjectClass *object_class; GtkWidgetClass *widget_class; GtkContainerClass *container_class; gobject_class = (GObjectClass *) path_bar_class; - object_class = (GtkObjectClass *) path_bar_class; widget_class = (GtkWidgetClass *) path_bar_class; container_class = (GtkContainerClass *) path_bar_class; @@ -388,7 +386,7 @@ caja_path_bar_class_init (CajaPathBarClass *path_bar_class) path_bar_signals [PATH_CLICKED] = g_signal_new ("path-clicked", - G_OBJECT_CLASS_TYPE (object_class), + G_OBJECT_CLASS_TYPE (path_bar_class), G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (CajaPathBarClass, path_clicked), NULL, NULL, @@ -397,7 +395,7 @@ caja_path_bar_class_init (CajaPathBarClass *path_bar_class) G_TYPE_FILE); path_bar_signals [PATH_SET] = g_signal_new ("path-set", - G_OBJECT_CLASS_TYPE (object_class), + G_OBJECT_CLASS_TYPE (path_bar_class), G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (CajaPathBarClass, path_set), NULL, NULL, diff --git a/src/caja-window-bookmarks.c b/src/caja-window-bookmarks.c index e2b6ec73..f96b823f 100644 --- a/src/caja-window-bookmarks.c +++ b/src/caja-window-bookmarks.c @@ -62,7 +62,7 @@ remove_bookmarks_for_uri_if_yes (GtkDialog *dialog, int response, gpointer callb caja_bookmark_list_delete_items_with_uri (window->details->bookmark_list, uri); } - gtk_object_destroy (GTK_OBJECT (dialog)); + gtk_widget_destroy (GTK_WIDGET (dialog)); } static void diff --git a/src/caja-window-manage-views.c b/src/caja-window-manage-views.c index f3e30f6a..aba56377 100644 --- a/src/caja-window-manage-views.c +++ b/src/caja-window-manage-views.c @@ -1313,13 +1313,13 @@ got_file_info_for_view_selection_callback (CajaFile *file, } else { - gtk_object_destroy (GTK_OBJECT (window)); + gtk_widget_destroy (GTK_WIDGET (window)); } } else { /* Since this is a window, destroying it will also unref it. */ - gtk_object_destroy (GTK_OBJECT (window)); + gtk_widget_destroy (GTK_WIDGET (window)); } } else diff --git a/src/caja-window.c b/src/caja-window.c index 13f45508..27e2852f 100644 --- a/src/caja-window.c +++ b/src/caja-window.c @@ -188,10 +188,14 @@ caja_window_init (CajaWindow *window) g_signal_connect_object (caja_signaller_get_current (), "popup_menu_changed", G_CALLBACK (caja_window_load_extension_menus), window, G_CONNECT_SWAPPED); +#if GTK_CHECK_VERSION(3, 0, 0) + gtk_quit_add_destroy (1, GTK_WIDGET (window)); +#else gtk_quit_add_destroy (1, GTK_OBJECT (window)); +#endif /* Keep the main event loop alive as long as the window exists */ - caja_main_event_loop_register (GTK_OBJECT (window)); + caja_main_event_loop_register (GTK_WIDGET (window)); } /* Unconditionally synchronize the GtkUIManager of WINDOW. */ @@ -621,8 +625,11 @@ free_stored_viewers (CajaWindow *window) window->details->extra_viewer = NULL; } -static void +#if GTK_CHECK_VERSION (3, 0, 0) +caja_window_destroy (GtkWidget *object) +#else caja_window_destroy (GtkObject *object) +#endif { CajaWindow *window; GList *panes_copy; @@ -638,7 +645,11 @@ caja_window_destroy (GtkObject *object) g_assert (window->details->panes == NULL); g_assert (window->details->active_pane == NULL); +#if GTK_CHECK_VERSION (3, 0, 0) + GTK_WIDGET_CLASS (caja_window_parent_class)->destroy (object); +#else GTK_OBJECT_CLASS (caja_window_parent_class)->destroy (object); +#endif } static void @@ -2099,12 +2110,18 @@ caja_window_class_init (CajaWindowClass *class) { GtkBindingSet *binding_set; - G_OBJECT_CLASS (class)->finalize = caja_window_finalize; G_OBJECT_CLASS (class)->constructor = caja_window_constructor; G_OBJECT_CLASS (class)->constructed = caja_window_constructed; G_OBJECT_CLASS (class)->get_property = caja_window_get_property; G_OBJECT_CLASS (class)->set_property = caja_window_set_property; + G_OBJECT_CLASS (class)->finalize = caja_window_finalize; + +#if !GTK_CHECK_VERSION (3, 0, 0) GTK_OBJECT_CLASS (class)->destroy = caja_window_destroy; +#else + GTK_WIDGET_CLASS (class)->destroy = caja_window_destroy; +#endif + GTK_WIDGET_CLASS (class)->show = caja_window_show; GTK_WIDGET_CLASS (class)->size_request = caja_window_size_request; GTK_WIDGET_CLASS (class)->realize = caja_window_realize; diff --git a/src/file-manager/fm-desktop-icon-view.c b/src/file-manager/fm-desktop-icon-view.c index ef9a84de..005bc198 100644 --- a/src/file-manager/fm-desktop-icon-view.c +++ b/src/file-manager/fm-desktop-icon-view.c @@ -460,7 +460,8 @@ do_desktop_rescan (gpointer data) } static void -done_loading (GtkObject *DirectoryView, FMDesktopIconView *desktop_icon_view) +done_loading (CajaDirectory *model, + FMDesktopIconView *desktop_icon_view) { struct stat buf; diff --git a/src/file-manager/fm-directory-view.c b/src/file-manager/fm-directory-view.c index bd75951e..a4119ec4 100644 --- a/src/file-manager/fm-directory-view.c +++ b/src/file-manager/fm-directory-view.c @@ -659,7 +659,7 @@ fm_directory_view_confirm_multiple (GtkWindow *parent_window, g_free (detail); response = gtk_dialog_run (dialog); - gtk_object_destroy (GTK_OBJECT (dialog)); + gtk_widget_destroy (GTK_WIDGET (dialog)); return response == GTK_RESPONSE_YES; } @@ -2096,7 +2096,11 @@ real_unmerge_menus (FMDirectoryView *view) } static void +#if GTK_CHECK_VERSION (3, 0, 0) +fm_directory_view_destroy (GtkWidget *object) +#else fm_directory_view_destroy (GtkObject *object) +#endif { FMDirectoryView *view; GList *node, *next; @@ -2157,7 +2161,11 @@ fm_directory_view_destroy (GtkObject *object) view->details->directory_as_file = NULL; } +#if GTK_CHECK_VERSION (3, 0, 0) + EEL_CALL_PARENT (GTK_WIDGET_CLASS, destroy, (object)); +#else EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object)); +#endif } static void @@ -2168,17 +2176,17 @@ fm_directory_view_finalize (GObject *object) view = FM_DIRECTORY_VIEW (object); g_signal_handlers_disconnect_by_func (caja_preferences, - schedule_update_menus_callback, view); + schedule_update_menus_callback, view); g_signal_handlers_disconnect_by_func (caja_icon_view_preferences, - text_attribute_names_changed_callback, view); + text_attribute_names_changed_callback, view); g_signal_handlers_disconnect_by_func (caja_preferences, - image_display_policy_changed_callback, view); + image_display_policy_changed_callback, view); g_signal_handlers_disconnect_by_func (caja_preferences, - click_policy_changed_callback, view); + click_policy_changed_callback, view); g_signal_handlers_disconnect_by_func (caja_preferences, - sort_directories_first_changed_callback, view); + sort_directories_first_changed_callback, view); g_signal_handlers_disconnect_by_func (mate_lockdown_preferences, - schedule_update_menus, view); + schedule_update_menus, view); unschedule_pop_up_location_context_menu (view); if (view->details->location_popup_event != NULL) { @@ -2738,7 +2746,7 @@ copy_move_done_callback (GHashTable *debuting_files, gpointer data) * operate on. The ADD_FILE signal is registered as G_SIGNAL_RUN_LAST, so we * must use connect_after. */ - g_signal_connect_data (GTK_OBJECT (directory_view), + g_signal_connect_data (directory_view, "add_file", G_CALLBACK (debuting_files_add_file_callback), debuting_files_data, @@ -10794,11 +10802,13 @@ fm_directory_view_class_init (FMDirectoryViewClass *klass) widget_class = GTK_WIDGET_CLASS (klass); scrolled_window_class = GTK_SCROLLED_WINDOW_CLASS (klass); - G_OBJECT_CLASS (klass)->finalize = fm_directory_view_finalize; G_OBJECT_CLASS (klass)->set_property = fm_directory_view_set_property; - + G_OBJECT_CLASS (klass)->finalize = fm_directory_view_finalize; +#if !GTK_CHECK_VERSION (3, 0, 0) GTK_OBJECT_CLASS (klass)->destroy = fm_directory_view_destroy; - +#else + widget_class->destroy = fm_directory_view_destroy; +#endif widget_class->scroll_event = fm_directory_view_scroll_event; widget_class->parent_set = fm_directory_view_parent_set; diff --git a/src/file-manager/fm-icon-view.c b/src/file-manager/fm-icon-view.c index eee45185..a9fb8b11 100644 --- a/src/file-manager/fm-icon-view.c +++ b/src/file-manager/fm-icon-view.c @@ -209,7 +209,11 @@ G_DEFINE_TYPE_WITH_CODE (FMIconView, fm_icon_view, FM_TYPE_DIRECTORY_VIEW, fm_icon_view_iface_init)); static void +#if GTK_CHECK_VERSION (3, 0, 0) +fm_icon_view_destroy (GtkWidget *object) +#else fm_icon_view_destroy (GtkObject *object) +#endif { FMIconView *icon_view; @@ -237,10 +241,13 @@ fm_icon_view_destroy (GtkObject *object) icon_view->details->icons_not_positioned = NULL; } +#if GTK_CHECK_VERSION (3, 0, 0) + GTK_WIDGET_CLASS (fm_icon_view_parent_class)->destroy (object); +#else GTK_OBJECT_CLASS (fm_icon_view_parent_class)->destroy (object); +#endif } - static void fm_icon_view_finalize (GObject *object) { @@ -271,6 +278,7 @@ fm_icon_view_finalize (GObject *object) g_signal_handlers_disconnect_by_func (caja_compact_view_preferences, all_columns_same_width_changed_callback, icon_view); + G_OBJECT_CLASS (fm_icon_view_parent_class)->finalize (object); } @@ -2829,8 +2837,6 @@ fm_icon_view_sort_directories_first_changed (FMDirectoryView *directory_view) } } -/* GtkObject methods. */ - static gboolean icon_view_can_accept_item (CajaIconContainer *container, CajaFile *target_item, @@ -3145,9 +3151,11 @@ fm_icon_view_class_init (FMIconViewClass *klass) G_OBJECT_CLASS (klass)->set_property = fm_icon_view_set_property; G_OBJECT_CLASS (klass)->finalize = fm_icon_view_finalize; - +#if !GTK_CHECK_VERSION (3, 0, 0) GTK_OBJECT_CLASS (klass)->destroy = fm_icon_view_destroy; - +#else + GTK_WIDGET_CLASS (klass)->destroy = fm_icon_view_destroy; +#endif GTK_WIDGET_CLASS (klass)->screen_changed = fm_icon_view_screen_changed; GTK_WIDGET_CLASS (klass)->scroll_event = fm_icon_view_scroll_event; diff --git a/src/file-manager/fm-properties-window.c b/src/file-manager/fm-properties-window.c index bb9f06cd..19eea640 100644 --- a/src/file-manager/fm-properties-window.c +++ b/src/file-manager/fm-properties-window.c @@ -5482,7 +5482,11 @@ real_response (GtkDialog *dialog, } static void +#if GTK_CHECK_VERSION (3, 0, 0) +real_destroy (GtkWidget *object) +#else real_destroy (GtkObject *object) +#endif { FMPropertiesWindow *window; GList *l; @@ -5540,7 +5544,11 @@ real_destroy (GtkObject *object) window->details->update_files_timeout_id = 0; } +#if GTK_CHECK_VERSION (3, 0, 0) + GTK_WIDGET_CLASS (parent_class)->destroy (object); +#else GTK_OBJECT_CLASS (parent_class)->destroy (object); +#endif } static void @@ -5795,7 +5803,11 @@ fm_properties_window_class_init (FMPropertiesWindowClass *class) GtkBindingSet *binding_set; G_OBJECT_CLASS (class)->finalize = real_finalize; +#if !GTK_CHECK_VERSION (3, 0, 0) GTK_OBJECT_CLASS (class)->destroy = real_destroy; +#else + GTK_WIDGET_CLASS (class)->destroy = real_destroy; +#endif GTK_DIALOG_CLASS (class)->response = real_response; binding_set = gtk_binding_set_by_class (class); |