Skip to content
Snippets Groups Projects
Commit de8ff2c7 authored by Mnikolenko Productengine's avatar Mnikolenko Productengine
Browse files

MAINT-8061 update folder label when item count changes

parent cdc23f48
No related branches found
No related tags found
No related merge requests found
...@@ -563,6 +563,7 @@ void LLInventoryPanel::modelChanged(U32 mask) ...@@ -563,6 +563,7 @@ void LLInventoryPanel::modelChanged(U32 mask)
{ {
setSelection(item_id, FALSE); setSelection(item_id, FALSE);
} }
updateFolderLabel(model_item->getParentUUID());
} }
////////////////////////////// //////////////////////////////
...@@ -574,6 +575,7 @@ void LLInventoryPanel::modelChanged(U32 mask) ...@@ -574,6 +575,7 @@ void LLInventoryPanel::modelChanged(U32 mask)
// Don't process the item if it is the root // Don't process the item if it is the root
if (old_parent) if (old_parent)
{ {
LLFolderViewModelItemInventory* viewmodel_folder = static_cast<LLFolderViewModelItemInventory*>(old_parent->getViewModelItem());
LLFolderViewFolder* new_parent = (LLFolderViewFolder*)getItemByID(model_item->getParentUUID()); LLFolderViewFolder* new_parent = (LLFolderViewFolder*)getItemByID(model_item->getParentUUID());
// Item has been moved. // Item has been moved.
if (old_parent != new_parent) if (old_parent != new_parent)
...@@ -591,6 +593,7 @@ void LLInventoryPanel::modelChanged(U32 mask) ...@@ -591,6 +593,7 @@ void LLInventoryPanel::modelChanged(U32 mask)
setSelection(item_id, FALSE); setSelection(item_id, FALSE);
} }
} }
updateFolderLabel(model_item->getParentUUID());
} }
else else
{ {
...@@ -602,6 +605,10 @@ void LLInventoryPanel::modelChanged(U32 mask) ...@@ -602,6 +605,10 @@ void LLInventoryPanel::modelChanged(U32 mask)
// doesn't include trash). Just remove the item's UI. // doesn't include trash). Just remove the item's UI.
view_item->destroyView(); view_item->destroyView();
} }
if(viewmodel_folder)
{
updateFolderLabel(viewmodel_folder->getUUID());
}
old_parent->getViewModelItem()->dirtyDescendantsFilter(); old_parent->getViewModelItem()->dirtyDescendantsFilter();
} }
} }
...@@ -619,6 +626,11 @@ void LLInventoryPanel::modelChanged(U32 mask) ...@@ -619,6 +626,11 @@ void LLInventoryPanel::modelChanged(U32 mask)
if(parent) if(parent)
{ {
parent->getViewModelItem()->dirtyDescendantsFilter(); parent->getViewModelItem()->dirtyDescendantsFilter();
LLFolderViewModelItemInventory* viewmodel_folder = static_cast<LLFolderViewModelItemInventory*>(parent->getViewModelItem());
if(viewmodel_folder)
{
updateFolderLabel(viewmodel_folder->getUUID());
}
} }
} }
} }
...@@ -1162,6 +1174,23 @@ void LLInventoryPanel::onSelectionChange(const std::deque<LLFolderViewItem*>& it ...@@ -1162,6 +1174,23 @@ void LLInventoryPanel::onSelectionChange(const std::deque<LLFolderViewItem*>& it
} }
void LLInventoryPanel::updateFolderLabel(const LLUUID& folder_id)
{
if(folder_id != mPreviousSelectedFolder) return;
LLFolderViewItem* folder_item = getItemByID(mPreviousSelectedFolder);
if(folder_item)
{
LLFolderBridge* bridge = (LLFolderBridge*)folder_item->getViewModelItem();
if(bridge)
{
bridge->clearDisplayName();
bridge->setShowDescendantsCount(true);
folder_item->refresh();
}
}
}
void LLInventoryPanel::doCreate(const LLSD& userdata) void LLInventoryPanel::doCreate(const LLSD& userdata)
{ {
reset_inventory_filter(); reset_inventory_filter();
......
...@@ -209,6 +209,8 @@ public: ...@@ -209,6 +209,8 @@ public:
bool attachObject(const LLSD& userdata); bool attachObject(const LLSD& userdata);
static void idle(void* user_data); static void idle(void* user_data);
void updateFolderLabel(const LLUUID& folder_id);
// DEBUG ONLY: // DEBUG ONLY:
static void dumpSelectionInformation(void* user_data); static void dumpSelectionInformation(void* user_data);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment