┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaurent Montel <[email protected]>2022-10-11 08:46:12 +0200
committerLaurent Montel <[email protected]>2022-10-11 08:46:12 +0200
commit40cc5f665d420071ba6e212c6191c2151f89a065 (patch)
tree34fe48f836ea3e5d4c99f8f752de3708da6a05e8 /src
parentd3617c06d47df25f70675e0f051fd7c7f38402bc (diff)
port to KIO::createDefaultJobUiDelegate
Diffstat (limited to 'src')
-rw-r--r--src/dolphinmainwindow.cpp9
-rw-r--r--src/dolphinviewcontainer.cpp11
2 files changed, 19 insertions, 1 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
index 496dad6c0..1eed9a016 100644
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -42,7 +42,12 @@
#include <KDualAction>
#include <KFileItemListProperties>
#include <KIO/CommandLauncherJob>
+#include <kio_version.h>
+#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
+#include <KIO/JobUiDelegateFactory>
+#else
#include <KIO/JobUiDelegate>
+#endif
#include <KIO/OpenFileManagerWindowJob>
#include <KIO/OpenUrlJob>
#include <KJobWidgets>
@@ -1241,7 +1246,11 @@ void DolphinMainWindow::handleUrl(const QUrl& url)
activeViewContainer()->setUrl(url);
} else {
m_lastHandleUrlOpenJob = new KIO::OpenUrlJob(url);
+#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
+ m_lastHandleUrlOpenJob->setUiDelegate(KIO::createDefaultJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, this));
+#else
m_lastHandleUrlOpenJob->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, this));
+#endif
m_lastHandleUrlOpenJob->setShowOpenOrExecuteDialog(true);
connect(m_lastHandleUrlOpenJob, &KIO::OpenUrlJob::mimeTypeFound, this,
diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp
index 66c1de3a9..1930226d8 100644
--- a/src/dolphinviewcontainer.cpp
+++ b/src/dolphinviewcontainer.cpp
@@ -24,7 +24,12 @@
#endif
#include <KFileItemActions>
#include <KFilePlacesModel>
+#include <kio_version.h>
+#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
+#include <KIO/JobUiDelegateFactory>
+#else
#include <KIO/JobUiDelegate>
+#endif
#include <KIO/OpenUrlJob>
#include <KLocalizedString>
#include <KMessageWidget>
@@ -758,7 +763,11 @@ void DolphinViewContainer::slotItemActivated(const KFileItem &item)
}
KIO::OpenUrlJob *job = new KIO::OpenUrlJob(item.targetUrl(), item.mimetype());
- job->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoWarningHandlingEnabled, this));
+#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
+ job->setUiDelegate(KIO::createDefaultJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, this));
+#else
+ job->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, this));
+#endif
job->setShowOpenOrExecuteDialog(true);
connect(job, &KIO::OpenUrlJob::finished, this, &DolphinViewContainer::slotOpenUrlFinished);
job->start();