MAINT-8061 update folder label when item count changes Firestorm_5.0.11

Wed, 20 Dec 2017 17:01:47 +0200

author
Mnikolenko Productengine<mnikolenko@productengine.com>
date
Wed, 20 Dec 2017 17:01:47 +0200
branch
Firestorm_5.0.11
changeset 53587
c0989ea67746
parent 53586
799140d23082
child 53588
20ec98047524

MAINT-8061 update folder label when item count changes

indra/newview/llinventorypanel.cpp file | annotate | diff | revisions
indra/newview/llinventorypanel.h file | annotate | diff | revisions
     1.1 --- a/indra/newview/llinventorypanel.cpp	Wed Dec 20 08:09:45 2017 +0100
     1.2 +++ b/indra/newview/llinventorypanel.cpp	Wed Dec 20 17:01:47 2017 +0200
     1.3 @@ -608,6 +608,7 @@
     1.4  				{
     1.5  					setSelection(item_id, FALSE);
     1.6  				}
     1.7 +				updateFolderLabel(model_item->getParentUUID());
     1.8  			}
     1.9  
    1.10  			//////////////////////////////
    1.11 @@ -619,6 +620,7 @@
    1.12  				// Don't process the item if it is the root
    1.13  				if (old_parent)
    1.14  				{
    1.15 +					LLFolderViewModelItemInventory* viewmodel_folder = static_cast<LLFolderViewModelItemInventory*>(old_parent->getViewModelItem());
    1.16  					LLFolderViewFolder* new_parent =   (LLFolderViewFolder*)getItemByID(model_item->getParentUUID());
    1.17  					// Item has been moved.
    1.18  					if (old_parent != new_parent)
    1.19 @@ -636,6 +638,7 @@
    1.20  									setSelection(item_id, FALSE);
    1.21  								}
    1.22  							}
    1.23 +							updateFolderLabel(model_item->getParentUUID());
    1.24  						}
    1.25  						else 
    1.26  						{
    1.27 @@ -647,6 +650,10 @@
    1.28  							// doesn't include trash).  Just remove the item's UI.
    1.29  							view_item->destroyView();
    1.30  						}
    1.31 +						if(viewmodel_folder)
    1.32 +						{
    1.33 +							updateFolderLabel(viewmodel_folder->getUUID());
    1.34 +						}
    1.35  						old_parent->getViewModelItem()->dirtyDescendantsFilter();
    1.36  					}
    1.37  				}
    1.38 @@ -664,6 +671,11 @@
    1.39  				if(parent)
    1.40  				{
    1.41  					parent->getViewModelItem()->dirtyDescendantsFilter();
    1.42 +					LLFolderViewModelItemInventory* viewmodel_folder = static_cast<LLFolderViewModelItemInventory*>(parent->getViewModelItem());
    1.43 +					if(viewmodel_folder)
    1.44 +					{
    1.45 +						updateFolderLabel(viewmodel_folder->getUUID());
    1.46 +					}
    1.47  				}
    1.48  			}
    1.49  		}
    1.50 @@ -1234,6 +1246,23 @@
    1.51  
    1.52  }
    1.53  
    1.54 +void LLInventoryPanel::updateFolderLabel(const LLUUID& folder_id)
    1.55 +{
    1.56 +	if(folder_id != mPreviousSelectedFolder) return;
    1.57 +
    1.58 +	LLFolderViewItem* folder_item = getItemByID(mPreviousSelectedFolder);
    1.59 +	if(folder_item)
    1.60 +	{
    1.61 +		LLFolderBridge* bridge = (LLFolderBridge*)folder_item->getViewModelItem();
    1.62 +		if(bridge)
    1.63 +		{
    1.64 +			bridge->clearDisplayName();
    1.65 +			bridge->setShowDescendantsCount(true);
    1.66 +			folder_item->refresh();
    1.67 +		}
    1.68 +	}
    1.69 +}
    1.70 +
    1.71  void LLInventoryPanel::doCreate(const LLSD& userdata)
    1.72  {
    1.73  	// <FS:Ansariel> FIRE-20108: Can't create new folder in secondary inventory if view is filtered
     2.1 --- a/indra/newview/llinventorypanel.h	Wed Dec 20 08:09:45 2017 +0100
     2.2 +++ b/indra/newview/llinventorypanel.h	Wed Dec 20 17:01:47 2017 +0200
     2.3 @@ -218,6 +218,8 @@
     2.4  	// <FS:Ansariel> Optional hiding of Inbox folder
     2.5  	void updateShowInboxFolder(const LLSD &data);
     2.6  
     2.7 +	void updateFolderLabel(const LLUUID& folder_id);
     2.8 +
     2.9  	// DEBUG ONLY:
    2.10  	static void dumpSelectionInformation(void* user_data);
    2.11  

mercurial