Commit 877b8335 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port to KIO::OpenUrlJob

parent 95afb460
Pipeline #20863 passed with stage
in 6 minutes and 33 seconds
......@@ -35,6 +35,11 @@
#include <QMenu>
#include <KMessageBox>
#include <KProtocolManager>
#include <kio_version.h>
#if KIO_VERSION >= QT_VERSION_CHECK(5, 71, 0)
#include <KIO/JobUiDelegate>
#include <KIO/OpenUrlJob>
#endif
#include <KRun>
#include <KIO/Job>
#include <KIO/StoredTransferJob>
......@@ -284,10 +289,18 @@ void IncidenceAttachment::showAttachment(QListWidgetItem *item)
if (att.isUri()) {
openURL(QUrl(att.uri()));
} else {
#if KIO_VERSION < QT_VERSION_CHECK(5, 71, 0)
KRun::RunFlags flags;
flags |= KRun::DeleteTemporaryFiles;
flags |= KRun::RunExecutables;
KRun::runUrl(attitem->tempFileForAttachment(), att.mimeType(), nullptr, flags);
#else
KIO::OpenUrlJob *job = new KIO::OpenUrlJob(attitem->tempFileForAttachment(), att.mimeType());
job->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, mAttachmentView));
job->setDeleteTemporaryFile(true);
job->setRunExecutables(true);
job->start();
#endif
}
}
......
Markdown is supported
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