From 0b8c6bd5f0291d96c6b53f948fc176ba8c1e418c Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Tue, 8 Dec 2020 22:09:19 +0100 Subject: rbutil: Fix log strings in s5l bootloader installation. We can't use a ternary expression within the tr() function. While this initially might work as expected it completely breaks translating the actual string -- we need to use separate strings here, and replacing a single word in a sentence will also not work for translations. Change-Id: I556ff2a3bd0dc476b312a59c47d4e0dcd3b743e1 --- rbutil/rbutilqt/base/bootloaderinstalls5l.cpp | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'rbutil/rbutilqt') diff --git a/rbutil/rbutilqt/base/bootloaderinstalls5l.cpp b/rbutil/rbutilqt/base/bootloaderinstalls5l.cpp index 3621a27e26..6568ffb74d 100644 --- a/rbutil/rbutilqt/base/bootloaderinstalls5l.cpp +++ b/rbutil/rbutilqt/base/bootloaderinstalls5l.cpp @@ -66,7 +66,8 @@ bool BootloaderInstallS5l::installStage1(void) if (doInstall) { // download firmware from server emit logItem(tr("Downloading bootloader file..."), LOGINFO); - connect(this, &BootloaderInstallBase::downloadDone, this, &BootloaderInstallS5l::installStageMkdfu); + connect(this, &BootloaderInstallBase::downloadDone, + this, &BootloaderInstallS5l::installStageMkdfu); downloadBlStart(m_blurl); } else { @@ -87,8 +88,10 @@ void BootloaderInstallS5l::installStageMkdfu(void) setProgress(0); aborted = false; - connect(this, &BootloaderInstallBase::installAborted, this, &BootloaderInstallS5l::abortInstall); - connect(this, &BootloaderInstallBase::done, this, &BootloaderInstallS5l::installDone); + connect(this, &BootloaderInstallBase::installAborted, + this, &BootloaderInstallS5l::abortInstall); + connect(this, &BootloaderInstallBase::done, + this, &BootloaderInstallS5l::installDone); if (doInstall) { dfu_type = DFU_INST; @@ -329,8 +332,10 @@ void BootloaderInstallS5l::installStageWaitForRemount(void) } emit logItem(tr("Device remounted."), LOGINFO); - emit logItem(tr("Bootloader successfully %1."). - arg(tr(doInstall ? "installed" : "uninstalled")), LOGOK); + if (doInstall) + emit logItem(tr("Bootloader successfully installed."), LOGOK); + else + emit logItem(tr("Bootloader successfully uninstalled."), LOGOK); logInstall(doInstall ? LogAdd : LogRemove); emit logProgress(1, 1); @@ -350,7 +355,8 @@ void BootloaderInstallS5l::abortInstall(void) { LOG_INFO() << "abortInstall"; aborted = true; - disconnect(this, &BootloaderInstallBase::installAborted, this, &BootloaderInstallS5l::abortInstall); + disconnect(this, &BootloaderInstallBase::installAborted, + this, &BootloaderInstallS5l::abortInstall); } @@ -358,8 +364,10 @@ bool BootloaderInstallS5l::abortDetected(void) { if (aborted) { LOG_ERROR() << "abortDetected"; - emit logItem(tr("%1 aborted by user."). - arg(tr(doInstall ? "Install" : "Uninstall")), LOGERROR); + if (doInstall) + emit logItem(tr("Install aborted by user."), LOGERROR); + else + emit logItem(tr("Uninstall aborted by user."), LOGERROR); emit done(true); return true; } -- cgit v1.2.3