diff --git a/discover/qml/DiscoverDrawer.qml b/discover/qml/DiscoverDrawer.qml --- a/discover/qml/DiscoverDrawer.qml +++ b/discover/qml/DiscoverDrawer.qml @@ -178,6 +178,7 @@ property QtObject category readonly property bool itsMe: window.leftPage && window.leftPage.hasOwnProperty("category") && (window.leftPage.category === category) text: category ? category.name : "" + iconName: category ? category.icon : "" checked: itsMe visible: (!window.leftPage || !window.leftPage.subcategories diff --git a/discover/qml/DiscoverWindow.qml b/discover/qml/DiscoverWindow.qml --- a/discover/qml/DiscoverWindow.qml +++ b/discover/qml/DiscoverWindow.qml @@ -64,6 +64,7 @@ } TopLevelPageData { id: installedAction + iconName: "view-list-symbolic" text: i18n("Installed") component: topInstalledComp objectName: "installed" @@ -84,6 +85,7 @@ } TopLevelPageData { id: sourcesAction + iconName: "configure" text: i18n("Sources") component: topSourcesComp objectName: "sources" diff --git a/libdiscover/Category/CategoriesReader.cpp b/libdiscover/Category/CategoriesReader.cpp --- a/libdiscover/Category/CategoriesReader.cpp +++ b/libdiscover/Category/CategoriesReader.cpp @@ -24,6 +24,7 @@ #include #include "libdiscover_debug.h" #include +#include #include #include @@ -64,7 +65,7 @@ while(!node.isNull()) { if (node.nodeType() == QDomNode::ElementNode) { - ret << new Category( {path} ); + ret << new Category( {path}, qApp ); ret.last()->parseData(path, node); } diff --git a/libdiscover/backends/KNSBackend/KNSBackend.cpp b/libdiscover/backends/KNSBackend/KNSBackend.cpp --- a/libdiscover/backends/KNSBackend/KNSBackend.cpp +++ b/libdiscover/backends/KNSBackend/KNSBackend.cpp @@ -134,13 +134,18 @@ m_displayName = fileName.mid(0, fileName.indexOf(QLatin1Char('.'))); m_displayName[0] = m_displayName[0].toUpper(); } + m_hasApplications = group.readEntry("X-Discover-HasApplications", false); const QStringList cats = group.readEntry("Categories", QStringList{}); QVector categories; if (cats.count() > 1) { m_categories += cats; - for(const auto &cat: cats) - categories << new Category(cat, {}, { {CategoryFilter, cat } }, backendName, {}, {}, true); + for(const auto &cat: cats) { + if (m_hasApplications) + categories << new Category(cat, QStringLiteral("applications-other"), { {CategoryFilter, cat } }, backendName, {}, {}, true); + else + categories << new Category(cat, QStringLiteral("plasma"), { {CategoryFilter, cat } }, backendName, {}, {}, true); + } } QVector topCategories{categories}; @@ -173,9 +178,8 @@ m_engine->setPageSize(100); m_engine->init(m_name); - m_hasApplications = group.readEntry("X-Discover-HasApplications", false); if(m_hasApplications) { - auto actualCategory = new Category(m_displayName, QStringLiteral("plasma"), filters, backendName, topCategories, QUrl(), false); + auto actualCategory = new Category(m_displayName, QStringLiteral("applications-other"), filters, backendName, topCategories, QUrl(), false); auto applicationCategory = new Category(i18n("Applications"), QStringLiteral("applications-internet"), filters, backendName, { actualCategory }, QUrl(), false); applicationCategory->setAndFilter({ {CategoryFilter, QLatin1String("Application")} }); m_categories.append(applicationCategory->name()); @@ -207,10 +211,11 @@ QStringLiteral("sddmtheme.knsrc"), QStringLiteral("wallpaperplugin.knsrc"), QStringLiteral("ksplash.knsrc"), QStringLiteral("window-decorations.knsrc") }; - auto actualCategory = new Category(m_displayName, QStringLiteral("plasma"), filters, backendName, categories, QUrl(), true); + const auto iconName = knsrcPlasma.contains(fileName)? QStringLiteral("plasma") : QStringLiteral("applications-other"); + auto actualCategory = new Category(m_displayName, iconName, filters, backendName, categories, QUrl(), true); const auto topLevelName = knsrcPlasma.contains(fileName)? i18n("Plasma Addons") : i18n("Application Addons"); - auto addonsCategory = new Category(topLevelName, QStringLiteral("plasma"), filters, backendName, {actualCategory}, QUrl(), true); + auto addonsCategory = new Category(topLevelName, iconName, filters, backendName, {actualCategory}, QUrl(), true); m_rootCategories = { addonsCategory }; } }