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>
This commit is contained in:
Marco Bubke
2023-04-26 17:52:01 +02:00
parent 5bf1b598c1
commit a6ba2354cc
8 changed files with 16 additions and 30 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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;

View File

@@ -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

View File

@@ -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;

View File

@@ -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
};

View File

@@ -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