diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llmessage/llexperiencecache.cpp | 21 | ||||
-rw-r--r-- | indra/llmessage/llexperiencecache.h | 2 | ||||
-rwxr-xr-x | indra/llui/llurlentry.cpp | 4 | ||||
-rwxr-xr-x | indra/newview/llpreviewscript.cpp | 20 |
4 files changed, 23 insertions, 24 deletions
diff --git a/indra/llmessage/llexperiencecache.cpp b/indra/llmessage/llexperiencecache.cpp index 648e2039a6..c8deaac1ef 100644 --- a/indra/llmessage/llexperiencecache.cpp +++ b/indra/llmessage/llexperiencecache.cpp @@ -320,9 +320,9 @@ namespace LLExperienceCache for ( ; it != mKeys.end(); ++it) { - LLSD exp; + LLSD exp = get(it->first); //leave the properties alone if we already have a cache entry for this xp - if(!get(it->first, exp)) + if(exp.isUndefined()) { exp[PROPERTIES]=PROPERTY_INVALID; } @@ -563,24 +563,21 @@ namespace LLExperienceCache LL_WARNS("ExperienceCache") << ": Ignoring cache insert of experience which is missing " << EXPERIENCE_ID << LL_ENDL; } } - - bool get( const LLUUID& key, LLSD& experience_data ) + static LLSD empty; + const LLSD& get(const LLUUID& key) { - if(key.isNull()) return false; + if(key.isNull()) return empty; cache_t::const_iterator it = sCache.find(key); - + if (it != sCache.end()) { - experience_data = it->second; - return true; + return it->second; } - + fetch(key); - return false; + return empty; } - - void get( const LLUUID& key, callback_slot_t slot ) { if(key.isNull()) return; diff --git a/indra/llmessage/llexperiencecache.h b/indra/llmessage/llexperiencecache.h index e6129796b7..e669ee888e 100644 --- a/indra/llmessage/llexperiencecache.h +++ b/indra/llmessage/llexperiencecache.h @@ -89,7 +89,7 @@ namespace LLExperienceCache void erase(const LLUUID& key); bool fetch(const LLUUID& key, bool refresh=false); void insert(const LLSD& experience_data); - bool get(const LLUUID& key, LLSD& experience_data); + const LLSD& get(const LLUUID& key); // If name information is in cache, callback will be called immediately. void get(const LLUUID& key, callback_slot_t slot); diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index f5baf17d8f..0af2cd42aa 100755 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -1231,8 +1231,8 @@ std::string LLUrlEntryExperienceProfile::getLabel( const std::string &url, const return LLTrans::getString("ExperienceNameNull"); } - LLSD experience_details; - if(LLExperienceCache::get(experience_id, experience_details)) + const LLSD& experience_details = LLExperienceCache::get(experience_id); + if(!experience_details.isUndefined()) { return experience_details[LLExperienceCache::NAME].asString(); } diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index e59c1c21f6..a4798f3911 100755 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -1319,6 +1319,7 @@ void LLLiveLSLEditor::updateExperiencePanel() mExperienceEnabled->setToolTip(getString("experience_enabled")); mExperienceEnabled->setEnabled(getIsModifiable()); mExperiences->setVisible(TRUE); + mExperienceEnabled->set(TRUE); buildExperienceList(); } } @@ -1328,7 +1329,6 @@ void LLLiveLSLEditor::buildExperienceList() mExperiences->clearRows(); bool foundAssociated=false; const LLUUID& associated = mScriptEd->getAssociatedExperience(); - LLSD experience; LLUUID last; LLScrollListItem* item; for(LLSD::array_const_iterator it = mExperienceIds.beginArray(); it != mExperienceIds.endArray(); ++it) @@ -1340,21 +1340,23 @@ void LLLiveLSLEditor::buildExperienceList() foundAssociated = true; position = ADD_TOP; } - if(LLExperienceCache::get(id, experience)) - { - mExperiences->add(experience[LLExperienceCache::NAME].asString(), id, position); - } - else + + const LLSD& experience = LLExperienceCache::get(id); + if(experience.isUndefined()) { mExperiences->add(getString("loading"), id, position); last = id; } - + else + { + mExperiences->add(experience[LLExperienceCache::NAME].asString(), id, position); + } } if(!foundAssociated ) - { - if(LLExperienceCache::get(associated, experience)) + { + const LLSD& experience = LLExperienceCache::get(associated); + if(experience.isDefined()) { item=mExperiences->add(experience[LLExperienceCache::NAME].asString(), associated, ADD_TOP); } |