diff options
author | Merov Linden <merov@lindenlab.com> | 2015-04-09 16:47:46 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2015-04-09 16:47:46 -0700 |
commit | 68771449157d27309ea77119d50dd8da31db1b23 (patch) | |
tree | ba1624ba5f4f1e502d5acc753e618df9b3e813b3 | |
parent | c5c027eb14e92b89a3888a7c17ee1fd44e2f65b2 (diff) |
DD-384, DD-388 : Do not trust cached values for stock folders, do not consider a non fetched stock folder empty
-rwxr-xr-x | indra/newview/llinventoryfunctions.cpp | 5 | ||||
-rwxr-xr-x | indra/newview/llinventorymodel.cpp | 9 |
2 files changed, 12 insertions, 2 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 386819b25a..123e55a8ee 100755 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -1024,6 +1024,11 @@ S32 compute_stock_count(LLUUID cat_uuid, bool force_count /* false */) } if (cat->getPreferredType() == LLFolderType::FT_MARKETPLACE_STOCK) { + if (cat->getVersion() == LLViewerInventoryCategory::VERSION_UNKNOWN) + { + // If the folder is not completely fetched, we do not want to return any confusing value that could lead to unlisting + return -1; + } // Note: stock folders are *not* supposed to have nested subfolders so we stop recursion here but we count only items (subfolders will be ignored) // Note: we *always* give a stock count for stock folders, it's useful even if the listing is unassociated LLInventoryModel::cat_array_t* cat_array; diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 8c4be57aaa..5139564a6d 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1995,17 +1995,22 @@ bool LLInventoryModel::loadSkeleton( // we can safely ignore anything loaded from file, but // not sent down in the skeleton. Must have been removed from inventory. - if(cit == not_cached) + if (cit == not_cached) { continue; } - if(cat->getVersion() != tcat->getVersion()) + else if (cat->getVersion() != tcat->getVersion()) { // if the cached version does not match the server version, // throw away the version we have so we can fetch the // correct contents the next time the viewer opens the folder. tcat->setVersion(NO_VERSION); } + else if (tcat->getPreferredType() == LLFolderType::FT_MARKETPLACE_STOCK) + { + // Do not trust stock folders being updated + tcat->setVersion(NO_VERSION); + } else { cached_ids.insert(tcat->getUUID()); |