#include "viewpropertiesdialog.h"
#include "dolphin_generalsettings.h"
-#include "dolphin_iconsmodesettings.h"
#include "global.h"
#include "kitemviews/kfileitemmodel.h"
#include "viewpropsprogressinfo.h"
#include <KMessageBox>
#include <KWindowConfig>
-#ifdef HAVE_BALOO
+#include <kwidgetsaddons_version.h>
+
+#if HAVE_BALOO
#include <Baloo/IndexerConfig>
#endif
// Add checkboxes
bool indexingEnabled = false;
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
Baloo::IndexerConfig config;
indexingEnabled = config.fileIndexingEnabled();
#endif
layout->addRow(QString(), m_showHiddenFiles);
layout->addRow(QString(), m_sortHiddenLast);
- connect(m_viewMode, QOverload<int>::of(&QComboBox::currentIndexChanged),
+ connect(m_viewMode, &QComboBox::currentIndexChanged,
this, &ViewPropertiesDialog::slotViewModeChanged);
- connect(m_sorting, QOverload<int>::of(&QComboBox::currentIndexChanged),
+ connect(m_sorting, &QComboBox::currentIndexChanged,
this, &ViewPropertiesDialog::slotSortingChanged);
- connect(m_sortOrder, QOverload<int>::of(&QComboBox::currentIndexChanged),
+ connect(m_sortOrder, &QComboBox::currentIndexChanged,
this, &ViewPropertiesDialog::slotSortOrderChanged);
connect(m_sortFoldersFirst, &QCheckBox::clicked,
this, &ViewPropertiesDialog::slotSortFoldersFirstChanged);
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 (KMessageBox::questionYesNo(this, text) == KMessageBox::No) {
+#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;
}
if (applyToAllFolders) {
const QString text(i18nc("@info", "The view properties of all folders will be changed. Do you want to continue?"));
- if (KMessageBox::questionYesNo(this, text) == KMessageBox::No) {
+#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;
}
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());