summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2012-04-24 11:13:37 -0400
committerCosimo Cecchi <cosimoc@gnome.org>2012-04-24 11:48:21 -0400
commitd5a9299fc58e646bfbdb8ede8eabb0b9e786eb5e (patch)
tree25363a687a1e55205b42ce5c8e8653e9df262e1f
parent8648e5da0f1a4e375dd985650558fe2ab2dc491b (diff)
downloadnautilus-d5a9299fc58e646bfbdb8ede8eabb0b9e786eb5e.tar.gz
all: remove unused NautilusUndoManager objects
This was some sort of GtkEditable undo framework in the past, but it's basically just unused code now.
-rw-r--r--libnautilus-private/Makefile.am9
-rw-r--r--libnautilus-private/nautilus-entry.c3
-rw-r--r--libnautilus-private/nautilus-undo-manager.c204
-rw-r--r--libnautilus-private/nautilus-undo-manager.h70
-rw-r--r--libnautilus-private/nautilus-undo-signal-handlers.c269
-rw-r--r--libnautilus-private/nautilus-undo-signal-handlers.h35
-rw-r--r--libnautilus-private/nautilus-undo-transaction.c288
-rw-r--r--libnautilus-private/nautilus-undo-transaction.h78
-rw-r--r--libnautilus-private/nautilus-undo.c205
-rw-r--r--libnautilus-private/nautilus-undo.h76
-rw-r--r--src/nautilus-application.c7
-rw-r--r--src/nautilus-application.h4
-rw-r--r--src/nautilus-bookmarks-window.c4
-rw-r--r--src/nautilus-properties-window.c16
-rw-r--r--src/nautilus-window-bookmarks.c1
-rw-r--r--src/nautilus-window-menus.c1
-rw-r--r--src/nautilus-window.c1
17 files changed, 1 insertions, 1270 deletions
diff --git a/libnautilus-private/Makefile.am b/libnautilus-private/Makefile.am
index 8c93c1ae4..8c7c94d6c 100644
--- a/libnautilus-private/Makefile.am
+++ b/libnautilus-private/Makefile.am
@@ -176,15 +176,6 @@ libnautilus_private_la_SOURCES = \
nautilus-tree-view-drag-dest.h \
nautilus-ui-utilities.c \
nautilus-ui-utilities.h \
- nautilus-undo-manager.c \
- nautilus-undo-manager.h \
- nautilus-undo-private.h \
- nautilus-undo-signal-handlers.c \
- nautilus-undo-signal-handlers.h \
- nautilus-undo-transaction.c \
- nautilus-undo-transaction.h \
- nautilus-undo.c \
- nautilus-undo.h \
nautilus-vfs-directory.c \
nautilus-vfs-directory.h \
nautilus-vfs-file.c \
diff --git a/libnautilus-private/nautilus-entry.c b/libnautilus-private/nautilus-entry.c
index 9c65bb157..889f86b35 100644
--- a/libnautilus-private/nautilus-entry.c
+++ b/libnautilus-private/nautilus-entry.c
@@ -29,7 +29,6 @@
#include <string.h>
#include "nautilus-global-preferences.h"
-#include "nautilus-undo-signal-handlers.h"
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
#include <glib/gi18n.h>
@@ -62,8 +61,6 @@ nautilus_entry_init (NautilusEntry *entry)
entry->details = g_new0 (NautilusEntryDetails, 1);
entry->details->user_edit = TRUE;
-
- nautilus_undo_set_up_nautilus_entry_for_undo (entry);
}
GtkWidget *
diff --git a/libnautilus-private/nautilus-undo-manager.c b/libnautilus-private/nautilus-undo-manager.c
deleted file mode 100644
index 5dbde404e..000000000
--- a/libnautilus-private/nautilus-undo-manager.c
+++ /dev/null
@@ -1,204 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/* NautilusUndoManager - Undo/Redo transaction manager.
- *
- * Copyright (C) 2000 Eazel, Inc.
- *
- * Author: Gene Z. Ragan <gzr@eazel.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-#include <libnautilus-private/nautilus-undo-manager.h>
-#include <libnautilus-private/nautilus-undo-transaction.h>
-
-#include <gtk/gtk.h>
-#include "nautilus-undo-private.h"
-
-struct NautilusUndoManagerDetails {
- NautilusUndoTransaction *transaction;
-
- /* These are used to tell undo from redo. */
- gboolean current_transaction_is_redo;
- gboolean new_transaction_is_redo;
-
- /* These are used only so that we can complain if we get more
- * than one transaction inside undo.
- */
- gboolean undo_in_progress;
- int num_transactions_during_undo;
-};
-
-enum {
- CHANGED,
- LAST_SIGNAL
-};
-static guint signals[LAST_SIGNAL];
-
-typedef struct {
- char *path;
- char *no_undo_menu_item_label;
- char *no_undo_menu_item_hint;
-} UndoMenuHandlerConnection;
-
-G_DEFINE_TYPE (NautilusUndoManager,
- nautilus_undo_manager,
- G_TYPE_OBJECT)
-
-static void
-release_transaction (NautilusUndoManager *manager)
-{
- NautilusUndoTransaction *transaction;
-
- transaction = manager->details->transaction;
- manager->details->transaction = NULL;
- if (transaction != NULL) {
- g_object_unref (transaction);
- }
-}
-
-void
-nautilus_undo_manager_append (NautilusUndoManager *manager,
- NautilusUndoTransaction *transaction)
-{
- NautilusUndoTransaction *duplicate_transaction;
-
- /* Check, complain, and ignore the passed-in transaction if we
- * get more than one within a single undo operation. The single
- * transaction we get during the undo operation is supposed to
- * be the one for redoing the undo (or re-undoing the redo).
- */
- if (manager->details->undo_in_progress) {
- manager->details->num_transactions_during_undo += 1;
- g_return_if_fail (manager->details->num_transactions_during_undo == 1);
- }
-
- g_return_if_fail (transaction != NULL);
-
- /* Keep a copy of this transaction (dump the old one). */
- duplicate_transaction = g_object_ref (transaction);
- release_transaction (manager);
- manager->details->transaction = duplicate_transaction;
- manager->details->current_transaction_is_redo =
- manager->details->new_transaction_is_redo;
-
- /* Fire off signal indicating that the undo state has changed. */
- g_signal_emit (manager, signals[CHANGED], 0);
-}
-
-void
-nautilus_undo_manager_forget (NautilusUndoManager *manager,
- NautilusUndoTransaction *transaction)
-{
- /* Nothing to forget unless the item we are passed is the
- * transaction we are currently holding.
- */
- if (transaction != manager->details->transaction) {
- return;
- }
-
- /* Get rid of the transaction we are holding on to. */
- release_transaction (manager);
-
- /* Fire off signal indicating that the undo state has changed. */
- g_signal_emit (manager, signals[CHANGED], 0);
-}
-
-NautilusUndoManager *
-nautilus_undo_manager_new (void)
-{
- return NAUTILUS_UNDO_MANAGER (g_object_new (nautilus_undo_manager_get_type (), NULL));
-}
-
-static void
-nautilus_undo_manager_init (NautilusUndoManager *manager)
-{
- manager->details = g_new0 (NautilusUndoManagerDetails, 1);
-}
-
-void
-nautilus_undo_manager_undo (NautilusUndoManager *manager)
-{
- NautilusUndoTransaction *transaction;
-
- g_return_if_fail (NAUTILUS_IS_UNDO_MANAGER (manager));
-
- transaction = manager->details->transaction;
- manager->details->transaction = NULL;
- if (transaction != NULL) {
- /* Perform the undo. New transactions that come in
- * during an undo are redo transactions. New
- * transactions that come in during a redo are undo
- * transactions. Transactions that come in outside
- * are always undo and never redo.
- */
- manager->details->new_transaction_is_redo =
- !manager->details->current_transaction_is_redo;
- manager->details->undo_in_progress = TRUE;
- manager->details->num_transactions_during_undo = 0;
- nautilus_undo_transaction_undo (transaction);
- manager->details->undo_in_progress = FALSE;
- manager->details->new_transaction_is_redo = FALSE;
-
- /* Let go of the transaction. */
- g_object_unref (transaction);
-
- /* Fire off signal indicating the undo state has changed. */
- g_signal_emit (manager, signals[CHANGED], 0);
- }
-}
-
-static void
-finalize (GObject *object)
-{
- NautilusUndoManager *manager;
-
- manager = NAUTILUS_UNDO_MANAGER (object);
-
- release_transaction (manager);
-
- g_free (manager->details);
-
- if (G_OBJECT_CLASS (nautilus_undo_manager_parent_class)->finalize) {
- (* G_OBJECT_CLASS (nautilus_undo_manager_parent_class)->finalize) (object);
- }
-}
-
-void
-nautilus_undo_manager_attach (NautilusUndoManager *manager, GObject *target)
-{
- g_return_if_fail (NAUTILUS_IS_UNDO_MANAGER (manager));
- g_return_if_fail (G_IS_OBJECT (target));
-
- nautilus_undo_attach_undo_manager (G_OBJECT (target), manager);
-}
-
-static void
-nautilus_undo_manager_class_init (NautilusUndoManagerClass *class)
-{
- G_OBJECT_CLASS (class)->finalize = finalize;
-
- signals[CHANGED] = g_signal_new
- ("changed",
- G_TYPE_FROM_CLASS (class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (NautilusUndoManagerClass,
- changed),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-}
diff --git a/libnautilus-private/nautilus-undo-manager.h b/libnautilus-private/nautilus-undo-manager.h
deleted file mode 100644
index 9307ce56c..000000000
--- a/libnautilus-private/nautilus-undo-manager.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/* NautilusUndoManager - Manages undo and redo transactions.
- * This is the public interface used by the application.
- *
- * Copyright (C) 2000 Eazel, Inc.
- *
- * Author: Gene Z. Ragan <gzr@eazel.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef NAUTILUS_UNDO_MANAGER_H
-#define NAUTILUS_UNDO_MANAGER_H
-
-#include <libnautilus-private/nautilus-undo.h>
-
-#define NAUTILUS_TYPE_UNDO_MANAGER nautilus_undo_manager_get_type()
-#define NAUTILUS_UNDO_MANAGER(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST ((obj), NAUTILUS_TYPE_UNDO_MANAGER, NautilusUndoManager))
-#define NAUTILUS_UNDO_MANAGER_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_UNDO_MANAGER, NautilusUndoManagerClass))
-#define NAUTILUS_IS_UNDO_MANAGER(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NAUTILUS_TYPE_UNDO_MANAGER))
-#define NAUTILUS_IS_UNDO_MANAGER_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_UNDO_MANAGER))
-#define NAUTILUS_UNDO_MANAGER_GET_CLASS(obj) \
- (G_TYPE_INSTANCE_GET_CLASS ((obj), NAUTILUS_TYPE_UNDO_MANAGER, NautilusUndoManagerClass))
-
-typedef struct NautilusUndoManagerDetails NautilusUndoManagerDetails;
-
-typedef struct {
- GObject parent;
- NautilusUndoManagerDetails *details;
-} NautilusUndoManager;
-
-typedef struct {
- GObjectClass parent_slot;
- void (* changed) (GObject *object, gpointer data);
-} NautilusUndoManagerClass;
-
-GType nautilus_undo_manager_get_type (void);
-NautilusUndoManager *nautilus_undo_manager_new (void);
-
-/* Undo operations. */
-void nautilus_undo_manager_undo (NautilusUndoManager *undo_manager);
-
-/* Attach the undo manager to a Gtk object so that object and the widgets inside it can participate in undo. */
-void nautilus_undo_manager_attach (NautilusUndoManager *manager,
- GObject *object);
-
-void nautilus_undo_manager_append (NautilusUndoManager *manager,
- NautilusUndoTransaction *transaction);
-void nautilus_undo_manager_forget (NautilusUndoManager *manager,
- NautilusUndoTransaction *transaction);
-
-#endif /* NAUTILUS_UNDO_MANAGER_H */
diff --git a/libnautilus-private/nautilus-undo-signal-handlers.c b/libnautilus-private/nautilus-undo-signal-handlers.c
deleted file mode 100644
index ac51b485d..000000000
--- a/libnautilus-private/nautilus-undo-signal-handlers.c
+++ /dev/null
@@ -1,269 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/* Signal handlers to enable undo in Gtk Widgets.
- *
- * Copyright (C) 2000 Eazel, Inc.
- *
- * Author: Gene Z. Ragan <gzr@eazel.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-
-#include <config.h>
-#include <gtk/gtk.h>
-
-#include <glib/gi18n.h>
-#include <libnautilus-private/nautilus-undo.h>
-
-#include <string.h>
-
-#include "nautilus-undo-signal-handlers.h"
-
-
-typedef struct {
- char *undo_text;
- gint position;
- guint selection_start;
- guint selection_end;
-} EditableUndoData;
-
-typedef struct {
- gboolean undo_registered;
-} EditableUndoObjectData;
-
-
-static void restore_editable_from_undo_snapshot_callback (GObject *target,
- gpointer callback_data);
-static void editable_register_edit_undo (GtkEditable *editable);
-static void free_editable_object_data (gpointer data);
-
-/* nautilus_undo_set_up_nautilus_entry_for_undo
- *
- * Functions and callback methods to handle undo
- * in a NautilusEntry
- */
-
-static void
-nautilus_entry_user_changed_callback (NautilusEntry *entry)
-{
- /* Register undo transaction */
- editable_register_edit_undo (GTK_EDITABLE (entry));
-}
-
-void
-nautilus_undo_set_up_nautilus_entry_for_undo (NautilusEntry *entry)
-{
- EditableUndoObjectData *data;
-
- if (!NAUTILUS_IS_ENTRY (entry) ) {
- return;
- }
-
- data = g_new(EditableUndoObjectData, 1);
- data->undo_registered = FALSE;
- g_object_set_data_full (G_OBJECT (entry), "undo_registered",
- data, free_editable_object_data);
-
- /* Connect to entry signals */
- g_signal_connect (entry, "user_changed",
- G_CALLBACK (nautilus_entry_user_changed_callback),
- NULL);
-}
-
-void
-nautilus_undo_tear_down_nautilus_entry_for_undo (NautilusEntry *entry)
-{
- if (!NAUTILUS_IS_ENTRY (entry) ) {
- return;
- }
-
- /* Disconnect from entry signals */
- g_signal_handlers_disconnect_by_func
- (entry, G_CALLBACK (nautilus_entry_user_changed_callback), NULL);
-
-}
-
-/* nautilus_undo_set_up_nautilus_entry_for_undo
- *
- * Functions and callback methods to handle undo
- * in a NautilusEntry
- */
-
-static void
-free_editable_undo_data (gpointer data)
-{
- EditableUndoData *undo_data;
-
- undo_data = (EditableUndoData *) data;
-
- g_free (undo_data->undo_text);
- g_free (undo_data);
-}
-
-static void
-free_editable_object_data (gpointer data)
-{
- g_free (data);
-}
-
-
-static void
-editable_insert_text_callback (GtkEditable *editable)
-{
- /* Register undo transaction */
- editable_register_edit_undo (editable);
-}
-
-static void
-editable_delete_text_callback (GtkEditable *editable)
-{
- /* Register undo transaction */
- editable_register_edit_undo (editable);
-}
-
-static void
-editable_register_edit_undo (GtkEditable *editable)
-{
- EditableUndoData *undo_data;
- EditableUndoObjectData *undo_info;
- gpointer data;
-
- if (!GTK_IS_EDITABLE (editable) ) {
- return;
- }
-
- /* Check our undo registered flag */
- data = g_object_get_data (G_OBJECT (editable), "undo_registered");
- if (data == NULL) {
- g_warning ("Undo data is NULL");
- return;
- }
-
- undo_info = (EditableUndoObjectData *)data;
- if (undo_info->undo_registered) {
- return;
- }
-
- undo_data = g_new0 (EditableUndoData, 1);
- undo_data->undo_text = gtk_editable_get_chars (editable, 0, -1);
- undo_data->position = gtk_editable_get_position (editable);
- gtk_editable_get_selection_bounds (editable,
- &undo_data->selection_start,
- &undo_data->selection_end);
-
- nautilus_undo_register
- (G_OBJECT (editable),
- restore_editable_from_undo_snapshot_callback,
- undo_data,
- (GDestroyNotify) free_editable_undo_data,
- _("Edit"),
- _("Undo Edit"),
- _("Undo the edit"),
- _("Redo Edit"),
- _("Redo the edit"));
-
- undo_info->undo_registered = TRUE;
-}
-
-void
-nautilus_undo_set_up_editable_for_undo (GtkEditable *editable)
-{
- EditableUndoObjectData *data;
-
- if (!GTK_IS_EDITABLE (editable) ) {
- return;
- }
-
- /* Connect to editable signals */
- g_signal_connect (editable, "insert_text",
- G_CALLBACK (editable_insert_text_callback), NULL);
- g_signal_connect (editable, "delete_text",
- G_CALLBACK (editable_delete_text_callback), NULL);
-
-
- data = g_new (EditableUndoObjectData, 1);
- data->undo_registered = FALSE;
- g_object_set_data_full (G_OBJECT (editable), "undo_registered",
- data, free_editable_object_data);
-}
-
-void
-nautilus_undo_tear_down_editable_for_undo (GtkEditable *editable)
-{
- if (!GTK_IS_EDITABLE (editable) ) {
- return;
- }
-
- /* Disconnect from entry signals */
- g_signal_handlers_disconnect_by_func
- (editable, G_CALLBACK (editable_insert_text_callback), NULL);
- g_signal_handlers_disconnect_by_func
- (editable, G_CALLBACK (editable_delete_text_callback), NULL);
-}
-
-/* restore_editable_from_undo_snapshot_callback
- *
- * Restore edited text.
- */
-static void
-restore_editable_from_undo_snapshot_callback (GObject *target, gpointer callback_data)
-{
- GtkEditable *editable;
- GtkWindow *window;
- EditableUndoData *undo_data;
- EditableUndoObjectData *data;
- gint position;
-
- editable = GTK_EDITABLE (target);
- undo_data = (EditableUndoData *) callback_data;
-
- /* Check our undo registered flag */
- data = g_object_get_data (target, "undo_registered");
- if (data == NULL) {
- g_warning ("Undo regisetred flag not found");
- return;
- }
-
- /* Reset the registered flag so we get a new item for future editing. */
- data->undo_registered = FALSE;
-
- /* Register a new undo transaction for redo. */
- editable_register_edit_undo (editable);
-
- /* Restore the text. */
- position = 0;
- gtk_editable_delete_text (editable, 0, -1);
- gtk_editable_insert_text (editable, undo_data->undo_text,
- strlen (undo_data->undo_text), &position);
-
- /* Set focus to widget */
- window = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (target)));
- gtk_window_set_focus (window, GTK_WIDGET (editable));
-
- /* We have to do this call, because the previous call selects all text */
- gtk_editable_select_region (editable, 0, 0);
-
- /* Restore selection */
- gtk_editable_select_region (editable, undo_data->selection_start,
- undo_data->selection_end);
-
- /* Set the i-beam to the saved position */
- gtk_editable_set_position (editable, undo_data->position);
-
- /* Reset the registered flag so we get a new item for future editing. */
- data->undo_registered = FALSE;
-}
diff --git a/libnautilus-private/nautilus-undo-signal-handlers.h b/libnautilus-private/nautilus-undo-signal-handlers.h
deleted file mode 100644
index afd1b6e85..000000000
--- a/libnautilus-private/nautilus-undo-signal-handlers.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/* Signal handlers to enable undo in Gtk Widgets.
- *
- * Copyright (C) 2000 Eazel, Inc.
- *
- * Author: Gene Z. Ragan <gzr@eazel.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef NAUTILUS_UNDO_SIGNAL_HANDLERS_H
-#define NAUTILUS_UNDO_SIGNAL_HANDLERS_H
-
-#include <libnautilus-private/nautilus-entry.h>
-
-void nautilus_undo_set_up_nautilus_entry_for_undo (NautilusEntry *entry);
-void nautilus_undo_tear_down_nautilus_entry_for_undo (NautilusEntry *entry);
-void nautilus_undo_set_up_editable_for_undo (GtkEditable *editable);
-void nautilus_undo_tear_down_editable_for_undo (GtkEditable *editable);
-
-#endif /* NAUTILUS_UNDO_SIGNAL_HANDLERS_H */
diff --git a/libnautilus-private/nautilus-undo-transaction.c b/libnautilus-private/nautilus-undo-transaction.c
deleted file mode 100644
index f7bb47be2..000000000
--- a/libnautilus-private/nautilus-undo-transaction.c
+++ /dev/null
@@ -1,288 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/* NautilusUndoTransaction - An object for an undoable transaction.
- * Used internally by undo machinery.
- * Not public.
- *
- * Copyright (C) 2000 Eazel, Inc.
- *
- * Author: Gene Z. Ragan <gzr@eazel.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-#include <libnautilus-private/nautilus-undo.h>
-#include <libnautilus-private/nautilus-undo-manager.h>
-#include <libnautilus-private/nautilus-undo-transaction.h>
-
-#include "nautilus-undo-private.h"
-#include <gtk/gtk.h>
-
-#define NAUTILUS_UNDO_TRANSACTION_LIST_DATA "Nautilus undo transaction list"
-
-/* undo atoms */
-static void undo_atom_list_free (GList *list);
-static void undo_atom_list_undo_and_free (GList *list);
-
-G_DEFINE_TYPE (NautilusUndoTransaction, nautilus_undo_transaction,
- G_TYPE_OBJECT);
-
-NautilusUndoTransaction *
-nautilus_undo_transaction_new (const char *operation_name,
- const char *undo_menu_item_label,
- const char *undo_menu_item_hint,
- const char *redo_menu_item_label,
- const char *redo_menu_item_hint)
-{
- NautilusUndoTransaction *transaction;
-
- transaction = NAUTILUS_UNDO_TRANSACTION (g_object_new (nautilus_undo_transaction_get_type (), NULL));
-
- transaction->operation_name = g_strdup (operation_name);
- transaction->undo_menu_item_label = g_strdup (undo_menu_item_label);
- transaction->undo_menu_item_hint = g_strdup (undo_menu_item_hint);
- transaction->redo_menu_item_label = g_strdup (redo_menu_item_label);
- transaction->redo_menu_item_hint = g_strdup (redo_menu_item_hint);
-
- return transaction;
-}
-
-static void
-nautilus_undo_transaction_init (NautilusUndoTransaction *transaction)
-{
-}
-
-static void
-remove_transaction_from_object (gpointer list_data, gpointer callback_data)
-{
- NautilusUndoAtom *atom;
- NautilusUndoTransaction *transaction;
- GList *list;
-
- g_assert (list_data != NULL);
- atom = list_data;
- transaction = NAUTILUS_UNDO_TRANSACTION (callback_data);
-
- /* Remove the transaction from the list on the atom. */
- list = g_object_get_data (atom->target, NAUTILUS_UNDO_TRANSACTION_LIST_DATA);
-
- if (list != NULL) {
- list = g_list_remove (list, transaction);
- g_object_set_data (atom->target, NAUTILUS_UNDO_TRANSACTION_LIST_DATA, list);
- }
-}
-
-static void
-remove_transaction_from_atom_targets (NautilusUndoTransaction *transaction)
-{
-
- g_list_foreach (transaction->atom_list,
- remove_transaction_from_object,
- transaction);
-}
-
-static void
-nautilus_undo_transaction_finalize (GObject *object)
-{
- NautilusUndoTransaction *transaction;
-
- transaction = NAUTILUS_UNDO_TRANSACTION (object);
-
- remove_transaction_from_atom_targets (transaction);
- undo_atom_list_free (transaction->atom_list);
-
- g_free (transaction->operation_name);
- g_free (transaction->undo_menu_item_label);
- g_free (transaction->undo_menu_item_hint);
- g_free (transaction->redo_menu_item_label);
- g_free (transaction->redo_menu_item_hint);
-
- if (transaction->owner != NULL) {
- g_object_unref (transaction->owner);
- }
-
- G_OBJECT_CLASS (nautilus_undo_transaction_parent_class)->finalize (object);
-}
-
-void
-nautilus_undo_transaction_add_atom (NautilusUndoTransaction *transaction,
- const NautilusUndoAtom *atom)
-{
- GList *list;
-
- g_return_if_fail (NAUTILUS_IS_UNDO_TRANSACTION (transaction));
- g_return_if_fail (atom != NULL);
- g_return_if_fail (G_IS_OBJECT (atom->target));
-
- /* Add the atom to the atom list in the transaction. */
- transaction->atom_list = g_list_append
- (transaction->atom_list, g_memdup (atom, sizeof (*atom)));
-
- /* Add the transaction to the list on the atoms target object. */
- list = g_object_get_data (atom->target, NAUTILUS_UNDO_TRANSACTION_LIST_DATA);
- if (g_list_find (list, transaction) != NULL) {
- return;
- }
-
- /* If it's not already on that atom, this object is new. */
- list = g_list_prepend (list, transaction);
- g_object_set_data (atom->target, NAUTILUS_UNDO_TRANSACTION_LIST_DATA, list);
-
- /* Connect a signal handler to the atom so it will unregister
- * itself when it's destroyed.
- */
- g_signal_connect (atom->target, "destroy",
- G_CALLBACK (nautilus_undo_transaction_unregister_object),
- NULL);
-}
-
-void
-nautilus_undo_transaction_undo (NautilusUndoTransaction *transaction)
-{
- g_return_if_fail (NAUTILUS_IS_UNDO_TRANSACTION (transaction));
-
- remove_transaction_from_atom_targets (transaction);
- undo_atom_list_undo_and_free (transaction->atom_list);
-
- transaction->atom_list = NULL;
-}
-
-void
-nautilus_undo_transaction_add_to_undo_manager (NautilusUndoTransaction *transaction,
- NautilusUndoManager *manager)
-{
- g_return_if_fail (NAUTILUS_IS_UNDO_TRANSACTION (transaction));
- g_return_if_fail (transaction->owner == NULL);
-
- if (manager != NULL) {
- nautilus_undo_manager_append (manager, transaction);
- transaction->owner = g_object_ref (manager);
- }
-}
-
-static void
-remove_atoms (NautilusUndoTransaction *transaction,
- GObject *object)
-{
- GList *p, *next;
- NautilusUndoAtom *atom;
-
- g_assert (NAUTILUS_IS_UNDO_TRANSACTION (transaction));
- g_assert (G_IS_OBJECT (object));
-
- /* Destroy any atoms for this object. */
- for (p = transaction->atom_list; p != NULL; p = next) {
- atom = p->data;
- next = p->next;
-
- if (atom->target == object) {
- transaction->atom_list = g_list_remove_link
- (transaction->atom_list, p);
- undo_atom_list_free (p);
- }
- }
-
- /* If all the atoms are gone, forget this transaction.
- * This may end up freeing the transaction.
- */
- if (transaction->atom_list == NULL) {
- nautilus_undo_manager_forget (
- transaction->owner, transaction);
- }
-}
-
-static void
-remove_atoms_cover (gpointer list_data, gpointer callback_data)
-{
- if (NAUTILUS_IS_UNDO_TRANSACTION (list_data)) {
- remove_atoms (NAUTILUS_UNDO_TRANSACTION (list_data), G_OBJECT (callback_data));
- }
-}
-
-void
-nautilus_undo_transaction_unregister_object (GObject *object)
-{
- GList *list;
-
- g_return_if_fail (G_IS_OBJECT (object));
-
- /* Remove atoms from each transaction on the list. */
- list = g_object_get_data (object, NAUTILUS_UNDO_TRANSACTION_LIST_DATA);
- if (list != NULL) {
- g_list_foreach (list, remove_atoms_cover, object);
- g_list_free (list);
- g_object_set_data (object, NAUTILUS_UNDO_TRANSACTION_LIST_DATA, NULL);
- }
-}
-
-static void
-undo_atom_free (NautilusUndoAtom *atom)
-{
- /* Call the destroy-notify function if it's present. */
- if (atom->callback_data_destroy_notify != NULL) {
- (* atom->callback_data_destroy_notify) (atom->callback_data);
- }
-
- /* Free the atom storage. */
- g_free (atom);
-}
-
-static void
-undo_atom_undo_and_free (NautilusUndoAtom *atom)
-{
- /* Call the function that does the actual undo. */
- (* atom->callback) (atom->target, atom->callback_data);
-
- /* Get rid of the atom now that it's spent. */
- undo_atom_free (atom);
-}
-
-static void
-undo_atom_free_cover (gpointer atom, gpointer callback_data)
-{
- g_assert (atom != NULL);
- g_assert (callback_data == NULL);
- undo_atom_free (atom);
-}
-
-static void
-undo_atom_undo_and_free_cover (gpointer atom, gpointer callback_data)
-{
- g_assert (atom != NULL);
- g_assert (callback_data == NULL);
- undo_atom_undo_and_free (atom);
-}
-
-static void
-undo_atom_list_free (GList *list)
-{
- g_list_foreach (list, undo_atom_free_cover, NULL);
- g_list_free (list);
-}
-
-static void
-undo_atom_list_undo_and_free (GList *list)
-{
- g_list_foreach (list, undo_atom_undo_and_free_cover, NULL);
- g_list_free (list);
-}
-
-static void
-nautilus_undo_transaction_class_init (NautilusUndoTransactionClass *klass)
-{
- G_OBJECT_CLASS (klass)->finalize = nautilus_undo_transaction_finalize;
-}
diff --git a/libnautilus-private/nautilus-undo-transaction.h b/libnautilus-private/nautilus-undo-transaction.h
deleted file mode 100644
index 2f911dcab..000000000
--- a/libnautilus-private/nautilus-undo-transaction.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/* NautilusUndoTransaction - An object for an undoable transaction.
- * Used internally by undo machinery.
- * Not public.
- *
- * Copyright (C) 2000 Eazel, Inc.
- *
- * Author: Gene Z. Ragan <gzr@eazel.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef NAUTILUS_UNDO_TRANSACTION_H
-#define NAUTILUS_UNDO_TRANSACTION_H
-
-#include <libnautilus-private/nautilus-undo.h>
-
-#define NAUTILUS_TYPE_UNDO_TRANSACTION nautilus_undo_transaction_get_type()
-#define NAUTILUS_UNDO_TRANSACTION(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST ((obj), NAUTILUS_TYPE_UNDO_TRANSACTION, NautilusUndoTransaction))
-#define NAUTILUS_UNDO_TRANSACTION_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_UNDO_TRANSACTION, NautilusUndoTransactionClass))
-#define NAUTILUS_IS_UNDO_TRANSACTION(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NAUTILUS_TYPE_UNDO_TRANSACTION))
-#define NAUTILUS_IS_UNDO_TRANSACTION_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_UNDO_TRANSACTION))
-#define NAUTILUS_UNDO_TRANSACTION_GET_CLASS(obj) \
- (G_TYPE_INSTANCE_GET_CLASS ((obj), NAUTILUS_TYPE_UNDO_TRANSACTION, NautilusUndoTransactionClass))
-
-/* The typedef for NautilusUndoTransaction is in nautilus-undo.h
- to avoid circular deps */
-typedef struct _NautilusUndoTransactionClass NautilusUndoTransactionClass;
-
-struct _NautilusUndoTransaction {
- GObject parent_slot;
-
- char *operation_name;
- char *undo_menu_item_label;
- char *undo_menu_item_hint;
- char *redo_menu_item_label;
- char *redo_menu_item_hint;
- GList *atom_list;
-
- NautilusUndoManager *owner;
-};
-
-struct _NautilusUndoTransactionClass {
- GObjectClass parent_slot;
-};
-
-GType nautilus_undo_transaction_get_type (void);
-NautilusUndoTransaction *nautilus_undo_transaction_new (const char *operation_name,
- const char *undo_menu_item_label,
- const char *undo_menu_item_hint,
- const char *redo_menu_item_label,
- const char *redo_menu_item_hint);
-void nautilus_undo_transaction_add_atom (NautilusUndoTransaction *transaction,
- const NautilusUndoAtom *atom);
-void nautilus_undo_transaction_add_to_undo_manager (NautilusUndoTransaction *transaction,
- NautilusUndoManager *manager);
-void nautilus_undo_transaction_unregister_object (GObject *atom_target);
-void nautilus_undo_transaction_undo (NautilusUndoTransaction *transaction);
-
-#endif /* NAUTILUS_UNDO_TRANSACTION_H */
diff --git a/libnautilus-private/nautilus-undo.c b/libnautilus-private/nautilus-undo.c
deleted file mode 100644
index ea8952dd2..000000000
--- a/libnautilus-private/nautilus-undo.c
+++ /dev/null
@@ -1,205 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/* nautilus-undo.c - public interface for objects that implement
- * undoable actions -- works across components
- *
- * Copyright (C) 2000 Eazel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Darin Adler <darin@bentspoon.com>
- */
-
-#include <config.h>
-#include "nautilus-undo.h"
-
-#include "nautilus-undo-private.h"
-#include "nautilus-undo-transaction.h"
-#include <gtk/gtk.h>
-
-#define NAUTILUS_UNDO_MANAGER_DATA "Nautilus undo manager"
-
-/* Register a simple undo action by calling nautilus_undo_register_full. */
-void
-nautilus_undo_register (GObject *target,
- NautilusUndoCallback callback,
- gpointer callback_data,
- GDestroyNotify callback_data_destroy_notify,
- const char *operation_name,
- const char *undo_menu_item_label,
- const char *undo_menu_item_hint,
- const char *redo_menu_item_label,
- const char *redo_menu_item_hint)
-{
- NautilusUndoAtom atom;
- GList single_atom_list;
-
- g_return_if_fail (G_IS_OBJECT (target));
- g_return_if_fail (callback != NULL);
-
- /* Make an atom. */
- atom.target = target;
- atom.callback = callback;
- atom.callback_data = callback_data;
- atom.callback_data_destroy_notify = callback_data_destroy_notify;
-
- /* Make a single-atom list. */
- single_atom_list.data = &atom;
- single_atom_list.next = NULL;
- single_atom_list.prev = NULL;
-
- /* Call the full version of the registration function,
- * using the undo target as the place to search for the
- * undo manager.
- */
- nautilus_undo_register_full (&single_atom_list,
- target,
- operation_name,
- undo_menu_item_label,
- undo_menu_item_hint,
- redo_menu_item_label,
- redo_menu_item_hint);
-}
-
-/* Register an undo action. */
-void
-nautilus_undo_register_full (GList *atoms,
- GObject *undo_manager_search_start_object,
- const char *operation_name,
- const char *undo_menu_item_label,
- const char *undo_menu_item_hint,
- const char *redo_menu_item_label,
- const char *redo_menu_item_hint)
-{
- NautilusUndoTransaction *transaction;
- GList *p;
-
- g_return_if_fail (atoms != NULL);
- g_return_if_fail (G_IS_OBJECT (undo_manager_search_start_object));
-
- /* Create an undo transaction */
- transaction = nautilus_undo_transaction_new (operation_name,
- undo_menu_item_label,
- undo_menu_item_hint,
- redo_menu_item_label,
- redo_menu_item_hint);
- for (p = atoms; p != NULL; p = p->next) {
- nautilus_undo_transaction_add_atom (transaction, p->data);
- }
- nautilus_undo_transaction_add_to_undo_manager
- (transaction,
- nautilus_undo_get_undo_manager (undo_manager_search_start_object));
-
- /* Now we are done with the transaction.
- * If the undo manager is holding it, then this will not destroy it.
- */
- g_object_unref (transaction);
-}
-
-/* Cover for forgetting about all undo relating to a particular target. */
-void
-nautilus_undo_unregister (GObject *target)
-{
- /* Perhaps this should also unregister all children if called on a
- * GtkContainer? That might be handy.
- */
- nautilus_undo_transaction_unregister_object (target);
-}
-
-void
-nautilus_undo (GObject *undo_manager_search_start_object)
-{
- NautilusUndoManager *manager;
-
- g_return_if_fail (G_IS_OBJECT (undo_manager_search_start_object));
-
- manager = nautilus_undo_get_undo_manager (undo_manager_search_start_object);
- if (manager != NULL) {
- nautilus_undo_manager_undo (manager);
- }
-}
-
-NautilusUndoManager *
-nautilus_undo_get_undo_manager (GObject *start_object)
-{
- NautilusUndoManager *manager;
- GtkWidget *parent;
- GtkWindow *transient_parent;
-
- if (start_object == NULL) {
- return NULL;
- }
-
- g_return_val_if_fail (G_IS_OBJECT (start_object), NULL);
-
- /* Check for an undo manager right here. */
- manager = g_object_get_data (start_object, NAUTILUS_UNDO_MANAGER_DATA);
- if (manager != NULL) {
- return manager;
- }
-
- /* Check for undo manager up the parent chain. */
- if (GTK_IS_WIDGET (start_object)) {
- parent = gtk_widget_get_parent (GTK_WIDGET (start_object));
- if (parent != NULL) {
- manager = nautilus_undo_get_undo_manager (G_OBJECT (parent));
- if (manager != NULL) {
- return manager;
- }
- }
-
- /* Check for undo manager in our window's parent. */
- if (GTK_IS_WINDOW (start_object)) {
- transient_parent = gtk_window_get_transient_for (GTK_WINDOW (start_object));
- if (transient_parent != NULL) {
- manager = nautilus_undo_get_undo_manager (G_OBJECT (transient_parent));
- if (manager != NULL) {
- return manager;
- }
- }
- }
- }
-
- /* Found nothing. I can live with that. */
- return NULL;
-}
-
-void
-nautilus_undo_attach_undo_manager (GObject *object,
- NautilusUndoManager *manager)
-{
- g_return_if_fail (G_IS_OBJECT (object));
-
- if (manager == NULL) {
- g_object_set_data (object, NAUTILUS_UNDO_MANAGER_DATA, NULL);
- } else {
- g_object_ref (manager);
- g_object_set_data_full
- (object, NAUTILUS_UNDO_MANAGER_DATA,
- manager, g_object_unref);
- }
-}
-
-/* Copy a reference to the undo manager fromone object to another. */
-void
-nautilus_undo_share_undo_manager (GObject *destination_object,
- GObject *source_object)
-{
- NautilusUndoManager *manager;
-
- manager = nautilus_undo_get_undo_manager (source_object);
- nautilus_undo_attach_undo_manager (destination_object, manager);
-}
diff --git a/libnautilus-private/nautilus-undo.h b/libnautilus-private/nautilus-undo.h
deleted file mode 100644
index d1ad1355e..000000000
--- a/libnautilus-private/nautilus-undo.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/* nautilus-undo.h - public interface for objects that implement
- * undoable actions -- works across components
- *
- * Copyright (C) 2000 Eazel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Darin Adler <darin@bentspoon.com>
- */
-
-#ifndef NAUTILUS_UNDO_H
-#define NAUTILUS_UNDO_H
-
-#include <glib-object.h>
-
-typedef struct _NautilusUndoTransaction NautilusUndoTransaction;
-
-
-/* The basic undoable operation. */
-typedef void (* NautilusUndoCallback) (GObject *target, gpointer callback_data);
-
-/* Recipe for undo of a bit of work on an object.
- * Create these atoms when you want to register more
- * than one as a single undoable operation.
- */
-typedef struct {
- GObject *target;
- NautilusUndoCallback callback;
- gpointer callback_data;
- GDestroyNotify callback_data_destroy_notify;
-} NautilusUndoAtom;
-
-/* Registering something that can be undone. */
-void nautilus_undo_register (GObject *target,
- NautilusUndoCallback callback,
- gpointer callback_data,
- GDestroyNotify callback_data_destroy_notify,
- const char *operation_name,
- const char *undo_menu_item_label,
- const char *undo_menu_item_hint,
- const char *redo_menu_item_label,
- const char *redo_menu_item_hint);
-void nautilus_undo_register_full (GList *atoms,
- GObject *undo_manager_search_start_object,
- const char *operation_name,
- const char *undo_menu_item_label,
- const char *undo_menu_item_hint,
- const char *redo_menu_item_label,
- const char *redo_menu_item_hint);
-void nautilus_undo_unregister (GObject *target);
-
-/* Performing an undo explicitly. Only for use by objects "out in the field".
- * The menu bar itself uses a richer API in the undo manager.
- */
-void nautilus_undo (GObject *undo_manager_search_start_object);
-
-/* Connecting an undo manager. */
-void nautilus_undo_share_undo_manager (GObject *destination_object,
- GObject *source_object);
-
-#endif /* NAUTILUS_UNDO_H */
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index 32770d0fa..f1d21a05c 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -61,7 +61,6 @@
#include <libnautilus-private/nautilus-module.h>
#include <libnautilus-private/nautilus-signaller.h>
#include <libnautilus-private/nautilus-ui-utilities.h>
-#include <libnautilus-private/nautilus-undo-manager.h>
#include <libnautilus-extension/nautilus-menu-provider.h>
#define DEBUG_FLAG NAUTILUS_DEBUG_APPLICATION
@@ -511,8 +510,6 @@ nautilus_application_create_window (NautilusApplication *application,
}
g_free (geometry_string);
- nautilus_undo_manager_attach (application->undo_manager, G_OBJECT (window));
-
DEBUG ("Creating a new navigation window");
return window;
@@ -909,7 +906,6 @@ nautilus_application_finalize (GObject *object)
nautilus_bookmarks_exiting ();
- g_clear_object (&application->undo_manager);
g_clear_object (&application->priv->volume_monitor);
g_clear_object (&application->priv->progress_handler);
@@ -1204,9 +1200,6 @@ nautilus_application_startup (GApplication *app)
/* initialize the previewer singleton */
nautilus_previewer_get_singleton ();
- /* create an undo manager */
- self->undo_manager = nautilus_undo_manager_new ();
-
/* create DBus manager */
nautilus_dbus_manager_start (app);
nautilus_freedesktop_dbus_start (self);
diff --git a/src/nautilus-application.h b/src/nautilus-application.h
index fd1885b23..53b589772 100644
--- a/src/nautilus-application.h
+++ b/src/nautilus-application.h
@@ -28,8 +28,6 @@
#include <gio/gio.h>
#include <gtk/gtk.h>
-#include <libnautilus-private/nautilus-undo-manager.h>
-
#include "nautilus-window.h"
#define NAUTILUS_DESKTOP_ICON_VIEW_IID "OAFIID:Nautilus_File_Manager_Desktop_Icon_View"
@@ -56,8 +54,6 @@ typedef struct _NautilusApplicationPriv NautilusApplicationPriv;
typedef struct {
GtkApplication parent;
- NautilusUndoManager *undo_manager;
-
NautilusApplicationPriv *priv;
} NautilusApplication;
diff --git a/src/nautilus-bookmarks-window.c b/src/nautilus-bookmarks-window.c
index 872a46f26..c6932ce1c 100644
--- a/src/nautilus-bookmarks-window.c
+++ b/src/nautilus-bookmarks-window.c
@@ -27,11 +27,10 @@
#include <config.h>
#include "nautilus-bookmarks-window.h"
+#include "nautilus-entry.h"
#include "nautilus-window.h"
-#include <libnautilus-private/nautilus-undo.h>
#include <libnautilus-private/nautilus-global-preferences.h>
-#include <libnautilus-private/nautilus-undo-signal-handlers.h>
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-gnome-extensions.h>
@@ -266,7 +265,6 @@ create_bookmarks_window (NautilusBookmarkList *list, GObject *undo_manager_sourc
jump_button = (GtkWidget *)gtk_builder_get_object (builder, "bookmark_jump_button");
set_up_close_accelerator (window);
- nautilus_undo_share_undo_manager (G_OBJECT (window), undo_manager_source);
gtk_window_set_wmclass (GTK_WINDOW (window), "bookmarks", "Nautilus");
nautilus_bookmarks_window_restore_geometry (window);
diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c
index d99105a95..db3b2eb9a 100644
--- a/src/nautilus-properties-window.c
+++ b/src/nautilus-properties-window.c
@@ -58,8 +58,6 @@
#include <libnautilus-private/nautilus-metadata.h>
#include <libnautilus-private/nautilus-mime-application-chooser.h>
#include <libnautilus-private/nautilus-module.h>
-#include <libnautilus-private/nautilus-undo-signal-handlers.h>
-#include <libnautilus-private/nautilus-undo.h>
#if HAVE_SYS_VFS_H
#include <sys/vfs.h>
@@ -586,20 +584,6 @@ set_name_field (NautilusPropertiesWindow *window,
GTK_WIDGET (window->details->name_label),
GTK_POS_RIGHT, 1, 1);
gtk_label_set_mnemonic_widget (GTK_LABEL (window->details->name_label), window->details->name_field);
-
- /* FIXME bugzilla.gnome.org 42151:
- * With this (and one place elsewhere in this file, not sure which is the
- * trouble-causer) code in place, bug 2151 happens (crash on quit). Since
- * we've removed Undo from Nautilus for now, I'm just ifdeffing out this
- * code rather than trying to fix 2151 now. Note that it might be possible
- * to fix 2151 without making Undo actually work, it's just not worth the
- * trouble.
- */
-#ifdef UNDO_ENABLED
- /* Set up name field for undo */
- nautilus_undo_set_up_nautilus_entry_for_undo ( NAUTILUS_ENTRY (window->details->name_field));
- nautilus_undo_editable_set_undo_key (GTK_EDITABLE (window->details->name_field), TRUE);
-#endif
g_signal_connect_object (window->details->name_field, "focus_out_event",
G_CALLBACK (name_field_focus_out), window, 0);
diff --git a/src/nautilus-window-bookmarks.c b/src/nautilus-window-bookmarks.c
index c7aa72cdd..18b5e3a89 100644
--- a/src/nautilus-window-bookmarks.c
+++ b/src/nautilus-window-bookmarks.c
@@ -33,7 +33,6 @@
#include "nautilus-bookmarks-window.h"
#include "nautilus-window-bookmarks.h"
#include "nautilus-window-private.h"
-#include <libnautilus-private/nautilus-undo-manager.h>
#include <libnautilus-private/nautilus-ui-utilities.h>
#include <eel/eel-debug.h>
#include <eel/eel-stock-dialogs.h>
diff --git a/src/nautilus-window-menus.c b/src/nautilus-window-menus.c
index 133c4f7d9..24292c56f 100644
--- a/src/nautilus-window-menus.c
+++ b/src/nautilus-window-menus.c
@@ -53,7 +53,6 @@
#include <libnautilus-private/nautilus-icon-names.h>
#include <libnautilus-private/nautilus-ui-utilities.h>
#include <libnautilus-private/nautilus-module.h>
-#include <libnautilus-private/nautilus-undo-manager.h>
#include <libnautilus-private/nautilus-program-choosing.h>
#include <libnautilus-private/nautilus-search-directory.h>
#include <libnautilus-private/nautilus-search-engine.h>
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index c1b71ab5e..63075d14b 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -60,7 +60,6 @@
#include <libnautilus-private/nautilus-global-preferences.h>
#include <libnautilus-private/nautilus-metadata.h>
#include <libnautilus-private/nautilus-clipboard.h>
-#include <libnautilus-private/nautilus-undo.h>
#include <libnautilus-private/nautilus-search-directory.h>
#include <libnautilus-private/nautilus-signaller.h>