diff options
| author | Yuri Chebotarev <ychebotarev@productengine.com> | 2010-04-30 17:59:53 +0300 |
|---|---|---|
| committer | Yuri Chebotarev <ychebotarev@productengine.com> | 2010-04-30 17:59:53 +0300 |
| commit | 67c95d6d9238615232fd581aaedf53adfe166e5c (patch) | |
| tree | 4332afc70cd8a46ce2c390ccc0a7d583d9ea6165 /indra/newview/llinventoryfunctions.cpp | |
| parent | 2479959dd9be78a74c10484c65094bd56d1c3d9e (diff) | |
| parent | 23bd34a78163c31bc2a661acd15db63ed248af53 (diff) | |
merge
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/llinventoryfunctions.cpp')
| -rw-r--r-- | indra/newview/llinventoryfunctions.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 8487588404..8010d1f43d 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -582,3 +582,26 @@ BOOL get_is_item_worn(const LLUUID& id) } return FALSE; } + + +void change_item_parent(LLInventoryModel* model, + LLViewerInventoryItem* item, + const LLUUID& new_parent_id, + BOOL restamp) +{ + if (item->getParentUUID() != new_parent_id) + { + LLInventoryModel::update_list_t update; + LLInventoryModel::LLCategoryUpdate old_folder(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(item); + new_item->setParent(new_parent_id); + new_item->updateParentOnServer(restamp); + model->updateItem(new_item); + model->notifyObservers(); + } +} |
