Commit 1eb9c86f authored by Volker Krause's avatar Volker Krause
Browse files

Add the last missing bits for building against Qt6

Also enables the Qt6 Linux CI.
parent ae73bd15
Pipeline #146284 passed with stage
in 1 minute and 34 seconds
......@@ -4,3 +4,4 @@
include:
- https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/linux.yml
- https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/freebsd.yml
- https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/linux-qt6.yml
......@@ -7,7 +7,7 @@ set(PROJECT_VERSION_MAJOR 5)
# check with non-Plasma consumers (e.g. KDevelop) before bumping these versions to make sure the KDE CI does not break
set(QT_MIN_VERSION "5.15.0")
set(KF5_MIN_VERSION "5.86")
set(KF5_MIN_VERSION "5.91")
set(KDE_COMPILERSETTINGS_LEVEL "5.82")
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
......@@ -23,6 +23,7 @@ include(ECMAddTests)
include(ECMInstallIcons)
include(ECMSetupVersion)
include(ECMQtDeclareLoggingCategory)
include(ECMDeprecationSettings)
include(CMakePackageConfigHelpers)
include(CheckIncludeFiles)
......@@ -131,6 +132,10 @@ add_feature_info(DESIGNERPLUGIN ${BUILD_DESIGNERPLUGIN} "Build plugin for Qt Des
option(ENABLE_KAUTH_HELPER "Build and install ksysguardprocesslist_helper KAuth helper" ON)
add_feature_info(KAUTH_HELPER ${ENABLE_KAUTH_HELPER} "Build and install ksysguardprocesslist_helper KAuth helper")
ecm_set_disabled_deprecation_versions(
QT 5.15.0
)
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055B00)
add_definitions(-DKF_DEPRECATED_WARNINGS_SINCE=0x060000)
add_definitions(-DQT_USE_QSTRINGBUILDER)
......
......@@ -21,7 +21,7 @@
bool ProcessFilter::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
{
if ((mFilter == AllProcesses || mFilter == AllProcessesInTreeForm) && filterRegExp().isEmpty())
if ((mFilter == AllProcesses || mFilter == AllProcessesInTreeForm) && filterRegularExpression().pattern().isEmpty())
return true; // Shortcut for common case
ProcessModel *model = static_cast<ProcessModel *>(sourceModel());
......@@ -91,17 +91,17 @@ bool ProcessFilter::filterAcceptsRow(int source_row, const QModelIndex &source_p
}
if (accepted) {
if (filterRegExp().isEmpty())
if (filterRegularExpression().pattern().isEmpty())
return true;
// Allow the user to search by PID
if (QString::number(process->pid()).contains(filterRegExp()))
if (QString::number(process->pid()).contains(filterRegularExpression()))
return true;
// None of our tests have rejected it. Pass it on to qsortfilterproxymodel's filter
if (QSortFilterProxyModel::filterAcceptsRow(source_row, source_parent))
return true;
auto strings = filterRegExp().pattern().split(QLatin1Char(','), Qt::SkipEmptyParts);
auto strings = filterRegularExpression().pattern().split(QLatin1Char(','), Qt::SkipEmptyParts);
for (auto string : strings) {
string = string.trimmed();
if (process->name().indexOf(string) != -1 || QString::number(process->pid()).indexOf(string) != -1) {
......
......@@ -1405,9 +1405,9 @@ QVariant ProcessModel::data(const QModelIndex &index, int role) const
KSysGuard::Process *process = reinterpret_cast<KSysGuard::Process *>(index.internalPointer());
const QVariant value = d->mExtraAttributes[attr]->data(process);
if (value.canConvert(QMetaType::LongLong) && static_cast<QMetaType::Type>(value.type()) != QMetaType::QString) {
return Qt::AlignRight + Qt::AlignVCenter;
return (int)(Qt::AlignRight | Qt::AlignVCenter);
}
return Qt::AlignLeft + Qt::AlignVCenter;
return (int)(Qt::AlignLeft | Qt::AlignVCenter);
}
}
return QVariant();
......
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