mirror of
https://github.com/parchlinux/calamares.git
synced 2025-02-24 19:05:46 -05:00
Avoid constructing more temporaries than necessary.
Thanks Winfried Kusgörd <w.kusgoerd@arcor.de> for the patch.
This commit is contained in:
parent
42f0e653cc
commit
dabfb68a68
1 changed files with 4 additions and 4 deletions
|
@ -41,7 +41,7 @@ GreetingPage::GreetingPage( QWidget* parent )
|
||||||
{
|
{
|
||||||
ui->setupUi( this );
|
ui->setupUi( this );
|
||||||
|
|
||||||
QString defaultLocale = QLocale::system().name();
|
QLocale defaultLocale = QLocale( QLocale::system().name() );
|
||||||
{
|
{
|
||||||
bool isTranslationAvailable = false;
|
bool isTranslationAvailable = false;
|
||||||
|
|
||||||
|
@ -56,8 +56,8 @@ GreetingPage::GreetingPage( QWidget* parent )
|
||||||
ui->languageWidget->addItem( lang );
|
ui->languageWidget->addItem( lang );
|
||||||
ui->languageWidget->item( ui->languageWidget->count() - 1 )
|
ui->languageWidget->item( ui->languageWidget->count() - 1 )
|
||||||
->setData( Qt::UserRole, thisLocale );
|
->setData( Qt::UserRole, thisLocale );
|
||||||
if ( thisLocale.language() == QLocale( defaultLocale ).language() &&
|
if ( thisLocale.language() == defaultLocale.language() &&
|
||||||
thisLocale.country() == QLocale( defaultLocale ).country() )
|
thisLocale.country() == defaultLocale.country() )
|
||||||
{
|
{
|
||||||
isTranslationAvailable = true;
|
isTranslationAvailable = true;
|
||||||
ui->languageWidget->setCurrentRow( ui->languageWidget->count() - 1 );
|
ui->languageWidget->setCurrentRow( ui->languageWidget->count() - 1 );
|
||||||
|
@ -72,7 +72,7 @@ GreetingPage::GreetingPage( QWidget* parent )
|
||||||
for (int i = 0; i < ui->languageWidget->count(); i++)
|
for (int i = 0; i < ui->languageWidget->count(); i++)
|
||||||
{
|
{
|
||||||
QLocale thisLocale = ui->languageWidget->item(i)->data( Qt::UserRole ).toLocale();
|
QLocale thisLocale = ui->languageWidget->item(i)->data( Qt::UserRole ).toLocale();
|
||||||
if ( thisLocale.language() == QLocale( defaultLocale ).language() )
|
if ( thisLocale.language() == defaultLocale.language() )
|
||||||
{
|
{
|
||||||
isTranslationAvailable = true;
|
isTranslationAvailable = true;
|
||||||
ui->languageWidget->setCurrentRow( i );
|
ui->languageWidget->setCurrentRow( i );
|
||||||
|
|
Loading…
Add table
Reference in a new issue