summaryrefslogtreecommitdiff
path: root/indra/newview/llappearancemgr.cpp
diff options
context:
space:
mode:
authorBradley Payne <vir@lindenlab.com>2009-10-12 18:40:11 +0000
committerBradley Payne <vir@lindenlab.com>2009-10-12 18:40:11 +0000
commit3bd6c1919cc3a142a112278a6dc83bd8292bcb5a (patch)
tree6ea3178f5aa587d6d2e445b6cf17f25a6127833b /indra/newview/llappearancemgr.cpp
parent45a375c3feb3027d7a329ac1beb97fa30759dcfe (diff)
Merging avatar-pipeline/currently-worn-folder-10 down to viewer-2.
svn merge -r 134766:135946 svn+ssh://svn.lindenlab.com/svn/linden/branches/avatar-pipeline/currently-worn-folder-10 .
Diffstat (limited to 'indra/newview/llappearancemgr.cpp')
-rw-r--r--indra/newview/llappearancemgr.cpp53
1 files changed, 47 insertions, 6 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index 3831846e2e..cf8d852dfe 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -165,6 +165,8 @@ void LLOutfitObserver::done()
cb);
}
}
+ // BAP fixes a lag in display of created dir.
+ gInventory.notifyObservers();
}
else
{
@@ -495,11 +497,16 @@ void removeDuplicateItems(LLInventoryModel::item_array_t& dst, const LLInventory
}
else if (item->getActualType() == LLAssetType::AT_LINK_FOLDER)
{
- link_inventory_item(gAgent.getID(),
- item->getLinkedUUID(),
- dst_id,
- item->getName(),
- LLAssetType::AT_LINK_FOLDER, cb);
+ LLViewerInventoryCategory *catp = item->getLinkedCategory();
+ // Skip copying outfit links.
+ if (catp && catp->getPreferredType() != LLAssetType::AT_OUTFIT)
+ {
+ link_inventory_item(gAgent.getID(),
+ item->getLinkedUUID(),
+ dst_id,
+ item->getName(),
+ LLAssetType::AT_LINK_FOLDER, cb);
+ }
}
else
{
@@ -519,6 +526,9 @@ void removeDuplicateItems(LLInventoryModel::item_array_t& dst, const LLInventory
{
lldebugs << "rebuildCOFFromOutfit()" << llendl;
+ dumpCat(category,"start, source outfit");
+ dumpCat(getCOF(),"start, COF");
+
// Find all the wearables that are in the category's subtree.
LLInventoryModel::item_array_t items;
getCOFValidDescendents(category, items);
@@ -538,6 +548,8 @@ void removeDuplicateItems(LLInventoryModel::item_array_t& dst, const LLInventory
gInventory.collectDescendents(current_outfit_id, cof_cats, cof_items,
LLInventoryModel::EXCLUDE_TRASH);
+ //dumpCat(current_outfit_id,"COF before remove:");
+
if (items.count() > 0)
{
for (S32 i = 0; i < cof_items.count(); ++i)
@@ -547,15 +559,19 @@ void removeDuplicateItems(LLInventoryModel::item_array_t& dst, const LLInventory
gInventory.notifyObservers();
}
+ //dumpCat(current_outfit_id,"COF after remove:");
+
LLPointer<LLInventoryCallback> link_waiter = new LLUpdateAppearanceOnDestroy;
LLAppearanceManager::shallowCopyCategory(category, current_outfit_id, link_waiter);
+ //dumpCat(current_outfit_id,"COF after shallow copy:");
+
// Create a link to the outfit that we wore.
LLViewerInventoryCategory* catp = gInventory.getCategory(category);
if (catp && catp->getPreferredType() == LLAssetType::AT_OUTFIT)
{
link_inventory_item(gAgent.getID(), category, current_outfit_id, catp->getName(),
- LLAssetType::AT_LINK_FOLDER, LLPointer<LLInventoryCallback>(NULL));
+ LLAssetType::AT_LINK_FOLDER, link_waiter);
}
}
@@ -628,6 +644,8 @@ void LLAppearanceManager::updateAgentWearables(LLWearableHoldingPattern* holder,
/* static */ void LLAppearanceManager::updateAppearanceFromCOF()
{
+ dumpCat(getCOF(),"COF, start");
+
bool follow_folder_links = true;
LLUUID current_outfit_id = getCOF();
@@ -921,3 +939,26 @@ void LLAppearanceManager::removeItemLinks(LLUUID& item_id, bool do_update)
LLAppearanceManager::updateAppearanceFromCOF();
}
}
+
+/* static */
+void LLAppearanceManager::dumpCat(const LLUUID& cat_id, std::string str)
+{
+ LLInventoryModel::cat_array_t cats;
+ LLInventoryModel::item_array_t items;
+ gInventory.collectDescendents(cat_id, cats, items, LLInventoryModel::EXCLUDE_TRASH);
+
+#if 0
+ llinfos << llendl;
+ llinfos << str << llendl;
+ S32 hitcount = 0;
+ for(S32 i=0; i<items.count(); i++)
+ {
+ LLViewerInventoryItem *item = items.get(i);
+ if (item)
+ hitcount++;
+ llinfos << i <<" "<< item->getName() <<llendl;
+ }
+#endif
+ llinfos << str << " count " << items.count() << llendl;
+}
+