From 406473f25e5282340bfc1a0057561f1f3922b08a Mon Sep 17 00:00:00 2001 From: Stefano Karapetsas Date: Sun, 19 Jan 2014 20:39:10 +0100 Subject: drivemount: Add GTK3 support --- drivemount/drive-list.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'drivemount/drive-list.c') diff --git a/drivemount/drive-list.c b/drivemount/drive-list.c index 03dbd8d2..26163160 100644 --- a/drivemount/drive-list.c +++ b/drivemount/drive-list.c @@ -35,7 +35,11 @@ G_DEFINE_TYPE (DriveList, drive_list, GTK_TYPE_TABLE); static GVolumeMonitor *volume_monitor = NULL; static void drive_list_finalize (GObject *object); +#if GTK_CHECK_VERSION (3, 0, 0) +static void drive_list_dispose (GObject *object); +#else static void drive_list_destroy (GtkObject *object); +#endif static void drive_list_add (GtkContainer *container, GtkWidget *child); static void drive_list_remove (GtkContainer *container, GtkWidget *child); @@ -70,7 +74,11 @@ static void drive_list_class_init (DriveListClass *class) { G_OBJECT_CLASS (class)->finalize = drive_list_finalize; +#if GTK_CHECK_VERSION (3, 0, 0) + G_OBJECT_CLASS (class)->dispose = drive_list_dispose; +#else GTK_OBJECT_CLASS (class)->destroy = drive_list_destroy; +#endif GTK_CONTAINER_CLASS (class)->add = drive_list_add; GTK_CONTAINER_CLASS (class)->remove = drive_list_remove; } @@ -144,7 +152,11 @@ drive_list_finalize (GObject *object) } static void +#if GTK_CHECK_VERSION (3, 0, 0) +drive_list_dispose (GObject *object) +#else drive_list_destroy (GtkObject *object) +#endif { DriveList *self = DRIVE_LIST (object); @@ -165,8 +177,13 @@ drive_list_destroy (GtkObject *object) g_source_remove (self->layout_tag); self->layout_tag = 0; +#if GTK_CHECK_VERSION (3, 0, 0) + if (G_OBJECT_CLASS (drive_list_parent_class)->dispose) + (* G_OBJECT_CLASS (drive_list_parent_class)->dispose) (object); +#else if (GTK_OBJECT_CLASS (drive_list_parent_class)->destroy) (* GTK_OBJECT_CLASS (drive_list_parent_class)->destroy) (object); +#endif } static void -- cgit v1.2.1