Changeset View
Changeset View
Standalone View
Standalone View
libdiscover/backends/KNSBackend/KNSBackend.cpp
Show First 20 Lines • Show All 155 Lines • ▼ Show 20 Line(s) | 94 | { | |||
---|---|---|---|---|---|
156 | auto actualCategory = new Category(m_displayName, QStringLiteral("plasma"), filters, backendName, {}, QUrl(), true); | 156 | auto actualCategory = new Category(m_displayName, QStringLiteral("plasma"), filters, backendName, {}, QUrl(), true); | ||
157 | 157 | | |||
158 | const auto topLevelName = knsrcPlasma.contains(fileName)? i18n("Plasma Addons") : i18n("Application Addons"); | 158 | const auto topLevelName = knsrcPlasma.contains(fileName)? i18n("Plasma Addons") : i18n("Application Addons"); | ||
159 | const QUrl decoration(knsrcPlasma.contains(fileName)? QStringLiteral("https://c2.staticflickr.com/4/3148/3042248532_20bd2e38f4_b.jpg") : QStringLiteral("https://c2.staticflickr.com/8/7067/6847903539_d9324dcd19_o.jpg")); | 159 | const QUrl decoration(knsrcPlasma.contains(fileName)? QStringLiteral("https://c2.staticflickr.com/4/3148/3042248532_20bd2e38f4_b.jpg") : QStringLiteral("https://c2.staticflickr.com/8/7067/6847903539_d9324dcd19_o.jpg")); | ||
160 | auto addonsCategory = new Category(topLevelName, QStringLiteral("plasma"), filters, backendName, {actualCategory}, decoration, true); | 160 | auto addonsCategory = new Category(topLevelName, QStringLiteral("plasma"), filters, backendName, {actualCategory}, decoration, true); | ||
161 | m_rootCategories = { addonsCategory }; | 161 | m_rootCategories = { addonsCategory }; | ||
162 | } | 162 | } | ||
163 | 163 | | |||
164 | KNSBackend::~KNSBackend() = default; | 164 | KNSBackend::~KNSBackend() | ||
165 | { | ||||
166 | qDeleteAll(m_rootCategories); | ||||
167 | } | ||||
165 | 168 | | |||
166 | void KNSBackend::markInvalid(const QString &message) | 169 | void KNSBackend::markInvalid(const QString &message) | ||
167 | { | 170 | { | ||
168 | qWarning() << "invalid kns backend!" << m_name << "because:" << message; | 171 | qWarning() << "invalid kns backend!" << m_name << "because:" << message; | ||
169 | m_isValid = false; | 172 | m_isValid = false; | ||
170 | setFetching(false); | 173 | setFetching(false); | ||
171 | Q_EMIT initialized(); | 174 | Q_EMIT initialized(); | ||
172 | } | 175 | } | ||
▲ Show 20 Lines • Show All 281 Lines • Show Last 20 Lines |