Commit 476029ac authored by Alexander Lohnau's avatar Alexander Lohnau 💬 Committed by Nate Graham
Browse files

kcms/cursortheme: Make code for new KNS entries more simple & robust

We always know this has to be a dir, otherwise we have regressions in KNS.

CCBUG: 456273


(cherry picked from commit 63df5f0f)
parent 11e3f3d2
Pipeline #241967 passed with stage
in 14 minutes and 14 seconds
......@@ -347,20 +347,16 @@ void CursorThemeConfig::ghnsEntryChanged(KNSCore::EntryWrapper *entry)
}
}
} else if (entry->entry().status() == KNS3::Entry::Installed) {
for (const QString &created : entry->entry().installedFiles()) {
QStringList list = created.split(QLatin1Char('/'));
if (list.last() == QLatin1Char('*')) {
list.takeLast();
}
// Because we sometimes get some extra slashes in the installed files list
list.removeAll({});
// Because we'll also get the containing folder, if it was not already there
// we need to ignore it.
if (list.last() == QLatin1String(".icons")) {
continue;
}
m_themeModel->addTheme(list.join(QLatin1Char('/')));
const QList<QString> installedFiles = entry->entry().installedFiles();
if (installedFiles.size() != 1) {
return;
}
const QString installedDir = installedFiles.first();
if (!installedDir.endsWith(QLatin1Char('*'))) {
return;
}
m_themeModel->addTheme(installedDir.left(installedDir.size() - 1));
}
}
......
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