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 /src/caja-location-entry.c | |
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
Diffstat (limited to 'src/caja-location-entry.c')
-rw-r--r-- | src/caja-location-entry.c | 29 |
1 files changed, 16 insertions, 13 deletions
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 |