diff --git a/kcms/colors/colors.h b/kcms/colors/colors.h --- a/kcms/colors/colors.h +++ b/kcms/colors/colors.h @@ -53,6 +53,7 @@ enum Roles { SchemeNameRole = Qt::UserRole + 1, + UntranslatedNameRole, PaletteRole, RemovableRole, PendingDeletionRole diff --git a/kcms/colors/colors.cpp b/kcms/colors/colors.cpp --- a/kcms/colors/colors.cpp +++ b/kcms/colors/colors.cpp @@ -113,9 +113,16 @@ int KCMColors::indexOfScheme(const QString &schemeName) const { - const auto results = m_model->match(m_model->index(0, 0), SchemeNameRole, schemeName); + // Matches the scheme file name (without .colors suffix) + auto results = m_model->match(m_model->index(0, 0), SchemeNameRole, schemeName); if (results.count() == 1) { - return results.first().row(); + return results.constFirst().row(); + } + + // Also try matching for the untranslated theme name + results = m_model->match(m_model->index(0, 0), UntranslatedNameRole, schemeName); + if (results.count() == 1) { + return results.constFirst().row(); } return -1; @@ -173,6 +180,7 @@ QStandardItem *item = new QStandardItem(name); item->setData(baseName, SchemeNameRole); + item->setData(group.readEntryUntranslated("Name", baseName), UntranslatedNameRole); item->setData(fi.isWritable(), RemovableRole); item->setData(false, PendingDeletionRole); @@ -380,7 +388,7 @@ m_config->reparseConfiguration(); KConfigGroup group(m_config, "General"); - const QString schemeName = group.readEntry("ColorScheme", s_defaultColorSchemeName); + const QString schemeName = group.readEntryUntranslated("ColorScheme", s_defaultColorSchemeName); // If the scheme named in kdeglobals doesn't exist, show a warning and use default scheme if (indexOfScheme(schemeName) == -1) {