summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am1
-rw-r--r--src/caja-application.c2
-rw-r--r--src/caja-bookmark-list.c2
-rw-r--r--src/caja-convert-metadata.c4
-rw-r--r--src/caja-emblem-sidebar.c2
-rw-r--r--src/caja-history-sidebar.c2
-rw-r--r--src/caja-information-panel.c2
-rw-r--r--src/caja-main.c4
-rw-r--r--src/caja-navigation-window-slot.c2
-rw-r--r--src/caja-pathbar.c2
-rw-r--r--src/caja-places-sidebar.c2
-rw-r--r--src/caja-property-browser.c2
-rw-r--r--src/caja-query-editor.c2
-rw-r--r--src/caja-spatial-window.c2
-rw-r--r--src/caja-trash-bar.c2
-rw-r--r--src/caja-window-manage-views.c2
-rw-r--r--src/caja-window-slot.c2
-rw-r--r--src/caja-window.c2
-rw-r--r--src/file-manager/fm-directory-view.c14
-rw-r--r--src/file-manager/fm-list-model.c2
-rw-r--r--src/file-manager/fm-list-view.c2
-rw-r--r--src/file-manager/fm-properties-window.c40
-rw-r--r--src/file-manager/fm-tree-model.c2
-rw-r--r--src/file-manager/fm-tree-view.c2
-rw-r--r--src/glibcompat.h59
25 files changed, 18 insertions, 142 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 189c1f5f..37bf1f54 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -162,7 +162,6 @@ caja_SOURCES = \
caja-zoom-action.h \
caja-zoom-control.c \
caja-zoom-control.h \
- glibcompat.h \
$(NULL)
nodist_caja_SOURCES = \
diff --git a/src/caja-application.c b/src/caja-application.c
index b7199725..02c1c3dc 100644
--- a/src/caja-application.c
+++ b/src/caja-application.c
@@ -78,8 +78,6 @@
#define MATE_DESKTOP_USE_UNSTABLE_API
#include <libmate-desktop/mate-bg.h>
-#include "glibcompat.h" /* for g_list_free_full */
-
enum {
COMMAND_0, /* unused: 0 is an invalid command */
diff --git a/src/caja-bookmark-list.c b/src/caja-bookmark-list.c
index 1e7d5c1d..c0976396 100644
--- a/src/caja-bookmark-list.c
+++ b/src/caja-bookmark-list.c
@@ -35,8 +35,6 @@
#include <gio/gio.h>
#include <string.h>
-#include "glibcompat.h" /* for g_list_free_full */
-
#define MAX_BOOKMARK_LENGTH 80
#define LOAD_JOB 1
#define SAVE_JOB 2
diff --git a/src/caja-convert-metadata.c b/src/caja-convert-metadata.c
index d3968abe..2047ace0 100644
--- a/src/caja-convert-metadata.c
+++ b/src/caja-convert-metadata.c
@@ -338,10 +338,6 @@ main (int argc, char *argv[])
GError *error = NULL;
int i;
-#if !GLIB_CHECK_VERSION (2, 36, 0)
- g_type_init ();
-#endif
-
context = g_option_context_new ("<caja metadata files> - convert caja metadata");
g_option_context_add_main_entries (context, entries, NULL);
if (!g_option_context_parse (context, &argc, &argv, &error))
diff --git a/src/caja-emblem-sidebar.c b/src/caja-emblem-sidebar.c
index b1e6ec58..fe254515 100644
--- a/src/caja-emblem-sidebar.c
+++ b/src/caja-emblem-sidebar.c
@@ -47,8 +47,6 @@
#include <libcaja-private/caja-module.h>
#include <libcaja-private/caja-signaller.h>
-#include "glibcompat.h" /* for g_list_free_full */
-
struct CajaEmblemSidebarDetails
{
CajaWindowInfo *window;
diff --git a/src/caja-history-sidebar.c b/src/caja-history-sidebar.c
index 72993d73..c064156f 100644
--- a/src/caja-history-sidebar.c
+++ b/src/caja-history-sidebar.c
@@ -40,8 +40,6 @@
#include "caja-history-sidebar.h"
-#include "glibcompat.h" /* for g_list_free_full */
-
#define CAJA_HISTORY_SIDEBAR_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), CAJA_TYPE_HISTORY_SIDEBAR, CajaHistorySidebarClass))
#define CAJA_IS_HISTORY_SIDEBAR(obj) \
diff --git a/src/caja-information-panel.c b/src/caja-information-panel.c
index 6049da98..19e2b01a 100644
--- a/src/caja-information-panel.c
+++ b/src/caja-information-panel.c
@@ -49,8 +49,6 @@
#include <libcaja-private/caja-sidebar-provider.h>
#include <libcaja-private/caja-module.h>
-#include "glibcompat.h" /* for g_list_free_full */
-
struct CajaInformationPanelDetails
{
GtkVBox *container;
diff --git a/src/caja-main.c b/src/caja-main.c
index 7eee311a..1de9fa29 100644
--- a/src/caja-main.c
+++ b/src/caja-main.c
@@ -389,10 +389,6 @@ main (int argc, char *argv[])
mallopt (M_MMAP_THRESHOLD, 128 *1024);
#endif
-#if !GLIB_CHECK_VERSION (2, 32, 0)
- g_thread_init (NULL);
-#endif
-
#if !GLIB_CHECK_VERSION (2, 42, 0)
/* This will be done by gtk+ later, but for now, force it to MATE */
g_desktop_app_info_set_desktop_env ("MATE");
diff --git a/src/caja-navigation-window-slot.c b/src/caja-navigation-window-slot.c
index 6c4cfbc6..4b3cb461 100644
--- a/src/caja-navigation-window-slot.c
+++ b/src/caja-navigation-window-slot.c
@@ -31,8 +31,6 @@
#include <libcaja-private/caja-file.h>
#include <eel/eel-gtk-macros.h>
-#include "glibcompat.h" /* for g_list_free_full */
-
static void caja_navigation_window_slot_init (CajaNavigationWindowSlot *slot);
static void caja_navigation_window_slot_class_init (CajaNavigationWindowSlotClass *class);
diff --git a/src/caja-pathbar.c b/src/caja-pathbar.c
index 1d634db5..0531a992 100644
--- a/src/caja-pathbar.c
+++ b/src/caja-pathbar.c
@@ -35,8 +35,6 @@
#include "caja-window-private.h"
#include "caja-window-slot.h"
-#include "glibcompat.h" /* for g_list_free_full */
-
#if !GTK_CHECK_VERSION(3,0,0)
#define gtk_widget_get_preferred_size(x,y,z) gtk_widget_size_request(x,y)
#endif
diff --git a/src/caja-places-sidebar.c b/src/caja-places-sidebar.c
index 6c7a0e57..6fbc2659 100644
--- a/src/caja-places-sidebar.c
+++ b/src/caja-places-sidebar.c
@@ -53,8 +53,6 @@
#include "caja-places-sidebar.h"
#include "caja-window.h"
-#include "glibcompat.h" /* for g_list_free_full and g_clear_object */
-
#define EJECT_BUTTON_XPAD 6
#define ICON_CELL_XPAD 6
diff --git a/src/caja-property-browser.c b/src/caja-property-browser.c
index bb9e4058..d1d75f8d 100644
--- a/src/caja-property-browser.c
+++ b/src/caja-property-browser.c
@@ -55,8 +55,6 @@
#include <libcaja-private/caja-signaller.h>
#include <atk/atkrelationset.h>
-#include "glibcompat.h" /* for g_list_free_full */
-
/* property types */
typedef enum
diff --git a/src/caja-query-editor.c b/src/caja-query-editor.c
index 324149f5..45201831 100644
--- a/src/caja-query-editor.c
+++ b/src/caja-query-editor.c
@@ -34,8 +34,6 @@
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
-#include "glibcompat.h" /* for g_list_free_full */
-
typedef enum
{
CAJA_QUERY_EDITOR_ROW_LOCATION,
diff --git a/src/caja-spatial-window.c b/src/caja-spatial-window.c
index 45525f33..4c655f64 100644
--- a/src/caja-spatial-window.c
+++ b/src/caja-spatial-window.c
@@ -62,8 +62,6 @@
#include <libcaja-private/caja-search-engine.h>
#include <libcaja-private/caja-signaller.h>
-#include "glibcompat.h" /* for g_list_free_full */
-
#if !GTK_CHECK_VERSION(3,0,0)
#define gtk_widget_get_preferred_size(x,y,z) gtk_widget_size_request(x,y)
#endif
diff --git a/src/caja-trash-bar.c b/src/caja-trash-bar.c
index 47cac9df..186c8527 100644
--- a/src/caja-trash-bar.c
+++ b/src/caja-trash-bar.c
@@ -33,8 +33,6 @@
#include <libcaja-private/caja-file.h>
#include <libcaja-private/caja-trash-monitor.h>
-#include "glibcompat.h" /* for g_list_free_full */
-
#define CAJA_TRASH_BAR_GET_PRIVATE(o)\
(G_TYPE_INSTANCE_GET_PRIVATE ((o), CAJA_TYPE_TRASH_BAR, CajaTrashBarPrivate))
diff --git a/src/caja-window-manage-views.c b/src/caja-window-manage-views.c
index 09d1ac94..e34f7542 100644
--- a/src/caja-window-manage-views.c
+++ b/src/caja-window-manage-views.c
@@ -76,8 +76,6 @@
*/
#include "caja-desktop-window.h"
-#include "glibcompat.h" /* for g_list_free_full */
-
/* This number controls a maximum character count for a URL that is
* displayed as part of a dialog. It's fairly arbitrary -- big enough
* to allow most "normal" URIs to display in full, but small enough to
diff --git a/src/caja-window-slot.c b/src/caja-window-slot.c
index 0fe2375b..128b52f7 100644
--- a/src/caja-window-slot.c
+++ b/src/caja-window-slot.c
@@ -33,8 +33,6 @@
#include <eel/eel-gtk-macros.h>
#include <eel/eel-string.h>
-#include "glibcompat.h" /* for g_list_free_full */
-
static void caja_window_slot_init (CajaWindowSlot *slot);
static void caja_window_slot_class_init (CajaWindowSlotClass *class);
static void caja_window_slot_dispose (GObject *object);
diff --git a/src/caja-window.c b/src/caja-window.c
index 365c3696..1c0a01c3 100644
--- a/src/caja-window.c
+++ b/src/caja-window.c
@@ -65,8 +65,6 @@
#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"
diff --git a/src/file-manager/fm-directory-view.c b/src/file-manager/fm-directory-view.c
index 7efa3494..ebf80eb3 100644
--- a/src/file-manager/fm-directory-view.c
+++ b/src/file-manager/fm-directory-view.c
@@ -86,8 +86,6 @@
#define MATE_DESKTOP_USE_UNSTABLE_API
#include <libmate-desktop/mate-desktop-utils.h>
-#include <src/glibcompat.h> /* for g_list_free_full */
-
/* Minimum starting update inverval */
#define UPDATE_INTERVAL_MIN 100
/* Maximum update interval */
@@ -2329,14 +2327,10 @@ fm_directory_view_display_selection_info (FMDirectoryView *view)
if (non_folder_size_known) {
char *size_string;
- #if GLIB_CHECK_VERSION(2, 30, 0)
- if (g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_USE_IEC_UNITS))
- size_string = g_format_size_full (non_folder_size, G_FORMAT_SIZE_IEC_UNITS);
- else
- size_string = g_format_size(non_folder_size);
- #else
- size_string = g_format_size_for_display(non_folder_size);
- #endif
+ if (g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_USE_IEC_UNITS))
+ size_string = g_format_size_full (non_folder_size, G_FORMAT_SIZE_IEC_UNITS);
+ else
+ size_string = g_format_size(non_folder_size);
/* This is marked for translation in case a localiser
* needs to use something other than parentheses. The
diff --git a/src/file-manager/fm-list-model.c b/src/file-manager/fm-list-model.c
index 1be811f4..6a1692f4 100644
--- a/src/file-manager/fm-list-model.c
+++ b/src/file-manager/fm-list-model.c
@@ -35,8 +35,6 @@
#include <libcaja-private/caja-dnd.h>
#include <glib.h>
-#include <src/glibcompat.h> /* for g_list_free_full */
-
enum
{
SUBDIRECTORY_UNLOADED,
diff --git a/src/file-manager/fm-list-view.c b/src/file-manager/fm-list-view.c
index c92e0c12..626c3836 100644
--- a/src/file-manager/fm-list-view.c
+++ b/src/file-manager/fm-list-view.c
@@ -61,8 +61,6 @@
#include <libcaja-private/caja-clipboard.h>
#include <libcaja-private/caja-cell-renderer-text-ellipsized.h>
-#include <src/glibcompat.h> /* for g_list_free_full */
-
struct FMListViewDetails
{
GtkTreeView *tree_view;
diff --git a/src/file-manager/fm-properties-window.c b/src/file-manager/fm-properties-window.c
index c6b59efc..ba305015 100644
--- a/src/file-manager/fm-properties-window.c
+++ b/src/file-manager/fm-properties-window.c
@@ -68,8 +68,6 @@
#include <sys/mount.h>
#endif
-#include <src/glibcompat.h> /* for g_list_free_full */
-
#define USED_FILL_R (0.988235294 * 65535)
#define USED_FILL_G (0.91372549 * 65535)
#define USED_FILL_B (0.309803922 * 65535)
@@ -2321,14 +2319,10 @@ directory_contents_value_field_update (FMPropertiesWindow *window)
} else {
char *size_str;
- #if GLIB_CHECK_VERSION(2, 30, 0)
- if (g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_USE_IEC_UNITS))
- size_str = g_format_size_full (total_size, G_FORMAT_SIZE_IEC_UNITS);
- else
- size_str = g_format_size(total_size);
- #else
- size_str = g_format_size_for_display(total_size);
- #endif
+ if (g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_USE_IEC_UNITS))
+ size_str = g_format_size_full (total_size, G_FORMAT_SIZE_IEC_UNITS);
+ else
+ size_str = g_format_size(total_size);
text = g_strdup_printf (ngettext("%'d item, with size %s",
"%'d items, totalling %s",
@@ -3147,22 +3141,16 @@ create_pie_widget (FMPropertiesWindow *window)
GFile *location;
GFileInfo *info;
- #if GLIB_CHECK_VERSION(2, 30, 0)
- if (g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_USE_IEC_UNITS)) {
- capacity = g_format_size_full(window->details->volume_capacity, G_FORMAT_SIZE_IEC_UNITS);
- free = g_format_size_full(window->details->volume_free, G_FORMAT_SIZE_IEC_UNITS);
- used = g_format_size_full(window->details->volume_capacity - window->details->volume_free, G_FORMAT_SIZE_IEC_UNITS);
- }
- else {
- capacity = g_format_size(window->details->volume_capacity);
- free = g_format_size(window->details->volume_free);
- used = g_format_size(window->details->volume_capacity - window->details->volume_free);
- }
- #else
- capacity = g_format_size_for_display(window->details->volume_capacity);
- free = g_format_size_for_display(window->details->volume_free);
- used = g_format_size_for_display(window->details->volume_capacity - window->details->volume_free);
- #endif
+ if (g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_USE_IEC_UNITS)) {
+ capacity = g_format_size_full(window->details->volume_capacity, G_FORMAT_SIZE_IEC_UNITS);
+ free = g_format_size_full(window->details->volume_free, G_FORMAT_SIZE_IEC_UNITS);
+ used = g_format_size_full(window->details->volume_capacity - window->details->volume_free, G_FORMAT_SIZE_IEC_UNITS);
+ }
+ else {
+ capacity = g_format_size(window->details->volume_capacity);
+ free = g_format_size(window->details->volume_free);
+ used = g_format_size(window->details->volume_capacity - window->details->volume_free);
+ }
file = get_original_file (window);
diff --git a/src/file-manager/fm-tree-model.c b/src/file-manager/fm-tree-model.c
index 604c660e..504dd89a 100644
--- a/src/file-manager/fm-tree-model.c
+++ b/src/file-manager/fm-tree-model.c
@@ -37,8 +37,6 @@
#include <gtk/gtk.h>
#include <string.h>
-#include <src/glibcompat.h> /* for g_list_free_full */
-
enum
{
ROW_LOADED,
diff --git a/src/file-manager/fm-tree-view.c b/src/file-manager/fm-tree-view.c
index ab2f1593..f86a0634 100644
--- a/src/file-manager/fm-tree-view.c
+++ b/src/file-manager/fm-tree-view.c
@@ -55,8 +55,6 @@
#include <libcaja-private/caja-window-info.h>
#include <libcaja-private/caja-window-slot-info.h>
-#include <src/glibcompat.h> /* for g_list_free_full */
-
typedef struct
{
GObject parent;
diff --git a/src/glibcompat.h b/src/glibcompat.h
deleted file mode 100644
index 4c71b2b5..00000000
--- a/src/glibcompat.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * glibcompat.h - GLib version-dependent definitions
- *
- * Copyright (C) 2012 MATE Desktop Project
- *
- * Caja is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * Caja is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * Authors: Jasmine Hassan <[email protected]>
- *
- */
-
-#ifndef GLIB_COMPAT_H
-#define GLIB_COMPAT_H
-
-#include <glib.h>
-#include <glib-object.h>
-
-#if !GLIB_CHECK_VERSION (2, 27, 2)
-static inline void
-g_list_free_full (GList *list, GDestroyNotify free_func)
-{
- g_list_foreach (list, (GFunc) free_func, NULL);
- g_list_free (list);
-}
-#endif
-
-#if !GLIB_CHECK_VERSION(2,28,0)
-static inline void
-g_clear_object_inline(volatile GObject **object_ptr)
-{
- gpointer * const ptr = (gpointer)object_ptr;
- gpointer old;
-
- do {
- old = g_atomic_pointer_get(ptr);
- } while G_UNLIKELY(!g_atomic_pointer_compare_and_exchange(ptr, old, NULL));
-
- if (old)
- g_object_unref(old);
-}
-#undef g_clear_object
-#define g_clear_object(obj) g_clear_object_inline((volatile GObject **)(obj))
-#endif
-
-#endif /* GLIB_COMPAT_H */