summaryrefslogtreecommitdiff
path: root/indra/newview/llstartup.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llstartup.cpp')
-rw-r--r--indra/newview/llstartup.cpp47
1 files changed, 32 insertions, 15 deletions
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 975d1f9f32..b70b3662a7 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -46,6 +46,7 @@
#endif
#include "llares.h"
+#include "llavatarnamecache.h"
#include "lllandmark.h"
#include "llcachename.h"
#include "lldir.h"
@@ -261,11 +262,10 @@ void apply_udp_blacklist(const std::string& csv);
bool process_login_success_response();
void transition_back_to_login_panel(const std::string& emsg);
-void callback_cache_name(const LLUUID& id, const std::string& firstname, const std::string& lastname, BOOL is_group)
+void callback_cache_name(const LLUUID& id, const std::string& full_name, bool is_group)
{
- LLNameListCtrl::refreshAll(id, firstname, lastname, is_group);
- LLNameBox::refreshAll(id, firstname, lastname, is_group);
- LLNameEditor::refreshAll(id, firstname, lastname, is_group);
+ LLNameBox::refreshAll(id, full_name, is_group);
+ LLNameEditor::refreshAll(id, full_name, is_group);
// TODO: Actually be intelligent about the refresh.
// For now, just brute force refresh the dialogs.
@@ -1279,16 +1279,7 @@ bool idle_startup()
gXferManager->registerCallbacks(gMessageSystem);
- if ( gCacheName == NULL )
- {
- gCacheName = new LLCacheName(gMessageSystem);
- gCacheName->addObserver(&callback_cache_name);
- gCacheName->LocalizeCacheName("waiting", LLTrans::getString("AvatarNameWaiting"));
- gCacheName->LocalizeCacheName("nobody", LLTrans::getString("AvatarNameNobody"));
- gCacheName->LocalizeCacheName("none", LLTrans::getString("GroupNameNone"));
- // Load stored cache if possible
- LLAppViewer::instance()->loadNameCache();
- }
+ LLStartUp::initNameCache();
// update the voice settings *after* gCacheName initialization
// so that we can construct voice UI that relies on the name cache
@@ -1630,7 +1621,6 @@ bool idle_startup()
LLClassifiedInfo::loadCategories(classified_categories);
}
-
// This method MUST be called before gInventory.findCategoryUUIDForType because of
// gInventory.mIsAgentInvUsable is set to true in the gInventory.buildParentChildMap.
gInventory.buildParentChildMap();
@@ -2675,6 +2665,33 @@ void LLStartUp::fontInit()
LLFontGL::loadDefaultFonts();
}
+void LLStartUp::initNameCache()
+{
+ // Can be called multiple times
+ if ( gCacheName ) return;
+
+ gCacheName = new LLCacheName(gMessageSystem);
+ gCacheName->addObserver(&callback_cache_name);
+ gCacheName->localizeCacheName("waiting", LLTrans::getString("AvatarNameWaiting"));
+ gCacheName->localizeCacheName("nobody", LLTrans::getString("AvatarNameNobody"));
+ gCacheName->localizeCacheName("none", LLTrans::getString("GroupNameNone"));
+ // Load stored cache if possible
+ LLAppViewer::instance()->loadNameCache();
+
+ // Start cache in not-running state until we figure out if we have
+ // capabilities for display name lookup
+ LLAvatarNameCache::initClass(false);
+ LLAvatarNameCache::setUseDisplayNames(gSavedSettings.getBOOL("UseDisplayNames"));
+}
+
+void LLStartUp::cleanupNameCache()
+{
+ LLAvatarNameCache::cleanupClass();
+
+ delete gCacheName;
+ gCacheName = NULL;
+}
+
bool LLStartUp::dispatchURL()
{
// ok, if we've gotten this far and have a startup URL