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

Port away from deprecated KIO code

parent 0ee2b2bc
Pipeline #220484 passed with stage
in 3 minutes and 52 seconds
......@@ -18,7 +18,12 @@
#include <KActionCollection>
#include <KIO/Job>
#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 <KIO/StoredTransferJob>
#include <KJobWidgets>
......@@ -270,7 +275,11 @@ void IncidenceAttachment::showAttachment(QListWidgetItem *item)
openURL(QUrl(att.uri()));
} else {
auto job = new KIO::OpenUrlJob(attitem->tempFileForAttachment(), att.mimeType());
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
job->setUiDelegate(KIO::createDefaultJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, mAttachmentView));
#else
job->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, mAttachmentView));
#endif
job->setDeleteTemporaryFile(true);
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