Changeset View
Changeset View
Standalone View
Standalone View
kcms/notifications/sourcesmodel.cpp
Show First 20 Lines • Show All 367 Lines • ▼ Show 20 Line(s) | 362 | std::sort(servicesData.begin(), servicesData.end(), [&collator](const SourceData &a, const SourceData &b) { | |||
---|---|---|---|---|---|
368 | } | 368 | } | ||
369 | return collator.compare(a.display(), b.display()) < 0; | 369 | return collator.compare(a.display(), b.display()) < 0; | ||
370 | }); | 370 | }); | ||
371 | 371 | | |||
372 | m_data << appsData << servicesData; | 372 | m_data << appsData << servicesData; | ||
373 | 373 | | |||
374 | endResetModel(); | 374 | endResetModel(); | ||
375 | } | 375 | } | ||
376 | | ||||
377 | QVector<QPair<QString, QString>> SourcesModel::settingsList() const | ||||
378 | { | ||||
379 | QVector<QPair<QString, QString>> res; | ||||
380 | for (auto &source : qAsConst(m_data)) { | ||||
ervin: const auto & | |||||
381 | if (source.desktopEntry.isEmpty()) { | ||||
382 | res << qMakePair(QStringLiteral("Services"), source.notifyRcName); | ||||
383 | } else { | ||||
384 | res << qMakePair(QStringLiteral("Applications"), source.desktopEntry); | ||||
385 | } | ||||
386 | } | ||||
387 | return res; | ||||
388 | } |
const auto &