Commit 7167066a authored by con's avatar con
Browse files

Fixes: Selection in color scheme settings sometimes didn't match reality.

In case of the default being used, the selected item in the settings
was always the first of the schemes, in "inode order".
The fix always puts the default scheme at the top of the list
which makes sense anyhow.

Reviewed-by: Thorbjørn
parent 639338b3
......@@ -102,9 +102,9 @@ public:
static QString defaultFixedFontFamily();
static int defaultFontSize();
static QString defaultSchemeFileName(const QString &fileName = QString());
QString m_family;
QString m_schemeFileName;
int m_fontSize;
......@@ -562,7 +562,11 @@ void FontSettingsPage::refreshColorSchemeList()
int selected = 0;
foreach (const QString &file, styleDir.entryList()) {
QStringList schemeList = styleDir.entryList();
QString defaultScheme = QFileInfo(FontSettings::defaultSchemeFileName()).fileName();
if (schemeList.removeAll(defaultScheme))
foreach (const QString &file, schemeList) {
const QString fileName = styleDir.absoluteFilePath(file);
if (d_ptr->m_value.colorSchemeFileName() == fileName)
selected = colorSchemes.size();
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment