diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2023-03-17 23:44:28 +0200 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2023-03-18 00:31:09 +0200 |
commit | 70d99cde5826893be4964d4673ff875320b7220f (patch) | |
tree | f251dde18af1ca74b9b037b600af18f0f2146f82 /indra/newview/llinventorymodelbackgroundfetch.cpp | |
parent | 4f9f149939cfd79ba6d18ed90202b29225c2969c (diff) |
SL-18629 Track request depth to be able to distinguish incomplete folder reliably
Diffstat (limited to 'indra/newview/llinventorymodelbackgroundfetch.cpp')
-rw-r--r-- | indra/newview/llinventorymodelbackgroundfetch.cpp | 73 |
1 files changed, 36 insertions, 37 deletions
diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp index 282d234cf3..6cae035fcf 100644 --- a/indra/newview/llinventorymodelbackgroundfetch.cpp +++ b/indra/newview/llinventorymodelbackgroundfetch.cpp @@ -478,10 +478,10 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis(const FetchQueueInfo& fetc else { - if (!gInventory.isCategoryComplete(cat_id)) + const LLViewerInventoryCategory * cat(gInventory.getCategory(cat_id)); + if (cat) { - const LLViewerInventoryCategory * cat(gInventory.getCategory(cat_id)); - if (cat) + if (!gInventory.isCategoryComplete(cat_id)) { if (ALEXANDRIA_LINDEN_ID == cat->getOwnerID()) { @@ -502,25 +502,24 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis(const FetchQueueInfo& fetc } mFetchCount++; } - // else? - } - else - { - // Already fetched, check if anything inside needs fetching - if (fetch_info.mRecursive) + else { - LLInventoryModel::cat_array_t * categories(NULL); - LLInventoryModel::item_array_t * items(NULL); - gInventory.getDirectDescendentsOf(cat_id, categories, items); - for (LLInventoryModel::cat_array_t::const_iterator it = categories->begin(); - it != categories->end(); - ++it) + // Already fetched, check if anything inside needs fetching + if (fetch_info.mRecursive) { - // not push_front to not cause an infinite loop - mFetchQueue.push_back(FetchQueueInfo((*it)->getUUID(), fetch_info.mRecursive)); + LLInventoryModel::cat_array_t * categories(NULL); + LLInventoryModel::item_array_t * items(NULL); + gInventory.getDirectDescendentsOf(cat_id, categories, items); + for (LLInventoryModel::cat_array_t::const_iterator it = categories->begin(); + it != categories->end(); + ++it) + { + // not push_front to not cause an infinite loop + mFetchQueue.push_back(FetchQueueInfo((*it)->getUUID(), fetch_info.mRecursive)); + } } } - } + } // else? } } else @@ -613,10 +612,10 @@ void LLInventoryModelBackgroundFetch::bulkFetch() } else { - if (!gInventory.isCategoryComplete(cat_id)) + const LLViewerInventoryCategory * cat(gInventory.getCategory(cat_id)); + if (cat) { - const LLViewerInventoryCategory * cat(gInventory.getCategory(cat_id)); - if (cat) + if (LLViewerInventoryCategory::VERSION_UNKNOWN == cat->getVersion()) { LLSD folder_sd; folder_sd["folder_id"] = cat->getUUID(); @@ -635,23 +634,23 @@ void LLInventoryModelBackgroundFetch::bulkFetch() } folder_count++; } + else + { + // May already have this folder, but append child folders to list. + if (fetch_info.mRecursive) + { + LLInventoryModel::cat_array_t * categories(NULL); + LLInventoryModel::item_array_t * items(NULL); + gInventory.getDirectDescendentsOf(cat_id, categories, items); + for (LLInventoryModel::cat_array_t::const_iterator it = categories->begin(); + it != categories->end(); + ++it) + { + mFetchQueue.push_back(FetchQueueInfo((*it)->getUUID(), fetch_info.mRecursive)); + } + } + } } - else - { - // May already have this folder, but append child folders to list. - if (fetch_info.mRecursive) - { - LLInventoryModel::cat_array_t * categories(NULL); - LLInventoryModel::item_array_t * items(NULL); - gInventory.getDirectDescendentsOf(cat_id, categories, items); - for (LLInventoryModel::cat_array_t::const_iterator it = categories->begin(); - it != categories->end(); - ++it) - { - mFetchQueue.push_back(FetchQueueInfo((*it)->getUUID(), fetch_info.mRecursive)); - } - } - } } if (fetch_info.mRecursive) { |