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:
1 parent
971cad475f
commit
9980f4aa5e
1 file changed
+1
-3
@@ -228,11 +228,9 @@ void TransactionView::setModel(WalletModel *_model)
|
|||||||
QString host = QUrl(url, QUrl::StrictMode).host();
|
QString host = QUrl(url, QUrl::StrictMode).host();
|
||||||
if (!host.isEmpty())
|
if (!host.isEmpty())
|
||||||
{
|
{
|
||||||
QAction *thirdPartyTxUrlAction = new QAction(host, this); // use host as menu item label
|
|
||||||
if (i == 0)
|
if (i == 0)
|
||||||
contextMenu->addSeparator();
|
contextMenu->addSeparator();
|
||||||
contextMenu->addAction(thirdPartyTxUrlAction);
|
contextMenu->addAction(host, [this, url] { openThirdPartyTxUrl(url); });
|
||||||
connect(thirdPartyTxUrlAction, &QAction::triggered, [this, url] { openThirdPartyTxUrl(url); });
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user