summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterpreference.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloaterpreference.cpp')
-rw-r--r--indra/newview/llfloaterpreference.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index d7ac8f0552..2bfe7aabc9 100644
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -2004,7 +2004,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();