summaryrefslogtreecommitdiff
path: root/src/caja-window.c
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2012-11-23 03:09:17 -0800
committerStefano Karapetsas <[email protected]>2012-11-23 03:09:17 -0800
commitf6f5c1bb6d060aff5fb334017c640733675c2ae2 (patch)
treecde88ea4e11a2f0809da857feaefa6824d4ba8fa /src/caja-window.c
parentcbfe84ee50d01e523472a8e086add01245fad6bb (diff)
parentae06676815e24a27549e0c79a74bc81c77822554 (diff)
downloadcaja-f6f5c1bb6d060aff5fb334017c640733675c2ae2.tar.bz2
caja-f6f5c1bb6d060aff5fb334017c640733675c2ae2.tar.xz
Merge pull request #56 from jasmineaura/develop
[all] add and use glibcompat.h for glib-2.27.2 forward-compat
Diffstat (limited to 'src/caja-window.c')
-rw-r--r--src/caja-window.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/caja-window.c b/src/caja-window.c
index 35b78432..e351f007 100644
--- a/src/caja-window.c
+++ b/src/caja-window.c
@@ -65,6 +65,8 @@
#include <math.h>
#include <sys/time.h>
+#include "glibcompat.h" /* for g_list_free_full */
+
#define MAX_HISTORY_ITEMS 50
#define EXTRA_VIEW_WIDGETS_BACKGROUND "#a7c6e1"
@@ -189,12 +191,13 @@ caja_window_init (CajaWindow *window)
#if GTK_CHECK_VERSION(3, 0, 0)
gtk_quit_add_destroy (1, GTK_WIDGET (window));
-#else
- gtk_quit_add_destroy (1, GTK_OBJECT (window));
-#endif
/* Keep the main event loop alive as long as the window exists */
caja_main_event_loop_register (GTK_WIDGET (window));
+#else
+ gtk_quit_add_destroy (1, GTK_OBJECT (window));
+ caja_main_event_loop_register (GTK_OBJECT (window));
+#endif
}
/* Unconditionally synchronize the GtkUIManager of WINDOW. */
@@ -343,8 +346,7 @@ caja_window_go_up (CajaWindow *window, gboolean close_behind, gboolean new_tab)
g_object_unref (parent);
- g_list_foreach(selection, (GFunc) g_object_unref, NULL);
- g_list_free(selection);
+ g_list_free_full (selection, g_object_unref);
}
static void
@@ -606,13 +608,13 @@ caja_window_get_property (GObject *object,
static void
free_stored_viewers (CajaWindow *window)
{
- g_list_foreach(window->details->short_list_viewers, (GFunc) g_free, NULL);
- g_list_free(window->details->short_list_viewers);
+ g_list_free_full (window->details->short_list_viewers, g_free);
window->details->short_list_viewers = NULL;
g_free (window->details->extra_viewer);
window->details->extra_viewer = NULL;
}
+static void
#if GTK_CHECK_VERSION (3, 0, 0)
caja_window_destroy (GtkWidget *object)
#else
@@ -626,8 +628,7 @@ caja_window_destroy (GtkObject *object)
/* close all panes safely */
panes_copy = g_list_copy (window->details->panes);
- g_list_foreach (panes_copy, (GFunc) caja_window_close_pane, NULL);
- g_list_free (panes_copy);
+ g_list_free_full (panes_copy, (GDestroyNotify) caja_window_close_pane);
/* the panes list should now be empty */
g_assert (window->details->panes == NULL);
@@ -1760,8 +1761,7 @@ caja_send_history_list_changed (void)
static void
free_history_list (void)
{
- g_list_foreach(history_list, (GFunc) g_object_unref, NULL);
- g_list_free(history_list);
+ g_list_free_full (history_list, g_object_unref);
history_list = NULL;
}
@@ -2158,7 +2158,7 @@ caja_window_class_init (CajaWindowClass *class)
#endif
GTK_WIDGET_CLASS (class)->show = caja_window_show;
-#if GTK_CHECK_VERSION(3,0,0)
+#if GTK_CHECK_VERSION (3,0,0)
GTK_WIDGET_CLASS (class)->get_preferred_width = caja_window_get_preferred_width;
GTK_WIDGET_CLASS (class)->get_preferred_height = caja_window_get_preferred_height;
#else