From 2472d52a0f28dd84d362dcc5570e747a82aa8ba6 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Wed, 31 Oct 2012 04:42:15 +0200 Subject: [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 --- src/caja-location-entry.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'src/caja-location-entry.c') 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 -- cgit v1.2.1