diff options
| author | Laurent Montel <[email protected]> | 2022-10-11 08:46:12 +0200 |
|---|---|---|
| committer | Laurent Montel <[email protected]> | 2022-10-11 08:46:12 +0200 |
| commit | 40cc5f665d420071ba6e212c6191c2151f89a065 (patch) | |
| tree | 34fe48f836ea3e5d4c99f8f752de3708da6a05e8 /src/dolphinviewcontainer.cpp | |
| parent | d3617c06d47df25f70675e0f051fd7c7f38402bc (diff) | |
port to KIO::createDefaultJobUiDelegate
Diffstat (limited to 'src/dolphinviewcontainer.cpp')
| -rw-r--r-- | src/dolphinviewcontainer.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
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(); |
