summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2014-03-25 12:00:00 -0700
committerMerov Linden <merov@lindenlab.com>2014-03-25 12:00:00 -0700
commit54bba824228162724a1d46d9c7900e9aa7a077a3 (patch)
tree3355699f63f141e5fc0546dfe279b8aa65d40e07 /indra/llcommon
parentf813a25224081e68d4772676909d2cff14407486 (diff)
parent78eada5b6c3a8d20a2ea49887ab7c091e4b6fa14 (diff)
Pull merge from lindenlab/viewer-release
Diffstat (limited to 'indra/llcommon')
-rwxr-xr-xindra/llcommon/llavatarname.cpp17
-rwxr-xr-xindra/llcommon/llavatarname.h6
-rwxr-xr-xindra/llcommon/llerror.cpp4
-rwxr-xr-xindra/llcommon/llfasttimer.cpp1
-rwxr-xr-xindra/llcommon/llstl.h1
5 files changed, 26 insertions, 3 deletions
diff --git a/indra/llcommon/llavatarname.cpp b/indra/llcommon/llavatarname.cpp
index 642bd82e90..d12f157910 100755
--- a/indra/llcommon/llavatarname.cpp
+++ b/indra/llcommon/llavatarname.cpp
@@ -44,6 +44,7 @@ static const std::string DISPLAY_NAME_EXPIRES("display_name_expires");
static const std::string DISPLAY_NAME_NEXT_UPDATE("display_name_next_update");
bool LLAvatarName::sUseDisplayNames = true;
+bool LLAvatarName::sUseUsernames = true;
// Minimum time-to-live (in seconds) for a name entry.
// Avatar name should always guarantee to expire reasonably soon by default
@@ -81,6 +82,16 @@ bool LLAvatarName::useDisplayNames()
return sUseDisplayNames;
}
+void LLAvatarName::setUseUsernames(bool use)
+{
+ sUseUsernames = use;
+}
+
+bool LLAvatarName::useUsernames()
+{
+ return sUseUsernames;
+}
+
LLSD LLAvatarName::asLLSD() const
{
LLSD sd;
@@ -168,7 +179,11 @@ std::string LLAvatarName::getCompleteName() const
}
else
{
- name = mDisplayName + " (" + mUsername + ")";
+ name = mDisplayName;
+ if(sUseUsernames)
+ {
+ name += " (" + mUsername + ")";
+ }
}
}
else
diff --git a/indra/llcommon/llavatarname.h b/indra/llcommon/llavatarname.h
index 5d2fccc5ba..1cb3ae421f 100755
--- a/indra/llcommon/llavatarname.h
+++ b/indra/llcommon/llavatarname.h
@@ -54,6 +54,9 @@ public:
static void setUseDisplayNames(bool use);
static bool useDisplayNames();
+ static void setUseUsernames(bool use);
+ static bool useUsernames();
+
// A name object is valid if not temporary and not yet expired (default is expiration not checked)
bool isValidName(F64 max_unrefreshed = 0.0f) const { return !mIsTemporaryName && (mExpires >= max_unrefreshed); }
@@ -128,6 +131,9 @@ private:
// Global flag indicating if display name should be used or not
// This will affect the output of the high level "get" methods
static bool sUseDisplayNames;
+
+ // Flag indicating if username should be shown after display name or not
+ static bool sUseUsernames;
};
#endif
diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp
index d2af004cde..853f279c95 100755
--- a/indra/llcommon/llerror.cpp
+++ b/indra/llcommon/llerror.cpp
@@ -429,8 +429,8 @@ namespace LLError
~Settings()
{
- for_each(recorders.begin(), recorders.end(),
- DeletePointer());
+ for_each(recorders.begin(), recorders.end(), DeletePointer());
+ recorders.clear();
}
static Settings*& getPtr();
diff --git a/indra/llcommon/llfasttimer.cpp b/indra/llcommon/llfasttimer.cpp
index 01b6e60d2b..58db7d0d17 100755
--- a/indra/llcommon/llfasttimer.cpp
+++ b/indra/llcommon/llfasttimer.cpp
@@ -119,6 +119,7 @@ public:
~NamedTimerFactory()
{
std::for_each(mTimers.begin(), mTimers.end(), DeletePairedPointer());
+ mTimers.clear();
delete mTimerRoot;
}
diff --git a/indra/llcommon/llstl.h b/indra/llcommon/llstl.h
index d3941e1bc9..0a39288f5a 100755
--- a/indra/llcommon/llstl.h
+++ b/indra/llcommon/llstl.h
@@ -98,6 +98,7 @@ struct DeletePointerArray
// The general form is:
//
// std::for_each(somemap.begin(), somemap.end(), DeletePairedPointer());
+// somemap.clear(); // Don't leave dangling pointers around
struct DeletePairedPointer
{