Commit 2b34a8bf authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Port away from deprecated KIO::JobUiDelegate ctor

parent 10d665c6
Pipeline #243537 passed with stage
in 3 minutes and 59 seconds
......@@ -8,7 +8,7 @@ set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE
project(ark VERSION ${RELEASE_SERVICE_VERSION})
set(QT_MIN_VERSION 5.15.2)
set(KF5_MIN_VERSION 5.90.0)
set(KF5_MIN_VERSION 5.98.0)
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
......
......@@ -14,6 +14,7 @@
#include <KIO/JobTracker>
#include <KIO/JobUiDelegate>
#include <KIO/OpenUrlJob>
#include <KIO/JobUiDelegateFactory>
#include <KLocalizedString>
#include <KMessageBox>
#include <KWidgetJobTracker>
......@@ -154,7 +155,7 @@ void BatchExtract::slotResult(KJob *job)
const QString path = QDir::cleanPath(destinationFolder());
const QUrl destination(QUrl::fromLocalFile(path));
KIO::OpenUrlJob *job = new KIO::OpenUrlJob(destination, QStringLiteral("inode/directory"));
job->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, nullptr));
job->setUiDelegate(KIO::createDefaultJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, nullptr));
job->start();
}
......
......@@ -14,6 +14,7 @@
#include <KApplicationTrader>
#include <KIO/ApplicationLauncherJob>
#include <KIO/JobUiDelegate>
#include <KIO/JobUiDelegateFactory>
#include <KLocalizedString>
#include <KMessageBox>
#include <KMimeTypeTrader>
......@@ -78,7 +79,7 @@ void ArkViewer::openExternalViewer(const KService::Ptr viewer, const QString& fi
const QList<QUrl> fileUrlList = {QUrl::fromLocalFile(fileName)};
KIO::ApplicationLauncherJob *job = new KIO::ApplicationLauncherJob(viewer);
job->setUrls(fileUrlList);
job->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, nullptr));
job->setUiDelegate(KIO::createDefaultJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, nullptr));
// The temporary file will be removed when the viewer application exits.
job->setRunFlags(KIO::ApplicationLauncherJob::DeleteTemporaryFiles);
job->start();
......
......@@ -37,6 +37,7 @@
#include <KIO/Job>
#include <KIO/JobUiDelegate>
#include <KIO/OpenUrlJob>
#include <KIO/JobUiDelegateFactory>
#include <KJobWidgets>
#include <KIO/StatJob>
#include <KMessageBox>
......@@ -1048,11 +1049,11 @@ void Part::slotOpenExtractedEntry(KJob *job)
// trigger the openWith dialog
KIO::ApplicationLauncherJob *job = new KIO::ApplicationLauncherJob();
job->setUrls({url});
job->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, widget()));
job->setUiDelegate(KIO::createDefaultJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, widget()));
job->start();
} else {
KIO::OpenUrlJob *job = new KIO::OpenUrlJob(url);
job->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, widget()));
job->setUiDelegate(KIO::createDefaultJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, widget()));
job->start();
}
} else if (job->error() != KJob::KilledJobError) {
......@@ -1296,7 +1297,7 @@ void Part::slotExtractionDone(KJob* job)
qCDebug(ARK) << "Shall open URL" << destinationDirectory;
KIO::OpenUrlJob *job = new KIO::OpenUrlJob(destinationDirectory, QStringLiteral("inode/directory"));
job->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, widget()));
job->setUiDelegate(KIO::createDefaultJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, widget()));
job->start();
}
......
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