Skip to content

Commit ad92e04

Browse files
committed
gui: use SPACE constant, QStringBuilder concat in rpcconsole.cpp
1 parent 842f4e8 commit ad92e04

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/qt/rpcconsole.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -482,9 +482,9 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty
482482
const QString list{"<ul><li>" % Join(CONNECTION_TYPE_DOC, QString("</li><li>")) % "</li></ul>"};
483483
ui->peerConnectionTypeLabel->setToolTip(ui->peerConnectionTypeLabel->toolTip().arg(list));
484484
const QString hb_list{"<ul><li>\""
485-
+ ts.to + "\"" + tr("we selected the peer for high bandwidth relay") + "</li><li>\""
486-
+ ts.from + "\"" + tr("the peer selected us for high bandwidth relay") + "</li><li>\""
487-
+ ts.no + "\"" + tr("no high bandwidth relay selected") + "</li></ul>"};
485+
% ts.to % "\"" % tr("we selected the peer for high bandwidth relay") % "</li><li>\""
486+
% ts.from % "\"" % tr("the peer selected us for high bandwidth relay") % "</li><li>\""
487+
% ts.no % "\"" % tr("no high bandwidth relay selected") % "</li></ul>"};
488488
ui->peerHighBandwidthLabel->setToolTip(ui->peerHighBandwidthLabel->toolTip().arg(hb_list));
489489
ui->dataDir->setToolTip(ui->dataDir->toolTip().arg(QString(nonbreaking_hyphen) + "datadir"));
490490
ui->blocksDir->setToolTip(ui->blocksDir->toolTip().arg(QString(nonbreaking_hyphen) + "blocksdir"));
@@ -627,10 +627,10 @@ void RPCConsole::setClientModel(ClientModel *model, int bestblock_height, int64_
627627
// create peer table context menu
628628
peersTableContextMenu = new QMenu(this);
629629
peersTableContextMenu->addAction(tr("Disconnect"), this, &RPCConsole::disconnectSelectedNode);
630-
peersTableContextMenu->addAction(ts.ban_for + " " + tr("1 hour"), [this] { banSelectedNode(60 * 60); });
631-
peersTableContextMenu->addAction(ts.ban_for + " " + tr("1 day"), [this] { banSelectedNode(60 * 60 * 24); });
632-
peersTableContextMenu->addAction(ts.ban_for + " " + tr("1 week"), [this] { banSelectedNode(60 * 60 * 24 * 7); });
633-
peersTableContextMenu->addAction(ts.ban_for + " " + tr("1 year"), [this] { banSelectedNode(60 * 60 * 24 * 365); });
630+
peersTableContextMenu->addAction(ts.ban_for % SPACE % tr("1 hour"), [this] { banSelectedNode(60 * 60); });
631+
peersTableContextMenu->addAction(ts.ban_for % SPACE % tr("1 day"), [this] { banSelectedNode(60 * 60 * 24); });
632+
peersTableContextMenu->addAction(ts.ban_for % SPACE % tr("1 week"), [this] { banSelectedNode(60 * 60 * 24 * 7); });
633+
peersTableContextMenu->addAction(ts.ban_for % SPACE % tr("1 year"), [this] { banSelectedNode(60 * 60 * 24 * 365); });
634634
connect(ui->peerWidget, &QTableView::customContextMenuRequested, this, &RPCConsole::showPeersTableContextMenu);
635635

636636
// peer table signal handling - update peer details when selecting new node
@@ -842,12 +842,12 @@ void RPCConsole::message(int category, const QString &message, bool html)
842842

843843
void RPCConsole::updateNetworkState()
844844
{
845-
QString connections = QString::number(clientModel->getNumConnections()) + " (";
846-
connections += tr("In:") + " " + QString::number(clientModel->getNumConnections(CONNECTIONS_IN)) + " / ";
847-
connections += tr("Out:") + " " + QString::number(clientModel->getNumConnections(CONNECTIONS_OUT)) + ")";
845+
QString connections = QString::number(clientModel->getNumConnections()) % " (";
846+
connections += tr("In:") % SPACE % QString::number(clientModel->getNumConnections(CONNECTIONS_IN)) % " / ";
847+
connections += tr("Out:") % SPACE % QString::number(clientModel->getNumConnections(CONNECTIONS_OUT)) % ")";
848848

849849
if(!clientModel->node().getNetworkActive()) {
850-
connections += " (" + tr("Network activity disabled") + ")";
850+
connections += " (" % tr("Network activity disabled") % ")";
851851
}
852852

853853
ui->numberOfConnections->setText(connections);
@@ -1029,7 +1029,7 @@ void RPCConsole::updateDetailWidget()
10291029
}
10301030
const auto stats = selected_peers.first().data(PeerTableModel::StatsRole).value<CNodeCombinedStats*>();
10311031
// update the detail ui with latest node information
1032-
QString peerAddrDetails(QString::fromStdString(stats->nodeStats.addrName) + " ");
1032+
QString peerAddrDetails(QString::fromStdString(stats->nodeStats.addrName) % SPACE);
10331033
peerAddrDetails += tr("(peer id: %1)").arg(QString::number(stats->nodeStats.nodeid));
10341034
if (!stats->nodeStats.addrLocal.empty())
10351035
peerAddrDetails += "<br />" + tr("via %1").arg(QString::fromStdString(stats->nodeStats.addrLocal));

0 commit comments

Comments
 (0)