EXT-7783 FIXED Provided updating outfit label in My outfits and Edit outfit panels.

1 Corrected LLAppearanceMgr::getBaseOutfitLink() method to avoid returning link in case base outfit moved to trash.
2 Hooked up LLSidepanelAppearance::refreshCurrentOutfitName() method on BOFReplaced signal.

reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/571/

--HG--
branch : product-engine
meow-7.2.2
Alexei Arabadji 2010-06-14 16:12:20 +03:00
parent 5626e1b8af
commit 0ec92fb1c8
2 changed files with 8 additions and 0 deletions

View File

@ -644,6 +644,13 @@ const LLViewerInventoryItem* LLAppearanceMgr::getBaseOutfitLink()
const LLViewerInventoryCategory *cat = item->getLinkedCategory();
if (cat && cat->getPreferredType() == LLFolderType::FT_OUTFIT)
{
const LLUUID parent_id = cat->getParentUUID();
LLViewerInventoryCategory* parent_cat = gInventory.getCategory(parent_id);
// if base outfit moved to trash it means that we don't have base outfit
if (parent_cat != NULL && parent_cat->getPreferredType() == LLFolderType::FT_TRASH)
{
return NULL;
}
return item;
}
}

View File

@ -83,6 +83,7 @@ LLSidepanelAppearance::LLSidepanelAppearance() :
mOpened(false)
{
LLOutfitObserver& outfit_observer = LLOutfitObserver::instance();
outfit_observer.addBOFReplacedCallback(boost::bind(&LLSidepanelAppearance::refreshCurrentOutfitName, this, ""));
outfit_observer.addBOFChangedCallback(boost::bind(&LLSidepanelAppearance::refreshCurrentOutfitName, this, ""));
outfit_observer.addCOFChangedCallback(boost::bind(&LLSidepanelAppearance::refreshCurrentOutfitName, this, ""));
}