Commit f94ea566 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

It can build without deprecated method (kf5 5.71)

parent 7505d03a
Pipeline #21435 passed with stage
in 11 minutes and 38 seconds
...@@ -72,7 +72,7 @@ ecm_setup_version(PROJECT VARIABLE_PREFIX LIBKSIEVE ...@@ -72,7 +72,7 @@ ecm_setup_version(PROJECT VARIABLE_PREFIX LIBKSIEVE
if (EXISTS "${CMAKE_SOURCE_DIR}/.git") if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00) add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054600) add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054700)
endif() endif()
add_definitions(-DQT_NO_FOREACH) add_definitions(-DQT_NO_FOREACH)
......
...@@ -20,9 +20,15 @@ ...@@ -20,9 +20,15 @@
#include <KLocalizedString> #include <KLocalizedString>
#include <QIcon> #include <QIcon>
#include <KRun>
#include <QWhatsThisClickedEvent> #include <QWhatsThisClickedEvent>
#include <QWhatsThis> #include <QWhatsThis>
#include <kio_version.h>
#if KIO_VERSION >= QT_VERSION_CHECK(5, 71, 0)
#include <KIO/JobUiDelegate>
#include <KIO/OpenUrlJob>
#else
#include <KRun>
#endif
using namespace KSieveUi; using namespace KSieveUi;
SieveHelpButton::SieveHelpButton(QWidget *parent) SieveHelpButton::SieveHelpButton(QWidget *parent)
...@@ -40,7 +46,13 @@ bool SieveHelpButton::event(QEvent *event) ...@@ -40,7 +46,13 @@ bool SieveHelpButton::event(QEvent *event)
{ {
if (event->type() == QEvent::WhatsThisClicked) { if (event->type() == QEvent::WhatsThisClicked) {
QWhatsThisClickedEvent *clicked = static_cast<QWhatsThisClickedEvent *>(event); QWhatsThisClickedEvent *clicked = static_cast<QWhatsThisClickedEvent *>(event);
#if KIO_VERSION >= QT_VERSION_CHECK(5, 71, 0)
KIO::OpenUrlJob *job = new KIO::OpenUrlJob(QUrl(clicked->href()));
job->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, this));
job->start();
#else
new KRun(QUrl(clicked->href()), this); new KRun(QUrl(clicked->href()), this);
#endif
return true; return true;
} }
return QToolButton::event(event); return QToolButton::event(event);
......
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