diff options
| author | Ansariel Hiller <none@none> | 2011-12-02 14:37:23 -0500 | 
|---|---|---|
| committer | Ansariel Hiller <none@none> | 2011-12-02 14:37:23 -0500 | 
| commit | 9a79b6f3306e805227d68c07a151d25b0e70553d (patch) | |
| tree | 76f6b0221ff23004c0af1b06c6902ce23cdc0a7d /indra | |
| parent | 34b44fe714cb8f9e5962b975474400b07599cff8 (diff) | |
storm-1717: fix avatar names in object details floater
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/newview/llfloaterinspect.cpp | 39 | ||||
| -rw-r--r-- | indra/newview/llfloaterinspect.h | 4 | 
2 files changed, 39 insertions, 4 deletions
| diff --git a/indra/newview/llfloaterinspect.cpp b/indra/newview/llfloaterinspect.cpp index a09b9ea235..cece8d299c 100644 --- a/indra/newview/llfloaterinspect.cpp +++ b/indra/newview/llfloaterinspect.cpp @@ -37,6 +37,7 @@  #include "llselectmgr.h"  #include "lltoolcomp.h"  #include "lltoolmgr.h" +#include "lltrans.h"  #include "llviewercontrol.h"  #include "llviewerobject.h"  #include "lluictrlfactory.h" @@ -166,6 +167,15 @@ LLUUID LLFloaterInspect::getSelectedUUID()  	return LLUUID::null;  } +void LLFloaterInspect::onGetAvNameCallback(const LLUUID& idCreator, const LLAvatarName& av_name, void* FloaterPtr) +{ +	if (FloaterPtr) +	{ +		LLFloaterInspect* floater = (LLFloaterInspect*)FloaterPtr; +		floater->dirty(); +	} +} +  void LLFloaterInspect::refresh()  {  	LLUUID creator_id; @@ -205,11 +215,32 @@ void LLFloaterInspect::refresh()  		substitution["datetime"] = (S32) timestamp;  		LLStringUtil::format (timeStr, substitution); +		const LLUUID& idOwner = obj->mPermissions->getOwner(); +		const LLUUID& idCreator = obj->mPermissions->getCreator();  		LLAvatarName av_name; -		LLAvatarNameCache::get(obj->mPermissions->getOwner(), &av_name); -		owner_name = av_name.getCompleteName(); -		LLAvatarNameCache::get(obj->mPermissions->getCreator(), &av_name); -		creator_name = av_name.getCompleteName(); + +		// Only work with the names if we actually get a result +		// from the name cache. If not, defer setting the +		// actual name and set a placeholder. +		if (LLAvatarNameCache::get(idOwner, &av_name)) +		{ +			owner_name = av_name.getCompleteName(); +		} +		else +		{ +			owner_name = LLTrans::getString("RetrievingData"); +			LLAvatarNameCache::get(idOwner, boost::bind(&LLFloaterInspect::onGetAvNameCallback, _1, _2, this)); +		} + +		if (LLAvatarNameCache::get(idCreator, &av_name)) +		{ +			creator_name = av_name.getCompleteName(); +		} +		else +		{ +			creator_name = LLTrans::getString("RetrievingData"); +			LLAvatarNameCache::get(idCreator, boost::bind(&LLFloaterInspect::onGetAvNameCallback, _1, _2, this)); +		}  		row["id"] = obj->getObject()->getID();  		row["columns"][0]["column"] = "object_name"; diff --git a/indra/newview/llfloaterinspect.h b/indra/newview/llfloaterinspect.h index d9ffdf114b..7ee83ccdb4 100644 --- a/indra/newview/llfloaterinspect.h +++ b/indra/newview/llfloaterinspect.h @@ -29,6 +29,7 @@  #ifndef LL_LLFLOATERINSPECT_H  #define LL_LLFLOATERINSPECT_H +#include "llavatarname.h"  #include "llfloater.h"  //class LLTool; @@ -53,6 +54,9 @@ public:  	void onClickCreatorProfile();  	void onClickOwnerProfile();  	void onSelectObject(); + +	static void onGetAvNameCallback(const LLUUID& idCreator, const LLAvatarName& av_name, void* FloaterPtr); +  	LLScrollListCtrl* mObjectList;  protected:  	// protected members | 
