Rework HippoGridManager's parseUrl to be called after LLAppViewer::init
No more hangs~ I'm not exactly sure if this exhibits the same behavior it used to, but this doesn't matter because it hasn't worked for versions, probably since AICurl, so no one is relying on it. It would seem to me that it needs to be called after pumps are created. parseUrl is now public. Also, move hippogridmanager.h into AI_UNUSED section of llxmlrpcresponder.cpp, it's part of the unused
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -187,6 +187,8 @@ public:
|
||||
return mCurrentGridChangeSignal->connect(cb);
|
||||
}
|
||||
|
||||
void parseUrl();
|
||||
|
||||
private:
|
||||
friend class HippoGridInfo;
|
||||
std::map<std::string, HippoGridInfo*> 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);
|
||||
};
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user