diff options
Diffstat (limited to 'libcaja-private/caja-undostack-manager.c')
-rw-r--r-- | libcaja-private/caja-undostack-manager.c | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/libcaja-private/caja-undostack-manager.c b/libcaja-private/caja-undostack-manager.c index 16f977f3..1d988cda 100644 --- a/libcaja-private/caja-undostack-manager.c +++ b/libcaja-private/caja-undostack-manager.c @@ -34,8 +34,6 @@ #include <locale.h> #include <gdk/gdk.h> -#include <src/glibcompat.h> /* for g_list_free_full */ - /* ***************************************************************** Private fields ***************************************************************** */ @@ -100,11 +98,7 @@ struct _CajaUndoStackManagerPrivate GQueue *stack; guint undo_levels; guint index; -#if GLIB_CHECK_VERSION(2, 32, 0) GMutex mutex; /* Used to protect access to stack (because of async file ops) */ -#else - GMutex *mutex; /* Used to protect access to stack (because of async file ops) */ -#endif gboolean dispose_has_run; gboolean undo_redo_flag; gboolean confirm_delete; @@ -273,11 +267,7 @@ caja_undostack_manager_init (CajaUndoStackManager * self) /* Initialize private fields */ priv->stack = g_queue_new (); -#if GLIB_CHECK_VERSION(2, 32, 0) g_mutex_init (&priv->mutex); -#else - priv->mutex = g_mutex_new (); -#endif priv->index = 0; priv->dispose_has_run = FALSE; priv->undo_redo_flag = FALSE; @@ -293,22 +283,13 @@ caja_undostack_manager_dispose (GObject * object) if (priv->dispose_has_run) return; -#if GLIB_CHECK_VERSION(2, 32, 0) g_mutex_lock (&priv->mutex); -#else - g_mutex_lock (priv->mutex); -#endif /* Free each undoable action in the stack and the stack itself */ undostack_dispose_all (priv->stack); g_queue_free (priv->stack); -#if GLIB_CHECK_VERSION(2, 32, 0) g_mutex_unlock (&priv->mutex); g_mutex_clear (&priv->mutex); -#else - g_mutex_unlock (priv->mutex); - g_mutex_free (priv->mutex); -#endif priv->dispose_has_run = TRUE; @@ -339,17 +320,9 @@ caja_undostack_manager_set_property (GObject * object, guint prop_id, new_undo_levels = g_value_get_uint (value); if (new_undo_levels > 0 && (priv->undo_levels != new_undo_levels)) { priv->undo_levels = new_undo_levels; -#if GLIB_CHECK_VERSION(2, 32, 0) g_mutex_lock (&priv->mutex); -#else - g_mutex_lock (priv->mutex); -#endif stack_fix_size (priv); -#if GLIB_CHECK_VERSION(2, 32, 0) g_mutex_unlock (&priv->mutex); -#else - g_mutex_unlock (priv->mutex); -#endif do_menu_update (manager); } break; @@ -436,12 +409,7 @@ caja_undostack_manager_redo (CajaUndoStackManager * manager, char *puri; CajaUndoStackManagerPrivate *priv = manager->priv; -#if GLIB_CHECK_VERSION(2, 32, 0) g_mutex_lock (&priv->mutex); -#else - g_mutex_lock (priv->mutex); -#endif - CajaUndoStackActionData *action = stack_scroll_left (priv); @@ -450,12 +418,7 @@ caja_undostack_manager_redo (CajaUndoStackManager * manager, action->locked = TRUE; } -#if GLIB_CHECK_VERSION(2, 32, 0) g_mutex_unlock (&priv->mutex); -#else - g_mutex_unlock (priv->mutex); -#endif - do_menu_update (manager); @@ -585,11 +548,7 @@ caja_undostack_manager_undo (CajaUndoStackManager * manager, char *new_name; CajaUndoStackManagerPrivate *priv = manager->priv; -#if GLIB_CHECK_VERSION(2, 32, 0) g_mutex_lock (&priv->mutex); -#else - g_mutex_lock (priv->mutex); -#endif CajaUndoStackActionData *action = stack_scroll_right (priv); @@ -597,11 +556,7 @@ caja_undostack_manager_undo (CajaUndoStackManager * manager, action->locked = TRUE; } -#if GLIB_CHECK_VERSION(2, 32, 0) g_mutex_unlock (&priv->mutex); -#else - g_mutex_unlock (priv->mutex); -#endif do_menu_update (manager); @@ -757,22 +712,13 @@ caja_undostack_manager_add_action (CajaUndoStackManager * manager, action->manager = manager; -#if GLIB_CHECK_VERSION(2, 32, 0) g_mutex_lock (&priv->mutex); -#else - g_mutex_lock (priv->mutex); -#endif stack_push_action (priv, action); -#if GLIB_CHECK_VERSION(2, 32, 0) g_mutex_unlock (&priv->mutex); -#else - g_mutex_unlock (priv->mutex); -#endif do_menu_update (manager); - } static GList * @@ -825,11 +771,7 @@ caja_undostack_manager_trash_has_emptied (CajaUndoStackManager * /* Clear actions from the oldest to the newest move to trash */ -#if GLIB_CHECK_VERSION(2, 32, 0) g_mutex_lock (&priv->mutex); -#else - g_mutex_lock (priv->mutex); -#endif clear_redo_actions (priv); CajaUndoStackActionData *action = NULL; @@ -855,11 +797,7 @@ caja_undostack_manager_trash_has_emptied (CajaUndoStackManager * } g_queue_free (tmp_stack); -#if GLIB_CHECK_VERSION(2, 32, 0) g_mutex_unlock (&priv->mutex); -#else - g_mutex_unlock (priv->mutex); -#endif do_menu_update (manager); } @@ -1922,11 +1860,7 @@ do_menu_update (CajaUndoStackManager * manager) CajaUndoStackManagerPrivate *priv = manager->priv; CajaUndoStackMenuData *data = g_slice_new0 (CajaUndoStackMenuData); -#if GLIB_CHECK_VERSION(2, 32, 0) g_mutex_lock (&priv->mutex); -#else - g_mutex_lock (priv->mutex); -#endif action = get_next_undo_action (priv); data->undo_label = get_undo_label (action); @@ -1937,11 +1871,7 @@ do_menu_update (CajaUndoStackManager * manager) data->redo_label = get_redo_label (action); data->redo_description = get_redo_description (action); -#if GLIB_CHECK_VERSION(2, 32, 0) g_mutex_unlock (&priv->mutex); -#else - g_mutex_unlock (priv->mutex); -#endif /* Update menus */ g_signal_emit_by_name (manager, "request-menu-update", data); |