Improve warning message code readability.
authorCamila <hello@camila.codes>
Wed, 1 Feb 2023 15:21:25 +0000 (16:21 +0100)
committerMatthieu Gallien <matthieu_gallien@yahoo.fr>
Thu, 2 Feb 2023 07:44:48 +0000 (08:44 +0100)
Signed-off-by: Camila <hello@camila.codes>
src/gui/application.cpp

index b74943093201eef753d9dad0368e006389440c7a..f82604e739bb0752ed8a1727c314d21dea3bfd51 100644 (file)
@@ -172,23 +172,18 @@ bool Application::configVersionMigration()
     }
 
     if (showWarning || backupFilesList.count() > 0) {
-        QString boldMessage;
-        if (!deleteKeys.isEmpty()) {
-            boldMessage = tr("Continuing will mean <b>deleting these settings</b>.");
-        } else {
-            boldMessage = tr("Continuing will mean <b>ignoring these settings</b>.");
-        }
-
         QMessageBox box(
             QMessageBox::Warning,
             APPLICATION_SHORTNAME,
             tr("Some settings were configured in %1 versions of this client and "
                "use features that are not available in this version.<br>"
                "<br>"
-               "%2<br>"
+               "Continuing will mean <b>%2 these settings</b><br>"
                "<br>"
                "The current configuration file was already backed up to <i>%3</i>.")
-                .arg((downgrading ? tr("newer", "newer software version") : tr("older", "older software version")), boldMessage, backupFilesList.join("<br>")));
+                .arg((downgrading ? tr("newer", "newer software version") : tr("older", "older software version")),
+                     deleteKeys.isEmpty()? tr("ignoring") : tr("deleting"),
+                     backupFilesList.join("<br>")));
         box.addButton(tr("Quit"), QMessageBox::AcceptRole);
         auto continueBtn = box.addButton(tr("Continue"), QMessageBox::DestructiveRole);