Commit 50c9f586 authored by David Jarvie's avatar David Jarvie
Browse files

Add qDebug operator for CalEvent::Type

parent f2941119
......@@ -2,7 +2,7 @@
* kacalendar.cpp - KAlarm kcal library calendar and event functions
* This file is part of kalarmcal library, which provides access to KAlarm
* calendar data.
* Copyright © 2001-2019 David Jarvie <djarvie@kde.org>
* Copyright © 2001-2020 David Jarvie <djarvie@kde.org>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as published
......@@ -457,4 +457,17 @@ QStringList mimeTypes(Types types)
} // namespace KAlarmCal
QDebug operator<<(QDebug debug, KAlarmCal::CalEvent::Type type)
{
const char* str;
switch (type) {
case KAlarmCal::CalEvent::ACTIVE: str = "Active alarms"; break;
case KAlarmCal::CalEvent::ARCHIVED: str = "Archived alarms"; break;
case KAlarmCal::CalEvent::TEMPLATE: str = "Alarm templates"; break;
default: return debug;
}
debug << str;
return debug;
}
// vim: et sw=4:
......@@ -2,7 +2,7 @@
* kacalendar.h - KAlarm kcal library calendar and event categorisation
* This file is part of kalarmcal library, which provides access to KAlarm
* calendar data.
* Copyright © 2005-2019 David Jarvie <djarvie@kde.org>
* Copyright © 2005-2020 David Jarvie <djarvie@kde.org>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as published
......@@ -33,6 +33,7 @@
#include <QByteArray>
#include <QStringList>
#include <QDebug>
namespace KCalendarCore
{
......@@ -149,6 +150,8 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(CalEvent::Types)
} // namespace KAlarmCal
KALARMCAL_EXPORT QDebug operator<<(QDebug, KAlarmCal::CalEvent::Type);
#endif // KALARM_KACALENDAR_H
// vim: et sw=4:
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