diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llsyntaxid.cpp | 40 | ||||
-rw-r--r-- | indra/newview/llsyntaxid.h | 1 |
2 files changed, 24 insertions, 17 deletions
diff --git a/indra/newview/llsyntaxid.cpp b/indra/newview/llsyntaxid.cpp index 43f840544c..94226b82b1 100644 --- a/indra/newview/llsyntaxid.cpp +++ b/indra/newview/llsyntaxid.cpp @@ -96,16 +96,7 @@ LLSD LLSyntaxIdLSL::sKeywordsXml; std::string LLSyntaxIdLSL::buildFileNameNew() { - std::string filename = "keywords_lsl_"; - if (!mSyntaxIdNew.isNull()) - { - filename += gLastVersionChannel + "_" + mSyntaxIdNew.asString(); - } - else - { - filename += mFileNameDefault; - } - mFileNameNew = filename + ".llsd.xml"; + mFileNameNew = mSyntaxIdNew.isNull() ? mFileNameDefault : "keywords_lsl_" + gLastVersionChannel + "_" + mSyntaxIdNew.asString() + ".llsd.xml"; return mFileNameNew; } @@ -204,6 +195,8 @@ void LLSyntaxIdLSL::fetchKeywordsFile() void LLSyntaxIdLSL::initialise() { + mFileNameNew = mFileNameCurrent; + mSyntaxIdNew = mSyntaxIdCurrent; if (checkSyntaxIdChanged()) { LL_INFOS("SyntaxLSL") @@ -231,20 +224,33 @@ void LLSyntaxIdLSL::initialise() } else { // Need to open the default - LL_INFOS("SyntaxLSL") - << "LSLSyntaxId is null so we will use the default file!" - << LL_ENDL; - loadKeywordsIntoLLSD(); + loadDefaultKeywordsIntoLLSD("LSLSyntaxId is null so we will use the default file!"); } - mFileNameCurrent = mFileNameNew; - mSyntaxIdCurrent = mSyntaxIdNew; } - else + else if (sKeywordsXml.isDefined()) { LL_INFOS("SyntaxLSL") << "No change to Syntax! Nothing to see. Move along now!" << LL_ENDL; } + else + { // Need to open the default + loadDefaultKeywordsIntoLLSD("LSLSyntaxId is null so we will use the default file!"); + } + + mFileNameCurrent = mFileNameNew; + mSyntaxIdCurrent = mSyntaxIdNew; +} + +//----------------------------------------------------------------------------- +// loadDefaultKeywordsIntoLLSD() +//----------------------------------------------------------------------------- +void LLSyntaxIdLSL::loadDefaultKeywordsIntoLLSD(const std::string message) +{ + LL_INFOS("SyntaxLSL") << message << LL_ENDL; + mSyntaxIdNew = LLUUID(); + buildFullFileSpec(); + loadKeywordsIntoLLSD(); } //----------------------------------------------------------------------------- diff --git a/indra/newview/llsyntaxid.h b/indra/newview/llsyntaxid.h index 3a711d7460..b968dd233d 100644 --- a/indra/newview/llsyntaxid.h +++ b/indra/newview/llsyntaxid.h @@ -111,6 +111,7 @@ protected: std::string buildFileNameNew(); std::string buildFullFileSpec(); void fetchKeywordsFile(); + void loadDefaultKeywordsIntoLLSD(const std::string message); bool loadKeywordsIntoLLSD(); void setSyntaxId(LLUUID SyntaxId) { mSyntaxIdCurrent = SyntaxId; } void setFileNameCurrent(std::string& name) { mFileNameCurrent = name; } |