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-main.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-main.c')
-rw-r--r-- | src/caja-main.c | 12 |
1 files changed, 8 insertions, 4 deletions
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); } } |