Adapt an x option for app-carrying knsrc files

This adds in an extended option in KNSRC files, which allows them
to tell us whether or not they carry applications. It would also
be possible to make this change in knewstuff itself, but as this
would be somewhat invasive for, frankly, not a great deal of gain,
i propose we do it here. @apol and i discussed this (very) briefly
in person a couple of weeks ago, and it still seems like it would
be reasonable to do it here rather than in the framework.

Differential Revision:
parent 29be60b1
......@@ -173,11 +173,9 @@ KNSBackend::KNSBackend(QObject* parent, const QString& iconName, const QString &
static const QString knsrcApplications = QLatin1String("storekdeapps.knsrc");
if(knsrcApplications == fileName) {
m_hasApplications = true;
auto actualCategory = new Category(m_displayName, QStringLiteral("plasma"), filters, backendName, categories, QUrl(), false);
m_hasApplications = group.readEntry<bool>("X-Discover-HasApplications", false);
if(m_hasApplications) {
auto actualCategory = new Category(m_displayName, QStringLiteral("plasma"), filters, backendName, topCategories, QUrl(), false);
auto applicationCategory = new Category(i18n("Applications"), QStringLiteral("applications-internet"), filters, backendName, { actualCategory }, QUrl(), false);
applicationCategory->setAndFilter({ {CategoryFilter, QLatin1String("Application")} });
Markdown is supported
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