diff options
| author | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2023-05-17 18:38:23 +0300 | 
|---|---|---|
| committer | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2023-05-17 18:38:23 +0300 | 
| commit | 784436a5b89062df69251c9ac28904f06a018011 (patch) | |
| tree | 5fb13545c0159a38594ed1e5f6c7d5f7789dce8f | |
| parent | 86fc10f710ced7d2e7b1ddf01eef945aafd60e8b (diff) | |
SL-19721 use LLOutfitObserver to handle cof changes
| -rw-r--r-- | indra/newview/llinventorygallery.cpp | 4 | ||||
| -rw-r--r-- | indra/newview/lloutfitslist.cpp | 3 | ||||
| -rw-r--r-- | indra/newview/llpanelwearing.cpp | 13 | ||||
| -rw-r--r-- | indra/newview/llpanelwearing.h | 1 | 
4 files changed, 5 insertions, 16 deletions
| diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp index 9c7e96e97e..f97cb9dbf4 100644 --- a/indra/newview/llinventorygallery.cpp +++ b/indra/newview/llinventorygallery.cpp @@ -45,6 +45,7 @@  #include "llfriendcard.h"  #include "llgesturemgr.h"  #include "llmarketplacefunctions.h" +#include "lloutfitobserver.h"  #include "lltrans.h"  #include "llviewerassettype.h"  #include "llviewermessage.h" @@ -244,8 +245,7 @@ void LLInventoryGallery::updateRootFolder()          }      } -    const LLUUID cof = gInventory.findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT); -    mCategoriesObserver->addCategory(cof, boost::bind(&LLInventoryGallery::onCOFChanged, this)); +    LLOutfitObserver::instance().addCOFChangedCallback(boost::bind(&LLInventoryGallery::onCOFChanged, this));      if (!mGalleryCreated)      { diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index fe15d21e36..5c7792b0df 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -122,9 +122,8 @@ void LLOutfitsList::onOpen(const LLSD& info)  {      if (!mIsInitialized)      { -        const LLUUID cof = gInventory.findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT);          // Start observing changes in Current Outfit category. -        mCategoriesObserver->addCategory(cof, boost::bind(&LLOutfitsList::onCOFChanged, this)); +        LLOutfitObserver::instance().addCOFChangedCallback(boost::bind(&LLOutfitsList::onCOFChanged, this));      }      LLOutfitListBase::onOpen(info); diff --git a/indra/newview/llpanelwearing.cpp b/indra/newview/llpanelwearing.cpp index 3347c40687..062150dc56 100644 --- a/indra/newview/llpanelwearing.cpp +++ b/indra/newview/llpanelwearing.cpp @@ -40,6 +40,7 @@  #include "llinventorymodel.h"  #include "llinventoryobserver.h"  #include "llmenubutton.h" +#include "lloutfitobserver.h"  #include "llscrolllistctrl.h"  #include "llviewermenu.h"  #include "llviewerregion.h" @@ -218,8 +219,6 @@ LLPanelWearing::LLPanelWearing()  	,	mIsInitialized(false)  	,	mAttachmentsChangedConnection()  { -	mCategoriesObserver = new LLInventoryCategoriesObserver(); -  	mGearMenu = new LLWearingGearMenu(this);  	mContextMenu = new LLWearingContextMenu();  	mAttachmentsMenu = new LLTempAttachmentsContextMenu(this); @@ -231,12 +230,6 @@ LLPanelWearing::~LLPanelWearing()  	delete mContextMenu;  	delete mAttachmentsMenu; -	if (gInventory.containsObserver(mCategoriesObserver)) -	{ -		gInventory.removeObserver(mCategoriesObserver); -	} -	delete mCategoriesObserver; -  	if (mAttachmentsChangedConnection.connected())  	{  		mAttachmentsChangedConnection.disconnect(); @@ -281,10 +274,8 @@ void LLPanelWearing::onOpen(const LLSD& /*info*/)  		if (!category)  			return; -		gInventory.addObserver(mCategoriesObserver); -  		// Start observing changes in Current Outfit category. -		mCategoriesObserver->addCategory(cof, boost::bind(&LLWearableItemsList::updateList, mCOFItemsList, cof)); +        LLOutfitObserver::instance().addCOFChangedCallback(boost::bind(&LLWearableItemsList::updateList, mCOFItemsList, cof));  		// Fetch Current Outfit contents and refresh the list to display  		// initially fetched items. If not all items are fetched now diff --git a/indra/newview/llpanelwearing.h b/indra/newview/llpanelwearing.h index 715404a457..18e543eec6 100644 --- a/indra/newview/llpanelwearing.h +++ b/indra/newview/llpanelwearing.h @@ -90,7 +90,6 @@ private:  	void getAttachmentLimitsCoro(std::string url); -	LLInventoryCategoriesObserver* 	mCategoriesObserver;  	LLWearableItemsList* 			mCOFItemsList;  	LLScrollListCtrl*				mTempItemsList;  	LLWearingGearMenu*				mGearMenu; | 
