diff options
| author | Friedrich W. H. Kossebau <[email protected]> | 2022-09-30 19:56:52 +0200 |
|---|---|---|
| committer | Méven Car <[email protected]> | 2022-10-15 07:18:34 +0000 |
| commit | 5be69f0daba256cd3faad0aaa16dee8447a76af4 (patch) | |
| tree | 1b3f83de331543ea418fe4a5fb9842431b6454aa /src/settings/dolphinsettingsdialog.cpp | |
| parent | a509bd76291d330c69cb89284b2d99a3512a199e (diff) | |
Port away from deprecated KMessageBox Yes/No
GIT_SILENT
Diffstat (limited to 'src/settings/dolphinsettingsdialog.cpp')
| -rw-r--r-- | src/settings/dolphinsettingsdialog.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/settings/dolphinsettingsdialog.cpp b/src/settings/dolphinsettingsdialog.cpp index f6c4c8308..eed2f5155 100644 --- a/src/settings/dolphinsettingsdialog.cpp +++ b/src/settings/dolphinsettingsdialog.cpp @@ -25,6 +25,8 @@ #include <KWindowConfig> #include <KMessageBox> +#include <kwidgetsaddons_version.h> + #include <QCloseEvent> #include <QPushButton> @@ -179,17 +181,29 @@ void DolphinSettingsDialog::closeEvent(QCloseEvent* event) return; } +#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0) + const auto response = KMessageBox::warningTwoActionsCancel(this, +#else const auto response = KMessageBox::warningYesNoCancel(this, +#endif i18n("You have unsaved changes. Do you want to apply the changes or discard them?"), i18n("Warning"), KStandardGuiItem::save(), KStandardGuiItem::discard(), KStandardGuiItem::cancel()); switch (response) { +#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0) + case KMessageBox::PrimaryAction: +#else case KMessageBox::Yes: +#endif applySettings(); Q_FALLTHROUGH(); +#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0) + case KMessageBox::SecondaryAction: +#else case KMessageBox::No: +#endif event->accept(); break; case KMessageBox::Cancel: |
