]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/settings/viewpropertiesdialog.cpp
GIT_SILENT Sync po/docbooks with svn
[dolphin.git] / src / settings / viewpropertiesdialog.cpp
index 0f182512c89ca6749b4d2ed255823e182573bcc4..30995f1f72d5644a1f0ce291b621bb85d55045d7 100644 (file)
@@ -8,7 +8,6 @@
 #include "viewpropertiesdialog.h"
 
 #include "dolphin_generalsettings.h"
-#include "dolphin_iconsmodesettings.h"
 #include "global.h"
 #include "kitemviews/kfileitemmodel.h"
 #include "viewpropsprogressinfo.h"
@@ -19,6 +18,8 @@
 #include <KMessageBox>
 #include <KWindowConfig>
 
+#include <kwidgetsaddons_version.h>
+
 #if HAVE_BALOO
     #include <Baloo/IndexerConfig>
 #endif
@@ -348,9 +349,15 @@ void ViewPropertiesDialog::applyViewProperties()
     const bool applyToSubFolders = m_applyToSubFolders && m_applyToSubFolders->isChecked();
     if (applyToSubFolders) {
         const QString text(i18nc("@info", "The view properties of all sub-folders will be changed. Do you want to continue?"));
+#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
+        if (KMessageBox::questionTwoActions(this, text, {},
+                                            KStandardGuiItem::cont(),
+                                            KStandardGuiItem::cancel()) == KMessageBox::SecondaryAction) {
+#else
         if (KMessageBox::questionYesNo(this, text, {},
                                        KStandardGuiItem::cont(),
                                        KStandardGuiItem::cancel()) == KMessageBox::No) {
+#endif
             return;
         }
 
@@ -382,9 +389,15 @@ void ViewPropertiesDialog::applyViewProperties()
 
     if (applyToAllFolders) {
         const QString text(i18nc("@info", "The view properties of all folders will be changed. Do you want to continue?"));
+#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
+        if (KMessageBox::questionTwoActions(this, text, {},
+                                            KStandardGuiItem::cont(),
+                                            KStandardGuiItem::cancel()) == KMessageBox::SecondaryAction) {
+#else
         if (KMessageBox::questionYesNo(this, text, {},
                                        KStandardGuiItem::cont(),
                                        KStandardGuiItem::cancel()) == KMessageBox::No) {
+#endif
             return;
         }
 
@@ -395,7 +408,7 @@ void ViewPropertiesDialog::applyViewProperties()
         settings->save();
     }
 
-    m_dolphinView->setMode(m_viewProps->viewMode());
+    m_dolphinView->setViewMode(m_viewProps->viewMode());
     m_dolphinView->setSortRole(m_viewProps->sortRole());
     m_dolphinView->setSortOrder(m_viewProps->sortOrder());
     m_dolphinView->setSortFoldersFirst(m_viewProps->sortFoldersFirst());