mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-02-26 12:33:53 +08:00
Multilang: remove redundant QString() around tr() (#25003)
remove qstring
This commit is contained in:
@@ -151,7 +151,7 @@ void DeclinePage::showEvent(QShowEvent *event) {
|
||||
|
||||
QObject::connect(back_btn, &QPushButton::clicked, this, &DeclinePage::getBack);
|
||||
|
||||
QPushButton *uninstall_btn = new QPushButton(QString(tr("Decline, uninstall %1")).arg(getBrand()));
|
||||
QPushButton *uninstall_btn = new QPushButton(tr("Decline, uninstall %1").arg(getBrand()));
|
||||
uninstall_btn->setStyleSheet("background-color: #B73D3D");
|
||||
buttons->addWidget(uninstall_btn);
|
||||
QObject::connect(uninstall_btn, &QPushButton::clicked, [=]() {
|
||||
|
||||
@@ -179,7 +179,7 @@ void DevicePanel::updateCalibDescription() {
|
||||
if (calib.getCalStatus() != 0) {
|
||||
double pitch = calib.getRpyCalib()[1] * (180 / M_PI);
|
||||
double yaw = calib.getRpyCalib()[2] * (180 / M_PI);
|
||||
desc += QString(tr(" Your device is pointed %1° %2 and %3° %4."))
|
||||
desc += tr(" Your device is pointed %1° %2 and %3° %4.")
|
||||
.arg(QString::number(std::abs(pitch), 'g', 1), pitch > 0 ? tr("down") : tr("up"),
|
||||
QString::number(std::abs(yaw), 'g', 1), yaw > 0 ? tr("left") : tr("right"));
|
||||
}
|
||||
|
||||
@@ -63,13 +63,13 @@ QString timeAgo(const QDateTime &date) {
|
||||
s = "now";
|
||||
} else if (diff < 60 * 60) {
|
||||
int minutes = diff / 60;
|
||||
s = QString(QObject::tr("%1 minute%2 ago")).arg(minutes).arg(minutes > 1 ? "s" : "");
|
||||
s = QObject::tr("%1 minute%2 ago").arg(minutes).arg(minutes > 1 ? "s" : "");
|
||||
} else if (diff < 60 * 60 * 24) {
|
||||
int hours = diff / (60 * 60);
|
||||
s = QString(QObject::tr("%1 hour%2 ago")).arg(hours).arg(hours > 1 ? "s" : "");
|
||||
s = QObject::tr("%1 hour%2 ago").arg(hours).arg(hours > 1 ? "s" : "");
|
||||
} else if (diff < 3600 * 24 * 7) {
|
||||
int days = diff / (60 * 60 * 24);
|
||||
s = QString(QObject::tr("%1 day%2 ago")).arg(days).arg(days > 1 ? "s" : "");
|
||||
s = QObject::tr("%1 day%2 ago").arg(days).arg(days > 1 ? "s" : "");
|
||||
} else {
|
||||
s = date.date().toString();
|
||||
}
|
||||
|
||||
@@ -47,13 +47,13 @@ void SshControl::getUserKeys(const QString &username) {
|
||||
params.put("GithubUsername", username.toStdString());
|
||||
params.put("GithubSshKeys", resp.toStdString());
|
||||
} else {
|
||||
ConfirmationDialog::alert(QString(tr("Username '%1' has no keys on GitHub")).arg(username), this);
|
||||
ConfirmationDialog::alert(tr("Username '%1' has no keys on GitHub").arg(username), this);
|
||||
}
|
||||
} else {
|
||||
if (request->timeout()) {
|
||||
ConfirmationDialog::alert(tr("Request timed out"), this);
|
||||
} else {
|
||||
ConfirmationDialog::alert(QString(tr("Username '%1' doesn't exist on GitHub")).arg(username), this);
|
||||
ConfirmationDialog::alert(tr("Username '%1' doesn't exist on GitHub").arg(username), this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user