diff options
-rwxr-xr-x | indra/newview/llaisapi.cpp | 2 | ||||
-rwxr-xr-x | indra/newview/llappearancemgr.cpp | 5 | ||||
-rwxr-xr-x | indra/newview/llinventorymodel.cpp | 63 | ||||
-rwxr-xr-x | indra/newview/llinventorymodel.h | 5 | ||||
-rwxr-xr-x | indra/newview/llviewerinventory.cpp | 2 |
5 files changed, 31 insertions, 46 deletions
diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp index cb8700865a..9389aeb3b4 100755 --- a/indra/newview/llaisapi.cpp +++ b/indra/newview/llaisapi.cpp @@ -794,7 +794,7 @@ void AISUpdate::doUpdate() } // DELETE OBJECTS - for (std::set<LLUUID>::const_iterator del_it = mObjectsDeletedIds.begin(); + for (uuid_list_t::const_iterator del_it = mObjectsDeletedIds.begin(); del_it != mObjectsDeletedIds.end(); ++del_it) { LL_DEBUGS("Inventory") << "deleted item " << *del_it << LL_ENDL; diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index fc07932860..3818bd8aec 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2115,7 +2115,10 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool enforce_item_restrictions, return; } - llassert(validateClothingOrderingInfo()); + if (!validateClothingOrderingInfo()) + { + llwarns << "Clothing ordering error" << llendl; + } BoolSetter setIsInUpdateAppearanceFromCOF(mIsInUpdateAppearanceFromCOF); selfStartPhase("update_appearance_from_cof"); diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 0d99bea3fc..be1a396fff 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -388,16 +388,13 @@ void LLInventoryModel::unlockDirectDescendentArrays(const LLUUID& cat_id) mItemLock[cat_id] = false; } -// findCategoryUUIDForType() returns the uuid of the category that -// specifies 'type' as what it defaults to containing. The category is -// not necessarily only for that type. *NOTE: This will create a new -// inventory category on the fly if one does not exist. -const LLUUID LLInventoryModel::findCategoryUUIDForType(LLFolderType::EType preferred_type, bool create_folder/*, - bool find_in_library*/) +const LLUUID LLInventoryModel::findCategoryUUIDForTypeInRoot( + LLFolderType::EType preferred_type, + bool create_folder, + const LLUUID& root_id) { LLUUID rv = LLUUID::null; - const LLUUID &root_id = /*(find_in_library) ? gInventory.getLibraryRootFolderID() :*/ gInventory.getRootFolderID(); if(LLFolderType::FT_ROOT_INVENTORY == preferred_type) { rv = root_id; @@ -413,14 +410,17 @@ const LLUUID LLInventoryModel::findCategoryUUIDForType(LLFolderType::EType prefe { if(cats->get(i)->getPreferredType() == preferred_type) { - rv = cats->get(i)->getUUID(); - break; + const LLUUID& folder_id = cats->get(i)->getUUID(); + if (rv.isNull() || folder_id < rv) + { + rv = folder_id; + } } } } } - if(rv.isNull() && isInventoryUsable() && (create_folder && true/*!find_in_library*/)) + if(rv.isNull() && isInventoryUsable() && create_folder) { if(root_id.notNull()) { @@ -430,41 +430,18 @@ const LLUUID LLInventoryModel::findCategoryUUIDForType(LLFolderType::EType prefe return rv; } -const LLUUID LLInventoryModel::findLibraryCategoryUUIDForType(LLFolderType::EType preferred_type, bool create_folder) +// findCategoryUUIDForType() returns the uuid of the category that +// specifies 'type' as what it defaults to containing. The category is +// not necessarily only for that type. *NOTE: This will create a new +// inventory category on the fly if one does not exist. +const LLUUID LLInventoryModel::findCategoryUUIDForType(LLFolderType::EType preferred_type, bool create_folder) { - LLUUID rv = LLUUID::null; - - const LLUUID &root_id = gInventory.getLibraryRootFolderID(); - if(LLFolderType::FT_ROOT_INVENTORY == preferred_type) - { - rv = root_id; - } - else if (root_id.notNull()) - { - cat_array_t* cats = NULL; - cats = get_ptr_in_map(mParentChildCategoryTree, root_id); - if(cats) - { - S32 count = cats->count(); - for(S32 i = 0; i < count; ++i) - { - if(cats->get(i)->getPreferredType() == preferred_type) - { - rv = cats->get(i)->getUUID(); - break; - } - } - } - } + return findCategoryUUIDForTypeInRoot(preferred_type, create_folder, gInventory.getRootFolderID()); +} - if(rv.isNull() && isInventoryUsable() && (create_folder && true/*!find_in_library*/)) - { - if(root_id.notNull()) - { - return createNewCategory(root_id, preferred_type, LLStringUtil::null); - } - } - return rv; +const LLUUID LLInventoryModel::findLibraryCategoryUUIDForType(LLFolderType::EType preferred_type, bool create_folder) +{ + return findCategoryUUIDForTypeInRoot(preferred_type, create_folder, gInventory.getLibraryRootFolderID()); } class LLCreateInventoryCategoryResponder : public LLHTTPClient::Responder diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index ee0d4e1994..7afe1dea35 100755 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -230,6 +230,11 @@ public: // Find //-------------------------------------------------------------------- public: + const LLUUID findCategoryUUIDForTypeInRoot( + LLFolderType::EType preferred_type, + bool create_folder, + const LLUUID& root_id); + // Returns the uuid of the category that specifies 'type' as what it // defaults to containing. The category is not necessarily only for that type. // NOTE: If create_folder is true, this will create a new inventory category diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 5beae8ec24..5b4ca97319 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1230,7 +1230,7 @@ void update_inventory_category( LLPointer<LLViewerInventoryCategory> new_cat = new LLViewerInventoryCategory(obj); new_cat->fromLLSD(updates); // FIXME - restore this once the back-end work has been done. - if (0) // if (AISCommand::isAPIAvailable()) + if (AISCommand::isAPIAvailable()) { LLSD new_llsd = new_cat->asLLSD(); LLPointer<AISCommand> cmd_ptr = new UpdateCategoryCommand(cat_id, new_llsd, cb); |