From fe8a983ee32e736b2576e2ccba287594fcbee576 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 19 Oct 2021 14:43:49 +0300 Subject: [PATCH] Improve code quality. --- src/app/tape/mapplication.cpp | 2 +- .../dialogs/configpages/preferencesconfigurationpage.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/tape/mapplication.cpp b/src/app/tape/mapplication.cpp index 6727c3d93..a365383e9 100644 --- a/src/app/tape/mapplication.cpp +++ b/src/app/tape/mapplication.cpp @@ -786,7 +786,7 @@ void MApplication::ParseCommandLine(const SocketConnection &connection, const QS } } - for (auto &arg : args) + for (const auto &arg : args) { NewMainWindow(); if (not MainWindow()->LoadFile(arg)) diff --git a/src/app/valentina/dialogs/configpages/preferencesconfigurationpage.cpp b/src/app/valentina/dialogs/configpages/preferencesconfigurationpage.cpp index d9f49515a..cbd1c2d47 100644 --- a/src/app/valentina/dialogs/configpages/preferencesconfigurationpage.cpp +++ b/src/app/valentina/dialogs/configpages/preferencesconfigurationpage.cpp @@ -202,11 +202,11 @@ QStringList PreferencesConfigurationPage::Apply() if (m_langChanged || m_systemChanged) { - const QString locale = qvariant_cast(ui->langCombo->currentData()); + const auto locale = qvariant_cast(ui->langCombo->currentData()); settings->SetLocale(locale); m_langChanged = false; - const QString code = qvariant_cast(ui->systemCombo->currentData()); + const auto code = qvariant_cast(ui->systemCombo->currentData()); settings->SetPMSystemCode(code); m_systemChanged = false; @@ -214,14 +214,14 @@ QStringList PreferencesConfigurationPage::Apply() } if (m_unitChanged) { - const QString unit = qvariant_cast(ui->unitCombo->currentData()); + const auto unit = qvariant_cast(ui->unitCombo->currentData()); settings->SetUnit(unit); m_unitChanged = false; preferences.append(tr("default unit")); } if (m_labelLangChanged) { - const QString locale = qvariant_cast(ui->labelCombo->currentData()); + const auto locale = qvariant_cast(ui->labelCombo->currentData()); settings->SetLabelLanguage(locale); m_labelLangChanged = false; }