Changeset View
Changeset View
Standalone View
Standalone View
src/core/collection.cpp
Show First 20 Lines • Show All 183 Lines • ▼ Show 20 Line(s) | 183 | { | |||
---|---|---|---|---|---|
184 | return d_ptr->mAttributeStorage.attributes(); | 184 | return d_ptr->mAttributeStorage.attributes(); | ||
185 | } | 185 | } | ||
186 | 186 | | |||
187 | void Akonadi::Collection::clearAttributes() | 187 | void Akonadi::Collection::clearAttributes() | ||
188 | { | 188 | { | ||
189 | return d_ptr->mAttributeStorage.clearAttributes(); | 189 | return d_ptr->mAttributeStorage.clearAttributes(); | ||
190 | } | 190 | } | ||
191 | 191 | | |||
192 | Attribute *Collection::attribute(const QByteArray &type) const | 192 | Attribute *Collection::attribute(const QByteArray &type) | ||
193 | { | ||||
194 | markAttributeModified(type); | ||||
195 | return d_ptr->mAttributeStorage.attribute(type); | ||||
196 | } | ||||
197 | | ||||
198 | const Attribute *Collection::attribute(const QByteArray &type) const | ||||
193 | { | 199 | { | ||
194 | return d_ptr->mAttributeStorage.attribute(type); | 200 | return d_ptr->mAttributeStorage.attribute(type); | ||
195 | } | 201 | } | ||
196 | 202 | | |||
197 | Collection &Collection::parentCollection() | 203 | Collection &Collection::parentCollection() | ||
198 | { | 204 | { | ||
199 | if (!d_ptr->mParent) { | 205 | if (!d_ptr->mParent) { | ||
200 | d_ptr->mParent = new Collection(); | 206 | d_ptr->mParent = new Collection(); | ||
Show All 30 Lines | |||||
231 | 237 | | |||
232 | void Collection::setName(const QString &name) | 238 | void Collection::setName(const QString &name) | ||
233 | { | 239 | { | ||
234 | d_ptr->name = name; | 240 | d_ptr->name = name; | ||
235 | } | 241 | } | ||
236 | 242 | | |||
237 | Collection::Rights Collection::rights() const | 243 | Collection::Rights Collection::rights() const | ||
238 | { | 244 | { | ||
239 | CollectionRightsAttribute *attr = attribute<CollectionRightsAttribute>(); | 245 | if (const auto attr = attribute<CollectionRightsAttribute>()) { | ||
240 | if (attr) { | | |||
241 | return attr->rights(); | 246 | return attr->rights(); | ||
242 | } else { | 247 | } else { | ||
243 | return AllRights; | 248 | return AllRights; | ||
244 | } | 249 | } | ||
245 | } | 250 | } | ||
246 | 251 | | |||
247 | void Collection::setRights(Rights rights) | 252 | void Collection::setRights(Rights rights) | ||
248 | { | 253 | { | ||
249 | CollectionRightsAttribute *attr = attribute<CollectionRightsAttribute>(AddIfMissing); | 254 | attribute<CollectionRightsAttribute>(AddIfMissing)->setRights(rights); | ||
250 | attr->setRights(rights); | | |||
251 | } | 255 | } | ||
252 | 256 | | |||
253 | QStringList Collection::contentMimeTypes() const | 257 | QStringList Collection::contentMimeTypes() const | ||
254 | { | 258 | { | ||
255 | return d_ptr->contentTypes; | 259 | return d_ptr->contentTypes; | ||
256 | } | 260 | } | ||
257 | 261 | | |||
258 | void Collection::setContentMimeTypes(const QStringList &types) | 262 | void Collection::setContentMimeTypes(const QStringList &types) | ||
▲ Show 20 Lines • Show All 194 Lines • Show Last 20 Lines |