diff options
| author | Gilbert Gonzales <gilbert@lindenlab.com> | 2013-03-04 10:11:51 -0800 |
|---|---|---|
| committer | Gilbert Gonzales <gilbert@lindenlab.com> | 2013-03-04 10:11:51 -0800 |
| commit | 9f965be297422ddab79ff9be47fb6d5c64a5096f (patch) | |
| tree | 02140b5fe78f7f348325d769b130c983127adee4 /indra/newview/lllogchat.cpp | |
| parent | 084ea74d43471eec1ae8781c4946fcf2a3a76a78 (diff) | |
CHUI-778: Now when changing paths for chat logs and transcripts any empty conversations will be reloaded with data from the new location. Use case for this is if the users nearby chat is empty and they switch to a location that has a nearby chat file, then the nearby chat file be loaded.
Diffstat (limited to 'indra/newview/lllogchat.cpp')
| -rw-r--r-- | indra/newview/lllogchat.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index 6562cfe1bb..448100c5d6 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -517,6 +517,22 @@ bool LLLogChat::moveTranscripts(const std::string originDirectory, backupFileCount = 0; newFullPath = targetDirectory + fullpath.substr(originDirectory.length(), std::string::npos); + //The target directory contains that file already, so lets store it + if(LLFile::isfile(newFullPath)) + { + backupFileName = newFullPath + ".backup"; + + //If needed store backup file as .backup1 etc. + while(LLFile::isfile(backupFileName)) + { + ++backupFileCount; + backupFileName = newFullPath + ".backup" + boost::lexical_cast<std::string>(backupFileCount); + } + + //Rename the file to its backup name so it is not overwritten + LLFile::rename(newFullPath, backupFileName); + } + S32 retry_count = 0; while (retry_count < 5) { @@ -528,22 +544,6 @@ bool LLLogChat::moveTranscripts(const std::string originDirectory, LL_WARNS("LLLogChat::moveTranscripts") << "Problem renaming " << fullpath << " - errorcode: " << result << " attempt " << retry_count << LL_ENDL; - //The target directory contains that file already, so lets store it - if(LLFile::isfile(newFullPath)) - { - backupFileName = newFullPath + ".backup"; - - //If needed store backup file as .backup1 etc. - while(LLFile::isfile(backupFileName)) - { - ++backupFileCount; - backupFileName = newFullPath + ".backup" + boost::lexical_cast<std::string>(backupFileCount); - } - - //Rename the file to its backup name so it is not overwritten - LLFile::rename(newFullPath, backupFileName); - } - ms_sleep(100); } else |
