From 7415e53a8bd509781e2bc589887d46b11610048f Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Fri, 24 Jun 2022 15:09:56 +0200 Subject: moc: Strip parentheses from RESET methods in JSON output READ, WRITE, NOTIFY etc all come without parentheses. What we actually want to check in the generator is whether the reset method is empty. Task-number: QTBUG-104508 Change-Id: If8c70c7491b25e3c4d9a39dc2c0add0212e64dea Reviewed-by: Andrei Golubev --- src/tools/moc/generator.cpp | 4 ++-- src/tools/moc/moc.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/tools/moc') diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp index 8219571162..c6384bf340 100644 --- a/src/tools/moc/generator.cpp +++ b/src/tools/moc/generator.cpp @@ -1351,13 +1351,13 @@ void Generator::generateStaticMetacall() fprintf(out, " switch (_id) {\n"); for (int propindex = 0; propindex < cdef->propertyList.size(); ++propindex) { const PropertyDef &p = cdef->propertyList.at(propindex); - if (!p.reset.endsWith(')')) + if (p.reset.isEmpty()) continue; QByteArray prefix = "_t->"; if (p.inPrivateClass.size()) { prefix += p.inPrivateClass + "->"; } - fprintf(out, " case %d: %s%s; break;\n", + fprintf(out, " case %d: %s%s(); break;\n", propindex, prefix.constData(), p.reset.constData()); } fprintf(out, " default: break;\n"); diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp index e931e32f4e..c6e8f0bda8 100644 --- a/src/tools/moc/moc.cpp +++ b/src/tools/moc/moc.cpp @@ -1335,7 +1335,7 @@ void Moc::parsePropertyAttributes(PropertyDef &propDef) if (l == "READ") propDef.read = v; else if (l == "RESET") - propDef.reset = v + v2; + propDef.reset = v; else if (l == "REVISION") { bool ok = false; const int minor = v.toInt(&ok); -- cgit v1.2.3