mirror of
https://github.com/transmission/transmission.git
synced 2025-12-25 04:45:56 +00:00
chore: prefer QStringLiteral (#1284)
Further reading: * https://forum.qt.io/topic/78540/qstringliteral-vs-qlatin1string/2 * https://woboq.com/blog/qstringliteral.html * https://www.qt.io/blog/2014/06/13/qt-weekly-13-qstringliteral tl;dr: QLatin1Literal uses less memory than QStringLiteral; however, since most Qt APIs require a QString argument, there's extra runtime cost of converting QLatin1Strings to QStrings. QStringLiteral uses a little more memory but constructs its QStrings at compile time. ok, the `prefer-qstringliteral` branch is getting out of control: the secondary goal of fixing a .clang-tidy issue is causing more diffs than the primary goal. So, I'm breaking it into two separate PRs.
This commit is contained in:
@@ -327,10 +327,10 @@ void PrefsDialog::initSpeedTab()
|
||||
QString const speed_K_str = Formatter::unitStr(Formatter::SPEED, Formatter::KB);
|
||||
QLocale const locale;
|
||||
|
||||
ui_.uploadSpeedLimitSpin->setSuffix(QString::fromLatin1(" %1").arg(speed_K_str));
|
||||
ui_.downloadSpeedLimitSpin->setSuffix(QString::fromLatin1(" %1").arg(speed_K_str));
|
||||
ui_.altUploadSpeedLimitSpin->setSuffix(QString::fromLatin1(" %1").arg(speed_K_str));
|
||||
ui_.altDownloadSpeedLimitSpin->setSuffix(QString::fromLatin1(" %1").arg(speed_K_str));
|
||||
ui_.uploadSpeedLimitSpin->setSuffix(QStringLiteral(" %1").arg(speed_K_str));
|
||||
ui_.downloadSpeedLimitSpin->setSuffix(QStringLiteral(" %1").arg(speed_K_str));
|
||||
ui_.altUploadSpeedLimitSpin->setSuffix(QStringLiteral(" %1").arg(speed_K_str));
|
||||
ui_.altDownloadSpeedLimitSpin->setSuffix(QStringLiteral(" %1").arg(speed_K_str));
|
||||
|
||||
ui_.altSpeedLimitDaysCombo->addItem(tr("Every Day"), QVariant(TR_SCHED_ALL));
|
||||
ui_.altSpeedLimitDaysCombo->addItem(tr("Weekdays"), QVariant(TR_SCHED_WEEKDAY));
|
||||
|
||||
Reference in New Issue
Block a user