Stinson Linden avatar Stinson Linden committed f47dca8

PATH-849: Group objects were losing their [group] identifier following the last commit. This should fix that issue.

Comments (0)

Files changed (8)

indra/newview/llfloaterpathfindingcharacters.cpp

 	return 0;
 }
 
+S32 LLFloaterPathfindingCharacters::getOwnerNameColumnIndex() const
+{
+	return 2;
+}
+
+std::string LLFloaterPathfindingCharacters::getOwnerName(const LLPathfindingObject *pObject) const
+{
+	return (pObject->hasOwner()
+		? (pObject->hasOwnerName()
+		? (pObject->isGroupOwned()
+		? (pObject->getOwnerName() + " " + getString("character_owner_group"))
+		: pObject->getOwnerName())
+		: getString("character_owner_loading"))
+		: getString("character_owner_unknown"));
+}
+
 const LLColor4 &LLFloaterPathfindingCharacters::getBeaconColor() const
 {
 	return mBeaconColor;
 	columns[1]["value"] = pCharacterPtr->getDescription();
 
 	columns[2]["column"] = "owner";
-	columns[2]["value"] = (pCharacterPtr->hasOwner()
-			? (pCharacterPtr->hasOwnerName()
-			? (pCharacterPtr->isGroupOwned()
-			? (pCharacterPtr->getOwnerName() + " " + getString("character_owner_group"))
-			: pCharacterPtr->getOwnerName())
-			: getString("character_owner_loading"))
-			: getString("character_owner_unknown"));
+	columns[2]["value"] = getOwnerName(pCharacterPtr);
 
 	S32 cpuTime = llround(pCharacterPtr->getCPUTime());
 	std::string cpuTimeString = llformat("%d", cpuTime);

indra/newview/llfloaterpathfindingcharacters.h

 	virtual void                       updateControlsOnScrollListChange();
 
 	virtual S32                        getNameColumnIndex() const;
+	virtual S32                        getOwnerNameColumnIndex() const;
+	virtual std::string                getOwnerName(const LLPathfindingObject *pObject) const;
 	virtual const LLColor4             &getBeaconColor() const;
 
 	virtual LLPathfindingObjectListPtr getEmptyObjectList() const;

indra/newview/llfloaterpathfindinglinksets.cpp

 	return 0;
 }
 
+S32 LLFloaterPathfindingLinksets::getOwnerNameColumnIndex() const
+{
+	return 2;
+}
+
+std::string LLFloaterPathfindingLinksets::getOwnerName(const LLPathfindingObject *pObject) const
+{
+	return (pObject->hasOwner()
+		? (pObject->hasOwnerName()
+		? (pObject->isGroupOwned()
+		? (pObject->getOwnerName() + " " + getString("linkset_owner_group"))
+		: pObject->getOwnerName())
+		: getString("linkset_owner_loading"))
+		: getString("linkset_owner_unknown"));
+}
+
 const LLColor4 &LLFloaterPathfindingLinksets::getBeaconColor() const
 {
 	return mBeaconColor;
 		columns[1]["value"] = pLinksetPtr->getDescription();
 
 		columns[2]["column"] = "owner";
-		columns[2]["value"] = (pLinksetPtr->hasOwner()
-			? (pLinksetPtr->hasOwnerName()
-			? (pLinksetPtr->isGroupOwned()
-			? (pLinksetPtr->getOwnerName() + " " + getString("linkset_owner_group"))
-			: pLinksetPtr->getOwnerName())
-			: getString("linkset_owner_loading"))
-			: getString("linkset_owner_unknown"));
+		columns[2]["value"] = getOwnerName(pLinksetPtr);
 
 		columns[3]["column"] = "land_impact";
 		columns[3]["value"] = llformat("%1d", pLinksetPtr->getLandImpact());

indra/newview/llfloaterpathfindinglinksets.h

 	virtual void                       updateControlsOnScrollListChange();
 
 	virtual S32                        getNameColumnIndex() const;
+	virtual S32                        getOwnerNameColumnIndex() const;
+	virtual std::string                getOwnerName(const LLPathfindingObject *pObject) const;
 	virtual const LLColor4             &getBeaconColor() const;
 
 	virtual LLPathfindingObjectListPtr getEmptyObjectList() const;

indra/newview/llfloaterpathfindingobjects.cpp

 	if (pObjectPtr->hasOwner() && !pObjectPtr->hasOwnerName())
 	{
 		mMissingNameObjectsScrollListItems.insert(std::make_pair<std::string, LLScrollListItem *>(pObjectPtr->getUUID().asString(), scrollListItem));
-		pObjectPtr->registerOwnerNameListener(boost::bind(&LLFloaterPathfindingObjects::handleObjectNameResponse, this, _1, _2));
+		pObjectPtr->registerOwnerNameListener(boost::bind(&LLFloaterPathfindingObjects::handleObjectNameResponse, this, _1));
 	}
 }
 
 	return 2;
 }
 
