Commit 549bd98b authored by Laurent Montel's avatar Laurent Montel
Browse files

Port away from deprecated KIO code

parent 4de777e3
Pipeline #220488 passed with stage
in 5 minutes and 41 seconds
......@@ -5,7 +5,12 @@
*/
#include "sievehelpbutton.h"
#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 <QIcon>
......@@ -27,7 +32,11 @@ bool SieveHelpButton::event(QEvent *event)
if (event->type() == QEvent::WhatsThisClicked) {
auto clicked = static_cast<QWhatsThisClickedEvent *>(event);
auto job = new KIO::OpenUrlJob(QUrl(clicked->href()));
#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->start();
return true;
}
......
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