Changeset View
Changeset View
Standalone View
Standalone View
src/core/attributestorage.cpp
Show First 20 Lines • Show All 91 Lines • ▼ Show 20 Line(s) | 91 | { | |||
---|---|---|---|---|---|
92 | for (Attribute *attr : qAsConst(mAttributes)) { | 92 | for (Attribute *attr : qAsConst(mAttributes)) { | ||
93 | mDeletedAttributes.insert(attr->type()); | 93 | mDeletedAttributes.insert(attr->type()); | ||
94 | delete attr; | 94 | delete attr; | ||
95 | } | 95 | } | ||
96 | mAttributes.clear(); | 96 | mAttributes.clear(); | ||
97 | mModifiedAttributes.clear(); | 97 | mModifiedAttributes.clear(); | ||
98 | } | 98 | } | ||
99 | 99 | | |||
100 | Attribute *AttributeStorage::attribute(const QByteArray &type) const | 100 | const Attribute *AttributeStorage::attribute(const QByteArray &type) const | ||
101 | { | 101 | { | ||
102 | return mAttributes.value(type); | 102 | return mAttributes.value(type); | ||
103 | } | 103 | } | ||
104 | 104 | | |||
105 | Attribute *AttributeStorage::attribute(const QByteArray &type) | ||||
106 | { | ||||
107 | markAttributeModified(type); | ||||
108 | return mAttributes.value(type); | ||||
109 | } | ||||
110 | | ||||
105 | void AttributeStorage::markAttributeModified(const QByteArray &type) | 111 | void AttributeStorage::markAttributeModified(const QByteArray &type) | ||
106 | { | 112 | { | ||
107 | mDeletedAttributes.remove(type); | 113 | mDeletedAttributes.remove(type); | ||
108 | mModifiedAttributes.insert(type); | 114 | mModifiedAttributes.insert(type); | ||
109 | } | 115 | } | ||
110 | 116 | | |||
111 | void AttributeStorage::resetChangeLog() | 117 | void AttributeStorage::resetChangeLog() | ||
112 | { | 118 | { | ||
Show All 25 Lines |