From 0ec92fb1c8a90d619d0102d0807a32abedc916f1 Mon Sep 17 00:00:00 2001
From: Alexei Arabadji <aarabadji@productengine.com>
Date: Mon, 14 Jun 2010 16:12:20 +0300
Subject: 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
---
 indra/newview/llappearancemgr.cpp       | 7 +++++++
 indra/newview/llsidepanelappearance.cpp | 1 +
 2 files changed, 8 insertions(+)

(limited to 'indra')

diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index dba8707423..bc17605202 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -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;
 		}
 	}
diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp
index e23643da0b..67e79cb54a 100644
--- a/indra/newview/llsidepanelappearance.cpp
+++ b/indra/newview/llsidepanelappearance.cpp
@@ -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, ""));
 }
-- 
cgit v1.2.3