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.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index 537dca99da..d58a5a76ca 100644
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -1359,7 +1359,7 @@ void LLFloaterPreference::onChangeQuality(const LLSD& data)
if (level >= LVL_HIGH && mLastQualityLevel < level)
{
constexpr U32 LOW_MEM_THRESHOLD = 4097;
- U32 total_mem = (U32Megabytes)LLMemory::getMaxMemKB();
+ U32 total_mem = U32Megabytes(LLMemory::getMaxMemKB());
if (total_mem < LOW_MEM_THRESHOLD)
{
LLSD args;
@@ -1505,7 +1505,7 @@ bool LLFloaterPreference::moveTranscriptsAndLog()
//Couldn't move the log and created a new directory so remove the new directory
if(madeDirectory)
{
- LLFile::rmdir(chatLogPath);
+ LLFile::remove(chatLogPath);
}
return false;
}
@@ -1531,7 +1531,7 @@ bool LLFloaterPreference::moveTranscriptsAndLog()
if(madeDirectory)
{
- LLFile::rmdir(chatLogPath);
+ LLFile::remove(chatLogPath);
}
return false;
@@ -2052,17 +2052,19 @@ void LLFloaterPreference::changed()
{
if (LLConversationLog::instance().getIsLoggingEnabled())
{
- getChild<LLButton>("clear_log")->setEnabled(LLConversationLog::instance().getConversations().size() > 0);
+ 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;
+ bool has_logs = false;
+ if (LLConversationLog::instance().getConversations().size() > 0)
+ {
+ std::filesystem::path file_path = fsyspath(LLConversationLog::instance().getFileName());
+ has_logs = LLFile::isfile(file_path)
+ && LLFile::size(file_path) > 0;
+ }
getChild<LLButton>("clear_log")->setEnabled(has_logs);
}