diff options
author | fanquake <fanquake@gmail.com> | 2020-01-17 20:14:35 +0800 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2020-01-17 20:33:15 +0800 |
commit | 0deba680646fc5c2bd4ead59933605970ae80995 (patch) | |
tree | 0de2cc3cafe4d75b40439f431fabc7708cb4fef5 /src/qt/bitcoingui.cpp | |
parent | c20fbb7be864bb7652280d5855be89b6b04cdfd1 (diff) | |
parent | 1a53b0da60097cd7fd423c519f01ceca0fd0aa14 (diff) |
Merge #17943: qt, refactor: Remove never used default parameter
1a53b0da60097cd7fd423c519f01ceca0fd0aa14 refactor: Simplify connection syntax (Hennadii Stepanov)
7d0a8f4f530885cbf3870291f10f667326373bd1 refactor: Remove never used default parameter (Hennadii Stepanov)
Pull request description:
In `BitcoinGUI::message()` slot the `bool* ret = nullptr` parameter is never used.
This PR removes it and simplifies connections syntax by replacing lambdas with the `&BitcoinGUI::message` slot.
ACKs for top commit:
promag:
Code review ACK 1a53b0da60097cd7fd423c519f01ceca0fd0aa14.
Sjors:
Tested ACK 1a53b0da60097cd7fd423c519f01ceca0fd0aa14
Empact:
Code review ACK https://github.com/bitcoin/bitcoin/pull/17943/commits/1a53b0da60097cd7fd423c519f01ceca0fd0aa14
Tree-SHA512: e287c3218d31a387338d50da3de79c27e8691829449c3a75a2f75bb1c680bd81eb9de43e4dd3646560a422d4a45c84debfce9783c4376b50aa5cde491f300688
Diffstat (limited to 'src/qt/bitcoingui.cpp')
-rw-r--r-- | src/qt/bitcoingui.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index f22d33bf0a..6043e93f92 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -564,9 +564,7 @@ void BitcoinGUI::setClientModel(ClientModel *_clientModel) connect(_clientModel, &ClientModel::numBlocksChanged, this, &BitcoinGUI::setNumBlocks); // Receive and report messages from client model - connect(_clientModel, &ClientModel::message, [this](const QString &title, const QString &message, unsigned int style){ - this->message(title, message, style); - }); + connect(_clientModel, &ClientModel::message, this, &BitcoinGUI::message); // Show progress dialog connect(_clientModel, &ClientModel::showProgress, this, &BitcoinGUI::showProgress); @@ -1027,7 +1025,7 @@ void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, double nVer progressBar->setToolTip(tooltip); } -void BitcoinGUI::message(const QString& title, QString message, unsigned int style, bool* ret) +void BitcoinGUI::message(const QString& title, QString message, unsigned int style) { // Default title. On macOS, the window title is ignored (as required by the macOS Guidelines). QString strTitle{PACKAGE_NAME}; @@ -1081,9 +1079,7 @@ void BitcoinGUI::message(const QString& title, QString message, unsigned int sty showNormalIfMinimized(); QMessageBox mBox(static_cast<QMessageBox::Icon>(nMBoxIcon), strTitle, message, buttons, this); mBox.setTextFormat(Qt::PlainText); - int r = mBox.exec(); - if (ret != nullptr) - *ret = r == QMessageBox::Ok; + mBox.exec(); } else { notificator->notify(static_cast<Notificator::Class>(nNotifyIcon), strTitle, message); } |