From eee28bd007178ac83053dfb891a7951d368bcc6e Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Wed, 18 Jan 2012 13:03:19 -0800
Subject: EXP-1125 FIX -- New tags always shown in Received Items inbox when
 Inventory window is detached from side panel EXP-1578 FIX -- received items
 folder shows shadows of content when scrolling through lots of folders in
 same window

* Put in guard to prevent the inventory panel from being created multiple times
---
 indra/newview/llsidepanelinventory.cpp | 28 ++++++++++++++++++----------
 1 file changed, 18 insertions(+), 10 deletions(-)

diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp
index e7d486e058..3761eb5777 100644
--- a/indra/newview/llsidepanelinventory.cpp
+++ b/indra/newview/llsidepanelinventory.cpp
@@ -71,8 +71,6 @@ static const char * const INBOX_BUTTON_NAME = "inbox_btn";
 static const char * const INBOX_LAYOUT_PANEL_NAME = "inbox_layout_panel";
 static const char * const MAIN_INVENTORY_LAYOUT_PANEL_NAME = "main_inventory_layout_panel";
 
-static const char * const INBOX_INVENTORY_PANEL = "inventory_inbox";
-
 static const char * const INVENTORY_LAYOUT_STACK_NAME = "inventory_layout_stack";
 
 static const char * const MARKETPLACE_INBOX_PANEL = "marketplace_inbox";
@@ -288,34 +286,44 @@ void LLSidepanelInventory::observeInboxCreation()
 
 void LLSidepanelInventory::observeInboxModifications(const LLUUID& inboxID)
 {
+	//
+	// Silently do nothing if we already have an inbox inventory panel set up
+	// (this can happen multiple times on the initial session that creates the inbox)
+	//
+
+	if (mInventoryPanelInbox != NULL)
+	{
+		return;
+	}
+
 	//
 	// Track inbox folder changes
 	//
-	
+
 	if (inboxID.isNull())
 	{
-		llwarns << "Attempting to track modifications to non-existant inbox" << llendl;
+		llwarns << "Attempting to track modifications to non-existent inbox" << llendl;
 		return;
 	}
-	
+
 	if (mCategoriesObserver == NULL)
 	{
 		mCategoriesObserver = new LLInventoryCategoriesObserver();
 		gInventory.addObserver(mCategoriesObserver);
 	}
-	
+
 	mCategoriesObserver->addCategory(inboxID, boost::bind(&LLSidepanelInventory::onInboxChanged, this, inboxID));
-	
+
 	//
 	// Trigger a load for the entire contents of the Inbox
 	//
-	
+
 	LLInventoryModelBackgroundFetch::instance().start(inboxID);
-	
+
 	//
 	// Set up the inbox inventory view
 	//
-	
+
 	LLPanelMarketplaceInbox * inbox = getChild<LLPanelMarketplaceInbox>(MARKETPLACE_INBOX_PANEL);
 	mInventoryPanelInbox = inbox->setupInventoryPanel();
 }
-- 
cgit v1.2.3