Skip to content

Commit

Permalink
qt, refactor: simplify third-party tx url action through overload
Browse files Browse the repository at this point in the history
Simplify the creation, addition, and slot/signal connection of
a third part tx url context menu action by using an overloaded
addAction function.
  • Loading branch information
jarolrod committed Sep 23, 2021
1 parent 971cad4 commit 9980f4a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/qt/transactionview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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); });
}
}
}
Expand Down

0 comments on commit 9980f4a

Please sign in to comment.