summaryrefslogtreecommitdiff
path: root/indra/newview/llappearancemgr.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2023-12-18 07:08:59 +0200
committerAndrey Lihatskiy <alihatskiy@productengine.com>2023-12-18 07:57:29 +0200
commitc87850ddab5604e57fdcebad6a53616232a1b648 (patch)
tree47da586a3b93b1cbd9af9db5f81f65bf066306cd /indra/newview/llappearancemgr.cpp
parentf5a7c22cea16b51db12360436ce64c2433a5aa5f (diff)
parenta592292242e29d0379ee72572a434359e1e892d1 (diff)
Merge branch 'main' into DRTVWR-591-maint-X
# Conflicts: # doc/contributions.txt # indra/newview/llpanelprofile.cpp # indra/newview/llspatialpartition.cpp
Diffstat (limited to 'indra/newview/llappearancemgr.cpp')
-rw-r--r--indra/newview/llappearancemgr.cpp72
1 files changed, 31 insertions, 41 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index 10b3f4b573..fa0dee3ef9 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -2781,9 +2781,23 @@ void LLAppearanceMgr::wearInventoryCategory(LLInventoryCategory* category, bool
else
{
selfStartPhase("wear_inventory_category_fetch");
- callAfterCategoryFetch(category->getUUID(),boost::bind(&LLAppearanceMgr::wearCategoryFinal,
- &LLAppearanceMgr::instance(),
- category->getUUID(), copy, append));
+ if (AISAPI::isAvailable() && category->getPreferredType() == LLFolderType::FT_OUTFIT)
+ {
+ // for reliability just fetch it whole, linked items included
+ LLUUID cat_id = category->getUUID();
+ LLInventoryModelBackgroundFetch::getInstance()->fetchFolderAndLinks(
+ cat_id,
+ [cat_id, copy, append]
+ {
+ LLAppearanceMgr::instance().wearCategoryFinal(cat_id, copy, append);
+ });
+ }
+ else
+ {
+ callAfterCategoryFetch(category->getUUID(), boost::bind(&LLAppearanceMgr::wearCategoryFinal,
+ &LLAppearanceMgr::instance(),
+ category->getUUID(), copy, append));
+ }
}
}
@@ -2792,7 +2806,7 @@ S32 LLAppearanceMgr::getActiveCopyOperations() const
return LLCallAfterInventoryCopyMgr::getInstanceCount();
}
-void LLAppearanceMgr::wearCategoryFinal(LLUUID& cat_id, bool copy_items, bool append)
+void LLAppearanceMgr::wearCategoryFinal(const LLUUID& cat_id, bool copy_items, bool append)
{
LL_INFOS("Avatar") << self_av_string() << "starting" << LL_ENDL;
@@ -4609,30 +4623,20 @@ protected:
void callAfterCOFFetch(nullary_func_t cb)
{
- LLUUID cat_id = LLAppearanceMgr::instance().getCOF();
- LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id);
-
if (AISAPI::isAvailable())
{
- // Mark cof (update timer) so that background fetch won't request it
- cat->setFetching(LLViewerInventoryCategory::FETCH_RECURSIVE);
// For reliability assume that we have no relevant cache, so
// fetch cof along with items cof's links point to.
- AISAPI::FetchCOF([cb](const LLUUID& id)
- {
- cb();
- LLUUID cat_id = LLAppearanceMgr::instance().getCOF();
- LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id);
- if (cat)
- {
- cat->setFetching(LLViewerInventoryCategory::FETCH_NONE);
- }
- });
+ LLInventoryModelBackgroundFetch::getInstance()->fetchCOF(cb);
}
else
{
LL_INFOS() << "AIS API v3 not available, using callAfterCategoryFetch" << LL_ENDL;
- // startup should have marked folder as fetching, remove that
+ LLUUID cat_id = LLAppearanceMgr::instance().getCOF();
+ LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id);
+
+ // Special case, startup should have marked cof as FETCH_RECURSIVE
+ // to prevent dupplicate request, remove that
cat->setFetching(LLViewerInventoryCategory::FETCH_NONE);
callAfterCategoryFetch(cat_id, cb);
}
@@ -4654,30 +4658,16 @@ void callAfterCategoryFetch(const LLUUID& cat_id, nullary_func_t cb)
void callAfterCategoryLinksFetch(const LLUUID &cat_id, nullary_func_t cb)
{
- LLViewerInventoryCategory *cat = gInventory.getCategory(cat_id);
if (AISAPI::isAvailable())
{
- // Mark folder (update timer) so that background fetch won't request it
- cat->setFetching(LLViewerInventoryCategory::FETCH_RECURSIVE);
// Assume that we have no relevant cache. Fetch folder, and items folder's links point to.
- AISAPI::FetchCategoryLinks(cat_id,
- [cb, cat_id](const LLUUID &id)
- {
- cb();
- LLViewerInventoryCategory *cat = gInventory.getCategory(cat_id);
- if (cat)
- {
- cat->setFetching(LLViewerInventoryCategory::FETCH_NONE);
- }
- });
- }
- else
- {
- LL_WARNS() << "AIS API v3 not available, can't use AISAPI::FetchCOF" << LL_ENDL;
- // startup should have marked folder as fetching, remove that
- cat->setFetching(LLViewerInventoryCategory::FETCH_NONE);
- callAfterCategoryFetch(cat_id, cb);
- }
+ LLInventoryModelBackgroundFetch::getInstance()->fetchFolderAndLinks(cat_id, cb);
+ }
+ else
+ {
+ LL_WARNS() << "AIS API v3 not available, can't use AISAPI::FetchCOF" << LL_ENDL;
+ callAfterCategoryFetch(cat_id, cb);
+ }
}