Skip to content

Commit def1e64

Browse files
committed
scripted-diff: Drop redundant QString calls
-BEGIN VERIFY SCRIPT- sed -i 's/QString(QObject::tr(\([^)]*\))/QObject::tr(\1/' src/qt/guiutil.cpp -END VERIFY SCRIPT-
1 parent 3c63191 commit def1e64

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)