diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfloaterpreference.cpp | 4 | ||||
-rw-r--r-- | indra/newview/lllogchat.cpp | 21 | ||||
-rw-r--r-- | indra/newview/lllogchat.h | 1 |
3 files changed, 23 insertions, 3 deletions
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 9ea49e935f..e48f989c52 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -471,9 +471,7 @@ BOOL LLFloaterPreference::postBuild() void LLFloaterPreference::updateDeleteTranscriptsButton() { - std::vector<std::string> list_of_transcriptions_file_names; - LLLogChat::getListOfTranscriptFiles(list_of_transcriptions_file_names); - getChild<LLButton>("delete_transcripts")->setEnabled(list_of_transcriptions_file_names.size() > 0); + getChild<LLButton>("delete_transcripts")->setEnabled(LLLogChat::transcriptFilesExist()); } void LLFloaterPreference::onDoNotDisturbResponseChanged() diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index ba82ff0b0f..1592afc66c 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -651,6 +651,27 @@ std::string LLLogChat::oldLogFileName(std::string filename) return scanResult; } +bool LLLogChat::transcriptFilesExist() +{ + std::string pattern = "*." + LL_TRANSCRIPT_FILE_EXTENSION; + // get Users log directory + std::string dirname = gDirUtilp->getPerAccountChatLogsDir(); + + // add final OS dependent delimiter + dirname += gDirUtilp->getDirDelimiter(); + + LLDirIterator iter(dirname, pattern); + std::string filename; + while (iter.next(filename)) + { + std::string fullname = gDirUtilp->add(dirname, filename); + if (isTranscriptFileFound(fullname)) + { + return true; + } + } + return false; +} // static void LLLogChat::findTranscriptFiles(std::string pattern, std::vector<std::string>& list_of_transcriptions) { diff --git a/indra/newview/lllogchat.h b/indra/newview/lllogchat.h index 5dce8ab1d2..9e2e060de2 100644 --- a/indra/newview/lllogchat.h +++ b/indra/newview/lllogchat.h @@ -103,6 +103,7 @@ public: const std::string& from, const LLUUID& from_id, const std::string& line); + static bool transcriptFilesExist(); static void findTranscriptFiles(std::string pattern, std::vector<std::string>& list_of_transcriptions); static void getListOfTranscriptFiles(std::vector<std::string>& list); static void getListOfTranscriptBackupFiles(std::vector<std::string>& list_of_transcriptions); |