aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmllint
diff options
context:
space:
mode:
Diffstat (limited to 'tools/qmllint')
-rw-r--r--tools/qmllint/findunqualified.cpp2
-rw-r--r--tools/qmllint/main.cpp2
-rw-r--r--tools/qmllint/scopetree.cpp12
-rw-r--r--tools/qmllint/scopetree.h16
-rw-r--r--tools/qmllint/typedescriptionreader.h4
5 files changed, 18 insertions, 18 deletions
diff --git a/tools/qmllint/findunqualified.cpp b/tools/qmllint/findunqualified.cpp
index 187471125a..6155ea4637 100644
--- a/tools/qmllint/findunqualified.cpp
+++ b/tools/qmllint/findunqualified.cpp
@@ -123,7 +123,7 @@ QStringList completeImportPaths(const QString &uri, const QString &basePath, QTy
static const QLatin1Char Slash('/');
static const QLatin1Char Backslash('\\');
- const QVector<QStringRef> parts = uri.splitRef(QLatin1Char('.'), QString::SkipEmptyParts);
+ const QVector<QStringRef> parts = uri.splitRef(QLatin1Char('.'), Qt::SkipEmptyParts);
QStringList qmlDirPathsPaths;
// fully & partially versioned parts + 1 unversioned for each base path
diff --git a/tools/qmllint/main.cpp b/tools/qmllint/main.cpp
index 0a0e669e94..fa601986b2 100644
--- a/tools/qmllint/main.cpp
+++ b/tools/qmllint/main.cpp
@@ -78,7 +78,7 @@ static bool lint_file(const QString &filename, const bool silent, const bool war
const auto diagnosticMessages = parser.diagnosticMessages();
for (const QQmlJS::DiagnosticMessage &m : diagnosticMessages) {
qWarning().noquote() << QString::fromLatin1("%1:%2 : %3")
- .arg(filename).arg(m.line).arg(m.message);
+ .arg(filename).arg(m.loc.startLine).arg(m.message);
}
}
diff --git a/tools/qmllint/scopetree.cpp b/tools/qmllint/scopetree.cpp
index 2ca3ed9a67..e7e0113f35 100644
--- a/tools/qmllint/scopetree.cpp
+++ b/tools/qmllint/scopetree.cpp
@@ -62,7 +62,7 @@ void ScopeTree::insertJSIdentifier(const QString &id, QQmlJS::AST::VariableScope
}
void ScopeTree::insertSignalIdentifier(const QString &id, const MetaMethod &method,
- const QQmlJS::AST::SourceLocation &loc,
+ const QQmlJS::SourceLocation &loc,
bool hasMultilineHandlerBody)
{
Q_ASSERT(m_scopeType == ScopeType::QMLScope);
@@ -77,7 +77,7 @@ void ScopeTree::insertPropertyIdentifier(const MetaProperty &property)
}
void ScopeTree::addUnmatchedSignalHandler(const QString &handler,
- const QQmlJS::AST::SourceLocation &location)
+ const QQmlJS::SourceLocation &location)
{
m_unmatchedSignalHandlers.append(qMakePair(handler, location));
}
@@ -87,13 +87,13 @@ bool ScopeTree::isIdInCurrentScope(const QString &id) const
return isIdInCurrentQMlScopes(id) || isIdInCurrentJSScopes(id);
}
-void ScopeTree::addIdToAccessed(const QString &id, const QQmlJS::AST::SourceLocation &location) {
+void ScopeTree::addIdToAccessed(const QString &id, const QQmlJS::SourceLocation &location) {
m_currentFieldMember = new FieldMemberList {id, QString(), location, {}};
m_accessedIdentifiers.push_back(std::unique_ptr<FieldMemberList>(m_currentFieldMember));
}
void ScopeTree::accessMember(const QString &name, const QString &parentType,
- const QQmlJS::AST::SourceLocation &location)
+ const QQmlJS::SourceLocation &location)
{
Q_ASSERT(m_currentFieldMember);
auto *fieldMember = new FieldMemberList {name, parentType, location, {}};
@@ -115,7 +115,7 @@ bool ScopeTree::isVisualRootScope() const
class IssueLocationWithContext
{
public:
- IssueLocationWithContext(const QString &code, const QQmlJS::AST::SourceLocation &location) {
+ IssueLocationWithContext(const QString &code, const QQmlJS::SourceLocation &location) {
int before = std::max(0,code.lastIndexOf('\n', location.offset));
m_beforeText = code.midRef(before + 1, int(location.offset - (before + 1)));
m_issueText = code.midRef(location.offset, location.length);
@@ -440,7 +440,7 @@ const ScopeTree *ScopeTree::currentQMLScope() const
}
void ScopeTree::printContext(ColorOutput &colorOut, const QString &code,
- const QQmlJS::AST::SourceLocation &location) const
+ const QQmlJS::SourceLocation &location) const
{
IssueLocationWithContext issueLocationWithContext {code, location};
colorOut.write(issueLocationWithContext.beforeText().toString(), Normal);
diff --git a/tools/qmllint/scopetree.h b/tools/qmllint/scopetree.h
index f5d1155a49..63f4310bf8 100644
--- a/tools/qmllint/scopetree.h
+++ b/tools/qmllint/scopetree.h
@@ -68,7 +68,7 @@ enum class ScopeType
struct MethodUsage
{
MetaMethod method;
- QQmlJS::AST::SourceLocation loc;
+ QQmlJS::SourceLocation loc;
bool hasMultilineHandlerBody;
};
@@ -112,16 +112,16 @@ public:
void insertJSIdentifier(const QString &id, QQmlJS::AST::VariableScope scope);
void insertSignalIdentifier(const QString &id, const MetaMethod &method,
- const QQmlJS::AST::SourceLocation &loc, bool hasMultilineHandlerBody);
+ const QQmlJS::SourceLocation &loc, bool hasMultilineHandlerBody);
// inserts property as qml identifier as well as the corresponding
void insertPropertyIdentifier(const MetaProperty &prop);
void addUnmatchedSignalHandler(const QString &handler,
- const QQmlJS::AST::SourceLocation &location);
+ const QQmlJS::SourceLocation &location);
bool isIdInCurrentScope(const QString &id) const;
- void addIdToAccessed(const QString &id, const QQmlJS::AST::SourceLocation &location);
+ void addIdToAccessed(const QString &id, const QQmlJS::SourceLocation &location);
void accessMember(const QString &name, const QString &parentType,
- const QQmlJS::AST::SourceLocation &location);
+ const QQmlJS::SourceLocation &location);
void resetMemberScope();
bool isVisualRootScope() const;
@@ -174,7 +174,7 @@ private:
{
QString m_name;
QString m_parentType;
- QQmlJS::AST::SourceLocation m_location;
+ QQmlJS::SourceLocation m_location;
std::unique_ptr<FieldMemberList> m_child;
};
@@ -188,7 +188,7 @@ private:
std::vector<std::unique_ptr<FieldMemberList>> m_accessedIdentifiers;
FieldMemberList *m_currentFieldMember = nullptr;
- QVector<QPair<QString, QQmlJS::AST::SourceLocation>> m_unmatchedSignalHandlers;
+ QVector<QPair<QString, QQmlJS::SourceLocation>> m_unmatchedSignalHandlers;
QVector<ScopeTree::Ptr> m_childScopes;
ScopeTree *m_parentScope;
@@ -211,7 +211,7 @@ private:
bool isIdInjectedFromSignal(const QString &id) const;
const ScopeTree *currentQMLScope() const;
void printContext(ColorOutput &colorOut, const QString &code,
- const QQmlJS::AST::SourceLocation &location) const;
+ const QQmlJS::SourceLocation &location) const;
bool checkMemberAccess(
const QString &code,
FieldMemberList *members,
diff --git a/tools/qmllint/typedescriptionreader.h b/tools/qmllint/typedescriptionreader.h
index 5fcbe3abc9..48c33bee3c 100644
--- a/tools/qmllint/typedescriptionreader.h
+++ b/tools/qmllint/typedescriptionreader.h
@@ -90,8 +90,8 @@ private:
void readMetaObjectRevisions(QQmlJS::AST::UiScriptBinding *ast, const ScopeTree::Ptr &scope);
void readEnumValues(QQmlJS::AST::UiScriptBinding *ast, MetaEnum *metaEnum);
- void addError(const QQmlJS::AST::SourceLocation &loc, const QString &message);
- void addWarning(const QQmlJS::AST::SourceLocation &loc, const QString &message);
+ void addError(const QQmlJS::SourceLocation &loc, const QString &message);
+ void addWarning(const QQmlJS::SourceLocation &loc, const QString &message);
QString m_fileName;
QString m_source;