summaryrefslogtreecommitdiff
path: root/indra/llcommon/llliveappconfig.cpp
diff options
context:
space:
mode:
authorAaron Brashears <aaronb@lindenlab.com>2009-05-18 23:38:35 +0000
committerAaron Brashears <aaronb@lindenlab.com>2009-05-18 23:38:35 +0000
commit6df2755ba6b24d0cefd52ce175b0212dd46c9b10 (patch)
tree833bc29e7bd5438eb89f34119ae157efe6258b2c /indra/llcommon/llliveappconfig.cpp
parent0257214763203708e8e29d09346e777b95cdfce6 (diff)
Result of svn merge -r119432:120464 svn+ssh://svn/svn/linden/branches/http_database/merge-03 into trunk. QAR-1462
Diffstat (limited to 'indra/llcommon/llliveappconfig.cpp')
-rw-r--r--indra/llcommon/llliveappconfig.cpp32
1 files changed, 24 insertions, 8 deletions
diff --git a/indra/llcommon/llliveappconfig.cpp b/indra/llcommon/llliveappconfig.cpp
index e1bfc11a03..75bdfee8b7 100644
--- a/indra/llcommon/llliveappconfig.cpp
+++ b/indra/llcommon/llliveappconfig.cpp
@@ -38,9 +38,12 @@
#include "llsd.h"
#include "llsdserialize.h"
-LLLiveAppConfig::LLLiveAppConfig(LLApp* app, const std::string& filename, F32 refresh_period)
-: LLLiveFile(filename, refresh_period),
- mApp(app)
+LLLiveAppConfig::LLLiveAppConfig(
+ const std::string& filename,
+ F32 refresh_period,
+ LLApp::OptionPriority priority) :
+ LLLiveFile(filename, refresh_period),
+ mPriority(priority)
{ }
@@ -48,7 +51,7 @@ LLLiveAppConfig::~LLLiveAppConfig()
{ }
// virtual
-void LLLiveAppConfig::loadFile()
+bool LLLiveAppConfig::loadFile()
{
llinfos << "LLLiveAppConfig::loadFile(): reading from "
<< filename() << llendl;
@@ -59,12 +62,25 @@ void LLLiveAppConfig::loadFile()
LLSDSerialize::fromXML(config, file);
if(!config.isMap())
{
- llinfos << "LLDataserverConfig::loadFile(): not an map!"
+ llwarns << "Live app config not an map in " << filename()
<< " Ignoring the data." << llendl;
- return;
+ return false;
}
file.close();
}
- mApp->setOptionData(
- LLApp::PRIORITY_SPECIFIC_CONFIGURATION, config);
+ else
+ {
+ llinfos << "Live file " << filename() << " does not exit." << llendl;
+ }
+ // *NOTE: we do not handle the else case here because we would not
+ // have attempted to load the file unless LLLiveFile had
+ // determined there was a reason to load it. This only happens
+ // when either the file has been updated or it is either suddenly
+ // in existence or has passed out of existence. Therefore, we want
+ // to set the config to an empty config, and return that it
+ // changed.
+
+ LLApp* app = LLApp::instance();
+ if(app) app->setOptionData(mPriority, config);
+ return true;
}