diff options
author | Jasmine Hassan <[email protected]> | 2012-10-31 04:23:12 +0200 |
---|---|---|
committer | Jasmine Hassan <[email protected]> | 2012-11-16 09:45:51 +0200 |
commit | 4895118afc287dc511792a5f91f109a2e1f868d0 (patch) | |
tree | 21a92696c37001614f506534bf3c85b826e79701 | |
parent | ca47debc4ffe4f3ec5b8d6094261dbef02b73dcd (diff) | |
download | caja-4895118afc287dc511792a5f91f109a2e1f868d0.tar.bz2 caja-4895118afc287dc511792a5f91f109a2e1f868d0.tar.xz |
[lc-p] 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 working with GTK2
Original commit:
http://git.gnome.org/browse/nautilus/commit/?id=aef4cfcf93ef34a0b2d4c87b40fcec2b7a66dd06
-rw-r--r-- | libcaja-private/caja-autorun.c | 2 | ||||
-rw-r--r-- | libcaja-private/caja-clipboard.c | 4 | ||||
-rw-r--r-- | libcaja-private/caja-entry.c | 12 | ||||
-rw-r--r-- | libcaja-private/caja-icon-container.c | 16 | ||||
-rw-r--r-- | libcaja-private/caja-mime-actions.c | 6 | ||||
-rw-r--r-- | libcaja-private/caja-mime-application-chooser.c | 10 | ||||
-rw-r--r-- | libcaja-private/caja-open-with-dialog.c | 12 | ||||
-rw-r--r-- | libcaja-private/caja-program-choosing.c | 2 |
8 files changed, 25 insertions, 39 deletions
diff --git a/libcaja-private/caja-autorun.c b/libcaja-private/caja-autorun.c index 21f71eb8..89b8e63d 100644 --- a/libcaja-private/caja-autorun.c +++ b/libcaja-private/caja-autorun.c @@ -274,7 +274,7 @@ dialog_response_cb (GtkDialog *dialog, } static void -dialog_destroy_cb (GtkObject *object, +dialog_destroy_cb (GtkWidget *object, CajaAutorunComboBoxData *data) { handle_dialog_closure (data); diff --git a/libcaja-private/caja-clipboard.c b/libcaja-private/caja-clipboard.c index b1614509..bc06675a 100644 --- a/libcaja-private/caja-clipboard.c +++ b/libcaja-private/caja-clipboard.c @@ -432,7 +432,7 @@ owner_change_callback (GtkClipboard *clipboard, } static void -target_destroy_callback (GtkObject *object, +target_destroy_callback (GtkWidget *object, gpointer callback_data) { TargetCallbackData *target_data; @@ -440,7 +440,7 @@ target_destroy_callback (GtkObject *object, g_assert (callback_data != NULL); target_data = callback_data; - if (clipboard_items_are_merged_in (GTK_WIDGET(object))) + if (clipboard_items_are_merged_in (object)) { merge_out_clipboard_menu_items (G_OBJECT (object), callback_data); } diff --git a/libcaja-private/caja-entry.c b/libcaja-private/caja-entry.c index 863b1b4f..fb9ac38c 100644 --- a/libcaja-private/caja-entry.c +++ b/libcaja-private/caja-entry.c @@ -395,12 +395,10 @@ static void caja_entry_class_init (CajaEntryClass *class) { GtkWidgetClass *widget_class; - GtkObjectClass *object_class; GObjectClass *gobject_class; widget_class = GTK_WIDGET_CLASS (class); gobject_class = G_OBJECT_CLASS (class); - object_class = GTK_OBJECT_CLASS (class); widget_class->button_press_event = caja_entry_button_press; widget_class->button_release_event = caja_entry_button_release; @@ -413,19 +411,17 @@ caja_entry_class_init (CajaEntryClass *class) /* Set up signals */ signals[USER_CHANGED] = g_signal_new ("user_changed", - G_TYPE_FROM_CLASS (object_class), + G_TYPE_FROM_CLASS (class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (CajaEntryClass, - user_changed), + G_STRUCT_OFFSET (CajaEntryClass, user_changed), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); signals[SELECTION_CHANGED] = g_signal_new ("selection_changed", - G_TYPE_FROM_CLASS (object_class), + G_TYPE_FROM_CLASS (class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (CajaEntryClass, - selection_changed), + G_STRUCT_OFFSET (CajaEntryClass, selection_changed), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); diff --git a/libcaja-private/caja-icon-container.c b/libcaja-private/caja-icon-container.c index f9b01311..0f6898c9 100644 --- a/libcaja-private/caja-icon-container.c +++ b/libcaja-private/caja-icon-container.c @@ -4379,10 +4379,12 @@ select_previous_or_next_icon (CajaIconContainer *container, } #endif -/* GtkObject methods. */ - static void +#if GTK_CHECK_VERSION(3, 0, 0) +destroy (GtkWidget *object) +#else destroy (GtkObject *object) +#endif { CajaIconContainer *container; @@ -4439,8 +4441,11 @@ destroy (GtkObject *object) } } - +#if GTK_CHECK_VERSION(3, 0, 0) + GTK_WIDGET_CLASS (caja_icon_container_parent_class)->destroy (object); +#else GTK_OBJECT_CLASS (caja_icon_container_parent_class)->destroy (object); +#endif } static void @@ -6213,7 +6218,12 @@ caja_icon_container_class_init (CajaIconContainerClass *class) G_OBJECT_CLASS (class)->constructor = caja_icon_container_constructor; G_OBJECT_CLASS (class)->finalize = finalize; + +#if GTK_CHECK_VERSION(3, 0, 0) + GTK_WIDGET_CLASS (class)->destroy = destroy; +#else GTK_OBJECT_CLASS (class)->destroy = destroy; +#endif /* Signals. */ diff --git a/libcaja-private/caja-mime-actions.c b/libcaja-private/caja-mime-actions.c index a4dc8c97..794c84b0 100644 --- a/libcaja-private/caja-mime-actions.c +++ b/libcaja-private/caja-mime-actions.c @@ -793,7 +793,7 @@ report_broken_symbolic_link (GtkWindow *parent_window, CajaFile *file) */ response = gtk_dialog_run (dialog); - gtk_object_destroy (GTK_OBJECT (dialog)); + gtk_widget_destroy (GTK_WIDGET (dialog)); if (response == GTK_RESPONSE_YES) { @@ -860,7 +860,7 @@ get_executable_text_file_action (GtkWindow *parent_window, CajaFile *file) g_free (detail); response = gtk_dialog_run (dialog); - gtk_object_destroy (GTK_OBJECT (dialog)); + gtk_widget_destroy (GTK_WIDGET (dialog)); switch (response) { @@ -1223,7 +1223,7 @@ confirm_multiple_windows (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; } diff --git a/libcaja-private/caja-mime-application-chooser.c b/libcaja-private/caja-mime-application-chooser.c index 3f458dba..32767f38 100644 --- a/libcaja-private/caja-mime-application-chooser.c +++ b/libcaja-private/caja-mime-application-chooser.c @@ -108,22 +108,12 @@ caja_mime_application_chooser_finalize (GObject *object) } static void -caja_mime_application_chooser_destroy (GtkObject *object) -{ - GTK_OBJECT_CLASS (caja_mime_application_chooser_parent_class)->destroy (object); -} - -static void caja_mime_application_chooser_class_init (CajaMimeApplicationChooserClass *class) { GObjectClass *gobject_class; - GtkObjectClass *object_class; gobject_class = G_OBJECT_CLASS (class); gobject_class->finalize = caja_mime_application_chooser_finalize; - - object_class = GTK_OBJECT_CLASS (class); - object_class->destroy = caja_mime_application_chooser_destroy; } static void diff --git a/libcaja-private/caja-open-with-dialog.c b/libcaja-private/caja-open-with-dialog.c index dcd601bc..93e376c9 100644 --- a/libcaja-private/caja-open-with-dialog.c +++ b/libcaja-private/caja-open-with-dialog.c @@ -120,12 +120,6 @@ caja_open_with_dialog_finalize (GObject *object) G_OBJECT_CLASS (caja_open_with_dialog_parent_class)->finalize (object); } -static void -caja_open_with_dialog_destroy (GtkObject *object) -{ - GTK_OBJECT_CLASS (caja_open_with_dialog_parent_class)->destroy (object); -} - /* An application is valid if: * * 1) The file exists @@ -397,17 +391,13 @@ static void caja_open_with_dialog_class_init (CajaOpenWithDialogClass *class) { GObjectClass *gobject_class; - GtkObjectClass *object_class; gobject_class = G_OBJECT_CLASS (class); gobject_class->finalize = caja_open_with_dialog_finalize; - object_class = GTK_OBJECT_CLASS (class); - object_class->destroy = caja_open_with_dialog_destroy; - signals[APPLICATION_SELECTED] = g_signal_new ("application_selected", - G_TYPE_FROM_CLASS (object_class), + G_TYPE_FROM_CLASS (class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (CajaOpenWithDialogClass, application_selected), diff --git a/libcaja-private/caja-program-choosing.c b/libcaja-private/caja-program-choosing.c index a31746ec..56d6e8eb 100644 --- a/libcaja-private/caja-program-choosing.c +++ b/libcaja-private/caja-program-choosing.c @@ -98,7 +98,7 @@ application_cannot_open_location (GAppInfo *application, GTK_STOCK_CANCEL, parent_window); response = gtk_dialog_run (message_dialog); - gtk_object_destroy (GTK_OBJECT (message_dialog)); + gtk_widget_destroy (GTK_WIDGET (message_dialog)); if (response == GTK_RESPONSE_YES) { |