diff options
-rw-r--r-- | doc/contributions.txt | 1 | ||||
-rw-r--r-- | indra/newview/llfloaterinspect.cpp | 39 | ||||
-rw-r--r-- | indra/newview/llfloaterinspect.h | 4 |
3 files changed, 40 insertions, 4 deletions
diff --git a/doc/contributions.txt b/doc/contributions.txt index 89be96fcf5..454a1e90ea 100644 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -171,6 +171,7 @@ Ansariel Hiller VWR-25480 VWR-26150 STORM-1685 + STORM-1717 Aralara Rajal Ardy Lay STORM-859 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 |