aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmldirparser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/qml/qqmldirparser.cpp')
-rw-r--r--src/qml/qml/qqmldirparser.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/qml/qml/qqmldirparser.cpp b/src/qml/qml/qqmldirparser.cpp
index 0bfc4eb4bd..ae328ca240 100644
--- a/src/qml/qml/qqmldirparser.cpp
+++ b/src/qml/qml/qqmldirparser.cpp
@@ -98,7 +98,7 @@ bool QQmlDirParser::parse(const QString &source)
_components.clear();
_scripts.clear();
- int lineNumber = 0;
+ quint16 lineNumber = 0;
bool firstLine = true;
const QChar *ch = source.constData();
@@ -141,7 +141,7 @@ bool QQmlDirParser::parse(const QString &source)
++ch;
if (invalidLine) {
- reportError(lineNumber, -1,
+ reportError(lineNumber, 0,
QString::fromUtf8("invalid qmldir directive contains too many tokens"));
continue;
} else if (sectionCount == 0) {
@@ -149,17 +149,17 @@ bool QQmlDirParser::parse(const QString &source)
} else if (sections[0] == QLatin1String("module")) {
if (sectionCount != 2) {
- reportError(lineNumber, -1,
+ reportError(lineNumber, 0,
QString::fromUtf8("module identifier directive requires one argument, but %1 were provided").arg(sectionCount - 1));
continue;
}
if (!_typeNamespace.isEmpty()) {
- reportError(lineNumber, -1,
+ reportError(lineNumber, 0,
QString::fromUtf8("only one module identifier directive may be defined in a qmldir file"));
continue;
}
if (!firstLine) {
- reportError(lineNumber, -1,
+ reportError(lineNumber, 0,
QString::fromUtf8("module identifier directive must be the first command in a qmldir file"));
continue;
}
@@ -168,7 +168,7 @@ bool QQmlDirParser::parse(const QString &source)
} else if (sections[0] == QLatin1String("plugin")) {
if (sectionCount < 2) {
- reportError(lineNumber, -1,
+ reportError(lineNumber, 0,
QString::fromUtf8("plugin directive requires one or two arguments, but %1 were provided").arg(sectionCount - 1));
continue;
@@ -180,7 +180,7 @@ bool QQmlDirParser::parse(const QString &source)
} else if (sections[0] == QLatin1String("internal")) {
if (sectionCount != 3) {
- reportError(lineNumber, -1,
+ reportError(lineNumber, 0,
QString::fromUtf8("internal types require 2 arguments, but %1 were provided").arg(sectionCount - 1));
continue;
}
@@ -189,7 +189,7 @@ bool QQmlDirParser::parse(const QString &source)
_components.insertMulti(entry.typeName, entry);
} else if (sections[0] == QLatin1String("typeinfo")) {
if (sectionCount != 2) {
- reportError(lineNumber, -1,
+ reportError(lineNumber, 0,
QString::fromUtf8("typeinfo requires 1 argument, but %1 were provided").arg(sectionCount - 1));
continue;
}
@@ -207,9 +207,9 @@ bool QQmlDirParser::parse(const QString &source)
const int dotIndex = version.indexOf(QLatin1Char('.'));
if (dotIndex == -1) {
- reportError(lineNumber, -1, QLatin1String("expected '.'"));
+ reportError(lineNumber, 0, QLatin1String("expected '.'"));
} else if (version.indexOf(QLatin1Char('.'), dotIndex + 1) != -1) {
- reportError(lineNumber, -1, QLatin1String("unexpected '.'"));
+ reportError(lineNumber, 0, QLatin1String("unexpected '.'"));
} else {
bool validVersionNumber = false;
const int majorVersion = parseInt(QStringRef(&version, 0, dotIndex), &validVersionNumber);
@@ -232,7 +232,7 @@ bool QQmlDirParser::parse(const QString &source)
}
}
} else {
- reportError(lineNumber, -1,
+ reportError(lineNumber, 0,
QString::fromUtf8("a component declaration requires two or three arguments, but %1 were provided").arg(sectionCount));
}
@@ -242,7 +242,7 @@ bool QQmlDirParser::parse(const QString &source)
return hasError();
}
-void QQmlDirParser::reportError(int line, int column, const QString &description)
+void QQmlDirParser::reportError(quint16 line, quint16 column, const QString &description)
{
QQmlError error;
error.setLine(line);