+std::string LLFloaterPathfindingObjects::getOwnerName(const LLPathfindingObject *pObject) const
+{
+	llassert(0);
+	std::string returnVal;
+	return returnVal;
+}
+
 const LLColor4 &LLFloaterPathfindingObjects::getBeaconColor() const
 {
 	return mDefaultBeaconColor;
 	requestGetObjects();
 }
 
-void LLFloaterPathfindingObjects::handleObjectNameResponse(const LLUUID &pObjectUUID, const std::string &pOwnerName)
+void LLFloaterPathfindingObjects::handleObjectNameResponse(const LLPathfindingObject *pObject)
 {
-	const std::string uuid = pObjectUUID.asString();
+	llassert(pObject != NULL);
+	const std::string uuid = pObject->getUUID().asString();
 	scroll_list_item_map::iterator scrollListItemIter = mMissingNameObjectsScrollListItems.find(uuid);
 	if (scrollListItemIter != mMissingNameObjectsScrollListItems.end())
 	{
 		llassert(scrollListItem != NULL);
 
 		LLScrollListCell *scrollListCell = scrollListItem->getColumn(getOwnerNameColumnIndex());
-		LLSD ownerName = pOwnerName;
+		LLSD ownerName = getOwnerName(pObject);
 
 		scrollListCell->setValue(ownerName);
 

indra/newview/llfloaterpathfindingobjects.h

 
 	virtual S32                        getNameColumnIndex() const;
 	virtual S32                        getOwnerNameColumnIndex() const;
+	virtual std::string                getOwnerName(const LLPathfindingObject *pObject) const;
 	virtual const LLColor4             &getBeaconColor() const;
 	virtual const LLColor4             &getBeaconTextColor() const;
 	virtual S32                        getBeaconWidth() const;
 	void                   onRegionBoundaryCrossed();
 	void                   onGodLevelChange(U8 pGodLevel);
 
-	void                   handleObjectNameResponse(const LLUUID &pObjectUUID, const std::string &pOwnerName);
+	void                   handleObjectNameResponse(const LLPathfindingObject *pObject);
 
 	void                   updateMessagingStatus();
 	void                   updateStateOnListControls();

indra/newview/llpathfindingobject.cpp

 	name_connection_t connection;
 	if (hasOwnerName())
 	{
-		pOwnerNameCallback(getUUID(), getOwnerName());
+		pOwnerNameCallback(this);
 	}
 	else
 	{
 
 	disconnectAvatarNameCacheConnection();
 
-	mOwnerNameSignal(getUUID(), getOwnerName());
+	mOwnerNameSignal(this);
 }
 
 void LLPathfindingObject::disconnectAvatarNameCacheConnection()

indra/newview/llpathfindingobject.h

 	inline BOOL               isGroupOwned() const   {return mIsGroupOwned;};
 	inline const LLVector3&   getLocation() const    {return mLocation;};
 
-	typedef boost::function<void (const LLUUID &, const std::string &)>         name_callback_t;
-	typedef boost::signals2::signal<void (const LLUUID &, const std::string &)> name_signal_t;
-	typedef boost::signals2::connection                                         name_connection_t;
+	typedef boost::function<void (const LLPathfindingObject *)>         name_callback_t;
+	typedef boost::signals2::signal<void (const LLPathfindingObject *)> name_signal_t;
+	typedef boost::signals2::connection                                 name_connection_t;
 
 	name_connection_t registerOwnerNameListener(name_callback_t pOwnerNameCallback);
 
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.