diff options
author | Marco Bubke <marco.bubke@qt.io> | 2023-04-26 17:52:01 +0200 |
---|---|---|
committer | Marco Bubke <marco.bubke@qt.io> | 2023-05-11 09:12:13 +0000 |
commit | a6ba2354ccaf5858b7fe681c51ffdd33c33d85c4 (patch) | |
tree | bae61c7c102ba3cc595ca2f44c1bf53e7564a5eb | |
parent | 5bf1b598c153fdab3ab95c66ce132482ec622add (diff) | |
download | qt-creator-a6ba2354ccaf5858b7fe681c51ffdd33c33d85c4.tar.gz |
QmlDesigner: Cleanup the Qt conditions
We have now demand QmlPrivate, QmlDomPrivate and QmlCompilerPrivate.
Change-Id: I77fa5b506c827b9ba2f7ea18e3ffdd176c1871ec
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
8 files changed, 16 insertions, 30 deletions
diff --git a/src/plugins/qmldesigner/CMakeLists.txt b/src/plugins/qmldesigner/CMakeLists.txt index be90de8ae2..992f46b68b 100644 --- a/src/plugins/qmldesigner/CMakeLists.txt +++ b/src/plugins/qmldesigner/CMakeLists.txt @@ -36,7 +36,7 @@ extend_qtc_library(QmlDesignerUtils ) add_qtc_library(QmlDesignerCore STATIC - CONDITION Qt6_VERSION VERSION_GREATER_EQUAL 6.4.3 + CONDITION Qt6_VERSION VERSION_GREATER_EQUAL 6.4.3 AND TARGET Qt6::QmlPrivate AND TARGET Qt6::QmlDomPrivate AND TARGET Qt6::QmlCompilerPrivate EXCLUDE_FROM_INSTALL PROPERTIES SKIP_AUTOUIC ON DEPENDS @@ -47,6 +47,8 @@ add_qtc_library(QmlDesignerCore STATIC Qt::Widgets Qt::Qml Qt::QmlPrivate + Qt6::QmlDomPrivate + Qt6::QmlCompilerPrivate Core ProjectExplorer QmakeProjectManager @@ -87,10 +89,8 @@ extend_qtc_library(QmlDesignerCore ) extend_qtc_library(QmlDesignerCore - CONDITION TARGET Qt6::QmlDomPrivate AND TARGET Qt6::QmlCompilerPrivate - AND Qt6_VERSION VERSION_LESS 6.6.0 - DEPENDS Qt6::QmlDomPrivate Qt6::QmlCompilerPrivate - PUBLIC_DEFINES QDS_HAS_QMLPRIVATE + CONDITION Qt6_VERSION VERSION_GREATER_EQUAL 6.5.0 AND Qt6_VERSION VERSION_LESS 6.6.0 + PUBLIC_DEFINES QDS_BUILD_QMLPARSER ) extend_qtc_library(QmlDesignerCore diff --git a/src/plugins/qmldesigner/designercore/projectstorage/modulescanner.cpp b/src/plugins/qmldesigner/designercore/projectstorage/modulescanner.cpp index c9c7fd8d61..c458d8376b 100644 --- a/src/plugins/qmldesigner/designercore/projectstorage/modulescanner.cpp +++ b/src/plugins/qmldesigner/designercore/projectstorage/modulescanner.cpp @@ -3,9 +3,7 @@ #include "modulescanner.h" -#ifdef QDS_HAS_QMLPRIVATE #include <private/qqmldirparser_p.h> -#endif #include <QDirIterator> #include <QFile> @@ -15,7 +13,6 @@ namespace QmlDesigner { namespace { -#ifdef QDS_HAS_QMLPRIVATE std::optional<QString> contentAsQString(const QString &filePath) { QFile file{filePath}; @@ -57,7 +54,6 @@ QString createCoreVersion(QStringView moduleName, ExternalDependenciesInterface return {}; } -#endif } // namespace void ModuleScanner::scan(const QStringList &modulePaths) @@ -68,7 +64,6 @@ void ModuleScanner::scan(const QStringList &modulePaths) void ModuleScanner::scan([[maybe_unused]] std::string_view modulePath) { -#ifdef QDS_HAS_QMLPRIVATE if (modulePath.empty()) return; @@ -110,7 +105,6 @@ void ModuleScanner::scan([[maybe_unused]] std::string_view modulePath) std::sort(m_modules.begin(), m_modules.end()); m_modules.erase(std::unique(m_modules.begin(), m_modules.end()), m_modules.end()); -#endif } } // namespace QmlDesigner diff --git a/src/plugins/qmldesigner/designercore/projectstorage/modulescanner.h b/src/plugins/qmldesigner/designercore/projectstorage/modulescanner.h index f450192087..2083d1d48c 100644 --- a/src/plugins/qmldesigner/designercore/projectstorage/modulescanner.h +++ b/src/plugins/qmldesigner/designercore/projectstorage/modulescanner.h @@ -22,11 +22,9 @@ public: ModuleScanner([[maybe_unused]] SkipFunction skip, [[maybe_unused]] VersionScanning versionScanning, [[maybe_unused]] ExternalDependenciesInterface &externalDependencies) -#ifdef QDS_HAS_QMLPRIVATE : m_skip{std::move(skip)} , m_versionScanning{versionScanning} , m_externalDependencies{externalDependencies} -#endif { m_modules.reserve(128); } @@ -40,11 +38,9 @@ private: private: Imports m_modules; -#ifdef QDS_HAS_QMLPRIVATE SkipFunction m_skip; VersionScanning m_versionScanning; ExternalDependenciesInterface &m_externalDependencies; -#endif }; } // namespace QmlDesigner diff --git a/src/plugins/qmldesigner/designercore/projectstorage/qmldocumentparser.cpp b/src/plugins/qmldesigner/designercore/projectstorage/qmldocumentparser.cpp index b530dc84e3..3e9ac43ded 100644 --- a/src/plugins/qmldesigner/designercore/projectstorage/qmldocumentparser.cpp +++ b/src/plugins/qmldesigner/designercore/projectstorage/qmldocumentparser.cpp @@ -10,7 +10,7 @@ #include <sqlitedatabase.h> -#ifdef QDS_HAS_QMLPRIVATE +#ifdef QDS_BUILD_QMLPARSER #include <private/qqmldomtop_p.h> #endif @@ -19,7 +19,7 @@ namespace QmlDesigner { -#ifdef QDS_HAS_QMLPRIVATE +#ifdef QDS_BUILD_QMLPARSER namespace QmlDom = QQmlJS::Dom; diff --git a/src/plugins/qmldesigner/designercore/projectstorage/qmldocumentparser.h b/src/plugins/qmldesigner/designercore/projectstorage/qmldocumentparser.h index 87fb03ddab..2896d54ebe 100644 --- a/src/plugins/qmldesigner/designercore/projectstorage/qmldocumentparser.h +++ b/src/plugins/qmldesigner/designercore/projectstorage/qmldocumentparser.h @@ -18,7 +18,7 @@ public: using ProjectStorage = QmlDesigner::ProjectStorage<Sqlite::Database>; using PathCache = QmlDesigner::SourcePathCache<ProjectStorage, NonLockingMutex>; -#ifdef QDS_HAS_QMLPRIVATE +#ifdef QDS_BUILD_QMLPARSER QmlDocumentParser(ProjectStorage &storage, PathCache &pathCache) : m_storage{storage} , m_pathCache{pathCache} @@ -35,7 +35,7 @@ public: private: // m_pathCache and m_storage are only used when compiled for QDS -#ifdef QDS_HAS_QMLPRIVATE +#ifdef QDS_BUILD_QMLPARSER ProjectStorage &m_storage; PathCache &m_pathCache; #endif diff --git a/src/plugins/qmldesigner/designercore/projectstorage/qmltypesparser.cpp b/src/plugins/qmldesigner/designercore/projectstorage/qmltypesparser.cpp index 46613b015a..c858076aa1 100644 --- a/src/plugins/qmldesigner/designercore/projectstorage/qmltypesparser.cpp +++ b/src/plugins/qmldesigner/designercore/projectstorage/qmltypesparser.cpp @@ -7,7 +7,7 @@ #include <sqlitedatabase.h> -#ifdef HasQQmlJSTypeDescriptionReader +#ifdef QDS_BUILD_QMLPARSER #include <private/qqmldomtop_p.h> #include <private/qqmljstypedescriptionreader_p.h> #endif @@ -19,7 +19,7 @@ namespace QmlDesigner { -#ifdef HasQQmlJSTypeDescriptionReader +#ifdef QDS_BUILD_QMLPARSER namespace QmlDom = QQmlJS::Dom; diff --git a/src/plugins/qmldesigner/designercore/projectstorage/qmltypesparser.h b/src/plugins/qmldesigner/designercore/projectstorage/qmltypesparser.h index 0af85be757..c1d9a3a0d4 100644 --- a/src/plugins/qmldesigner/designercore/projectstorage/qmltypesparser.h +++ b/src/plugins/qmldesigner/designercore/projectstorage/qmltypesparser.h @@ -10,10 +10,6 @@ namespace Sqlite { class Database; } -#if defined(QDS_HAS_QMLPRIVATE) && QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) -#define HasQQmlJSTypeDescriptionReader -#endif - namespace QmlDesigner { template<typename Database> @@ -27,7 +23,7 @@ class QmlTypesParser : public QmlTypesParserInterface public: using ProjectStorage = QmlDesigner::ProjectStorage<Sqlite::Database>; -#ifdef HasQQmlJSTypeDescriptionReader +#ifdef QDS_BUILD_QMLPARSER QmlTypesParser(ProjectStorage &storage) : m_storage{storage} {} @@ -41,7 +37,7 @@ public: const Storage::Synchronization::ProjectData &projectData) override; private: -#ifdef HasQQmlJSTypeDescriptionReader +#ifdef QDS_BUILD_QMLPARSER ProjectStorage &m_storage; #endif }; diff --git a/tests/unit/unittest/CMakeLists.txt b/tests/unit/unittest/CMakeLists.txt index 5d53959a7b..3c8a565243 100644 --- a/tests/unit/unittest/CMakeLists.txt +++ b/tests/unit/unittest/CMakeLists.txt @@ -346,7 +346,7 @@ extend_qtc_test(unittest ) extend_qtc_test(unittest - CONDITION TARGET Qt6::QmlDomPrivate AND TARGET Qt6::QmlCompilerPrivate AND Qt6_VERSION VERSION_GREATER_EQUAL 6.5.0 + CONDITION TARGET Qt6::QmlDomPrivate AND TARGET Qt6::QmlCompilerPrivate AND Qt6_VERSION VERSION_GREATER_EQUAL 6.5.0 AND Qt6_VERSION VERSION_LESS 6.6.0 DEPENDS Qt6::QmlDomPrivate Qt6::QmlCompilerPrivate SOURCES qmldocumentparser-test.cpp @@ -354,10 +354,10 @@ extend_qtc_test(unittest ) extend_qtc_test(unittest - CONDITION TARGET Qt6::QmlDomPrivate AND TARGET Qt6::QmlCompilerPrivate AND Qt6_VERSION VERSION_GREATER_EQUAL 6.5.0 + CONDITION TARGET Qt6::QmlDomPrivate AND TARGET Qt6::QmlCompilerPrivate AND Qt6_VERSION VERSION_GREATER_EQUAL 6.5.0 AND Qt6_VERSION VERSION_LESS 6.6.0 SOURCES_PREFIX "${QmlDesignerDir}/designercore" DEPENDS Qt6::QmlDomPrivate Qt6::QmlCompilerPrivate - DEFINES QDS_HAS_QMLPRIVATE + DEFINES QDS_BUILD_QMLPARSER SOURCES projectstorage/qmldocumentparser.cpp projectstorage/qmldocumentparser.h projectstorage/qmltypesparser.cpp projectstorage/qmltypesparser.h |