Changeset View
Changeset View
Standalone View
Standalone View
src/core/item.cpp
Show First 20 Lines • Show All 246 Lines • ▼ Show 20 Line(s) | 246 | { | |||
---|---|---|---|---|---|
247 | return ItemChangeLog::instance()->attributeStorage(d_ptr).attributes(); | 247 | return ItemChangeLog::instance()->attributeStorage(d_ptr).attributes(); | ||
248 | } | 248 | } | ||
249 | 249 | | |||
250 | void Akonadi::Item::clearAttributes() | 250 | void Akonadi::Item::clearAttributes() | ||
251 | { | 251 | { | ||
252 | ItemChangeLog::instance()->attributeStorage(d_ptr).clearAttributes(); | 252 | ItemChangeLog::instance()->attributeStorage(d_ptr).clearAttributes(); | ||
253 | } | 253 | } | ||
254 | 254 | | |||
255 | Attribute *Item::attribute(const QByteArray &type) const | 255 | Attribute *Item::attribute(const QByteArray &type) | ||
256 | { | 256 | { | ||
257 | // FIXME: Createa a truly const and non-const overloads of this method | 257 | return ItemChangeLog::instance()->attributeStorage(d_ptr).attribute(type); | ||
258 | // so only non-const access marks the attribute as modified | 258 | } | ||
259 | auto &storage = ItemChangeLog::instance()->attributeStorage(d_ptr); | 259 | | ||
260 | storage.markAttributeModified(type); | 260 | const Attribute *Item::attribute(const QByteArray &type) const | ||
261 | return attribute(type); | 261 | { | ||
262 | return ItemChangeLog::instance()->attributeStorage(d_ptr).attribute(type); | ||||
262 | } | 263 | } | ||
263 | 264 | | |||
264 | Collection &Item::parentCollection() | 265 | Collection &Item::parentCollection() | ||
265 | { | 266 | { | ||
266 | if (!d_ptr->mParent) { | 267 | if (!d_ptr->mParent) { | ||
267 | d_ptr->mParent = new Collection(); | 268 | d_ptr->mParent = new Collection(); | ||
268 | } | 269 | } | ||
269 | return *(d_ptr->mParent); | 270 | return *(d_ptr->mParent); | ||
▲ Show 20 Lines • Show All 476 Lines • Show Last 20 Lines |