From 10dadc6b0dd646faa251c0935e75d07c97b3052d Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 8 Feb 2012 17:22:04 -0800 Subject: EXP-1873 : Move cut items to trash in cut/copy over cut situations. --- indra/newview/llfolderview.cpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfolderview.cpp') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 1d318ca221..51a5839b75 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -1014,6 +1014,24 @@ bool isDescendantOfASelectedItem(LLFolderViewItem* item, const std::vector exit + if (!LLClipboard::getInstance()->isCutMode()) + return; + + // Get the list of clipboard item uuids and iterate through them + LLDynamicArray objects; + LLClipboard::getInstance()->pasteFromClipboard(objects); + for (LLDynamicArray::const_iterator iter = objects.begin(); + iter != objects.end(); + ++iter) + { + const LLUUID& item_id = (*iter); + remove_item(&gInventory, item_id); + } +} + void LLFolderView::onItemsRemovalConfirmation(const LLSD& notification, const LLSD& response) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); @@ -2109,7 +2127,12 @@ bool LLFolderView::doToSelected(LLInventoryModel* model, const LLSD& userdata) return true; } if (("copy" == action) || ("cut" == action)) - { + { + // If there are things on the clipboard that have not been pasted but + // already disappeared from view, we need to move them to the trash + removeCutItems(); + + // Clear the clipboard before we start adding things on it LLClipboard::getInstance()->reset(); } -- cgit v1.2.3