summaryrefslogtreecommitdiff
path: root/indra/newview/llinventoryobserver.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-11-28 21:23:38 +0200
committerakleshchev <117672381+akleshchev@users.noreply.github.com>2023-12-06 01:02:42 +0200
commitf4307bed264cc4c5502e8f0552cbf368e23edc28 (patch)
treef1c8bf6a2c0b5c1280a53616ce7e0c40555072c0 /indra/newview/llinventoryobserver.cpp
parentc409236dacc215231e8404133c2613d5ee90c990 (diff)
SL-20181 Don't force fetch if vesion is unknown
Diffstat (limited to 'indra/newview/llinventoryobserver.cpp')
-rw-r--r--indra/newview/llinventoryobserver.cpp65
1 files changed, 31 insertions, 34 deletions
diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp
index 655bdfca6b..71c81e9352 100644
--- a/indra/newview/llinventoryobserver.cpp
+++ b/indra/newview/llinventoryobserver.cpp
@@ -337,51 +337,48 @@ void LLInventoryFetchItemsObserver::startFetch()
{
for (requests_by_folders_t::value_type &folder : requests)
{
- if (folder.second.size() > MAX_INDIVIDUAL_ITEM_REQUESTS)
+ LLViewerInventoryCategory* cat = gInventory.getCategory(folder.first);
+ if (cat)
{
- // requesting one by one will take a while
- // do whole folder
- LLInventoryModelBackgroundFetch::getInstance()->scheduleFolderFetch(folder.first, true);
- }
- else
- {
- LLViewerInventoryCategory* cat = gInventory.getCategory(folder.first);
- if (cat)
+ if (cat->getVersion() == LLViewerInventoryCategory::VERSION_UNKNOWN)
{
- if (cat->getVersion() == LLViewerInventoryCategory::VERSION_UNKNOWN)
- {
- // start fetching whole folder since it's not ready either way
- cat->fetch();
- }
- else if (cat->getViewerDescendentCount() <= folder.second.size()
- || cat->getDescendentCount() <= folder.second.size())
- {
- // Start fetching whole folder since we need all items
- LLInventoryModelBackgroundFetch::getInstance()->scheduleFolderFetch(folder.first, true);
- }
- else
- {
- // get items one by one
- for (LLUUID &item_id : folder.second)
- {
- LLInventoryModelBackgroundFetch::getInstance()->scheduleItemFetch(item_id);
- }
- }
+ // start fetching whole folder since it's not ready either way
+ cat->fetch();
+ }
+ else if (folder.second.size() > MAX_INDIVIDUAL_ITEM_REQUESTS)
+ {
+ // requesting one by one will take a while
+ // do whole folder
+ LLInventoryModelBackgroundFetch::getInstance()->scheduleFolderFetch(folder.first, true);
+ }
+ else if (cat->getViewerDescendentCount() <= folder.second.size()
+ || cat->getDescendentCount() <= folder.second.size())
+ {
+ // Start fetching whole folder since we need all items
+ LLInventoryModelBackgroundFetch::getInstance()->scheduleFolderFetch(folder.first, true);
}
else
{
- // Isn't supposed to happen? We should have all folders
- // and if item exists, folder is supposed to exist as well.
- llassert(false);
- LL_WARNS("Inventory") << "Missing folder: " << folder.first << " fetching items individually" << LL_ENDL;
-
// get items one by one
- for (LLUUID &item_id : folder.second)
+ for (LLUUID& item_id : folder.second)
{
LLInventoryModelBackgroundFetch::getInstance()->scheduleItemFetch(item_id);
}
}
}
+ else
+ {
+ // Isn't supposed to happen? We should have all folders
+ // and if item exists, folder is supposed to exist as well.
+ llassert(false);
+ LL_WARNS("Inventory") << "Missing folder: " << folder.first << " fetching items individually" << LL_ENDL;
+
+ // get items one by one
+ for (LLUUID& item_id : folder.second)
+ {
+ LLInventoryModelBackgroundFetch::getInstance()->scheduleItemFetch(item_id);
+ }
+ }
}
}
else