DolphinQt: Restore log font current index accurately.

The logic in the code was deliberately avoiding index `2` (**Selected
Font**; the debug font) by using `std::min(index, 1)`. Presumably, the
reason was that there was no debugger in Qt version of Dolphin at the
time.

Test plan:

- Select a debug font via the **Options > Font...** action.
- Show the **Log** tab via the **View > Log** action.
- In the **Log** tab, choose the **Selected Font** item in the combobox.
- Restart Dolphin.

**Without** the patch, the **Monospaced Font** item is wrongly selected
in the combobox.

**With** the patch, the **Selected Font** item is now properly restored
from the saved settings, and the selected debug font is correctly used
in the log messages.
This commit is contained in:
cristian64 2026-02-20 21:55:21 +00:00
parent 981b7df420
commit 643fcaec03

View File

@ -182,8 +182,7 @@ void LogWidget::LoadSettings()
Qt::ScrollBarAlwaysOn);
// Log - Font Selection
// Currently "Debugger Font" is not supported as there is no Qt Debugger, defaulting to Monospace
m_log_font->setCurrentIndex(std::min(settings.value(QStringLiteral("logging/font")).toInt(), 1));
m_log_font->setCurrentIndex(settings.value(QStringLiteral("logging/font")).toInt());
UpdateFont();
}