Use lambda functions for overloaded connections.
This commit is contained in:
parent
2b7f23ec27
commit
75adb928fe
|
@ -249,7 +249,7 @@ void MainWindow::setupActions()
|
|||
smartStatusDevice->setStatusTip(i18nc("@info:status", "Show the device's SMART status if supported"));
|
||||
|
||||
QAction* propertiesDevice = actionCollection()->addAction(QStringLiteral("propertiesDevice"));
|
||||
connect(propertiesDevice, &QAction::triggered, this, &MainWindow::onPropertiesDevice2);
|
||||
connect(propertiesDevice, &QAction::triggered, [this] {onPropertiesDevice({});});
|
||||
propertiesDevice->setEnabled(false);
|
||||
propertiesDevice->setText(i18nc("@action:inmenu", "Properties"));
|
||||
propertiesDevice->setToolTip(i18nc("@info:tooltip", "Show device properties dialog"));
|
||||
|
@ -1066,11 +1066,6 @@ void MainWindow::onSmartStatusDevice()
|
|||
}
|
||||
}
|
||||
|
||||
void MainWindow::onPropertiesDevice2()
|
||||
{
|
||||
onPropertiesDevice({});
|
||||
}
|
||||
|
||||
void MainWindow::onPropertiesDevice(const QString&)
|
||||
{
|
||||
Q_ASSERT(pmWidget().selectedDevice());
|
||||
|
|
|
@ -253,7 +253,6 @@ protected:
|
|||
void onFileSystemSupport();
|
||||
|
||||
void onSmartStatusDevice();
|
||||
void onPropertiesDevice2();
|
||||
void onPropertiesDevice(const QString& deviceNode = {});
|
||||
|
||||
private:
|
||||
|
|
|
@ -255,7 +255,7 @@ void PartPropsDialog::updateHideAndShow()
|
|||
|
||||
void PartPropsDialog::setupConnections()
|
||||
{
|
||||
connect(&dialogWidget().label(), &QLineEdit::textEdited, this, &PartPropsDialog::setDirty2);
|
||||
connect(&dialogWidget().label(), &QLineEdit::textEdited, [this] (const QString &) {setDirty();});
|
||||
connect(&dialogWidget().fileSystem(), static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &PartPropsDialog::onFilesystemChanged);
|
||||
connect(&dialogWidget().checkRecreate(), &QCheckBox::stateChanged, this, &PartPropsDialog::onRecreate);
|
||||
|
||||
|
@ -265,7 +265,7 @@ void PartPropsDialog::setupConnections()
|
|||
// itemClicked alone isn't enough either. We choose to rather enable the OK-button too often than too
|
||||
// seldom.
|
||||
connect(&dialogWidget().listFlags(), &QListWidget::itemClicked, this, &PartPropsDialog::setDirty);
|
||||
connect(&dialogWidget().listFlags(), &QListWidget::currentRowChanged, this, &PartPropsDialog::setDirty3);
|
||||
connect(&dialogWidget().listFlags(), &QListWidget::currentRowChanged, [this] (int) {setDirty();});
|
||||
}
|
||||
|
||||
void PartPropsDialog::setDirty(void*)
|
||||
|
|
|
@ -107,8 +107,6 @@ protected:
|
|||
|
||||
protected:
|
||||
void setDirty(void *unused = nullptr);
|
||||
void setDirty2(QString) {setDirty();};
|
||||
void setDirty3(int) {setDirty();};
|
||||
void onFilesystemChanged(int idx);
|
||||
void onRecreate(int);
|
||||
|
||||
|
|
Loading…
Reference in New Issue