Use a lambda for a single Q_EMIT rather than a slot
This commit is contained in:
parent
70ccd49d04
commit
77ad8472c5
2 changed files with 4 additions and 8 deletions
|
@ -89,7 +89,7 @@ DanbooruConnectWidget::DanbooruConnectWidget(QVector< QUrl > urlList,
|
||||||
connect(anonCheckBox, &QCheckBox::stateChanged, this, &DanbooruConnectWidget::toggleLineEdits);
|
connect(anonCheckBox, &QCheckBox::stateChanged, this, &DanbooruConnectWidget::toggleLineEdits);
|
||||||
|
|
||||||
connect(buttonBox, &QDialogButtonBox::accepted, this, &DanbooruConnectWidget::accept);
|
connect(buttonBox, &QDialogButtonBox::accepted, this, &DanbooruConnectWidget::accept);
|
||||||
connect(closeButton, &QPushButton::clicked, this, &DanbooruConnectWidget::emitRejected);
|
connect(closeButton, &QPushButton::clicked, [this]() {Q_EMIT(rejected());} );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -165,11 +165,6 @@ void DanbooruConnectWidget::setBoards(const QVector<QUrl> &urlList) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DanbooruConnectWidget::emitRejected()
|
|
||||||
{
|
|
||||||
Q_EMIT rejected();
|
|
||||||
}
|
|
||||||
|
|
||||||
QUrl DanbooruConnectWidget::boardUrl() const
|
QUrl DanbooruConnectWidget::boardUrl() const
|
||||||
{
|
{
|
||||||
return m_boardUrl;
|
return m_boardUrl;
|
||||||
|
@ -191,7 +186,9 @@ void DanbooruConnectWidget::accept()
|
||||||
|
|
||||||
QString currentBoard = danbooruUrlComboBox->currentText();
|
QString currentBoard = danbooruUrlComboBox->currentText();
|
||||||
|
|
||||||
if (!userLineEdit->text().isEmpty() && !passwdLineEdit->text().isEmpty()) {
|
if (!userLineEdit->text().isEmpty() &&
|
||||||
|
!passwdLineEdit->text().isEmpty() &&
|
||||||
|
!anonCheckBox->isChecked()) {
|
||||||
|
|
||||||
if (m_wallet && !m_wallet->hasEntry(currentBoard)) {
|
if (m_wallet && !m_wallet->hasEntry(currentBoard)) {
|
||||||
QMap<QString, QString> dataMap;
|
QMap<QString, QString> dataMap;
|
||||||
|
|
|
@ -71,7 +71,6 @@ private Q_SLOTS:
|
||||||
void checkWallet(bool);
|
void checkWallet(bool);
|
||||||
void getWalletData();
|
void getWalletData();
|
||||||
void toggleLineEdits(int state);
|
void toggleLineEdits(int state);
|
||||||
void emitRejected();
|
|
||||||
void accept();
|
void accept();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue