forked from quickshell/quickshell
		
	
							parent
							
								
									69430e3873
								
							
						
					
					
						commit
						fa74449139
					
				
					 3 changed files with 11 additions and 10 deletions
				
			
		| 
						 | 
				
			
			@ -352,6 +352,7 @@ DBusResult<Status::Enum> DBusDataTransform<Status::Enum>::fromWire(const QString
 | 
			
		|||
 | 
			
		||||
DBusResult<Category::Enum> DBusDataTransform<Category::Enum>::fromWire(const QString& wire) {
 | 
			
		||||
	if (wire == "ApplicationStatus") return DBusResult(Category::ApplicationStatus);
 | 
			
		||||
	if (wire == "Communications") return DBusResult(Category::Communications);
 | 
			
		||||
	if (wire == "SystemServices") return DBusResult(Category::SystemServices);
 | 
			
		||||
	if (wire == "Hardware") return DBusResult(Category::Hardware);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -44,13 +44,15 @@ Q_NAMESPACE;
 | 
			
		|||
QML_ELEMENT;
 | 
			
		||||
 | 
			
		||||
enum Enum : quint8 {
 | 
			
		||||
	/// The fallback category for general applications or anything that does
 | 
			
		||||
	/// not fit into a different category.
 | 
			
		||||
	ApplicationStatus = 0,
 | 
			
		||||
	/// Hardware controls like battery indicators or volume control.
 | 
			
		||||
	Hardware = 0,
 | 
			
		||||
	/// System services such as IMEs or disk indexing.
 | 
			
		||||
	SystemServices = 1,
 | 
			
		||||
	/// Hardware controls like battery indicators or volume control.
 | 
			
		||||
	Hardware = 2,
 | 
			
		||||
	/// The fallback category for general applications or anything that does
 | 
			
		||||
	/// not fit into a different category.
 | 
			
		||||
	ApplicationStatus = 2,
 | 
			
		||||
	/// Communication related applications such as instant messengers or email clients.
 | 
			
		||||
	Communications = 3,
 | 
			
		||||
};
 | 
			
		||||
Q_ENUM_NS(Enum);
 | 
			
		||||
} // namespace Category
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,5 +1,6 @@
 | 
			
		|||
#include "qml.hpp"
 | 
			
		||||
 | 
			
		||||
#include <qnamespace.h>
 | 
			
		||||
#include <qobject.h>
 | 
			
		||||
 | 
			
		||||
#include "../../core/model.hpp"
 | 
			
		||||
| 
						 | 
				
			
			@ -28,9 +29,6 @@ void SystemTray::onItemRegistered(StatusNotifierItem* item) {
 | 
			
		|||
void SystemTray::onItemUnregistered(StatusNotifierItem* item) { this->mItems.removeObject(item); }
 | 
			
		||||
ObjectModel<StatusNotifierItem>* SystemTray::items() { return &this->mItems; }
 | 
			
		||||
 | 
			
		||||
bool SystemTray::compareItems(
 | 
			
		||||
    qs::service::sni::StatusNotifierItem* a,
 | 
			
		||||
    qs::service::sni::StatusNotifierItem* b
 | 
			
		||||
) {
 | 
			
		||||
	return a->category() > b->category() || a->id().compare(b->id(), Qt::CaseInsensitive) >= 0;
 | 
			
		||||
bool SystemTray::compareItems(StatusNotifierItem* a, StatusNotifierItem* b) {
 | 
			
		||||
	return a->category() < b->category() || a->id().compare(b->id(), Qt::CaseInsensitive) >= 0;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue