summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llappearancemgr.cpp33
-rw-r--r--indra/newview/llappearancemgr.h1
-rw-r--r--indra/newview/llinventorymodelbackgroundfetch.cpp18
-rw-r--r--indra/newview/llinventorymodelbackgroundfetch.h5
-rw-r--r--indra/newview/llstartup.cpp3
5 files changed, 28 insertions, 32 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index 9115d7e5c2..297403fc6c 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -4561,18 +4561,31 @@ protected:
nullary_func_t mCallable;
};
+void callAfterCOFFetch(nullary_func_t cb)
+{
+ if (AISAPI::isAvailable())
+ {
+ AISAPI::FetchCOF([cb](const LLUUID& id) { cb(); });
+ }
+ else
+ {
+ LLUUID cat_id = LLAppearanceMgr::instance().getCOF();
+ callAfterCategoryFetch(cat_id, cb);
+ }
+}
+
void callAfterCategoryFetch(const LLUUID& cat_id, nullary_func_t cb)
{
- CallAfterCategoryFetchStage1 *stage1 = new CallAfterCategoryFetchStage1(cat_id, cb);
- stage1->startFetch();
- if (stage1->isFinished())
- {
- stage1->done();
- }
- else
- {
- gInventory.addObserver(stage1);
- }
+ CallAfterCategoryFetchStage1* stage1 = new CallAfterCategoryFetchStage1(cat_id, cb);
+ stage1->startFetch();
+ if (stage1->isFinished())
+ {
+ stage1->done();
+ }
+ else
+ {
+ gInventory.addObserver(stage1);
+ }
}
void add_wearable_type_counts(const uuid_vec_t& ids,
diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h
index cf953d21ac..f6aa30d865 100644
--- a/indra/newview/llappearancemgr.h
+++ b/indra/newview/llappearancemgr.h
@@ -338,6 +338,7 @@ public:
LLUUID findDescendentCategoryIDByName(const LLUUID& parent_id,const std::string& name);
// Invoke a given callable after category contents are fully fetched.
+void callAfterCOFFetch(nullary_func_t cb);
void callAfterCategoryFetch(const LLUUID& cat_id, nullary_func_t cb);
// Wear all items in a uuid vector.
diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp
index f56532ff8c..277ddb16ba 100644
--- a/indra/newview/llinventorymodelbackgroundfetch.cpp
+++ b/indra/newview/llinventorymodelbackgroundfetch.cpp
@@ -354,17 +354,7 @@ void LLInventoryModelBackgroundFetch::start(const LLUUID& id, bool recursive)
void LLInventoryModelBackgroundFetch::scheduleFolderFetch(const LLUUID& cat_id, bool forced)
{
- if (AISAPI::isAvailable())
- {
- if (mFetchFolderQueue.empty() || mFetchFolderQueue.back().mUUID != cat_id)
- {
- // On AIS make sure root goes to the top and follow up recursive
- // fetches, not individual requests
- mFetchFolderQueue.push_back(FetchQueueInfo(cat_id, forced ? FT_FORCED : FT_DEFAULT));
- gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL);
- }
- }
- else if (mFetchFolderQueue.empty() || mFetchFolderQueue.front().mUUID != cat_id)
+ if (mFetchFolderQueue.empty() || mFetchFolderQueue.front().mUUID != cat_id)
{
// Specific folder requests go to front of queue.
mFetchFolderQueue.push_front(FetchQueueInfo(cat_id, forced ? FT_FORCED : FT_DEFAULT));
@@ -391,12 +381,6 @@ void LLInventoryModelBackgroundFetch::findLostItems()
gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL);
}
-void LLInventoryModelBackgroundFetch::fetchCOF()
-{
- // Will get COF folder, links in it and items those links point to
- AISAPI::FetchCOF();
-}
-
void LLInventoryModelBackgroundFetch::setAllFoldersFetched()
{
if (mRecursiveInventoryFetchStarted &&
diff --git a/indra/newview/llinventorymodelbackgroundfetch.h b/indra/newview/llinventorymodelbackgroundfetch.h
index db2d6db323..363d04486d 100644
--- a/indra/newview/llinventorymodelbackgroundfetch.h
+++ b/indra/newview/llinventorymodelbackgroundfetch.h
@@ -64,9 +64,8 @@ public:
bool inventoryFetchCompleted() const;
bool inventoryFetchInProgress() const;
- void findLostItems();
- void fetchCOF();
- void incrFetchCount(S32 fetching);
+ void findLostItems();
+ void incrFetchCount(S32 fetching);
void incrFetchFolderCount(S32 fetching);
bool isBulkFetchProcessingComplete() const;
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 161beaff19..3a96a7bced 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -1898,7 +1898,6 @@ bool idle_startup()
}
LLInventoryModelBackgroundFetch::instance().start();
- LLInventoryModelBackgroundFetch::instance().fetchCOF();
gInventory.createCommonSystemCategories();
// It's debatable whether this flag is a good idea - sets all
@@ -2161,7 +2160,7 @@ bool idle_startup()
gAgentWearables.notifyLoadingStarted();
gAgent.setOutfitChosen(TRUE);
gAgentWearables.sendDummyAgentWearablesUpdate();
- callAfterCategoryFetch(LLAppearanceMgr::instance().getCOF(), set_flags_and_update_appearance);
+ callAfterCOFFetch(set_flags_and_update_appearance);
}
display_startup();