⛏️ index : haiku.git

author John Scipione <jscipione@gmail.com> 2024-08-23 22:11:02.0 -04:00:00
committer waddlesplash <waddlesplash@gmail.com> 2024-08-26 18:21:40.0 +00:00:00
commit
e4b2c29b04df0ccd2575da8934b2bcaadf39fb3c [patch]
tree
0633a5c20e4016af80a91bb50c82128bee856215
parent
5bf6f3a20a28eff7469ea14e3e04a3d6a0a8824b
download
e4b2c29b04df0ccd2575da8934b2bcaadf39fb3c.tar.gz

Tracker: Change kMoveSelectionTo to kCopySelectionTo on paste

This restores cut items state to full opacity on paste.

Reverts the part of hrev53329 for cut items. We only copy duplicates
on copy operations, not cut, but we have to make all cut operations
copy after paste is over to restore the state. The clipboard mode is
altered but not the contents.

Fixes #15267

Change-Id: I8a036a548719fe49c512bd38ff1a072890ab2325
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8100
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
(cherry picked from commit 8c124cce0c40b738c559b6e60c60b80480ebdfc1)
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8117

Diff

 src/kits/tracker/FSClipboard.cpp | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/src/kits/tracker/FSClipboard.cpp b/src/kits/tracker/FSClipboard.cpp
index f54eb4e..4f79938 100644
--- a/src/kits/tracker/FSClipboard.cpp
+++ b/src/kits/tracker/FSClipboard.cpp
@@ -445,19 +445,15 @@
							moveList->AddItem(new entry_ref(ref));
						} else if (moveMode == kCopySelectionTo)
							copyList->AddItem(new entry_ref(ref));
					} else {
						// if the entry should have been removed from its
						// directory, we want to copy that entry next time, no
						// matter if the items don't have to be moved at all
						// (source == target)
						if (moveMode == kMoveSelectionTo)
							newMoveMode = kCopySelectionTo;
						else {
							// we are copying a file into its same directory, do
							// a duplicate
							duplicateList->AddItem(new entry_ref(ref));
						}
					} else if (moveMode != kMoveSelectionTo) {
						// we are copying a file into its same directory, do a duplicate
						duplicateList->AddItem(new entry_ref(ref));
					}

					// Whether the entry changed directories or not we want to copy that entry
					// next time, even if the items don't have to be moved (source == target).
					if (moveMode == kMoveSelectionTo)
						newMoveMode = kCopySelectionTo;
				}

				// add the change to the update message (if necessary)