summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-04-10 22:54:31 +0300
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2024-04-11 00:36:20 +0300
commitf4c41ec5c005f9093dd03bd1a52f7d67087ce219 (patch)
tree26d113460b106668bb45634c270e1f2aed3c2244 /indra
parent5af93ff0d53606db3dca727a8cd1b73d7c37d70b (diff)
triage#170 Fix 'Clear log' button having incorrect state
1. onClear should clear file even if in 'don't log' state. 2. When chat isn't logging, check presence of old log by checking file.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llconversationlog.cpp2
-rw-r--r--indra/newview/llfloaterpreference.cpp16
2 files changed, 16 insertions, 2 deletions
diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp
index a696c99a82..d2603dcc23 100644
--- a/indra/newview/llconversationlog.cpp
+++ b/indra/newview/llconversationlog.cpp
@@ -648,7 +648,7 @@ void LLConversationLog::onClearLogResponse(const LLSD& notification, const LLSD&
{
mConversations.clear();
notifyObservers();
- cache();
+ saveToFile(getFileName());
deleteBackupLogs();
}
}
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index b65d727948..35fcc9e1b1 100644
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -1917,7 +1917,21 @@ void LLFloaterPreference::selectChatPanel()
void LLFloaterPreference::changed()
{
- getChild<LLButton>("clear_log")->setEnabled(LLConversationLog::instance().getConversations().size() > 0);
+ if (LLConversationLog::instance().getIsLoggingEnabled())
+ {
+ getChild<LLButton>("clear_log")->setEnabled(LLConversationLog::instance().getConversations().size() > 0);
+ }
+ else
+ {
+ // onClearLog clears list, then notifies changed() and only then clears file,
+ // so check presence of conversations before checking file, file will cleared later.
+ llstat st;
+ bool has_logs = LLConversationLog::instance().getConversations().size() > 0
+ && LLFile::stat(LLConversationLog::instance().getFileName(), &st) == 0
+ && S_ISREG(st.st_mode)
+ && st.st_size > 0;
+ getChild<LLButton>("clear_log")->setEnabled(has_logs);
+ }
// set 'enable' property for 'Delete transcripts...' button
updateDeleteTranscriptsButton();