Anonymous avatar Anonymous committed a16b4d4

Cherry pick of simple fix for duplicate inventory folders (one non working) in some inventory panel views.
Result of:
svn merge -c 134827 svn+ssh://svn.lindenlab.com/svn/linden/branches/avatar-pipeline/currently-worn-folder-10 .

Comments (0)

Files changed (2)

indra/newview/llfloaterinventory.cpp

 	mScroller(NULL),
 	mSortOrderSetting(p.sort_order_setting),
 	mInventory(p.inventory),
-	mAllowMultiSelect(p.allow_multi_select)
+	mAllowMultiSelect(p.allow_multi_select),
+	mHasInventoryConnection(false)
 {
 	// contex menu callbacks
 	mCommitCallbackRegistrar.add("Inventory.DoToSelected", boost::bind(&LLInventoryPanel::doToSelected, this, _2));
 	mInventoryObserver = new LLInventoryPanelObserver(this);
 	mInventory->addObserver(mInventoryObserver);
 	// build view of inventory if inventory ready, otherwise wait for modelChanged() callback
-	if (mInventory->isInventoryUsable())
+	if (mInventory->isInventoryUsable() && !mHasInventoryConnection)
 	{
 		rebuildViewsFor(LLUUID::null, LLInventoryObserver::ADD);
+		mHasInventoryConnection = true;
 	}
 
 	// bit of a hack to make sure the inventory is open.
 	bool handled = false;
 
 	// inventory just initialized, do complete build
-	if ((mask & LLInventoryObserver::ADD) && gInventory.getChangedIDs().empty())
+	if ((mask & LLInventoryObserver::ADD) && gInventory.getChangedIDs().empty() && !mHasInventoryConnection)
 	{
 		rebuildViewsFor(LLUUID::null, LLInventoryObserver::ADD);
+		mHasInventoryConnection = true;
 		return;
 	}
 

indra/newview/llfloaterinventory.h

 	LLScrollContainer*			mScroller;
 	BOOL 						mAllowMultiSelect;
 	std::string					mSortOrderSetting;
+	bool						mHasInventoryConnection;
 };
 
 class LLFloaterInventory;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.