Commit a0f16565 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

[Notifications] Move Plasma Workspace "service" to the top of its category

Makes it obvious that it's more of an overall category of general stuff, since this is where warning sounds, login/logout sounds, etc are located in.

Differential Revision: https://phabricator.kde.org/D26423
parent be38224f
......@@ -38,6 +38,8 @@
#include <algorithm>
static const QString s_plasmaWorkspaceNotifyRcName = QStringLiteral("plasma_workspace");
SourcesModel::SourcesModel(QObject *parent) : QAbstractItemModel(parent)
{
......@@ -342,11 +344,9 @@ void SourcesModel::load()
desktopEntries.append(service->desktopEntryName());
}
auto sortData = [&collator](const SourceData &a, const SourceData &b) {
std::sort(appsData.begin(), appsData.end(), [&collator](const SourceData &a, const SourceData &b) {
return collator.compare(a.display(), b.display()) < 0;
};
std::sort(appsData.begin(), appsData.end(), sortData);
});
// Fake entry for configuring non-identifyable applications
appsData << SourceData{
......@@ -358,7 +358,16 @@ void SourcesModel::load()
{}
};
std::sort(servicesData.begin(), servicesData.end(), sortData);
// Sort and make sure plasma_workspace is at the beginning of the list
std::sort(servicesData.begin(), servicesData.end(), [&collator](const SourceData &a, const SourceData &b) {
if (a.notifyRcName == s_plasmaWorkspaceNotifyRcName) {
return true;
}
if (b.notifyRcName == s_plasmaWorkspaceNotifyRcName) {
return false;
}
return collator.compare(a.display(), b.display()) < 0;
});
m_data << appsData << servicesData;
......
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