Changeset View
Changeset View
Standalone View
Standalone View
src/core/tag.h
Show First 20 Lines • Show All 211 Lines • ▼ Show 20 Line(s) | |||||
212 | AKONADICORE_EXPORT uint qHash(const Akonadi::Tag &); | 212 | AKONADICORE_EXPORT uint qHash(const Akonadi::Tag &); | ||
213 | 213 | | |||
214 | template <typename T> | 214 | template <typename T> | ||
215 | inline T *Tag::attribute(CreateOption option) | 215 | inline T *Tag::attribute(CreateOption option) | ||
216 | { | 216 | { | ||
217 | Q_UNUSED(option); | 217 | Q_UNUSED(option); | ||
218 | 218 | | |||
219 | const QByteArray type = T().type(); | 219 | const QByteArray type = T().type(); | ||
220 | markAttributeModified(type); | ||||
220 | if (hasAttribute(type)) { | 221 | if (hasAttribute(type)) { | ||
221 | T *attr = dynamic_cast<T *>(attribute(type)); | 222 | T *attr = dynamic_cast<T *>(attribute(type)); | ||
222 | if (checkAttribute(attr, type)) { | 223 | if (checkAttribute(attr, type)) { | ||
223 | markAttributeModified(type); | | |||
224 | return attr; | 224 | return attr; | ||
225 | } | 225 | } | ||
226 | } | 226 | } | ||
227 | 227 | | |||
228 | T *attr = new T(); | 228 | T *attr = new T(); | ||
229 | addAttribute(attr); | 229 | addAttribute(attr); | ||
230 | return attr; | 230 | return attr; | ||
231 | } | 231 | } | ||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |