Commit 74c0ca9f authored by Laurent Montel's avatar Laurent Montel 😁

Add debug operator + add different operator

parent 33ec3a5d
......@@ -28,10 +28,22 @@ KdeLoggingCategory::KdeLoggingCategory()
bool KdeLoggingCategory::operator ==(const KdeLoggingCategory &other) const
{
return (description == other.description) &&
(logName == other.logName);
(logName == other.logName);
}
bool KdeLoggingCategory::operator !=(const KdeLoggingCategory &other) const
{
return ! operator==(other);
}
bool KdeLoggingCategory::isValid() const
{
return !logName.isEmpty();
}
QDebug operator<<(QDebug d, const KdeLoggingCategory &cat)
{
d << "description: " << cat.description;
d << "logname: " << cat.logName;
return d;
}
......@@ -24,15 +24,18 @@
#include <QVector>
#include <QString>
#include <QObject>
#include <QDebug>
struct KdeLoggingCategory {
KdeLoggingCategory();
typedef QVector<KdeLoggingCategory> List;
bool operator ==(const KdeLoggingCategory &other) const;
bool operator !=(const KdeLoggingCategory &other) const;
bool isValid() const;
QString description;
QString logName;
};
QDebug operator<<(QDebug debug, const KdeLoggingCategory &cat);
Q_DECLARE_TYPEINFO(KdeLoggingCategory, Q_MOVABLE_TYPE);
Q_DECLARE_METATYPE(KdeLoggingCategory)
......
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