summaryrefslogtreecommitdiff
path: root/indra/newview/llinventoryfunctions.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-04-30 10:10:16 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-04-30 10:10:16 +0100
commit6f339d5e9eb0a43f70effdf069d414e0ee7fff2c (patch)
treec8070823806fbeb68ea0813d9a766a1b1db458f2 /indra/newview/llinventoryfunctions.cpp
parent4f46e777a501ff0bfedaf657ac6decdeba8acbe5 (diff)
parentd597a7e36a0a8c4cbee70b053c41aa01afeab6b5 (diff)
merge from viewer-trunk
Diffstat (limited to 'indra/newview/llinventoryfunctions.cpp')
-rw-r--r--indra/newview/llinventoryfunctions.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index 449b1b5b4d..6c7251579d 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -585,3 +585,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();
+ }
+}