|
30 | 30 | #include <QMenu>
|
31 | 31 | #include <QPoint>
|
32 | 32 | #include <QScrollBar>
|
33 |
| -#include <QSignalMapper> |
34 | 33 | #include <QTableView>
|
35 | 34 | #include <QTimer>
|
36 | 35 | #include <QUrl>
|
@@ -176,11 +175,6 @@ TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *pa
|
176 | 175 | contextMenu->addAction(abandonAction);
|
177 | 176 | contextMenu->addAction(editLabelAction);
|
178 | 177 |
|
179 |
| - mapperThirdPartyTxUrls = new QSignalMapper(this); |
180 |
| - |
181 |
| - // Connect actions |
182 |
| - connect(mapperThirdPartyTxUrls, static_cast<void (QSignalMapper::*)(const QString&)>(&QSignalMapper::mapped), this, &TransactionView::openThirdPartyTxUrl); |
183 |
| - |
184 | 178 | connect(dateWidget, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, &TransactionView::chooseDate);
|
185 | 179 | connect(typeWidget, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, &TransactionView::chooseType);
|
186 | 180 | connect(watchOnlyWidget, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, &TransactionView::chooseWatchonly);
|
@@ -246,15 +240,15 @@ void TransactionView::setModel(WalletModel *_model)
|
246 | 240 | QStringList listUrls = _model->getOptionsModel()->getThirdPartyTxUrls().split("|", QString::SkipEmptyParts);
|
247 | 241 | for (int i = 0; i < listUrls.size(); ++i)
|
248 | 242 | {
|
249 |
| - QString host = QUrl(listUrls[i].trimmed(), QUrl::StrictMode).host(); |
| 243 | + QString url = listUrls[i].trimmed(); |
| 244 | + QString host = QUrl(url, QUrl::StrictMode).host(); |
250 | 245 | if (!host.isEmpty())
|
251 | 246 | {
|
252 | 247 | QAction *thirdPartyTxUrlAction = new QAction(host, this); // use host as menu item label
|
253 | 248 | if (i == 0)
|
254 | 249 | contextMenu->addSeparator();
|
255 | 250 | contextMenu->addAction(thirdPartyTxUrlAction);
|
256 |
| - connect(thirdPartyTxUrlAction, &QAction::triggered, mapperThirdPartyTxUrls, static_cast<void (QSignalMapper::*)()>(&QSignalMapper::map)); |
257 |
| - mapperThirdPartyTxUrls->setMapping(thirdPartyTxUrlAction, listUrls[i].trimmed()); |
| 251 | + connect(thirdPartyTxUrlAction, &QAction::triggered, [this, url] { openThirdPartyTxUrl(url); }); |
258 | 252 | }
|
259 | 253 | }
|
260 | 254 | }
|
|
0 commit comments