summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorIma Mechanique <ima.mechanique@secondlife.com>2013-12-19 04:27:28 +0000
committerIma Mechanique <ima.mechanique@secondlife.com>2013-12-19 04:27:28 +0000
commitb18c9578b58ed7f98cd162adcecbf9df253263c9 (patch)
tree438339978f40e1badebdfe457c52ac65fad5232d /indra/newview
parent86275f22e3003af06c289ef34b5f859113236e4f (diff)
Fixing loading of default keywords file when nothing has been previously loaded.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llsyntaxid.cpp40
-rw-r--r--indra/newview/llsyntaxid.h1
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; }