[nautilus] file-undo-manager: fix trash undo invalidation
- From: Carlos Soriano Sánchez <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] file-undo-manager: fix trash undo invalidation
- Date: Mon, 7 Mar 2016 20:13:40 +0000 (UTC)
commit 11fdde78eb2957fe297b9e2a77c521d64649a6f5
Author: Razvan Chitu <razvan ch95 gmail com>
Date: Sat Mar 5 13:32:40 2016 +0200
file-undo-manager: fix trash undo invalidation
In Nautilus, when the Trash is emptied, trash undo / redo operations are
invalidated by the undo manager. However, only the undo operations should be
invalidated, because a redo is not affected by the state of the Trash. In order
to fix this, change the invalidation condition to only target undo.
https://bugzilla.gnome.org/show_bug.cgi?id=763134
libnautilus-private/nautilus-file-undo-manager.c | 13 ++++---------
1 files changed, 4 insertions(+), 9 deletions(-)
---
diff --git a/libnautilus-private/nautilus-file-undo-manager.c
b/libnautilus-private/nautilus-file-undo-manager.c
index 862060f..0fb1583 100644
--- a/libnautilus-private/nautilus-file-undo-manager.c
+++ b/libnautilus-private/nautilus-file-undo-manager.c
@@ -83,15 +83,10 @@ trash_state_changed_cb (NautilusTrashMonitor *monitor,
{
NautilusFileUndoManager *self = user_data;
- if (!is_empty) {
- return;
- }
-
- if (self->priv->state == NAUTILUS_FILE_UNDO_MANAGER_STATE_NONE) {
- return;
- }
-
- if (NAUTILUS_IS_FILE_UNDO_INFO_TRASH (self->priv->info)) {
+ /* A trash operation cannot be undone if the trash is empty */
+ if (is_empty &&
+ self->priv->state == NAUTILUS_FILE_UNDO_MANAGER_STATE_UNDO &&
+ NAUTILUS_IS_FILE_UNDO_INFO_TRASH (self->priv->info)) {
file_undo_manager_clear (self);
g_signal_emit (self, signals[SIGNAL_UNDO_CHANGED], 0);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]