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

We depend against kf5.98

parent e88ab735
Pipeline #236409 passed with stage
in 13 minutes and 44 seconds
......@@ -25,12 +25,7 @@
#include <MessageCore/StringUtil>
#include <Akonadi/ItemFetchJob>
#include <kio_version.h>
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
#include <KIO/JobUiDelegateFactory>
#else
#include <KIO/JobUiDelegate>
#endif
#include <QIcon>
#include <QMenu>
......@@ -688,11 +683,7 @@ void AttachmentControllerBase::openWith(const KService::Ptr &offer)
// If offer is null, this will show the "open with" dialog
auto job = new KIO::ApplicationLauncherJob(offer);
job->setUrls({url});
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
job->setUiDelegate(KIO::createDefaultJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, d->wParent));
#else
job->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, d->wParent));
#endif
job->start();
connect(job, &KJob::result, this, [tempFile, job]() {
if (job->error()) {
......@@ -713,11 +704,7 @@ void AttachmentControllerBase::openAttachment(const AttachmentPart::Ptr &part)
}
tempFile->setPermissions(QFile::ReadUser);
auto job = new KIO::OpenUrlJob(QUrl::fromLocalFile(tempFile->fileName()), QString::fromLatin1(part->mimeType()));
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
job->setUiDelegate(KIO::createDefaultJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, d->wParent));
#else
job->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, d->wParent));
#endif
job->setDeleteTemporaryFile(true);
connect(job, &KIO::OpenUrlJob::result, this, [this, tempFile](KJob *job) {
if (job->error() == KIO::ERR_USER_CANCELED) {
......
......@@ -276,6 +276,7 @@ QString ConvertSnippetVariablesJob::getLastNameFromEmail(const QString &address)
for (const QString &str : lst) {
KMime::Types::Mailbox newAddress;
newAddress.fromUnicodeString(KEmailAddress::normalizeAddressesAndEncodeIdn(str));
qDebug() << "newAddress.name() " << newAddress.name();
const QString lastName = TemplateParser::Util::getLastNameFromEmail(newAddress.name());
if (!lastName.isEmpty()) {
resultName << lastName;
......
......@@ -49,12 +49,7 @@
#include <KEmailAddress>
#include <KFileItemActions>
#include <KIO/ApplicationLauncherJob>
#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 <KMessageBox>
......@@ -284,11 +279,7 @@ void ViewerPrivate::openAttachment(KMime::Content *node, const QUrl &url)
if (ct->mimeType() == "message/external-body") {
if (ct->hasParameter(QStringLiteral("url"))) {
auto job = new KIO::OpenUrlJob(url, QStringLiteral("text/html"));
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
job->setUiDelegate(KIO::createDefaultJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, q));
#else
job->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, q));
#endif
job->start();
return;
}
......@@ -689,11 +680,7 @@ void ViewerPrivate::attachmentOpenWith(KMime::Content *node, const KService::Ptr
auto job = new KIO::ApplicationLauncherJob(offer);
job->setUrls({url});
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
job->setUiDelegate(KIO::createDefaultJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, mMainWindow));
#else
job->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, mMainWindow));
#endif
job->start();
connect(job, &KJob::result, this, [url, job]() {
if (job->error()) {
......@@ -1945,11 +1932,7 @@ void ViewerPrivate::executeRunner(const QUrl &url)
{
if (!MessageViewer::Util::handleUrlWithQDesktopServices(url)) {
auto job = new KIO::OpenUrlJob(url);
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
job->setUiDelegate(KIO::createDefaultJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, viewer()));
#else
job->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, viewer()));
#endif
job->setRunExecutables(false);
job->start();
}
......@@ -2276,11 +2259,7 @@ void ViewerPrivate::slotExportHtmlPageSuccess(const QString &filename)
{
const QUrl url(QUrl::fromLocalFile(filename));
auto job = new KIO::OpenUrlJob(url, QStringLiteral("text/html"), q);
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
job->setUiDelegate(KIO::createDefaultJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, q));
#else
job->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, q));
#endif
job->setDeleteTemporaryFile(true);
job->start();
......
......@@ -6,12 +6,7 @@
#include "opensavedfilefolderwidget.h"
#include <kio_version.h>
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
#include <KIO/JobUiDelegateFactory>
#else
#include <KIO/JobUiDelegate>
#endif
#include <KIO/OpenFileManagerWindowJob>
#include <KIO/OpenUrlJob>
#include <KLocalizedString>
......@@ -75,11 +70,7 @@ void OpenSavedFileFolderWidget::slotOpenFile()
{
for (const auto &url : std::as_const(mUrls)) {
auto job = new KIO::OpenUrlJob(url);
#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->setDeleteTemporaryFile(true);
connect(job, &KIO::OpenUrlJob::result, this, [this](KJob *job) {
if (job->error() == KIO::ERR_USER_CANCELED) {
......
......@@ -101,7 +101,7 @@ QString TemplateParser::Util::getFirstNameFromEmail(const QString &str)
}
return res;
}
#include <QDebug>
QString TemplateParser::Util::getLastNameFromEmail(const QString &str)
{
// simple logic:
......@@ -134,6 +134,7 @@ QString TemplateParser::Util::getLastNameFromEmail(const QString &str)
}
}
}
qDebug() << " res " << res;
return res;
}
......
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