Skip to content

Commit 9980f4a

Browse files
committed
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.
1 parent 971cad4 commit 9980f4a

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/qt/transactionview.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,9 @@ void TransactionView::setModel(WalletModel *_model)
228228
QString host = QUrl(url, QUrl::StrictMode).host();
229229
if (!host.isEmpty())
230230
{
231-
QAction *thirdPartyTxUrlAction = new QAction(host, this); // use host as menu item label
232231
if (i == 0)
233232
contextMenu->addSeparator();
234-
contextMenu->addAction(thirdPartyTxUrlAction);
235-
connect(thirdPartyTxUrlAction, &QAction::triggered, [this, url] { openThirdPartyTxUrl(url); });
233+
contextMenu->addAction(host, [this, url] { openThirdPartyTxUrl(url); });
236234
}
237235
}
238236
}

0 commit comments

Comments
 (0)