From 49319a90ef1fcca590e077805d5aaa65322a1a6d Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Mon, 4 Mar 2013 19:35:31 -0800 Subject: CHUI-778: Now when delete transcripts is pressed the backup files will be deleted as well. Also if clear logs is pressed then backup logs will be cleared. --- indra/newview/lllogchat.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/lllogchat.cpp') diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index 448100c5d6..7f4b925b53 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -453,7 +453,7 @@ void LLLogChat::getListOfTranscriptFiles(std::vector& list_of_trans dirname += gDirUtilp->getDirDelimiter(); // create search pattern - std::string pattern = "*." + LL_TRANSCRIPT_FILE_EXTENSION; + std::string pattern = "*." + LL_TRANSCRIPT_FILE_EXTENSION + "*"; LLDirIterator iter(dirname, pattern); std::string filename; -- cgit v1.2.3 From 95cea4aa71b84fb203167084c51892f09520fd48 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 5 Mar 2013 13:20:24 -0800 Subject: CHUI-778: Adjusted deletion of transcripts/logs to be more clean code-wise. --- indra/newview/lllogchat.cpp | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'indra/newview/lllogchat.cpp') diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index 7f4b925b53..2d7454b636 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -444,7 +444,7 @@ std::string LLLogChat::oldLogFileName(std::string filename) } // static -void LLLogChat::getListOfTranscriptFiles(std::vector& list_of_transcriptions) +void LLLogChat::findTranscriptFiles(std::string pattern, std::vector& list_of_transcriptions) { // get Users log directory std::string dirname = gDirUtilp->getPerAccountChatLogsDir(); @@ -452,9 +452,6 @@ void LLLogChat::getListOfTranscriptFiles(std::vector& list_of_trans // add final OS dependent delimiter dirname += gDirUtilp->getDirDelimiter(); - // create search pattern - std::string pattern = "*." + LL_TRANSCRIPT_FILE_EXTENSION + "*"; - LLDirIterator iter(dirname, pattern); std::string filename; while (iter.next(filename)) @@ -490,6 +487,22 @@ void LLLogChat::getListOfTranscriptFiles(std::vector& list_of_trans } } +// static +void LLLogChat::getListOfTranscriptFiles(std::vector& list_of_transcriptions) +{ + // create search pattern + std::string pattern = "*." + LL_TRANSCRIPT_FILE_EXTENSION; + findTranscriptFiles(pattern, list_of_transcriptions); +} + +// static +void LLLogChat::getListOfTranscriptBackupFiles(std::vector& list_of_transcriptions) +{ + // create search pattern + std::string pattern = "*." + LL_TRANSCRIPT_FILE_EXTENSION + ".backup*"; + findTranscriptFiles(pattern, list_of_transcriptions); +} + //static boost::signals2::connection LLLogChat::setSaveHistorySignal(const save_history_signal_t::slot_type& cb) { @@ -581,6 +594,7 @@ void LLLogChat::deleteTranscripts() { std::vector list_of_transcriptions; getListOfTranscriptFiles(list_of_transcriptions); + getListOfTranscriptBackupFiles(list_of_transcriptions); BOOST_FOREACH(const std::string& fullpath, list_of_transcriptions) { -- cgit v1.2.3