Commit 841138e6 authored by Laurent Montel's avatar Laurent Montel
Browse files

Adapt to build against qt6

parent 8118e8d9
......@@ -5,14 +5,12 @@ set(PROJECT_VERSION "5.24.80")
set(PROJECT_VERSION_MAJOR 5)
set(QT_MIN_VERSION "5.15.0")
set(KF5_MIN_VERSION "5.86")
set(KF5_MIN_VERSION "5.90")
set(KDE_COMPILERSETTINGS_LEVEL "5.82")
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Qml Quick Widgets)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS CoreAddons I18n Declarative ItemModels Service Plasma Runner)
include(FeatureSummary)
include(KDEInstallDirs)
......@@ -23,6 +21,9 @@ include(GenerateExportHeader)
include(KDEClangFormat)
include(KDEGitCommitHooks)
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Qml Quick Widgets)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS CoreAddons I18n Declarative ItemModels Service Plasma Runner)
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050c00)
add_definitions(-DQT_NO_FOREACH -DQT_NO_KEYWORDS)
......
......@@ -261,8 +261,11 @@ void SourcesModel::slotMatchesChanged(const QList<Plasma::QueryMatch> &l)
// that do not
// The rest are given the same preference as given by the runners.
const QString simplifiedQuery = m_queryString.simplified();
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
const auto words = simplifiedQuery.splitRef(QLatin1Char(' '), Qt::SkipEmptyParts);
#else
const auto words = QStringView(simplifiedQuery).split(QLatin1Char(' '), Qt::SkipEmptyParts);
#endif
QSet<QString> higherTypes;
for (const QString &type : qAsConst(m_types)) {
const TypeData td = m_matches.value(type);
......
find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Test)
find_package(Qt${QT_MAJOR_VERSION} ${REQUIRED_QT_VERSION} CONFIG REQUIRED Test)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/..
)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment