summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorIma Mechanique <ima.mechanique@secondlife.com>2014-02-05 15:27:22 +0000
committerIma Mechanique <ima.mechanique@secondlife.com>2014-02-05 15:27:22 +0000
commit566b10e2250e484b2d3211565d387c3c73864e82 (patch)
tree313403690995f4542b31dd82b914a65aac9281fb /indra/newview
parent2dc2ce995983bfa87527b4ca94d4f13eb94b5c80 (diff)
Cleaning up a little. Using assigned values for simFeature/Capability name instead of literal values.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llsyntaxid.cpp34
-rw-r--r--indra/newview/llsyntaxid.h4
2 files changed, 18 insertions, 20 deletions
diff --git a/indra/newview/llsyntaxid.cpp b/indra/newview/llsyntaxid.cpp
index 886dcfaac0..4d7cc550af 100644
--- a/indra/newview/llsyntaxid.cpp
+++ b/indra/newview/llsyntaxid.cpp
@@ -113,7 +113,7 @@ void fetchKeywordsFileResponder::cacheFile(const LLSD& content_ref)
//-----------------------------------------------------------------------------
const std::string LLSyntaxIdLSL::CAPABILITY_NAME = "LSLSyntax";
const std::string LLSyntaxIdLSL::FILENAME_DEFAULT = "keywords_lsl_default.xml";
-const std::string LLSyntaxIdLSL::SIMULATOR_FEATURE ="LSLSyntaxId";
+const std::string LLSyntaxIdLSL::SIMULATOR_FEATURE = "LSLSyntaxId";
LLSD LLSyntaxIdLSL::sKeywordsXml;
bool LLSyntaxIdLSL::sLoaded;
@@ -123,21 +123,24 @@ bool LLSyntaxIdLSL::sVersionChanged;
/**
* @brief LLSyntaxIdLSL constructor
*/
-LLSyntaxIdLSL::LLSyntaxIdLSL(std::string filenameDefault, std::string simulatorFeature, std::string capabilityName) :
- // Move these to signature?
- mCapabilityURL(""),
+LLSyntaxIdLSL::LLSyntaxIdLSL(std::string filenameDefault, std::string simFeatureName, std::string capabilityName) :
mFilePath(LL_PATH_APP_SETTINGS)
{
mCapabilityName = capabilityName;
mFileNameCurrent = filenameDefault;
mFileNameDefault = filenameDefault;
- mSimulatorFeature = simulatorFeature;
+ mSimulatorFeature = simFeatureName;
mSyntaxIdCurrent = LLUUID();
}
-LLSyntaxIdLSL::LLSyntaxIdLSL()
+LLSyntaxIdLSL::LLSyntaxIdLSL() :
+ mFilePath(LL_PATH_APP_SETTINGS)
{
- LLSyntaxIdLSL(LLSyntaxIdLSL::FILENAME_DEFAULT, LLSyntaxIdLSL::SIMULATOR_FEATURE, LLSyntaxIdLSL::CAPABILITY_NAME);
+ mCapabilityName = CAPABILITY_NAME;
+ mFileNameCurrent = FILENAME_DEFAULT;
+ mFileNameDefault = FILENAME_DEFAULT;
+ mSimulatorFeature = SIMULATOR_FEATURE;
+ mSyntaxIdCurrent = LLUUID();
}
std::string LLSyntaxIdLSL::buildFileNameNew()
@@ -166,7 +169,7 @@ bool LLSyntaxIdLSL::checkSyntaxIdChanged()
{
if (!region->capabilitiesReceived())
{ // Shouldn't be possible, but experience shows that it may be needed.
- LL_WARNS("SyntaxLSL")
+ LL_ERRS("SyntaxLSL")
<< "Region '" << region->getName()
<< "' has not received capabilities yet! Cannot process SyntaxId."
<< LL_ENDL;
@@ -174,15 +177,14 @@ bool LLSyntaxIdLSL::checkSyntaxIdChanged()
else
{
LLSD simFeatures;
- std::string message;
region->getSimulatorFeatures(simFeatures);
- LL_INFOS("SyntaxLSL") << "Region is '" << region->getName() << "' ..." << LL_ENDL;
-
- // get and check the hash
- if (simFeatures.has("LSLSyntaxId"))
+ // Does the sim have the required feature
+ if (simFeatures.has(mSimulatorFeature))
{
- mSyntaxIdNew = simFeatures["LSLSyntaxId"].asUUID();
+ // get and check the hash
+ mSyntaxIdNew = simFeatures[mSimulatorFeature].asUUID();
+ mCapabilityURL = region->getCapability(mCapabilityName);
if (mSyntaxIdCurrent != mSyntaxIdNew)
{
LL_INFOS("SyntaxLSL")
@@ -216,8 +218,6 @@ bool LLSyntaxIdLSL::checkSyntaxIdChanged()
changed = true;
}
}
- LL_INFOS("SyntaxLSL")
- << "Region is '" << region->getName() << message << LL_ENDL;
}
}
sVersionChanged = changed;
@@ -260,8 +260,6 @@ void LLSyntaxIdLSL::initialise()
{
sKeywordsXml = LLSD();
sLoaded = sLoadFailed = false;
- LLViewerRegion* region = gAgent.getRegion();
- mCapabilityURL = region->getCapability(mCapabilityName);
if (!mCapabilityURL.empty())
{
LL_INFOS("SyntaxLSL")
diff --git a/indra/newview/llsyntaxid.h b/indra/newview/llsyntaxid.h
index 3c27a91ce4..a24edf7204 100644
--- a/indra/newview/llsyntaxid.h
+++ b/indra/newview/llsyntaxid.h
@@ -75,7 +75,7 @@ private:
public:
LLSyntaxIdLSL();
- LLSyntaxIdLSL(std::string filenameDefault, std::string simulatorFeature, std::string capabilityName);
+ LLSyntaxIdLSL(std::string filenameDefault, std::string simFeatureName, std::string capabilityName);
bool checkSyntaxIdChanged();
bool fetching();
@@ -103,7 +103,7 @@ protected:
void setFileNameCurrent(std::string& name) { mFileNameCurrent = name; }
void setFileNameDefault(std::string& name) { mFileNameDefault = name; }
void setFileNameNew(std::string name) { mFileNameNew = name; }
- void setSimulatorFeatureName(const std::string& name) { mSimulatorFeature = name; }
+// void setSimulatorFeatureName(const std::string& name) { mSimulatorFeature = name; }
};