summaryrefslogtreecommitdiff
path: root/indra/llvfs
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llvfs')
-rw-r--r--indra/llvfs/lldir.cpp18
-rw-r--r--indra/llvfs/lldir.h3
2 files changed, 18 insertions, 3 deletions
diff --git a/indra/llvfs/lldir.cpp b/indra/llvfs/lldir.cpp
index 5e5aeefba1..6899e9a44a 100644
--- a/indra/llvfs/lldir.cpp
+++ b/indra/llvfs/lldir.cpp
@@ -90,7 +90,8 @@ LLDir::LLDir()
mCAFile(""),
mTempDir(""),
mDirDelimiter("/"), // fallback to forward slash if not overridden
- mLanguage("en")
+ mLanguage("en"),
+ mUserName("undefined")
{
}
@@ -346,6 +347,11 @@ const std::string &LLDir::getLLPluginDir() const
return mLLPluginDir;
}
+const std::string &LLDir::getUserName() const
+{
+ return mUserName;
+}
+
static std::string ELLPathToString(ELLPath location)
{
typedef std::map<ELLPath, const char*> ELLPathMap;
@@ -814,6 +820,11 @@ void LLDir::setChatLogsDir(const std::string &path)
}
}
+void LLDir::updatePerAccountChatLogsDir()
+{
+ mPerAccountChatLogsDir = add(getChatLogsDir(), mUserName);
+}
+
void LLDir::setPerAccountChatLogsDir(const std::string &username)
{
// if both first and last aren't set, assume we're grabbing the cached dir
@@ -824,13 +835,14 @@ void LLDir::setPerAccountChatLogsDir(const std::string &username)
std::string userlower(username);
LLStringUtil::toLower(userlower);
LLStringUtil::replaceChar(userlower, ' ', '_');
- mPerAccountChatLogsDir = add(getChatLogsDir(), userlower);
+
+ mUserName = userlower;
+ updatePerAccountChatLogsDir();
}
else
{
llerrs << "NULL name for LLDir::setPerAccountChatLogsDir" << llendl;
}
-
}
void LLDir::setSkinFolder(const std::string &skin_folder, const std::string& language)
diff --git a/indra/llvfs/lldir.h b/indra/llvfs/lldir.h
index 300ff1eef6..cc10ed5bbd 100644
--- a/indra/llvfs/lldir.h
+++ b/indra/llvfs/lldir.h
@@ -104,6 +104,7 @@ class LLDir
const std::string &getUserSkinDir() const; // User-specified skin folder with user modifications. e.g. c:\documents and settings\username\application data\second life\skins\curskin
const std::string getSkinBaseDir() const; // folder that contains all installed skins (not user modifications). e.g. c:\program files\second life\skins
const std::string &getLLPluginDir() const; // Directory containing plugins and plugin shell
+ const std::string &getUserName() const;
// Expanded filename
std::string getExpandedFilename(ELLPath location, const std::string &filename) const;
@@ -186,6 +187,7 @@ class LLDir
virtual std::string getSkinFolder() const;
virtual std::string getLanguage() const;
virtual bool setCacheDir(const std::string &path);
+ virtual void updatePerAccountChatLogsDir();
virtual void dumpCurrentDirectories();
@@ -243,6 +245,7 @@ protected:
std::vector<std::string> mSearchSkinDirs;
std::string mLanguage; // Current viewer language
std::string mLLPluginDir; // Location for plugins and plugin shell
+ std::string mUserName; // Current user name
};
void dir_exists_or_crash(const std::string &dir_name);