Commit dbe85a8a authored by Laurent Montel's avatar Laurent Montel
Browse files

Make it compile against qt6

parent 05a2eb9e
Pipeline #150548 passed with stage
in 54 seconds
......@@ -45,7 +45,7 @@ include(KDEGitCommitHooks)
# Qt
set (CMAKE_AUTOMOC ON)
find_package (
Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED
Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED
COMPONENTS
Core
DBus
......
......@@ -47,7 +47,7 @@ QList<QAction *> PlasmaVaultFileItemAction::actions(const KFileItemListPropertie
auto fileItem = fileItemInfos.urlList()[0].toLocalFile();
auto createAction = [this](const QIcon &icon, const QString &name, QString command, QString device, QWidget *parentWidget) {
QAction *action = new QAction(icon, name, parentWidget);
QAction *action = new QAction(icon, name, this);
connect(action, &QAction::triggered, this, [command, device]() {
auto method = QDBusMessage::createMethodCall("org.kde.kded5", "/modules/plasmavault", "org.kde.plasmavault", command);
......
......@@ -13,9 +13,10 @@
#include <QUrl>
#include <QPointer>
#include <KSharedConfig>
#include <KConfig>
#include <KConfigGroup>
#include <KSharedConfig>
#include <QRegularExpression>
#include <processcore/process.h>
#include <processcore/processes.h>
......@@ -498,9 +499,7 @@ FutureResult<> Vault::close()
// based on ksolidnotify.cpp
QStringList blockApps;
const auto &pidList =
result.split(QRegExp(QStringLiteral("\\s+")),
Qt::SkipEmptyParts);
const auto &pidList = result.split(QRegularExpression(QStringLiteral("\\s+")), Qt::SkipEmptyParts);
if (pidList.isEmpty()) {
d->updateMessage(i18n("Unable to close the vault because an application is using it"));
......@@ -555,9 +554,7 @@ FutureResult<> Vault::forceClose()
| onSuccess([] (const QString &result) {
// based on ksolidnotify.cpp
const auto &pidList =
result.split(QRegExp(QStringLiteral("\\s+")),
Qt::SkipEmptyParts);
const auto &pidList = result.split(QRegularExpression(QStringLiteral("\\s+")), Qt::SkipEmptyParts);
KSysGuard::Processes procs;
......
......@@ -101,7 +101,7 @@ PlasmaVault::Vault::Payload CompoundDialogModule::fields() const
PlasmaVault::Vault::Payload result;
for (const auto &child : m_children) {
result.unite(child->fields());
result.insert(child->fields());
}
return result;
......
......@@ -117,7 +117,7 @@ public:
qDebug() << "Getting the data";
for (const auto *module : currentModuleDialogs) {
qDebug() << "Data: " << module->fields();
collectedPayload.unite(module->fields());
collectedPayload.insert(module->fields());
}
const auto name = collectedPayload[KEY_NAME].toString();
......
......@@ -103,7 +103,7 @@ public:
auto collectedPayload = firstStepModule->fields();
for (const auto *module : currentStepModules) {
collectedPayload.unite(module->fields());
collectedPayload.insert(module->fields());
}
const auto name = collectedPayload[KEY_NAME].toString();
......
......@@ -60,7 +60,7 @@ public:
{
auto collectedPayload = firstStepModule->fields();
for (const auto *module : currentStepModules) {
collectedPayload.unite(module->fields());
collectedPayload.insert(module->fields());
}
const auto name = collectedPayload[KEY_NAME].toString();
......
......@@ -145,7 +145,7 @@ public:
// previously collected data to it
auto collectedPayload = firstStepModule == module ? PlasmaVault::Vault::Payload{} : firstStepModule->fields();
for (const auto *module : currentStepModules) {
collectedPayload.unite(module->fields());
collectedPayload.insert(module->fields());
}
currentModule->init(collectedPayload);
}
......
......@@ -13,8 +13,8 @@
#include "vaultsmodel.h"
VaultApplet::VaultApplet(QObject *parent, const QVariantList &args)
: Plasma::Applet(parent, args)
VaultApplet::VaultApplet(QObject *parent, const KPluginMetaData &data, const QVariantList &args)
: Plasma::Applet(parent, data, args)
{
}
......
......@@ -19,7 +19,7 @@ class VaultApplet : public Plasma::Applet
Q_PROPERTY(QObject *vaultsModel READ vaultsModel CONSTANT)
public:
explicit VaultApplet(QObject *parent, const QVariantList &args);
explicit VaultApplet(QObject *parent, const KPluginMetaData &data, const QVariantList &args);
~VaultApplet() override;
QObject *vaultsModel();
......
......@@ -360,8 +360,11 @@ bool SortedVaultsModelProxy::lessThan(const QModelIndex &left, const QModelIndex
{
const auto leftData = sourceModel()->data(left, VaultsModel::VaultName);
const auto rightData = sourceModel()->data(right, VaultsModel::VaultName);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
return leftData < rightData;
#else
return QPartialOrdering::Less == QVariant::compare(leftData, rightData);
#endif
}
bool SortedVaultsModelProxy::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const
......
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