]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/settings/dolphinsettingsdialog.cpp
GIT_SILENT Sync po/docbooks with svn
[dolphin.git] / src / settings / dolphinsettingsdialog.cpp
index f6c4c830875d0c7b0a9d989f8c5d468135647a16..eed2f515576d1db6759a971365cafac24a9599e8 100644 (file)
@@ -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: