Commit 3b8a994d authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Now we depend against kf5.71

parent 291769b7
Pipeline #23594 canceled with stage
...@@ -34,12 +34,8 @@ ...@@ -34,12 +34,8 @@
#include <KLocalizedString> #include <KLocalizedString>
#include <QMenu> #include <QMenu>
#include <KMessageBox> #include <KMessageBox>
#include <kio_version.h>
#if KIO_VERSION >= QT_VERSION_CHECK(5, 71, 0)
#include <KIO/JobUiDelegate> #include <KIO/JobUiDelegate>
#include <KIO/OpenUrlJob> #include <KIO/OpenUrlJob>
#endif
#include <KRun>
#include <KIO/ApplicationLauncherJob> #include <KIO/ApplicationLauncherJob>
#include <KIO/JobUiDelegate> #include <KIO/JobUiDelegate>
#include <KShortcutsDialog> #include <KShortcutsDialog>
...@@ -51,6 +47,7 @@ ...@@ -51,6 +47,7 @@
#include <KRecentFilesAction> #include <KRecentFilesAction>
#include <KConfigGroup> #include <KConfigGroup>
#include <KRun>
#include <QContextMenuEvent> #include <QContextMenuEvent>
#include <QDir> #include <QDir>
...@@ -257,16 +254,10 @@ void KTNEFMain::viewFile() ...@@ -257,16 +254,10 @@ void KTNEFMain::viewFile()
} else { } else {
qCDebug(KTNEFAPPS_LOG) << "Mime type from attachment object: " << mimename; qCDebug(KTNEFAPPS_LOG) << "Mime type from attachment object: " << mimename;
} }
#if KIO_VERSION < QT_VERSION_CHECK(5, 71, 0)
KRun::RunFlags flags;
flags |= KRun::DeleteTemporaryFiles;
KRun::runUrl(url, mimename, this, flags);
#else
KIO::OpenUrlJob *job = new KIO::OpenUrlJob(url, mimename); KIO::OpenUrlJob *job = new KIO::OpenUrlJob(url, mimename);
job->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, this)); job->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, this));
job->setDeleteTemporaryFile(true); job->setDeleteTemporaryFile(true);
job->start(); job->start();
#endif
} else { } else {
KMessageBox::information( KMessageBox::information(
this, this,
...@@ -517,17 +508,10 @@ void KTNEFMain::slotShowMessageText() ...@@ -517,17 +508,10 @@ void KTNEFMain::slotShowMessageText()
tmpFile->setPermissions(QFile::ReadUser); tmpFile->setPermissions(QFile::ReadUser);
tmpFile->write(rtf.toLocal8Bit()); tmpFile->write(rtf.toLocal8Bit());
tmpFile->close(); tmpFile->close();
#if KIO_VERSION < QT_VERSION_CHECK(5, 71, 0)
KRun::RunFlags flags;
flags |= KRun::DeleteTemporaryFiles;
KRun::runUrl(QUrl::fromLocalFile(tmpFile->fileName()), QStringLiteral("text/rtf"), this, flags);
#else
KIO::OpenUrlJob *job = new KIO::OpenUrlJob(QUrl::fromLocalFile(tmpFile->fileName()), QStringLiteral("text/rtf")); KIO::OpenUrlJob *job = new KIO::OpenUrlJob(QUrl::fromLocalFile(tmpFile->fileName()), QStringLiteral("text/rtf"));
job->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, this)); job->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, this));
job->setDeleteTemporaryFile(true); job->setDeleteTemporaryFile(true);
job->start(); job->start();
#endif
delete tmpFile; delete tmpFile;
} else { } else {
KMessageBox::error( KMessageBox::error(
......
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