summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-03-19 12:55:04 +0200
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-03-19 13:22:05 +0200
commita66932a091bac4d4ca1a861901b9cef619a406f7 (patch)
tree3132a44e61235eb68d9542221710ca399a8d105e /indra/llui
parentc0f28ae36261cc31d6412c42c05d1b7719a2c04b (diff)
SL-14927 Some avatar names not resolving in chat
buildConversationViewParticipant() was deparenting view models that belong to session
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llfolderviewitem.cpp10
-rw-r--r--indra/llui/llfolderviewitem.h2
-rw-r--r--indra/llui/llfolderviewmodel.h6
3 files changed, 13 insertions, 5 deletions
diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp
index 9f6ceac768..31202f02bf 100644
--- a/indra/llui/llfolderviewitem.cpp
+++ b/indra/llui/llfolderviewitem.cpp
@@ -1608,7 +1608,7 @@ void LLFolderViewFolder::destroyView()
// extractItem() removes the specified item from the folder, but
// doesn't delete it.
-void LLFolderViewFolder::extractItem( LLFolderViewItem* item )
+void LLFolderViewFolder::extractItem( LLFolderViewItem* item)
{
if (item->isSelected())
getRoot()->clearSelection();
@@ -1631,7 +1631,13 @@ void LLFolderViewFolder::extractItem( LLFolderViewItem* item )
mItems.erase(it);
}
//item has been removed, need to update filter
- getViewModelItem()->removeChild(item->getViewModelItem());
+ LLFolderViewModelItem* parent_model = getViewModelItem();
+ LLFolderViewModelItem* child_model = item->getViewModelItem();
+ if (child_model->getParent() == parent_model)
+ {
+ // in some cases model does not belong to parent view, is shared between views
+ parent_model->removeChild(child_model);
+ }
//because an item is going away regardless of filter status, force rearrange
requestArrange();
removeChild(item);
diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h
index da09d139e9..3bfc7ee8cf 100644
--- a/indra/llui/llfolderviewitem.h
+++ b/indra/llui/llfolderviewitem.h
@@ -387,7 +387,7 @@ public:
// extractItem() removes the specified item from the folder, but
// doesn't delete it.
- virtual void extractItem( LLFolderViewItem* item );
+ virtual void extractItem( LLFolderViewItem* item);
// This function is called by a child that needs to be resorted.
void resort(LLFolderViewItem* item);
diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h
index f4ddfa8f18..8684c71672 100644
--- a/indra/llui/llfolderviewmodel.h
+++ b/indra/llui/llfolderviewmodel.h
@@ -218,7 +218,8 @@ public:
virtual S32 getSortVersion() = 0;
virtual void setSortVersion(S32 version) = 0;
virtual void setParent(LLFolderViewModelItem* parent) = 0;
- virtual bool hasParent() = 0;
+ virtual LLFolderViewModelItem* getParent() const = 0;
+ virtual bool hasParent() const = 0;
protected:
@@ -358,7 +359,8 @@ public:
protected:
virtual void setParent(LLFolderViewModelItem* parent) { mParent = parent; }
- virtual bool hasParent() { return mParent != NULL; }
+ virtual LLFolderViewModelItem* getParent() const { return mParent; }
+ virtual bool hasParent() const { return mParent != NULL; }
S32 mSortVersion;
bool mPassedFilter;