diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2023-03-28 19:38:26 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2023-03-28 21:37:32 +0300 |
commit | 3bf9c78f564f0b6c4fd79163bd63c0a6c1fab7cb (patch) | |
tree | a3ff8c1df49926f26385efc6aa55f006e18b471a /indra/newview/llviewerinventory.cpp | |
parent | d21a1aace63967fe62b12b71b7f683f662dfcf4a (diff) |
SL-18003 Improve dupplicate prevention
Try getting lost and found
Diffstat (limited to 'indra/newview/llviewerinventory.cpp')
-rw-r--r-- | indra/newview/llviewerinventory.cpp | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 6f62ba5409..8ec7719ade 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -561,7 +561,8 @@ LLViewerInventoryCategory::LLViewerInventoryCategory(const LLUUID& uuid, LLInventoryCategory(uuid, parent_uuid, pref, name), mOwnerID(owner_id), mVersion(LLViewerInventoryCategory::VERSION_UNKNOWN), - mDescendentCount(LLViewerInventoryCategory::DESCENDENT_COUNT_UNKNOWN) + mDescendentCount(LLViewerInventoryCategory::DESCENDENT_COUNT_UNKNOWN), + mFetching(FETCH_NONE) { mDescendentsRequested.reset(); } @@ -569,7 +570,8 @@ LLViewerInventoryCategory::LLViewerInventoryCategory(const LLUUID& uuid, LLViewerInventoryCategory::LLViewerInventoryCategory(const LLUUID& owner_id) : mOwnerID(owner_id), mVersion(LLViewerInventoryCategory::VERSION_UNKNOWN), - mDescendentCount(LLViewerInventoryCategory::DESCENDENT_COUNT_UNKNOWN) + mDescendentCount(LLViewerInventoryCategory::DESCENDENT_COUNT_UNKNOWN), + mFetching(FETCH_NONE) { mDescendentsRequested.reset(); } @@ -670,21 +672,33 @@ bool LLViewerInventoryCategory::fetch() return false; } -void LLViewerInventoryCategory::setFetching(bool fetching) +LLViewerInventoryCategory::EFetchType LLViewerInventoryCategory::getFetching() { - if (fetching) + // if timer hasn't expired, request was scheduled, but not in progress + // if mFetching request was actually started + if (mDescendentsRequested.hasExpired()) { - if ((VERSION_UNKNOWN == getVersion()) - && mDescendentsRequested.hasExpired()) + mFetching = FETCH_NONE; + } + return mFetching; +} + +void LLViewerInventoryCategory::setFetching(LLViewerInventoryCategory::EFetchType fetching) +{ + if (fetching > mFetching) // allow a switch from normal to recursive + { + if (mDescendentsRequested.hasExpired() || (mFetching == FETCH_NONE)) { const F32 FETCH_TIMER_EXPIRY = 10.0f; mDescendentsRequested.reset(); mDescendentsRequested.setTimerExpirySec(FETCH_TIMER_EXPIRY); } + mFetching = fetching; } - else + else if (fetching = FETCH_NONE) { mDescendentsRequested.stop(); + mFetching = fetching; } } |