diff options
| author | Loren Shih <seraph@lindenlab.com> | 2009-10-21 17:17:28 +0000 | 
|---|---|---|
| committer | Loren Shih <seraph@lindenlab.com> | 2009-10-21 17:17:28 +0000 | 
| commit | 6e75434493f3f253eb9d0b16b98ecc0f1b2af30a (patch) | |
| tree | fb64f82d2ba0ea7efe84db27d266566d761400ba | |
| parent | db8db81764e1e1996fa612eba24049ea8d475339 (diff) | |
DEV-41622 : [BUG] : "Could find parent for..." spam from LLInventoryPanel
It's now possible that items may not exist in the hierachy of the inventorypanel's contents, so this warning spam is a false positive.
Removed unnecessary spam, did slight code cleanup.
| -rw-r--r-- | indra/newview/llfloaterinventory.cpp | 44 | 
1 files changed, 19 insertions, 25 deletions
| diff --git a/indra/newview/llfloaterinventory.cpp b/indra/newview/llfloaterinventory.cpp index a33a605f50..4013f52f10 100644 --- a/indra/newview/llfloaterinventory.cpp +++ b/indra/newview/llfloaterinventory.cpp @@ -1508,14 +1508,28 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id)  		objectp = gInventory.getObject(id);  		if (objectp)  		{		 +			const LLUUID &parent_id = objectp->getParentUUID(); +			// If this item's parent is the starting folder, then just add it to the top level (recall that  +			// the starting folder isn't actually represented in the view, parent_folder would be NULL in +			// this case otherwise). +			LLFolderViewFolder* parent_folder = (parent_id == mStartFolderID ? +				mFolders : (LLFolderViewFolder*)mFolders->getItemByID(parent_id)); + +			// This item exists outside the inventory's hierarchy, so don't add it. +			if (!parent_folder) +			{ +				return; +			} +  			if (objectp->getType() <= LLAssetType::AT_NONE ||  				objectp->getType() >= LLAssetType::AT_COUNT)  			{ -				llwarns << "LLInventoryPanel::buildNewViews called with objectp->mType == "  -						<< ((S32) objectp->getType()) -						<< " (shouldn't happen)" << llendl; +				llwarns << "LLInventoryPanel::buildNewViews called with invalid objectp->mType : " <<  +					((S32) objectp->getType()) << llendl; +				return;  			} -			else if (objectp->getType() == LLAssetType::AT_CATEGORY && +			 +			if (objectp->getType() == LLAssetType::AT_CATEGORY &&  					 objectp->getActualType() != LLAssetType::AT_LINK_FOLDER)   			{  				LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(objectp->getType(), @@ -1563,27 +1577,7 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id)  			if (itemp)  			{ -				 -				const LLUUID &parent_id = objectp->getParentUUID(); -				LLFolderViewFolder* parent_folder = (LLFolderViewFolder*)mFolders->getItemByID(parent_id); - -				// If this item's parent is the starting folder, then just add it to the top level (recall that  -				// the starting folder isn't actually represented in the view, parent_folder would be NULL in -				// this case otherwise). -				if (parent_id == mStartFolderID) -				{ -					parent_folder = mFolders; -				} - -				if (parent_folder) -				{ -					itemp->addToFolder(parent_folder, mFolders); -				} -				else -				{ -					llwarns << "Couldn't find parent folder for child " << itemp->getLabel() << llendl; -					delete itemp; -				} +				itemp->addToFolder(parent_folder, mFolders);  			}  		}  	} | 
