Commit 86329a80 authored by Laurent Montel's avatar Laurent Montel
Browse files

Don't use deprecated methods

parent 83c30f77
Pipeline #248365 passed with stage
in 2 minutes and 44 seconds
......@@ -12,6 +12,7 @@
#include "articleviewerwebenginepage.h"
#include "webengine/urlhandlerwebenginemanager.h"
#include <kpimtextedit/kpimtextedit-texttospeech.h>
#include <kwidgetsaddons_version.h>
#if KPIMTEXTEDIT_TEXT_TO_SPEECH
#include <KPIMTextEdit/TextToSpeech>
#endif
......@@ -378,16 +379,22 @@ void ArticleViewerWebEngine::resizeEvent(QResizeEvent *e)
void ArticleViewerWebEngine::disableIntroduction()
{
KGuiItem yesButton(KStandardGuiItem::yes());
yesButton.setText(i18n("Disable"));
KGuiItem noButton(KStandardGuiItem::no());
noButton.setText(i18n("Keep Enabled"));
KGuiItem yesButton(i18n("Disable"));
KGuiItem noButton(i18n("Keep Enabled"));
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
if (KMessageBox::questionTwoActions(this,
#else
if (KMessageBox::questionYesNo(this,
i18n("Are you sure you want to disable this introduction page?"),
i18n("Disable Introduction Page"),
yesButton,
noButton)
#endif
i18n("Are you sure you want to disable this introduction page?"),
i18n("Disable Introduction Page"),
yesButton,
noButton)
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
== KMessageBox::PrimaryAction) {
#else
== KMessageBox::Yes) {
#endif
Settings::self()->setDisableIntroduction(true);
Settings::self()->save();
}
......@@ -417,12 +424,17 @@ void ArticleViewerWebEngine::forwardMouseReleaseEvent(QMouseEvent *event)
bool ArticleViewerWebEngine::urlIsAMalwareButContinue()
{
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
if (KMessageBox::SecondaryAction
== KMessageBox::questionTwoActions(this,
#else
if (KMessageBox::No
== KMessageBox::warningYesNo(this,
i18n("This web site is a malware, do you want to continue to show it?"),
i18n("Malware"),
KStandardGuiItem::cont(),
KStandardGuiItem::cancel())) {
#endif
i18n("This web site is a malware, do you want to continue to show it?"),
i18n("Malware"),
KStandardGuiItem::cont(),
KStandardGuiItem::cancel())) {
return false;
}
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