From 879cb73b8bda364f63cc97c0f9963cfddc581add Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sun, 17 Jun 2018 21:03:16 +0200 Subject: Localization: remove gettextFromC::instance() There were a handfull instances of the kind 1) gettextFromC::instance()->tr(...) 2) gettextFromC::instance()->trGettext(...) 1) is pointless, as tr is a static function. All instances of 2) were likewise pointless, because trGettext() returns a C-string, which was then immediately converted to a QString. Thus, replace both constructs by gettextFromC::tr(...). After this change there was only one user of gettextFromC::instance() left, viz. the C-interface funtion trGettext(). Therefore, remove gettextFromC::instance() and do all the caching / translating directly in the global trGettext(). Signed-off-by: Berthold Stoeger --- desktop-widgets/modeldelegates.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'desktop-widgets') diff --git a/desktop-widgets/modeldelegates.cpp b/desktop-widgets/modeldelegates.cpp index 8258c7d39..3af4b4f7a 100644 --- a/desktop-widgets/modeldelegates.cpp +++ b/desktop-widgets/modeldelegates.cpp @@ -301,7 +301,7 @@ QWidget *TankUseDelegate::createEditor(QWidget * parent, const QStyleOptionViewI { QComboBox *comboBox = new QComboBox(parent); for (int i = 0; i < NUM_GAS_USE; i++) - comboBox->addItem(gettextFromC::instance()->trGettext(cylinderuse_text[i])); + comboBox->addItem(gettextFromC::tr(cylinderuse_text[i])); return comboBox; } -- cgit v1.2.3-70-g09d2