From a5287ee9757da97f93d41fb86097c21bf58eb525 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Thu, 15 Aug 2013 21:52:40 -0400 Subject: [PATCH] Adjust chat log opening functions to use LLLogChat functions to determine log file This eliminates the possibility of the history button not opening the log file, which has been reported in the past. This also corrects cases where log files named with date would not be opened. --- indra/newview/llfloaterchat.cpp | 4 +--- indra/newview/llimpanel.cpp | 6 ++---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp index 6eb9dbe0f..a8d430ca5 100644 --- a/indra/newview/llfloaterchat.cpp +++ b/indra/newview/llfloaterchat.cpp @@ -653,9 +653,7 @@ void LLFloaterChat::onClickToggleActiveSpeakers(void* userdata) // static void LLFloaterChat::onClickChatHistoryOpen(void* userdata) { - char command[256]; - - sprintf(command, "\"%s%s%s\"", gDirUtilp->getPerAccountChatLogsDir().c_str(), gDirUtilp->getDirDelimiter().c_str(), "chat.txt"); + std::string command("\"" + LLLogChat::makeLogFileName("chat") + "\""); gViewerWindow->getWindow()->ShellEx(command); llinfos << command << llendl; diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index ef503ff5c..6311998fe 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -1079,12 +1079,10 @@ void LLFloaterIMPanel::onClickHistory() { if (mOtherParticipantUUID.notNull()) { - char command[256]; // [Ansariel: Display name support] - //std::string fullname(gDirUtilp->getScrubbedFileName(getTitle())); - std::string fullname(gDirUtilp->getScrubbedFileName(mSessionLabel)); + //std::string command("\"" + LLLogChat::makeLogFileName(getTitle()) + "\""); + std::string command("\"" + LLLogChat::makeLogFileName(mSessionLabel) + "\""); // [/Ansariel: Display name support] - sprintf(command, "\"%s%s%s.txt\"", gDirUtilp->getPerAccountChatLogsDir().c_str(), gDirUtilp->getDirDelimiter().c_str(), fullname.c_str()); gViewerWindow->getWindow()->ShellEx(command); llinfos << command << llendl;