cleanup
This commit is contained in:
parent
8e987c1cf8
commit
14e70eceee
|
@ -175,31 +175,34 @@ QDataStream &operator<< ( QDataStream &stream, const Notification ¬i )
|
||||||
return stream;
|
return stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define debugPrintEnum(x) case x: debug << #x ")"; break
|
||||||
|
|
||||||
QDebug operator <<(QDebug debug, const Snore::Notification::CloseReasons &flags)
|
QDebug operator <<(QDebug debug, const Snore::Notification::CloseReasons &flags)
|
||||||
{
|
{
|
||||||
static QMetaEnum e = Notification::staticMetaObject.property(Notification::staticMetaObject.indexOfProperty("closeReason")).enumerator();
|
|
||||||
debug.nospace() << "CloseReasons(";
|
debug.nospace() << "CloseReasons(";
|
||||||
bool needSeparator = false;
|
switch(flags)
|
||||||
int key;
|
|
||||||
for (int i = 0; i < e.keyCount(); ++i)
|
|
||||||
{
|
{
|
||||||
key = e.value(i);
|
debugPrintEnum(Notification::NONE);
|
||||||
if (flags.testFlag((Notification::CloseReason)key))
|
debugPrintEnum(Notification::TIMED_OUT);
|
||||||
{
|
debugPrintEnum(Notification::DISMISSED);
|
||||||
if (needSeparator)
|
debugPrintEnum(Notification::CLOSED);
|
||||||
{
|
default:
|
||||||
debug.nospace() << '|';
|
debug << QByteArray::number(flags,16) << ")";
|
||||||
}
|
}
|
||||||
else
|
return debug.space();
|
||||||
{
|
}
|
||||||
needSeparator = true;
|
|
||||||
}
|
QDebug operator<< ( QDebug debug, const Snore::Notification::Prioritys &flags)
|
||||||
|
{
|
||||||
debug.nospace() << e.valueToKey(key);
|
debug.nospace() << "Prioritys(";
|
||||||
|
switch(flags)
|
||||||
}
|
{
|
||||||
|
debugPrintEnum(Notification::LOW);
|
||||||
|
debugPrintEnum(Notification::NORMAL);
|
||||||
|
debugPrintEnum(Notification::HIGH);
|
||||||
|
default:
|
||||||
|
debug << QByteArray::number(flags,16) << ")";
|
||||||
}
|
}
|
||||||
debug << ')';
|
|
||||||
return debug.space();
|
return debug.space();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,11 +43,6 @@ class NotificationData;
|
||||||
|
|
||||||
class SNORE_EXPORT Notification
|
class SNORE_EXPORT Notification
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
Q_OBJECT
|
|
||||||
*/
|
|
||||||
Q_GADGET
|
|
||||||
Q_PROPERTY(CloseReasons closeReason READ closeReason)
|
|
||||||
friend class NotificationData;
|
friend class NotificationData;
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
|
@ -290,6 +285,8 @@ QDataStream &operator<< ( QDataStream & stream, const Snore::Notification & noti
|
||||||
|
|
||||||
SNORE_EXPORT QDebug operator<< ( QDebug, const Snore::Notification::CloseReasons &);
|
SNORE_EXPORT QDebug operator<< ( QDebug, const Snore::Notification::CloseReasons &);
|
||||||
|
|
||||||
|
SNORE_EXPORT QDebug operator<< ( QDebug, const Snore::Notification::Prioritys &);
|
||||||
|
|
||||||
inline QDebug operator<< ( QDebug debug, const Snore::Notification ¬i )
|
inline QDebug operator<< ( QDebug debug, const Snore::Notification ¬i )
|
||||||
{
|
{
|
||||||
if(noti.isValid())
|
if(noti.isValid())
|
||||||
|
|
Loading…
Reference in New Issue