Commit f77b7284 authored by Fushan Wen's avatar Fushan Wen 💬
Browse files

kcms/desktoptheme: find metadata.json when loading ThemesModel

Before this commit ThemesModel only finds metadata.desktop, but after
KF5.94, the default theme metadata files have been ported to json format.

BUG: 453830


(cherry picked from commit 10aa9bb8)
parent fbb64207
Pipeline #177100 passed with stage
in 8 minutes and 52 seconds
......@@ -155,7 +155,15 @@ void ThemesModel::load()
const QDir cd(ppath);
const QStringList &entries = cd.entryList(QDir::Dirs | QDir::Hidden | QDir::NoDotAndDotDot);
for (const QString &pack : entries) {
const QString _metadata = ppath + QLatin1Char('/') + pack + QStringLiteral("/metadata.desktop");
const QString prefix = QStringLiteral("%1%2%3%4metadata.").arg(ppath, QDir::separator(), pack, QDir::separator());
QString _metadata = QStringLiteral("%1json").arg(prefix);
if (QFile::exists(_metadata)) {
themes << _metadata;
continue;
}
_metadata = QStringLiteral("%1desktop").arg(prefix);
if (QFile::exists(_metadata)) {
themes << _metadata;
}
......
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