summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRazvan Chitu <razvan.ch95@gmail.com>2016-03-05 13:32:40 +0200
committerCarlos Soriano <csoriano@gnome.org>2016-03-07 21:13:02 +0100
commit11fdde78eb2957fe297b9e2a77c521d64649a6f5 (patch)
tree09e5d5f6d83e6936ffe656363c945d39fec6c307
parent7059cc66ca3bc338e49a6ac4cb37c3484ba3b19d (diff)
downloadnautilus-11fdde78eb2957fe297b9e2a77c521d64649a6f5.tar.gz
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
-rw-r--r--libnautilus-private/nautilus-file-undo-manager.c13
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 862060f03..0fb1583e0 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);
}