Qt: Fix timestamps in log window if file timestamps on

This commit is contained in:
Stenzek 2025-07-18 12:46:58 +10:00
parent 1289e045b9
commit 3f2b6995bc
No known key found for this signature in database
3 changed files with 4 additions and 4 deletions

View File

@ -149,9 +149,9 @@ float Log::GetCurrentMessageTime()
return static_cast<float>(Timer::ConvertValueToSeconds(Timer::GetCurrentValue() - s_state.start_timestamp));
}
bool Log::AreTimestampsEnabled()
bool Log::AreConsoleOutputTimestampsEnabled()
{
return s_state.console_output_timestamps || s_state.file_output_timestamp;
return s_state.console_output_timestamps;
}
bool Log::IsConsoleOutputCurrentlyAvailable()

View File

@ -98,7 +98,7 @@ const std::array<const char*, static_cast<size_t>(Channel::MaxCount)>& GetChanne
// returns the time in seconds since the start of the process
float GetCurrentMessageTime();
bool AreTimestampsEnabled();
bool AreConsoleOutputTimestampsEnabled();
// adds a standard console output
bool IsConsoleOutputCurrentlyAvailable();

View File

@ -411,7 +411,7 @@ void LogWindow::realAppendMessage(const QLatin1StringView& channel, quint32 cat,
const size_t dark = static_cast<size_t>(m_is_dark_theme);
temp_cursor.beginEditBlock();
if (Log::AreTimestampsEnabled())
if (Log::AreConsoleOutputTimestampsEnabled())
{
const float message_time = Log::GetCurrentMessageTime();
const QString qtimestamp = QStringLiteral("[%1] ").arg(message_time, 10, 'f', 4);