diff options
Diffstat (limited to 'src/qml/qmldirparser/qqmldirparser.cpp')
| -rw-r--r-- | src/qml/qmldirparser/qqmldirparser.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/qml/qmldirparser/qqmldirparser.cpp b/src/qml/qmldirparser/qqmldirparser.cpp index bb9036582e..3bc960291a 100644 --- a/src/qml/qmldirparser/qqmldirparser.cpp +++ b/src/qml/qmldirparser/qqmldirparser.cpp @@ -241,6 +241,23 @@ bool QQmlDirParser::parse(const QString &source) "not %1.").arg(sections[1])); continue; } + } else if (sections[0] == QLatin1String("default")) { + if (sectionCount < 2) { + reportError(lineNumber, 0, + QStringLiteral("default directive requires further " + "arguments, but none were provided.")); + continue; + } + if (sections[1] == QLatin1String("import")) { + if (!readImport(sections + 1, sectionCount - 1, + Import::Flags({ Import::Optional, Import::OptionalDefault }))) + continue; + } else { + reportError(lineNumber, 0, + QStringLiteral("only optional imports can have a a defaultl, " + "not %1.") + .arg(sections[1])); + } } else if (sections[0] == QLatin1String("classname")) { if (sectionCount < 2) { reportError(lineNumber, 0, |
