Skip to content

Commit fa74449

Browse files
committed
service/tray: add "Communications" category
Closes #28
1 parent 69430e3 commit fa74449

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

src/services/status_notifier/item.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@ DBusResult<Status::Enum> DBusDataTransform<Status::Enum>::fromWire(const QString
352352

353353
DBusResult<Category::Enum> DBusDataTransform<Category::Enum>::fromWire(const QString& wire) {
354354
if (wire == "ApplicationStatus") return DBusResult(Category::ApplicationStatus);
355+
if (wire == "Communications") return DBusResult(Category::Communications);
355356
if (wire == "SystemServices") return DBusResult(Category::SystemServices);
356357
if (wire == "Hardware") return DBusResult(Category::Hardware);
357358

src/services/status_notifier/item.hpp

+7-5
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,15 @@ Q_NAMESPACE;
4444
QML_ELEMENT;
4545

4646
enum Enum : quint8 {
47-
/// The fallback category for general applications or anything that does
48-
/// not fit into a different category.
49-
ApplicationStatus = 0,
47+
/// Hardware controls like battery indicators or volume control.
48+
Hardware = 0,
5049
/// System services such as IMEs or disk indexing.
5150
SystemServices = 1,
52-
/// Hardware controls like battery indicators or volume control.
53-
Hardware = 2,
51+
/// The fallback category for general applications or anything that does
52+
/// not fit into a different category.
53+
ApplicationStatus = 2,
54+
/// Communication related applications such as instant messengers or email clients.
55+
Communications = 3,
5456
};
5557
Q_ENUM_NS(Enum);
5658
} // namespace Category

src/services/status_notifier/qml.cpp

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "qml.hpp"
22

3+
#include <qnamespace.h>
34
#include <qobject.h>
45

56
#include "../../core/model.hpp"
@@ -28,9 +29,6 @@ void SystemTray::onItemRegistered(StatusNotifierItem* item) {
2829
void SystemTray::onItemUnregistered(StatusNotifierItem* item) { this->mItems.removeObject(item); }
2930
ObjectModel<StatusNotifierItem>* SystemTray::items() { return &this->mItems; }
3031

31-
bool SystemTray::compareItems(
32-
qs::service::sni::StatusNotifierItem* a,
33-
qs::service::sni::StatusNotifierItem* b
34-
) {
35-
return a->category() > b->category() || a->id().compare(b->id(), Qt::CaseInsensitive) >= 0;
32+
bool SystemTray::compareItems(StatusNotifierItem* a, StatusNotifierItem* b) {
33+
return a->category() < b->category() || a->id().compare(b->id(), Qt::CaseInsensitive) >= 0;
3634
}

0 commit comments

Comments
 (0)