Changeset View
Changeset View
Standalone View
Standalone View
src/calendar/calendar.cpp
| Show All 23 Lines | |||||
| 24 | #include "reminder.h" | 24 | #include "reminder.h" | ||
| 25 | #include "../debug.h" | 25 | #include "../debug.h" | ||
| 26 | 26 | | |||
| 27 | using namespace KGAPI2; | 27 | using namespace KGAPI2; | ||
| 28 | 28 | | |||
| 29 | class Q_DECL_HIDDEN Calendar::Private | 29 | class Q_DECL_HIDDEN Calendar::Private | ||
| 30 | { | 30 | { | ||
| 31 | public: | 31 | public: | ||
| 32 | Private(); | 32 | Private() = default; | ||
| 33 | Private(const Private &other); | 33 | Private(const Private &other) = default; | ||
| 34 | ~Private() {} | | |||
| 35 | 34 | | |||
| 36 | QString uid; | 35 | QString uid; | ||
| 37 | QString title; | 36 | QString title; | ||
| 38 | QString details; | 37 | QString details; | ||
| 39 | QString timezone; | 38 | QString timezone; | ||
| 40 | QString location; | 39 | QString location; | ||
| 41 | bool editable = false; | 40 | bool editable = false; | ||
| 42 | QColor backgroundColor; | 41 | QColor backgroundColor; | ||
| 43 | QColor foregroundColor; | 42 | QColor foregroundColor; | ||
| 44 | 43 | | |||
| 45 | RemindersList reminders; | 44 | RemindersList reminders; | ||
| 46 | }; | 45 | }; | ||
| 47 | 46 | | |||
| 48 | Calendar::Private::Private() | | |||
| 49 | { | | |||
| 50 | } | | |||
| 51 | | ||||
| 52 | Calendar::Private::Private(const Private &other) : | | |||
| 53 | uid(other.uid), | | |||
| 54 | title(other.title), | | |||
| 55 | details(other.details), | | |||
| 56 | timezone(other.timezone), | | |||
| 57 | location(other.location), | | |||
| 58 | editable(other.editable), | | |||
| 59 | backgroundColor(other.backgroundColor), | | |||
| 60 | foregroundColor(other.foregroundColor), | | |||
| 61 | reminders(other.reminders) | | |||
| 62 | { | | |||
| 63 | } | | |||
| 64 | | ||||
| 65 | Calendar::Calendar() : | 47 | Calendar::Calendar() : | ||
| 66 | Object(), | 48 | Object(), | ||
| 67 | d(new Private) | 49 | d(new Private) | ||
| 68 | { | 50 | { | ||
| 69 | } | 51 | } | ||
| 70 | 52 | | |||
| 71 | Calendar::Calendar(const Calendar &other) : | 53 | Calendar::Calendar(const Calendar &other) : | ||
| 72 | Object(other), | 54 | Object(other), | ||
| 73 | d(new Private(*(other.d))) | 55 | d(new Private(*(other.d.get()))) | ||
| 74 | { | 56 | { | ||
| 75 | } | 57 | } | ||
| 76 | 58 | | |||
| 77 | Calendar::~Calendar() | 59 | Calendar::~Calendar() = default; | ||
| 78 | { | | |||
| 79 | delete d; | | |||
| 80 | } | | |||
| 81 | 60 | | |||
| 82 | bool Calendar::operator==(const Calendar &other) const | 61 | bool Calendar::operator==(const Calendar &other) const | ||
| 83 | { | 62 | { | ||
| 84 | if (d->uid != other.d->uid) { | 63 | if (d->uid != other.d->uid) { | ||
| 85 | qCDebug(KGAPIDebug) << "UIDs don't match"; | 64 | qCDebug(KGAPIDebug) << "UIDs don't match"; | ||
| 86 | return false; | 65 | return false; | ||
| 87 | } | 66 | } | ||
| 88 | if (d->title != other.d->title) { | 67 | if (d->title != other.d->title) { | ||
| ▲ Show 20 Lines • Show All 136 Lines • Show Last 20 Lines | |||||