From 9d3b15bf9cb758e9f371d5f5f9eec0a3a2b0a4e2 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Mon, 21 Sep 2020 21:44:35 +0200 Subject: translations: initialize water type strings at run time The water type strings were static and therefore passed through gettextFromC::tr() before main(). One would hope to get a warning in such a case, but this is not the case. Therefore, use the QT_TRANSLATE_NOOP macro to register the strings in Qt's translation system and translate the list when needed. Signed-off-by: Berthold Stoeger --- desktop-widgets/tab-widgets/TabDiveInformation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'desktop-widgets') diff --git a/desktop-widgets/tab-widgets/TabDiveInformation.cpp b/desktop-widgets/tab-widgets/TabDiveInformation.cpp index eeb6d30cc..99ac898a4 100644 --- a/desktop-widgets/tab-widgets/TabDiveInformation.cpp +++ b/desktop-widgets/tab-widgets/TabDiveInformation.cpp @@ -27,7 +27,7 @@ TabDiveInformation::TabDiveInformation(QWidget *parent) : TabBase(parent), ui(ne QStringList atmPressTypes { "mbar", get_depth_unit() ,tr("Use DC")}; ui->atmPressType->insertItems(0, atmPressTypes); pressTypeIndex = 0; - ui->waterTypeCombo->insertItems(0, waterTypes); + ui->waterTypeCombo->insertItems(0, getWaterTypesAsString()); // This needs to be the same order as enum dive_comp_type in dive.h! QStringList types; -- cgit v1.2.3-70-g09d2