From dabfb68a68cb012a90cd7b94a22e1ea08f7dd8ad Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Mon, 9 Feb 2015 19:15:54 +0100 Subject: [PATCH] =?UTF-8?q?Avoid=20constructing=20more=20temporaries=20tha?= =?UTF-8?q?n=20necessary.=20Thanks=20Winfried=20Kusg=C3=B6rd=20=20for=20the=20patch.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/greeting/GreetingPage.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/greeting/GreetingPage.cpp b/src/modules/greeting/GreetingPage.cpp index cd302537e..74ba07110 100644 --- a/src/modules/greeting/GreetingPage.cpp +++ b/src/modules/greeting/GreetingPage.cpp @@ -41,7 +41,7 @@ GreetingPage::GreetingPage( QWidget* parent ) { ui->setupUi( this ); - QString defaultLocale = QLocale::system().name(); + QLocale defaultLocale = QLocale( QLocale::system().name() ); { bool isTranslationAvailable = false; @@ -56,8 +56,8 @@ GreetingPage::GreetingPage( QWidget* parent ) ui->languageWidget->addItem( lang ); ui->languageWidget->item( ui->languageWidget->count() - 1 ) ->setData( Qt::UserRole, thisLocale ); - if ( thisLocale.language() == QLocale( defaultLocale ).language() && - thisLocale.country() == QLocale( defaultLocale ).country() ) + if ( thisLocale.language() == defaultLocale.language() && + thisLocale.country() == defaultLocale.country() ) { isTranslationAvailable = true; ui->languageWidget->setCurrentRow( ui->languageWidget->count() - 1 ); @@ -72,7 +72,7 @@ GreetingPage::GreetingPage( QWidget* parent ) for (int i = 0; i < ui->languageWidget->count(); i++) { QLocale thisLocale = ui->languageWidget->item(i)->data( Qt::UserRole ).toLocale(); - if ( thisLocale.language() == QLocale( defaultLocale ).language() ) + if ( thisLocale.language() == defaultLocale.language() ) { isTranslationAvailable = true; ui->languageWidget->setCurrentRow( i );