87 virtual void serialize(class Serializer& serializer); |
87 virtual void serialize(class Serializer& serializer); |
88 |
88 |
89 static LDObject* newFromType(LDObjectType type); |
89 static LDObject* newFromType(LDObjectType type); |
90 |
90 |
91 signals: |
91 signals: |
|
92 void aboutToBeModified(); |
92 void modified(const LDObjectState& before, const LDObjectState& after); |
93 void modified(const LDObjectState& before, const LDObjectState& after); |
93 |
94 |
94 protected: |
95 protected: |
95 template<typename T> |
96 template<typename T> |
96 void changeProperty(T* property, const T& value); |
97 void changeProperty(T* property, const T& value); |
231 void LDObject::changeProperty(T* property, const T& value) |
232 void LDObject::changeProperty(T* property, const T& value) |
232 { |
233 { |
233 if (*property != value) |
234 if (*property != value) |
234 { |
235 { |
235 Serializer::Archive before = Serializer::store(this); |
236 Serializer::Archive before = Serializer::store(this); |
|
237 emit aboutToBeModified(); |
236 *property = value; |
238 *property = value; |
237 emit modified(before, Serializer::store(this)); |
239 emit modified(before, Serializer::store(this)); |
238 } |
240 } |
239 } |
241 } |