summaryrefslogtreecommitdiff
path: root/indra/newview/llfolderview.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2012-02-08 17:22:04 -0800
committerMerov Linden <merov@lindenlab.com>2012-02-08 17:22:04 -0800
commit10dadc6b0dd646faa251c0935e75d07c97b3052d (patch)
treec1701aaa27c85bb76006ca58644261e13b52fddd /indra/newview/llfolderview.cpp
parent91f77318db63d4b2560390551306056c4a6cc2d5 (diff)
EXP-1873 : Move cut items to trash in cut/copy over cut situations.
Diffstat (limited to 'indra/newview/llfolderview.cpp')
-rw-r--r--indra/newview/llfolderview.cpp25
1 files changed, 24 insertions, 1 deletions
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<LLFol
return false;
}
+void LLFolderView::removeCutItems()
+{
+ // There's no item in "cut" mode on the clipboard -> exit
+ if (!LLClipboard::getInstance()->isCutMode())
+ return;
+
+ // Get the list of clipboard item uuids and iterate through them
+ LLDynamicArray<LLUUID> objects;
+ LLClipboard::getInstance()->pasteFromClipboard(objects);
+ for (LLDynamicArray<LLUUID>::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();
}