summaryrefslogtreecommitdiff
path: root/indra/newview/llappearancemgr.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2009-11-02 14:10:56 -0500
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2009-11-02 14:10:56 -0500
commit86b1ee7703bb57c6b1e1c068cda02bfb9ed0721e (patch)
tree3f6b099fca5920cae4d93c4187ce614abfa9d83e /indra/newview/llappearancemgr.cpp
parent7335c6276865061d8b4a549b7cf29f8a8df929a0 (diff)
Work in progress on attachment tracking.
Diffstat (limited to 'indra/newview/llappearancemgr.cpp')
-rw-r--r--indra/newview/llappearancemgr.cpp38
1 files changed, 36 insertions, 2 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index 8e1f7775d2..c297f8db29 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -528,7 +528,7 @@ void LLAppearanceManager::shallowCopyCategory(const LLUUID& src_id, const LLUUID
{
LLInventoryModel::cat_array_t cats;
LLInventoryModel::item_array_t items;
- gInventory.collectDescendents(getCOF(), cats, items,
+ gInventory.collectDescendents(category, cats, items,
LLInventoryModel::EXCLUDE_TRASH);
for (S32 i = 0; i < items.count(); ++i)
{
@@ -563,7 +563,7 @@ void LLAppearanceManager::shallowCopyCategory(const LLUUID& src_id, const LLUUID
S32 size = items_by_type[i].size();
if (size <= 0)
continue;
- S32 start_index = max(0,size-max_per_type);
+ S32 start_index = llmax(0,size-max_per_type);
for (S32 j = start_index; j<size; j++)
{
items.push_back(items_by_type[i][j]);
@@ -1178,3 +1178,37 @@ void LLAppearanceManager::dumpItemArray(const LLInventoryModel::item_array_t& it
}
llinfos << llendl;
}
+
+
+std::set<LLUUID> LLAppearanceManager::sRegisteredAttachments;
+
+void dumpAttachmentSet(const std::set<LLUUID>& atts, const std::string& msg)
+{
+ llinfos << msg << llendl;
+ for (std::set<LLUUID>::const_iterator it = atts.begin();
+ it != atts.end();
+ ++it)
+ {
+ LLUUID item_id = *it;
+ LLViewerInventoryItem *item = gInventory.getItem(item_id);
+ if (item)
+ llinfos << "atts " << item->getName() << llendl;
+ else
+ llinfos << "atts " << "UNKNOWN[" << item_id.asString() << "]" << llendl;
+ }
+ llinfos << llendl;
+}
+
+/* static */
+void LLAppearanceManager::registerAttachment(const LLUUID& item_id)
+{
+ sRegisteredAttachments.insert(item_id);
+ dumpAttachmentSet(sRegisteredAttachments,"after register:");
+}
+
+/* static */
+void LLAppearanceManager::unregisterAttachment(const LLUUID& item_id)
+{
+ sRegisteredAttachments.erase(item_id);
+ dumpAttachmentSet(sRegisteredAttachments,"after unregister:");
+}