diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/qdoc/.prev_CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/qdoc/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/qdoc/importrec.h | 61 | ||||
-rw-r--r-- | src/qdoc/node.cpp | 2 | ||||
-rw-r--r-- | src/qdoc/node.h | 20 | ||||
-rw-r--r-- | src/qdoc/qdoc.pro | 1 | ||||
-rw-r--r-- | src/qdoc/qdocdatabase.cpp | 6 |
7 files changed, 69 insertions, 23 deletions
diff --git a/src/qdoc/.prev_CMakeLists.txt b/src/qdoc/.prev_CMakeLists.txt index 61dcf2b33..7cec47f4a 100644 --- a/src/qdoc/.prev_CMakeLists.txt +++ b/src/qdoc/.prev_CMakeLists.txt @@ -29,6 +29,7 @@ qt_add_tool(qdoc generator.cpp generator.h helpprojectwriter.cpp helpprojectwriter.h htmlgenerator.cpp htmlgenerator.h + importrec.h jscodemarker.cpp jscodemarker.h location.cpp location.h loggingcategory.h diff --git a/src/qdoc/CMakeLists.txt b/src/qdoc/CMakeLists.txt index 6a3841d67..e787c8bce 100644 --- a/src/qdoc/CMakeLists.txt +++ b/src/qdoc/CMakeLists.txt @@ -30,6 +30,7 @@ qt_add_tool(qdoc generator.cpp generator.h helpprojectwriter.cpp helpprojectwriter.h htmlgenerator.cpp htmlgenerator.h + importrec.h jscodemarker.cpp jscodemarker.h location.cpp location.h loggingcategory.h diff --git a/src/qdoc/importrec.h b/src/qdoc/importrec.h new file mode 100644 index 000000000..baab81452 --- /dev/null +++ b/src/qdoc/importrec.h @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the tools applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef IMPORTREC_H +#define IMPORTREC_H + +#include <QtCore/qglobal.h> +#include <QtCore/qstring.h> + +QT_BEGIN_NAMESPACE + +struct ImportRec +{ + QString m_moduleName; + QString m_majorMinorVersion; + QString m_importAsName; + QString m_importUri; // subdirectory of module directory + + ImportRec(const QString &name, const QString &version, const QString &importId, + const QString &importUri) + : m_moduleName(name), + m_majorMinorVersion(version), + m_importAsName(importId), + m_importUri(importUri) + { + } + QString &name() { return m_moduleName; } + QString &version() { return m_majorMinorVersion; } + QString &importId() { return m_importAsName; } + QString &importUri() { return m_importUri; } + bool isEmpty() const { return m_moduleName.isEmpty(); } +}; + +QT_END_NAMESPACE + +#endif // IMPORTREC_H diff --git a/src/qdoc/node.cpp b/src/qdoc/node.cpp index 9ac7a48dd..f803f2846 100644 --- a/src/qdoc/node.cpp +++ b/src/qdoc/node.cpp @@ -2818,7 +2818,7 @@ void Aggregate::resolveQmlInheritance() for (int i = 0; i < imports.size(); ++i) { base = QDocDatabase::qdocDB()->findQmlType(imports[i], type->qmlBaseName()); if (base && (base != type)) { - if (base->logicalModuleVersion()[0] != imports[i].version_[0]) + if (base->logicalModuleVersion()[0] != imports[i].m_majorMinorVersion[0]) base = nullptr; // Safeguard for QTBUG-53529 break; } diff --git a/src/qdoc/node.h b/src/qdoc/node.h index 0e0ac9bd9..6c1173504 100644 --- a/src/qdoc/node.h +++ b/src/qdoc/node.h @@ -32,6 +32,7 @@ #include "access.h" #include "doc.h" #include "enumitem.h" +#include "importrec.h" #include "parameters.h" #include "relatedclass.h" #include "usingclause.h" @@ -694,25 +695,6 @@ private: QStringList images_; }; -struct ImportRec -{ - QString name_; // module name - QString version_; // <major> . <minor> - QString importId_; // "as" name - QString importUri_; // subdirectory of module directory - - ImportRec(const QString &name, const QString &version, const QString &importId, - const QString &importUri) - : name_(name), version_(version), importId_(importId), importUri_(importUri) - { - } - QString &name() { return name_; } - QString &version() { return version_; } - QString &importId() { return importId_; } - QString &importUri() { return importUri_; } - bool isEmpty() const { return name_.isEmpty(); } -}; - typedef QVector<ImportRec> ImportList; class QmlTypeNode : public Aggregate diff --git a/src/qdoc/qdoc.pro b/src/qdoc/qdoc.pro index d274bb996..da51394c5 100644 --- a/src/qdoc/qdoc.pro +++ b/src/qdoc/qdoc.pro @@ -52,6 +52,7 @@ HEADERS += access.h \ generator.h \ helpprojectwriter.h \ htmlgenerator.h \ + importrec.h \ location.h \ loggingcategory.h \ macro.h \ diff --git a/src/qdoc/qdocdatabase.cpp b/src/qdoc/qdocdatabase.cpp index ceaa7e574..91577db2c 100644 --- a/src/qdoc/qdocdatabase.cpp +++ b/src/qdoc/qdocdatabase.cpp @@ -827,10 +827,10 @@ QmlTypeNode *QDocDatabase::findQmlType(const ImportRec &import, const QString &n QStringList dotSplit; dotSplit = name.split(QLatin1Char('.')); QString qmName; - if (import.importUri_.isEmpty()) - qmName = import.name_; + if (import.m_importUri.isEmpty()) + qmName = import.m_moduleName; else - qmName = import.importUri_; + qmName = import.m_importUri; for (int i = 0; i < dotSplit.size(); ++i) { QString qualifiedName = qmName + "::" + dotSplit[i]; QmlTypeNode *qcn = forest_.lookupQmlType(qualifiedName); |