Changeset View
Changeset View
Standalone View
Standalone View
src/core/item_p.h
Show First 20 Lines • Show All 302 Lines • ▼ Show 20 Line(s) | 284 | public: | |||
---|---|---|---|---|---|
303 | ItemPrivate(const ItemPrivate &other) | 303 | ItemPrivate(const ItemPrivate &other) | ||
304 | : QSharedData(other) | 304 | : QSharedData(other) | ||
305 | , mParent(nullptr) | 305 | , mParent(nullptr) | ||
306 | { | 306 | { | ||
307 | mId = other.mId; | 307 | mId = other.mId; | ||
308 | mRemoteId = other.mRemoteId; | 308 | mRemoteId = other.mRemoteId; | ||
309 | mRemoteRevision = other.mRemoteRevision; | 309 | mRemoteRevision = other.mRemoteRevision; | ||
310 | mPayloadPath = other.mPayloadPath; | 310 | mPayloadPath = other.mPayloadPath; | ||
311 | Q_FOREACH (Attribute *attr, other.mAttributes) { | | |||
312 | mAttributes.insert(attr->type(), attr->clone()); | | |||
313 | } | | |||
314 | if (other.mParent) { | 311 | if (other.mParent) { | ||
315 | mParent = new Collection(*(other.mParent)); | 312 | mParent = new Collection(*(other.mParent)); | ||
316 | } | 313 | } | ||
317 | mFlags = other.mFlags; | 314 | mFlags = other.mFlags; | ||
318 | mRevision = other.mRevision; | 315 | mRevision = other.mRevision; | ||
319 | mTags = other.mTags; | 316 | mTags = other.mTags; | ||
320 | mRelations = other.mRelations; | 317 | mRelations = other.mRelations; | ||
321 | mSize = other.mSize; | 318 | mSize = other.mSize; | ||
Show All 11 Lines | |||||
333 | mTagsOverwritten = other.mTagsOverwritten; | 330 | mTagsOverwritten = other.mTagsOverwritten; | ||
334 | mConversionInProgress = false; | 331 | mConversionInProgress = false; | ||
335 | 332 | | |||
336 | ItemChangeLog *changelog = ItemChangeLog::instance(); | 333 | ItemChangeLog *changelog = ItemChangeLog::instance(); | ||
337 | changelog->addedFlags(this) = changelog->addedFlags(&other); | 334 | changelog->addedFlags(this) = changelog->addedFlags(&other); | ||
338 | changelog->deletedFlags(this) = changelog->deletedFlags(&other); | 335 | changelog->deletedFlags(this) = changelog->deletedFlags(&other); | ||
339 | changelog->addedTags(this) = changelog->addedTags(&other); | 336 | changelog->addedTags(this) = changelog->addedTags(&other); | ||
340 | changelog->deletedTags(this) = changelog->deletedTags(&other); | 337 | changelog->deletedTags(this) = changelog->deletedTags(&other); | ||
341 | changelog->deletedAttributes(this) = changelog->deletedAttributes(&other); | 338 | changelog->attributeStorage(this) = changelog->attributeStorage(&other); | ||
342 | } | 339 | } | ||
343 | 340 | | |||
344 | ~ItemPrivate() | 341 | ~ItemPrivate() | ||
345 | { | 342 | { | ||
346 | qDeleteAll(mAttributes); | | |||
347 | delete mParent; | 343 | delete mParent; | ||
348 | 344 | | |||
349 | ItemChangeLog::instance()->clearItemChangelog(this); | 345 | ItemChangeLog::instance()->removeItem(this); | ||
350 | } | 346 | } | ||
351 | 347 | | |||
352 | void resetChangeLog() | 348 | void resetChangeLog() | ||
353 | { | 349 | { | ||
354 | mFlagsOverwritten = false; | 350 | mFlagsOverwritten = false; | ||
355 | mSizeChanged = false; | 351 | mSizeChanged = false; | ||
356 | mTagsOverwritten = false; | 352 | mTagsOverwritten = false; | ||
357 | ItemChangeLog::instance()->clearItemChangelog(this); | 353 | ItemChangeLog::instance()->clearItemChangelog(this); | ||
▲ Show 20 Lines • Show All 77 Lines • ▼ Show 20 Line(s) | 404 | #endif | |||
435 | void tryEnsureLegacyPayload() const; | 431 | void tryEnsureLegacyPayload() const; | ||
436 | 432 | | |||
437 | // Utilise the 4-bytes padding from QSharedData | 433 | // Utilise the 4-bytes padding from QSharedData | ||
438 | int mRevision; | 434 | int mRevision; | ||
439 | Item::Id mId; | 435 | Item::Id mId; | ||
440 | QString mRemoteId; | 436 | QString mRemoteId; | ||
441 | QString mRemoteRevision; | 437 | QString mRemoteRevision; | ||
442 | mutable QString mPayloadPath; | 438 | mutable QString mPayloadPath; | ||
443 | QHash<QByteArray, Attribute *> mAttributes; | | |||
444 | mutable Collection *mParent; | 439 | mutable Collection *mParent; | ||
445 | mutable _detail::clone_ptr<Internal::PayloadBase> mLegacyPayload; | 440 | mutable _detail::clone_ptr<Internal::PayloadBase> mLegacyPayload; | ||
446 | mutable PayloadContainer mPayloads; | 441 | mutable PayloadContainer mPayloads; | ||
447 | Item::Flags mFlags; | 442 | Item::Flags mFlags; | ||
448 | Tag::List mTags; | 443 | Tag::List mTags; | ||
449 | Relation::List mRelations; | 444 | Relation::List mRelations; | ||
450 | Item::Id mCollectionId; | 445 | Item::Id mCollectionId; | ||
451 | Collection::List mVirtualReferences; | 446 | Collection::List mVirtualReferences; | ||
Show All 17 Lines |