summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@theqtcompany.com>2016-01-28 10:32:05 +0100
committerJarek Kobus <jaroslaw.kobus@theqtcompany.com>2016-04-14 10:08:22 +0000
commit14c1090c89bba1af881d568274d4f1b9fe5f8a28 (patch)
tree5c04b1eb0176557cc945da95af387d07a4e32094 /tools
parent181928775bb5456c88e0528c639274bc7da259c2 (diff)
Detect clashes in event and state names
Change-Id: I6df9f73965442b7866c8912ac8a0a0858640bb62 Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/qscxmlc/scxmlcppdumper.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/tools/qscxmlc/scxmlcppdumper.cpp b/tools/qscxmlc/scxmlcppdumper.cpp
index a522c58..d78d213 100644
--- a/tools/qscxmlc/scxmlcppdumper.cpp
+++ b/tools/qscxmlc/scxmlcppdumper.cpp
@@ -448,9 +448,13 @@ protected:
const QString tName = transitionName(node);
if (m_qtMode) {
foreach (const QString &event, node->events) {
- if (isValidCppIdentifier(event)) {
- m_knownEvents.insert(event);
- }
+ if (!DocumentModel::isEventToBeGenerated(event))
+ continue;
+
+ // If the event name is not filtered out, is was already validated inside:
+ // bool ScxmlVerifier::visit(DocumentModel::Transition *transition)
+ // by a call to: validateEventName();
+ m_knownEvents.insert(event);
}
}
@@ -732,13 +736,6 @@ private:
std::sort(knownEventsList.begin(), knownEventsList.end());
if (m_qtMode) {
foreach (const QString &event, knownEventsList) {
- if (event.startsWith(QStringLiteral("done.")) || event.startsWith(QStringLiteral("qsignal."))
- || event.startsWith(QStringLiteral("qevent."))) {
- continue;
- }
- if (event.contains(QLatin1Char('*')))
- continue;
-
clazz.publicSlotDeclarations << QStringLiteral("void ") + event + QStringLiteral("(const QVariant &eventData = QVariant());");
clazz.publicSlotDefinitions << QStringLiteral("void ") + clazz.className
+ QStringLiteral("::")