diff options
| author | Gilbert Gonzales <gilbert@lindenlab.com> | 2013-03-05 13:20:24 -0800 | 
|---|---|---|
| committer | Gilbert Gonzales <gilbert@lindenlab.com> | 2013-03-05 13:20:24 -0800 | 
| commit | 95cea4aa71b84fb203167084c51892f09520fd48 (patch) | |
| tree | c5699cf81e1c878efacc84df149b641183e93f45 | |
| parent | 49319a90ef1fcca590e077805d5aaa65322a1a6d (diff) | |
CHUI-778: Adjusted deletion of transcripts/logs to be more clean code-wise.
| -rw-r--r-- | indra/newview/lllogchat.cpp | 22 | ||||
| -rw-r--r-- | indra/newview/lllogchat.h | 2 | 
2 files changed, 20 insertions, 4 deletions
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<std::string>& list_of_transcriptions) +void LLLogChat::findTranscriptFiles(std::string pattern, std::vector<std::string>& list_of_transcriptions)  {  	// get Users log directory  	std::string dirname = gDirUtilp->getPerAccountChatLogsDir(); @@ -452,9 +452,6 @@ void LLLogChat::getListOfTranscriptFiles(std::vector<std::string>& 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<std::string>& list_of_trans  	}  } +// static +void LLLogChat::getListOfTranscriptFiles(std::vector<std::string>& list_of_transcriptions) +{ +	// create search pattern +	std::string pattern = "*." + LL_TRANSCRIPT_FILE_EXTENSION; +	findTranscriptFiles(pattern, list_of_transcriptions); +} + +// static +void LLLogChat::getListOfTranscriptBackupFiles(std::vector<std::string>& 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<std::string> list_of_transcriptions;  	getListOfTranscriptFiles(list_of_transcriptions); +	getListOfTranscriptBackupFiles(list_of_transcriptions);  	BOOST_FOREACH(const std::string& fullpath, list_of_transcriptions)  	{ diff --git a/indra/newview/lllogchat.h b/indra/newview/lllogchat.h index 784786a565..e819f00dd9 100644 --- a/indra/newview/lllogchat.h +++ b/indra/newview/lllogchat.h @@ -49,7 +49,9 @@ public:  				const std::string& from,  				const LLUUID& from_id,  				const std::string& line); +	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);  	static void loadChatHistory(const std::string& file_name, std::list<LLSD>& messages, const LLSD& load_params = LLSD());  | 
