Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KAlarm
Commits
d45b7240
Commit
d45b7240
authored
Oct 22, 2019
by
David Jarvie
Browse files
Add operator==()
parent
a90ec341
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/collectionattribute.cpp
View file @
d45b7240
...
...
@@ -2,7 +2,7 @@
* collectionattribute.cpp - Akonadi attribute holding Collection characteristics
* This file is part of kalarmcal library, which provides access to KAlarm
* calendar data.
* Copyright © 2010-201
1 by
David Jarvie <djarvie@kde.org>
* Copyright © 2010-201
9
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
...
...
@@ -30,15 +30,19 @@ namespace KAlarmCal
class
Q_DECL_HIDDEN
CollectionAttribute
::
Private
{
public:
Private
()
:
mEnabled
(
CalEvent
::
EMPTY
),
mStandard
(
CalEvent
::
EMPTY
),
mKeepFormat
(
false
)
{}
Private
()
{}
bool
operator
==
(
const
Private
&
other
)
const
{
return
mBackgroundColour
==
other
.
mBackgroundColour
&&
mEnabled
==
other
.
mEnabled
&&
mStandard
==
other
.
mStandard
&&
mKeepFormat
==
other
.
mKeepFormat
;
}
QColor
mBackgroundColour
;
// background color for collection and its alarms
CalEvent
::
Types
mEnabled
;
// which alarm types the collection is enabled for
CalEvent
::
Types
mStandard
;
// whether the collection is a standard collection
bool
mKeepFormat
;
// whether user has chosen to keep old calendar storage format
QColor
mBackgroundColour
;
// background color for collection and its alarms
CalEvent
::
Types
mEnabled
{
CalEvent
::
EMPTY
};
// which alarm types the collection is enabled for
CalEvent
::
Types
mStandard
{
CalEvent
::
EMPTY
};
// whether the collection is a standard collection
bool
mKeepFormat
{
false
};
// whether user has chosen to keep old calendar storage format
};
CollectionAttribute
::
CollectionAttribute
()
...
...
@@ -66,6 +70,11 @@ CollectionAttribute &CollectionAttribute::operator=(const CollectionAttribute &o
return
*
this
;
}
bool
CollectionAttribute
::
operator
==
(
const
CollectionAttribute
&
other
)
const
{
return
*
d
==
*
other
.
d
;
}
CollectionAttribute
*
CollectionAttribute
::
clone
()
const
{
return
new
CollectionAttribute
(
*
this
);
...
...
src/collectionattribute.h
View file @
d45b7240
...
...
@@ -2,7 +2,7 @@
* collectionattribute.h - Akonadi attribute holding Collection characteristics
* This file is part of kalarmcal library, which provides access to KAlarm
* calendar data.
* Copyright © 2010-201
1 by
David Jarvie <djarvie@kde.org>
* Copyright © 2010-201
9
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
...
...
@@ -61,6 +61,10 @@ public:
~
CollectionAttribute
()
override
;
/** Comparison operator. */
bool
operator
==
(
const
CollectionAttribute
&
other
)
const
;
bool
operator
!=
(
const
CollectionAttribute
&
other
)
const
{
return
!
operator
==
(
other
);
}
/** Return whether the collection is enabled for a specified alarm type
* (active, archived, template or displaying).
* @param type alarm type to check for.
...
...
src/compatibilityattribute.cpp
View file @
d45b7240
...
...
@@ -2,7 +2,7 @@
* compatibilityattribute.cpp - Akonadi attribute holding Collection compatibility
* This file is part of kalarmcal library, which provides access to KAlarm
* calendar data.
* Copyright © 2011
by
David Jarvie <djarvie@kde.org>
* Copyright © 2011
-2019
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
...
...
@@ -30,13 +30,15 @@ namespace KAlarmCal
class
Q_DECL_HIDDEN
CompatibilityAttribute
::
Private
{
public:
Private
()
:
mCompatibility
(
KACalendar
::
Incompatible
),
mVersion
(
KACalendar
::
IncompatibleFormat
)
{}
Private
()
{}
bool
operator
==
(
const
Private
&
other
)
const
{
return
mCompatibility
==
other
.
mCompatibility
&&
mVersion
==
other
.
mVersion
;
}
KACalendar
::
Compat
mCompatibility
;
// calendar compatibility with current KAlarm format
int
mVersion
;
// KAlarm calendar format version
KACalendar
::
Compat
mCompatibility
{
KACalendar
::
Incompatible
};
// calendar compatibility with current KAlarm format
int
mVersion
{
KACalendar
::
IncompatibleFormat
};
// KAlarm calendar format version
};
CompatibilityAttribute
::
CompatibilityAttribute
()
...
...
@@ -64,6 +66,11 @@ CompatibilityAttribute &CompatibilityAttribute::operator=(const CompatibilityAtt
return
*
this
;
}
bool
CompatibilityAttribute
::
operator
==
(
const
CompatibilityAttribute
&
other
)
const
{
return
*
d
==
*
other
.
d
;
}
CompatibilityAttribute
*
CompatibilityAttribute
::
clone
()
const
{
return
new
CompatibilityAttribute
(
*
this
);
...
...
src/compatibilityattribute.h
View file @
d45b7240
...
...
@@ -2,7 +2,7 @@
* compatibilityattribute.h - Akonadi attribute holding Collection compatibility
* This file is part of kalarmcal library, which provides access to KAlarm
* calendar data.
* Copyright © 2011
by
David Jarvie <djarvie@kde.org>
* Copyright © 2011
-2019
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
...
...
@@ -58,6 +58,10 @@ public:
~
CompatibilityAttribute
()
override
;
/** Comparison operator. */
bool
operator
==
(
const
CompatibilityAttribute
&
other
)
const
;
bool
operator
!=
(
const
CompatibilityAttribute
&
other
)
const
{
return
!
operator
==
(
other
);
}
/** Return the compatibility status for the entity. */
KACalendar
::
Compat
compatibility
()
const
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment