mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-05-28 12:50:17 +02:00
qt, refactor: simplify third-party tx url action through overload
Simplify the creation, addition, and slot/signal connection of a third part tx url context menu action by using an overloaded addAction function.
This commit is contained in:
parent
971cad475f
commit
9980f4aa5e
@ -228,11 +228,9 @@ void TransactionView::setModel(WalletModel *_model)
|
||||
QString host = QUrl(url, QUrl::StrictMode).host();
|
||||
if (!host.isEmpty())
|
||||
{
|
||||
QAction *thirdPartyTxUrlAction = new QAction(host, this); // use host as menu item label
|
||||
if (i == 0)
|
||||
contextMenu->addSeparator();
|
||||
contextMenu->addAction(thirdPartyTxUrlAction);
|
||||
connect(thirdPartyTxUrlAction, &QAction::triggered, [this, url] { openThirdPartyTxUrl(url); });
|
||||
contextMenu->addAction(host, [this, url] { openThirdPartyTxUrl(url); });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user