Qt: Fix timestamps in log window if file timestamps on

pull/3483/head
Stenzek 3 months ago
parent 1289e045b9
commit 3f2b6995bc
No known key found for this signature in database

@ -149,9 +149,9 @@ float Log::GetCurrentMessageTime()
return static_cast<float>(Timer::ConvertValueToSeconds(Timer::GetCurrentValue() - s_state.start_timestamp)); 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() bool Log::IsConsoleOutputCurrentlyAvailable()

@ -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 // returns the time in seconds since the start of the process
float GetCurrentMessageTime(); float GetCurrentMessageTime();
bool AreTimestampsEnabled(); bool AreConsoleOutputTimestampsEnabled();
// adds a standard console output // adds a standard console output
bool IsConsoleOutputCurrentlyAvailable(); bool IsConsoleOutputCurrentlyAvailable();

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

Loading…
Cancel
Save