diff --git a/indra/newview/hippogridmanager.cpp b/indra/newview/hippogridmanager.cpp index ddadd6742..c2223fbe5 100644 --- a/indra/newview/hippogridmanager.cpp +++ b/indra/newview/hippogridmanager.cpp @@ -786,9 +786,6 @@ void HippoGridManager::loadFromFile() parseFile(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "grids_sg1.xml"), false); // merge default grid info, if newer. Force load, if list of grids is empty. parseFile(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "default_grids.xml"), !mGridInfo.empty()); - // merge grid info from web site, if newer. Force load, if list of grids is empty. - if (gSavedSettings.getBOOL("CheckForGridUpdates")) - parseUrl(gSavedSettings.getString("GridUpdateList"), !mGridInfo.empty()); std::string last_grid = gSavedSettings.getString("LastSelectedGrid"); if (last_grid.empty()) last_grid = gSavedSettings.getString("DefaultGrid"); @@ -796,8 +793,9 @@ void HippoGridManager::loadFromFile() setCurrentGrid(last_grid); } -void HippoGridManager::parseUrl(const std::string url, bool mergeIfNewer) +void HippoGridManager::parseUrl() { + const std::string& url(gSavedSettings.getString("GridUpdateList")); if (url.empty()) return; llinfos << "Loading grid info from '" << url << "'." << llendl; @@ -816,8 +814,8 @@ void HippoGridManager::parseUrl(const std::string url, bool mergeIfNewer) return; } - LLSD gridInfo = response["body"]; - parseData(gridInfo, mergeIfNewer); + // Force load, if list of grids is empty. + parseData(response["body"], !mGridInfo.empty()); } void HippoGridManager::parseFile(const std::string& fileName, bool mergeIfNewer) diff --git a/indra/newview/hippogridmanager.h b/indra/newview/hippogridmanager.h index a33970e28..5bc4b08ef 100644 --- a/indra/newview/hippogridmanager.h +++ b/indra/newview/hippogridmanager.h @@ -187,6 +187,8 @@ public: return mCurrentGridChangeSignal->connect(cb); } + void parseUrl(); + private: friend class HippoGridInfo; std::map mGridInfo; @@ -200,7 +202,6 @@ private: void cleanup(); void loadFromFile(); void parseFile(const std::string& fileName, bool mergeIfNewer); - void parseUrl(const std::string url, bool mergeIfNewer); void parseData(LLSD &gridInfo, bool mergeIfNewer); }; diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 3ed202986..933b87bee 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1130,6 +1130,11 @@ bool LLAppViewer::mainLoop() joystick->setNeedsReset(true); LLEventPump& mainloop(LLEventPumps::instance().obtain("mainloop")); + + // merge grid info from web site, if newer. + if (gSavedSettings.getBOOL("CheckForGridUpdates")) + gHippoGridManager->parseUrl(); + // As we do not (yet) send data on the mainloop LLEventPump that varies // with each frame, no need to instantiate a new LLSD event object each // time. Obviously, if that changes, just instantiate the LLSD at the diff --git a/indra/newview/llxmlrpcresponder.cpp b/indra/newview/llxmlrpcresponder.cpp index 2dbfa9148..2dc56449a 100644 --- a/indra/newview/llxmlrpcresponder.cpp +++ b/indra/newview/llxmlrpcresponder.cpp @@ -45,7 +45,6 @@ #include "llappviewer.h" -#include "hippogridmanager.h" #include "aicurleasyrequeststatemachine.h" #ifdef CWDEBUG @@ -213,6 +212,7 @@ LLXMLRPCValue XMLRPCResponder::responseValue(void) const } #ifdef AI_UNUSED +#include "hippogridmanager.h" void LLXMLRPCTransaction::Impl::setStatus(Status status, const std::string& message, const std::string& uri) {