Skip to content

Commit 6bc51af

Browse files
author
MarcoFalke
committed
Merge bitcoin-core#250: scripted-diff: Drop redundant QString calls
def1e64 scripted-diff: Drop redundant QString calls (Hennadii Stepanov) Pull request description: The return type of `QObject::tr` function _is_ `QString` 🐅 ACKs for top commit: jarolrod: ACK def1e64, tested on macOS 10.14.6 Qt 5.15.2 Tree-SHA512: ef405c87a30d6965f6887511d8666b6da57d258ca07833a3fa2dc9fd147d0539d33c57f7551ee13c1dd8024d6057139595c6ce5d088dd6efd7aa13db2a3eebdb
2 parents 16209b1 + def1e64 commit 6bc51af

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/qt/guiutil.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -683,13 +683,13 @@ QString formatDurationStr(int secs)
683683
int seconds = secs % 60;
684684

685685
if (days)
686-
strList.append(QString(QObject::tr("%1 d")).arg(days));
686+
strList.append(QObject::tr("%1 d").arg(days));
687687
if (hours)
688-
strList.append(QString(QObject::tr("%1 h")).arg(hours));
688+
strList.append(QObject::tr("%1 h").arg(hours));
689689
if (mins)
690-
strList.append(QString(QObject::tr("%1 m")).arg(mins));
690+
strList.append(QObject::tr("%1 m").arg(mins));
691691
if (seconds || (!days && !hours && !mins))
692-
strList.append(QString(QObject::tr("%1 s")).arg(seconds));
692+
strList.append(QObject::tr("%1 s").arg(seconds));
693693

694694
return strList.join(" ");
695695
}
@@ -712,12 +712,12 @@ QString formatPingTime(std::chrono::microseconds ping_time)
712712
{
713713
return (ping_time == std::chrono::microseconds::max() || ping_time == 0us) ?
714714
QObject::tr("N/A") :
715-
QString(QObject::tr("%1 ms")).arg(QString::number((int)(count_microseconds(ping_time) / 1000), 10));
715+
QObject::tr("%1 ms").arg(QString::number((int)(count_microseconds(ping_time) / 1000), 10));
716716
}
717717

718718
QString formatTimeOffset(int64_t nTimeOffset)
719719
{
720-
return QString(QObject::tr("%1 s")).arg(QString::number((int)nTimeOffset, 10));
720+
return QObject::tr("%1 s").arg(QString::number((int)nTimeOffset, 10));
721721
}
722722

723723
QString formatNiceTimeOffset(qint64 secs)
@@ -760,13 +760,13 @@ QString formatNiceTimeOffset(qint64 secs)
760760
QString formatBytes(uint64_t bytes)
761761
{
762762
if(bytes < 1024)
763-
return QString(QObject::tr("%1 B")).arg(bytes);
763+
return QObject::tr("%1 B").arg(bytes);
764764
if(bytes < 1024 * 1024)
765-
return QString(QObject::tr("%1 KB")).arg(bytes / 1024);
765+
return QObject::tr("%1 KB").arg(bytes / 1024);
766766
if(bytes < 1024 * 1024 * 1024)
767-
return QString(QObject::tr("%1 MB")).arg(bytes / 1024 / 1024);
767+
return QObject::tr("%1 MB").arg(bytes / 1024 / 1024);
768768

769-
return QString(QObject::tr("%1 GB")).arg(bytes / 1024 / 1024 / 1024);
769+
return QObject::tr("%1 GB").arg(bytes / 1024 / 1024 / 1024);
770770
}
771771

772772
qreal calculateIdealFontSize(int width, const QString& text, QFont font, qreal minPointSize, qreal font_size) {

0 commit comments

Comments
 (0)