summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorYuri Chebotarev <ychebotarev@productengine.com>2009-12-23 18:13:57 +0200
committerYuri Chebotarev <ychebotarev@productengine.com>2009-12-23 18:13:57 +0200
commitdd20b16ed084b936d2e6c11a48aa34d83828aab5 (patch)
tree8f4bc6590b3bad2c5b9edcbc1081c87820d2cbe6 /indra/newview
parent24ee9eeb2f3556b6c7a1ba738aca4ec3ebad7275 (diff)
no ticket. HACK !!!.
HACK code to fix inventory root folder for some broken accounts code executed only once and takes O(N) where N - number of inventory items. --HG-- branch : product-engine
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llinventorymodel.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index 1eb8d1bc2c..711114173c 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -2654,6 +2654,33 @@ void LLInventoryModel::buildParentChildMap()
cat_array_t* catsp = get_ptr_in_map(mParentChildCategoryTree, agent_inv_root_id);
if(catsp)
{
+ // *HACK - fix root inventory folder
+ // some accounts has pbroken inventory root folders
+
+ std::string name = "My Inventory";
+ LLUUID prev_root_id = mRootFolderID;
+ for (parent_cat_map_t::const_iterator it = mParentChildCategoryTree.begin(),
+ it_end = mParentChildCategoryTree.end(); it != it_end; ++it)
+ {
+ cat_array_t* cat_array = it->second;
+ for (cat_array_t::const_iterator cat_it = cat_array->begin(),
+ cat_it_end = cat_array->end(); cat_it != cat_it_end; ++cat_it)
+ {
+ LLPointer<LLViewerInventoryCategory> category = *cat_it;
+
+ if(category && category->getPreferredType() != LLFolderType::FT_ROOT_INVENTORY)
+ continue;
+ if ( category && 0 == LLStringUtil::compareInsensitive(name, category->getName()) )
+ {
+ if(category->getUUID()!=mRootFolderID)
+ {
+ LLUUID& new_inv_root_folder_id = const_cast<LLUUID&>(mRootFolderID);
+ new_inv_root_folder_id = category->getUUID();
+ }
+ }
+ }
+ }
+
// 'My Inventory',
// root of the agent's inv found.
// The inv tree is built.