summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2021-10-01 16:39:56 +0300
committerMnikolenko Productengine <mnikolenko@productengine.com>2021-10-01 16:39:56 +0300
commitf3743b8e3092daabf5c5324626c4f04f36ff5bd7 (patch)
tree0a1155384026bdb31c1cc75fccf810e896b1f130 /indra
parent8b935e9dfdda9e7782bf40dea117e1583fe06c72 (diff)
SL-15999 use callback for updating window title
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llteleporthistory.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/indra/newview/llteleporthistory.cpp b/indra/newview/llteleporthistory.cpp
index b872053d3f..3ece12931c 100644
--- a/indra/newview/llteleporthistory.cpp
+++ b/indra/newview/llteleporthistory.cpp
@@ -118,6 +118,20 @@ void LLTeleportHistory::handleLoginComplete()
updateCurrentLocation(gAgent.getPositionGlobal());
}
+static void on_avatar_name_update_title(const LLAvatarName& av_name)
+{
+ if (gAgent.getRegion() && gViewerWindow && gViewerWindow->getWindow())
+ {
+ std::string region = gAgent.getRegion()->getName();
+ std::string username = av_name.getUserName();
+
+ // this first pass simply displays username and region name
+ // but could easily be extended to include other details like
+ // X/Y/Z location within a region etc.
+ std::string new_title = STRINGIZE(username << " @ " << region);
+ gViewerWindow->getWindow()->setTitle(new_title);
+ }
+}
void LLTeleportHistory::updateCurrentLocation(const LLVector3d& new_pos)
{
@@ -184,21 +198,7 @@ void LLTeleportHistory::updateCurrentLocation(const LLVector3d& new_pos)
// setting to allow it is enabled (may be useful in other situations)
if (gNonInteractive || gSavedSettings.getBOOL("UpdateAppWindowTitleBar"))
{
- LLAvatarName av_name;
- if (LLAvatarNameCache::get(gAgent.getID(), &av_name))
- {
- if (gAgent.getRegion() && gViewerWindow && gViewerWindow->getWindow())
- {
- std::string region = gAgent.getRegion()->getName();
- std::string username = av_name.getUserName();
-
- // this first pass simply displays username and region name
- // but could easily be extended to include other details like
- // X/Y/Z location within a region etc.
- std::string new_title = STRINGIZE(username << " @ " << region);
- gViewerWindow->getWindow()->setTitle(new_title);
- }
- }
+ LLAvatarNameCache::get(gAgent.getID(), boost::bind(&on_avatar_name_update_title, _2));
}
// Signal the interesting party that we've changed.