summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-08-01 23:53:57 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-08-01 23:53:57 +0300
commit05b5540fe70067180be6bb664752742b31a49eb7 (patch)
tree94bf782d4ba3e8ef78b231b8bd859d5fc58c9ba7
parent5048b3878c027859dcc9005dff550f0afc38f623 (diff)
SL-20107 Detaching items from COF in gallery view didn't update COF
-rw-r--r--indra/newview/llaisapi.cpp30
-rw-r--r--indra/newview/llinventorygallery.cpp3
2 files changed, 24 insertions, 9 deletions
diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp
index f3799361db..f26549cc3d 100644
--- a/indra/newview/llaisapi.cpp
+++ b/indra/newview/llaisapi.cpp
@@ -1321,6 +1321,7 @@ void AISUpdate::parseCategory(const LLSD& category_map, S32 depth)
if (curr_cat
&& curr_cat->getVersion() > LLViewerInventoryCategory::VERSION_UNKNOWN
+ && curr_cat->getDescendentCount() != LLViewerInventoryCategory::DESCENDENT_COUNT_UNKNOWN
&& version > LLViewerInventoryCategory::VERSION_UNKNOWN
&& version < curr_cat->getVersion())
{
@@ -1429,15 +1430,26 @@ void AISUpdate::parseCategory(const LLSD& category_map, S32 depth)
void AISUpdate::parseDescendentCount(const LLUUID& category_id, const LLSD& embedded)
{
- // We can only determine true descendent count if this contains all descendent types.
- if (embedded.has("categories") &&
- embedded.has("links") &&
- embedded.has("items"))
- {
- mCatDescendentsKnown[category_id] = embedded["categories"].size();
- mCatDescendentsKnown[category_id] += embedded["links"].size();
- mCatDescendentsKnown[category_id] += embedded["items"].size();
- }
+ if (mType == AISAPI::FETCHCOF)
+ {
+ // contains only links
+ if (embedded.has("links"))
+ {
+ mCatDescendentsKnown[category_id] = embedded["links"].size();
+ }
+ }
+ else
+ {
+ // We can only determine true descendent count if this contains all descendent types.
+ if (embedded.has("categories") &&
+ embedded.has("links") &&
+ embedded.has("items"))
+ {
+ mCatDescendentsKnown[category_id] = embedded["categories"].size();
+ mCatDescendentsKnown[category_id] += embedded["links"].size();
+ mCatDescendentsKnown[category_id] += embedded["items"].size();
+ }
+ }
}
void AISUpdate::parseEmbedded(const LLSD& embedded, S32 depth)
diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp
index 87dba5f100..0801b71e34 100644
--- a/indra/newview/llinventorygallery.cpp
+++ b/indra/newview/llinventorygallery.cpp
@@ -2376,6 +2376,9 @@ void LLInventoryGalleryItem::setSelected(bool value)
BOOL LLInventoryGalleryItem::handleMouseDown(S32 x, S32 y, MASK mask)
{
+ // call changeItemSelection directly, before setFocus
+ // to avoid autoscroll from LLInventoryGallery::onFocusReceived()
+ mGallery->changeItemSelection(mUUID, false);
setFocus(TRUE);
mGallery->claimEditHandler();