Changeset View
Changeset View
Standalone View
Standalone View
libdiscover/backends/KNSBackend/KNSBackend.cpp
Show First 20 Lines • Show All 167 Lines • ▼ Show 20 Line(s) | 166 | if (cat->orFilters().count() > 0 && cat->orFilters().first().second == category.name) { | |||
---|---|---|---|---|---|
168 | break; | 168 | break; | ||
169 | } | 169 | } | ||
170 | } | 170 | } | ||
171 | } | 171 | } | ||
172 | }); | 172 | }); | ||
173 | m_engine->setPageSize(100); | 173 | m_engine->setPageSize(100); | ||
174 | m_engine->init(m_name); | 174 | m_engine->init(m_name); | ||
175 | 175 | | |||
176 | static const QString knsrcApplications = QLatin1String("storekdeapps.knsrc"); | 176 | m_hasApplications = group.readEntry<bool>("X-Discover-HasApplications", false); | ||
177 | 177 | if(m_hasApplications) { | |||
178 | if(knsrcApplications == fileName) { | 178 | auto actualCategory = new Category(m_displayName, QStringLiteral("plasma"), filters, backendName, topCategories, QUrl(), false); | ||
179 | m_hasApplications = true; | | |||
180 | auto actualCategory = new Category(m_displayName, QStringLiteral("plasma"), filters, backendName, categories, QUrl(), false); | | |||
181 | auto applicationCategory = new Category(i18n("Applications"), QStringLiteral("applications-internet"), filters, backendName, { actualCategory }, QUrl(), false); | 179 | auto applicationCategory = new Category(i18n("Applications"), QStringLiteral("applications-internet"), filters, backendName, { actualCategory }, QUrl(), false); | ||
182 | applicationCategory->setAndFilter({ {CategoryFilter, QLatin1String("Application")} }); | 180 | applicationCategory->setAndFilter({ {CategoryFilter, QLatin1String("Application")} }); | ||
183 | m_categories.append(applicationCategory->name()); | 181 | m_categories.append(applicationCategory->name()); | ||
184 | m_rootCategories = { applicationCategory }; | 182 | m_rootCategories = { applicationCategory }; | ||
185 | // Make sure we filter out any apps which won't run on the current system architecture | 183 | // Make sure we filter out any apps which won't run on the current system architecture | ||
186 | QStringList tagFilter = m_engine->tagFilter(); | 184 | QStringList tagFilter = m_engine->tagFilter(); | ||
187 | if(QSysInfo::currentCpuArchitecture() == QLatin1String("arm")) { | 185 | if(QSysInfo::currentCpuArchitecture() == QLatin1String("arm")) { | ||
188 | tagFilter << QLatin1String("application##architecture=armhf"); | 186 | tagFilter << QLatin1String("application##architecture=armhf"); | ||
▲ Show 20 Lines • Show All 407 Lines • Show Last 20 Lines |