]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinviewcontainer.cpp
port to KIO::createDefaultJobUiDelegate
[dolphin.git] / src / dolphinviewcontainer.cpp
index b76c6042432ed71c92d832945387c3cd13aed4e3..1930226d8f2442ba29e39ec519bd0b4f147ab53a 100644 (file)
 #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>
@@ -37,6 +42,7 @@
 #include <QGuiApplication>
 #include <QTimer>
 #include <QUrl>
+#include <QRegularExpression>
 
 // An overview of the widgets contained by this ViewContainer
 struct LayoutStructure {
@@ -757,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();