diff --git a/CMakeLists.txt b/CMakeLists.txt index ecdb427..e37e202 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,6 +30,9 @@ set(VERSION_RELEASE "1") set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_RELEASE}) add_definitions(-D'VERSION="${VERSION}"') #" +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + find_package(ECM 1.0.0 REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_MODULE_PATH}) include(ECMInstallIcons) diff --git a/src/config/configureoptionsdialog.cpp b/src/config/configureoptionsdialog.cpp index a1a9583..ae99c97 100644 --- a/src/config/configureoptionsdialog.cpp +++ b/src/config/configureoptionsdialog.cpp @@ -37,6 +37,7 @@ #include #include +#include #include #include @@ -55,7 +56,7 @@ ConfigureOptionsDialog::ConfigureOptionsDialog(QWidget* parent, const OperationS item = addPage(&generalPageWidget(), xi18nc("@title:tab general application settings", "General"), QString(), i18n("General Settings")); item->setIcon(QIcon::fromTheme(QStringLiteral("partitionmanager")).pixmap(IconSize(KIconLoader::Desktop))); - connect(&generalPageWidget().comboDefaultFileSystem(), static_cast(&QComboBox::activated), this, &ConfigureOptionsDialog::onComboDefaultFileSystemActivated); + connect(&generalPageWidget().comboDefaultFileSystem(), qOverload(&QComboBox::activated), this, &ConfigureOptionsDialog::onComboDefaultFileSystemActivated); connect(generalPageWidget().radioButton, &QRadioButton::toggled, this, &ConfigureOptionsDialog::onShredSourceActivated); item = addPage(&fileSystemColorsPageWidget(), xi18nc("@title:tab", "File System Colors"), QString(), i18n("File System Color Settings")); @@ -65,7 +66,7 @@ ConfigureOptionsDialog::ConfigureOptionsDialog(QWidget* parent, const OperationS item = addPage(&advancedPageWidget(), xi18nc("@title:tab advanced application settings", "Advanced"), QString(), i18n("Advanced Settings")); item->setIcon(QIcon::fromTheme(QStringLiteral("configure")).pixmap(IconSize(KIconLoader::Desktop))); - connect(&advancedPageWidget().comboBackend(), static_cast(&QComboBox::activated), this, &ConfigureOptionsDialog::onComboDefaultFileSystemActivated); + connect(&advancedPageWidget().comboBackend(), qOverload(&QComboBox::activated), this, &ConfigureOptionsDialog::onComboDefaultFileSystemActivated); } else advancedPageWidget().setVisible(false); diff --git a/src/gui/createvolumegroupdialog.cpp b/src/gui/createvolumegroupdialog.cpp index 815d88d..09dcd12 100644 --- a/src/gui/createvolumegroupdialog.cpp +++ b/src/gui/createvolumegroupdialog.cpp @@ -26,6 +26,8 @@ #include #include +#include + #include #include #include @@ -58,7 +60,7 @@ void CreateVolumeGroupDialog::setupDialog() void CreateVolumeGroupDialog::setupConnections() { connect(&dialogWidget().vgName(), &QLineEdit::textChanged, this, &CreateVolumeGroupDialog::onVGNameChanged); - connect(&dialogWidget().spinPESize(), static_cast(&QSpinBox::valueChanged), this, &CreateVolumeGroupDialog::onSpinPESizeChanged); + connect(&dialogWidget().spinPESize(), qOverload(&QSpinBox::valueChanged), this, &CreateVolumeGroupDialog::onSpinPESizeChanged); } void CreateVolumeGroupDialog::accept() diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 4198d46..6eed849 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -65,6 +65,7 @@ #include #include #include +#include #include #include #include @@ -453,7 +454,7 @@ void MainWindow::setupActions() void MainWindow::setupConnections() { - connect(&listDevices(), &ListDevices::selectionChanged, &pmWidget(), static_cast(&PartitionManagerWidget::setSelectedDevice)); + connect(&listDevices(), &ListDevices::selectionChanged, &pmWidget(), qOverload(&PartitionManagerWidget::setSelectedDevice)); connect(&listDevices(), &ListDevices::deviceDoubleClicked, this, &MainWindow::onPropertiesDevice); } diff --git a/src/gui/newdialog.cpp b/src/gui/newdialog.cpp index d7b67c7..2cc502a 100644 --- a/src/gui/newdialog.cpp +++ b/src/gui/newdialog.cpp @@ -32,8 +32,8 @@ #include #include "util/guihelpers.h" +#include #include -#include #include #include @@ -137,7 +137,7 @@ void NewDialog::setupConnections() connect(&dialogWidget().radioExtended(), &QRadioButton::toggled, this, &NewDialog::onRoleChanged); connect(&dialogWidget().radioLogical(), &QRadioButton::toggled, this, &NewDialog::onRoleChanged); connect(&dialogWidget().checkBoxEncrypt(), &QCheckBox::toggled, this, &NewDialog::onRoleChanged); - connect(&dialogWidget().comboFileSystem(), static_cast(&QComboBox::currentIndexChanged), this, &NewDialog::onFilesystemChanged); + connect(&dialogWidget().comboFileSystem(), qOverload(&QComboBox::currentIndexChanged), this, &NewDialog::onFilesystemChanged); connect(&dialogWidget().label(), &QLineEdit::textChanged, this, &NewDialog::onLabelChanged); // listen to password status updates connect(&dialogWidget().editPassphrase(), &KNewPasswordWidget::passwordStatusChanged, this, &NewDialog::slotPasswordStatusChanged); diff --git a/src/gui/partpropsdialog.cpp b/src/gui/partpropsdialog.cpp index e266adb..580513b 100644 --- a/src/gui/partpropsdialog.cpp +++ b/src/gui/partpropsdialog.cpp @@ -30,10 +30,10 @@ #include #include +#include #include #include #include -#include #include #include @@ -256,7 +256,7 @@ void PartPropsDialog::updateHideAndShow() void PartPropsDialog::setupConnections() { connect(&dialogWidget().label(), &QLineEdit::textEdited, [this] (const QString &) {setDirty();}); - connect(&dialogWidget().fileSystem(), static_cast(&QComboBox::currentIndexChanged), this, &PartPropsDialog::onFilesystemChanged); + connect(&dialogWidget().fileSystem(), qOverload(&QComboBox::currentIndexChanged), this, &PartPropsDialog::onFilesystemChanged); connect(&dialogWidget().checkRecreate(), &QCheckBox::stateChanged, this, &PartPropsDialog::onRecreate); // We want to enable the OK-button whenever the user checks or unchecks a flag in the flag list. @@ -349,7 +349,7 @@ void PartPropsDialog::onFilesystemChanged(int) } else { dialogWidget().fileSystem().disconnect(this); setupFileSystemComboBox(); - connect(&dialogWidget().fileSystem(), static_cast(&QComboBox::currentIndexChanged), this, &PartPropsDialog::onFilesystemChanged); + connect(&dialogWidget().fileSystem(), qOverload(&QComboBox::currentIndexChanged), this, &PartPropsDialog::onFilesystemChanged); } } diff --git a/src/gui/sizedialogbase.cpp b/src/gui/sizedialogbase.cpp index a90ec9d..4d4c663 100644 --- a/src/gui/sizedialogbase.cpp +++ b/src/gui/sizedialogbase.cpp @@ -36,8 +36,9 @@ #include -#include #include +#include +#include #include #include @@ -150,12 +151,12 @@ void SizeDialogBase::setupConnections() connect(&dialogWidget().partResizerWidget(), &PartResizerWidget::firstSectorChanged, this, &SizeDialogBase::onResizerWidgetFirstSectorChanged); connect(&dialogWidget().partResizerWidget(), &PartResizerWidget::lastSectorChanged, this, &SizeDialogBase::onResizerWidgetLastSectorChanged); - connect(&dialogWidget().spinFreeBefore(), static_cast(&QDoubleSpinBox::valueChanged), this, &SizeDialogBase::onSpinFreeBeforeChanged); - connect(&dialogWidget().spinFreeAfter(), static_cast(&QDoubleSpinBox::valueChanged), this, &SizeDialogBase::onSpinFreeAfterChanged); - connect(&dialogWidget().spinCapacity(), static_cast(&QDoubleSpinBox::valueChanged), this, &SizeDialogBase::onSpinCapacityChanged); + connect(&dialogWidget().spinFreeBefore(), qOverload(&QDoubleSpinBox::valueChanged), this, &SizeDialogBase::onSpinFreeBeforeChanged); + connect(&dialogWidget().spinFreeAfter(), qOverload(&QDoubleSpinBox::valueChanged), this, &SizeDialogBase::onSpinFreeAfterChanged); + connect(&dialogWidget().spinCapacity(), qOverload(&QDoubleSpinBox::valueChanged), this, &SizeDialogBase::onSpinCapacityChanged); - connect(&detailsWidget().spinFirstSector(), static_cast(&QDoubleSpinBox::valueChanged), this, &SizeDialogBase::onSpinFirstSectorChanged); - connect(&detailsWidget().spinLastSector(), static_cast(&QDoubleSpinBox::valueChanged), this, &SizeDialogBase::onSpinLastSectorChanged); + connect(&detailsWidget().spinFirstSector(), qOverload(&QDoubleSpinBox::valueChanged), this, &SizeDialogBase::onSpinFirstSectorChanged); + connect(&detailsWidget().spinLastSector(), qOverload(&QDoubleSpinBox::valueChanged), this, &SizeDialogBase::onSpinLastSectorChanged); connect(&detailsWidget().checkAlign(), &QCheckBox::toggled, this, &SizeDialogBase::onAlignToggled); } diff --git a/src/gui/volumegroupdialog.cpp b/src/gui/volumegroupdialog.cpp index 6a59ab5..30cf638 100644 --- a/src/gui/volumegroupdialog.cpp +++ b/src/gui/volumegroupdialog.cpp @@ -30,6 +30,7 @@ #include #include +#include #include #include @@ -95,7 +96,7 @@ void VolumeGroupDialog::setupConnections() { connect(dialogButtonBox, &QDialogButtonBox::accepted, this, &VolumeGroupDialog::accept); connect(dialogButtonBox, &QDialogButtonBox::rejected, this, &VolumeGroupDialog::reject); - connect(&dialogWidget().volumeType(), static_cast(&QComboBox::currentIndexChanged), this, &VolumeGroupDialog::onVolumeTypeChanged); + connect(&dialogWidget().volumeType(), qOverload(&QComboBox::currentIndexChanged), this, &VolumeGroupDialog::onVolumeTypeChanged); connect(&dialogWidget().listPV().listPhysicalVolumes(), &QListWidget::itemChanged, this, [=] ( QListWidgetItem*) { updateSizeInfos();