Proper per-account settings

This commit is contained in:
Siana Gearz
2011-04-01 02:58:33 +02:00
parent b34d9fb88e
commit b3593f0ffe
3 changed files with 19 additions and 20 deletions

View File

@@ -542,7 +542,7 @@ std::string LLDir::getForbiddenFileChars()
return "\\/:*?\"<>|";
}
void LLDir::setLindenUserDir(const std::string &first, const std::string &last)
void LLDir::setLindenUserDir(const std::string &grid, const std::string &first, const std::string &last)
{
// if both first and last aren't set, assume we're grabbing the cached dir
if (!first.empty() && !last.empty())
@@ -558,6 +558,14 @@ void LLDir::setLindenUserDir(const std::string &first, const std::string &last)
mLindenUserDir += firstlower;
mLindenUserDir += "_";
mLindenUserDir += lastlower;
if (!grid.empty())
{
std::string gridlower(grid);
LLStringUtil::toLower(gridlower);
mPerAccountChatLogsDir += "@";
mPerAccountChatLogsDir += gridlower;
}
}
else
{

View File

@@ -131,7 +131,7 @@ class LLDir
virtual void setChatLogsDir(const std::string &path); // Set the chat logs dir to this user's dir
virtual void setPerAccountChatLogsDir(const std::string &grid, const std::string &first, const std::string &last); // Set the per user chat log directory.
virtual void setLindenUserDir(const std::string &first, const std::string &last); // Set the linden user dir to this user's dir
virtual void setLindenUserDir(const std::string& grid, const std::string& first, const std::string& last); // Set the linden user dir to this user's dir
virtual void setSkinFolder(const std::string &skin_folder);
virtual bool setCacheDir(const std::string &path);

View File

@@ -807,13 +807,6 @@ bool idle_startup()
timeout_count = 0;
// OGPX : Load URL History File for saved user. Needs to happen *before* login panel is displayed.
// Note: it only loads them if it can figure out the saved username.
if (!firstname.empty() && !lastname.empty())
{
gDirUtilp->setLindenUserDir(firstname, lastname);
LLURLHistory::loadFile("url_history.xml");
}
// *NOTE: This is where LLViewerParcelMgr::getInstance() used to get allocated before becoming LLViewerParcelMgr::getInstance().
@@ -972,7 +965,14 @@ bool idle_startup()
// create necessary directories
// *FIX: these mkdir's should error check
gDirUtilp->setLindenUserDir(firstname, lastname);
if (gHippoGridManager->getCurrentGrid()->isSecondLife())
{
gDirUtilp->setLindenUserDir(LLStringUtil::null, firstname, lastname);
}
else
{
gDirUtilp->setLindenUserDir(gHippoGridManager->getCurrentGridNick(), firstname, lastname);
}
LLFile::mkdir(gDirUtilp->getLindenUserDir());
// Set PerAccountSettingsFile to the default value.
@@ -1043,22 +1043,13 @@ bool idle_startup()
// END TODO
LLPanelLogin::close();
}
//For HTML parsing in text boxes.
LLTextEditor::setLinkColor( gSavedSettings.getColor4("HTMLLinkColor") );
// Load URL History File
LLURLHistory::loadFile("url_history.xml");
// OGPX : Since loading the file wipes the new value that might have gotten added on
// the login panel, let's add it to URL history
// (appendToURLCollection() only adds unique values to list)
// OGPX kind of ugly. TODO: figure out something less hacky
if (!gSavedSettings.getString("CmdLineRegionURI").empty())
{
LLURLHistory::appendToURLCollection("regionuri",gSavedSettings.getString("CmdLineRegionURI"));
}
//-------------------------------------------------
// Handle startup progress screen
//-------------------------------------------------