diff options
| author | Mnikolenko Productengine <mnikolenko@productengine.com> | 2021-03-30 15:53:22 +0300 |
|---|---|---|
| committer | Mnikolenko Productengine <mnikolenko@productengine.com> | 2021-03-30 15:53:22 +0300 |
| commit | 89b4611fc00a17d923c06d510da6842002113199 (patch) | |
| tree | 183c19006270aa995f6c923599751ebf05bc4d9f /indra/newview/llinventoryfunctions.cpp | |
| parent | 309fb9e892beb724a442c85bcfd07d6f3f7c9c07 (diff) | |
SL-15036 Add actions to move landmarks between tabs in the Places floater
Diffstat (limited to 'indra/newview/llinventoryfunctions.cpp')
| -rw-r--r-- | indra/newview/llinventoryfunctions.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index f84bc68c82..f2e06d19f3 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -1847,6 +1847,26 @@ bool validate_marketplacelistings(LLInventoryCategory* cat, validation_callback_ return result && !has_bad_items; } +void change_item_parent(const LLUUID& item_id, const LLUUID& new_parent_id) +{ + LLInventoryItem* inv_item = gInventory.getItem(item_id); + if (inv_item) + { + LLInventoryModel::update_list_t update; + LLInventoryModel::LLCategoryUpdate old_folder(inv_item->getParentUUID(), -1); + update.push_back(old_folder); + LLInventoryModel::LLCategoryUpdate new_folder(new_parent_id, 1); + update.push_back(new_folder); + gInventory.accountForUpdate(update); + + LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(inv_item); + new_item->setParent(new_parent_id); + new_item->updateParentOnServer(FALSE); + gInventory.updateItem(new_item); + gInventory.notifyObservers(); + } +} + ///---------------------------------------------------------------------------- /// LLInventoryCollectFunctor implementations ///---------------------------------------------------------------------------- |
