Revision f8b8663b
Von Christian Ehringfeld vor mehr als 10 Jahren hinzugefügt
| src/entityhelper.cpp | ||
|---|---|---|
|
auto superObject = EntityInstanceFactory::newSuperClassInstance(entity);
|
||
|
if (superObject) {
|
||
|
auto superRelations = superObject->getRelations();
|
||
|
auto iterator = superRelations.constBegin();
|
||
|
while (iterator != relations.constEnd()) {
|
||
|
if (relations.contains(iterator.key())) {
|
||
|
relations.remove(iterator.key());
|
||
|
for (auto i = superRelations.constBegin(); i != superRelations.constEnd(); ++i) {
|
||
|
if (relations.contains(i.key())) {
|
||
|
relations.remove(i.key());
|
||
|
}
|
||
|
++iterator;
|
||
|
}
|
||
|
delete superObject;
|
||
|
superObject = nullptr;
|
||
| ... | ... | |
|
&entity, QSharedPointer<Entity> add, const QMetaProperty &property) {
|
||
|
QVariant var = property.read(entity.data());
|
||
|
QList<QSharedPointer<Entity>> list = (!var.isNull() && var.data() &&
|
||
|
var.canConvert<QList<QVariant>>() ? EntityInstanceFactory::castQVariantList( var) : QList<QSharedPointer<Entity>>());
|
||
|
var.canConvert<QList<QVariant>>() ? EntityInstanceFactory::castQVariantList(
|
||
|
var) : QList<QSharedPointer<Entity>>());
|
||
|
if (!list.contains(add)) {
|
||
|
list.append(add);
|
||
|
EntityHelper::setListProperty(entity, list, property);
|
||
Auch abrufbar als: Unified diff
fixxed possible crash in detection of nonInheritedRelations
test case update