diff options
author | Michael Brasser <mbrasser@ford.com> | 2019-12-17 10:52:08 -0600 |
---|---|---|
committer | Michael Brasser <mbrasser@ford.com> | 2020-07-28 08:10:58 -0500 |
commit | 86dc5afb569663a129411fdb9a1304f5906019b9 (patch) | |
tree | 0cde5e2e2c9070971f26d8ca687593e7ce12e443 /tools/repc/repcodegenerator.cpp | |
parent | 51695d93e7190d0cbb2e896a0a2bbdd24ebbaf71 (diff) |
Fix crash with same-named subobjects or models
Differentiate between subobjects or models coming from different
primary objects.
Change-Id: Ic4360ae208edbe31a1130f60248a501d63e55773
Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
Diffstat (limited to 'tools/repc/repcodegenerator.cpp')
-rw-r--r-- | tools/repc/repcodegenerator.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/repc/repcodegenerator.cpp b/tools/repc/repcodegenerator.cpp index c5df472..0da307e 100644 --- a/tools/repc/repcodegenerator.cpp +++ b/tools/repc/repcodegenerator.cpp @@ -703,12 +703,13 @@ void RepCodeGenerator::generateClass(Mode mode, QTextStream &out, const ASTClass const ASTProperty &property = astClass.properties.at(index); if (!property.isPointer) continue; + const QString acquireName = astClass.name + QLatin1String("::") + property.name; if (astClass.subClassPropertyIndices.contains(index)) out << QString::fromLatin1(" setChild(%1, QVariant::fromValue(node->acquire<%2Replica>(QRemoteObjectStringLiterals::CLASS().arg(\"%3\"))));") - .arg(QString::number(index), property.type, property.name) << Qt::endl; + .arg(QString::number(index), property.type, acquireName) << Qt::endl; else out << QString::fromLatin1(" setChild(%1, QVariant::fromValue(node->acquireModel(QRemoteObjectStringLiterals::MODEL().arg(\"%2\"))));") - .arg(QString::number(index), property.name) << Qt::endl; + .arg(QString::number(index), acquireName) << Qt::endl; out << " Q_EMIT " << property.name << "Changed(" << property.name << "()" << ");" << Qt::endl; } @@ -724,12 +725,13 @@ void RepCodeGenerator::generateClass(Mode mode, QTextStream &out, const ASTClass const ASTProperty &property = astClass.properties.at(index); if (!property.isPointer) continue; + const QString acquireName = astClass.name + QLatin1String("::") + property.name; if (astClass.subClassPropertyIndices.contains(index)) out << QString::fromLatin1(" setChild(%1, QVariant::fromValue(node->acquire<%2Replica>(QRemoteObjectStringLiterals::CLASS().arg(\"%3\"))));") - .arg(QString::number(index), property.type, property.name) << Qt::endl; + .arg(QString::number(index), property.type, acquireName) << Qt::endl; else out << QString::fromLatin1(" setChild(%1, QVariant::fromValue(node->acquireModel(QRemoteObjectStringLiterals::MODEL().arg(\"%2\"))));") - .arg(QString::number(index), property.name) << Qt::endl; + .arg(QString::number(index), acquireName) << Qt::endl; } out << " }" << Qt::endl; |