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
5d5b8e10
Commit
5d5b8e10
authored
Feb 17, 2012
by
David Jarvie
Browse files
Allow collection ID to be set without copying shared data
parent
e4f748a4
Changes
2
Hide whitespace changes
Inline
Side-by-side
kaevent.cpp
View file @
5d5b8e10
...
...
@@ -306,7 +306,7 @@ class KAEvent::Private : public QSharedData
#ifndef KALARMCAL_USE_KRESOURCES
QMap
<
QByteArray
,
QString
>
mCustomProperties
;
// KCal::Event's non-KAlarm custom properties
Akonadi
::
Item
::
Id
mItemId
;
// Akonadi::Item ID for this event
Akonadi
::
Collection
::
Id
mCollectionId
;
// ID of collection containing the event, or for a displaying event,
mutable
Akonadi
::
Collection
::
Id
mCollectionId
;
// ID of collection containing the event, or for a displaying event,
// saved collection ID (not the collection the event is in)
#else
QString
mOriginalResourceId
;
// saved resource ID (not the resource the event is in)
...
...
@@ -1888,6 +1888,11 @@ void KAEvent::setCollectionId(Akonadi::Collection::Id id)
d
->
mCollectionId
=
id
;
}
void
KAEvent
::
setCollectionId_const
(
Akonadi
::
Collection
::
Id
id
)
const
{
d
->
mCollectionId
=
id
;
}
Akonadi
::
Collection
::
Id
KAEvent
::
collectionId
()
const
{
// A displaying alarm contains the event's original collection ID
...
...
kaevent.h
View file @
5d5b8e10
...
...
@@ -472,6 +472,14 @@ class KALARMCAL_EXPORT KAEvent
#ifndef KALARMCAL_USE_KRESOURCES
/** Set the ID of the Akonadi Collection which contains the event. */
void
setCollectionId
(
Akonadi
::
Collection
::
Id
id
);
/** Set the ID of the Akonadi Collection which contains the event.
* \warning This is a const method, which means that any other instance
* which references the same shared data will also be
* updated. It is designed to be used when a KAEvent is
* being created from an Akonadi Item, to avoid unnecessary
* copying. Use with caution!
*/
void
setCollectionId_const
(
Akonadi
::
Collection
::
Id
id
)
const
;
/** Return the ID of the Akonadi Collection which contains the event. */
Akonadi
::
Collection
::
Id
collectionId
()
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