From b115de563cc15e6e181b65902ddca9f13abf41b6 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 27 Sep 2021 17:04:37 +0200 Subject: [PATCH] ProjectExplorer: Move user path conversion closer to the edge And replace some foreach(). Change-Id: I788e112c0e314f5514af22dabd111f9cdb64dca5 Reviewed-by: Christian Stenger --- .../projectexplorer/customwizard/customwizardpage.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/projectexplorer/customwizard/customwizardpage.cpp b/src/plugins/projectexplorer/customwizard/customwizardpage.cpp index 0e256bd9fc3..4348b0f72e3 100644 --- a/src/plugins/projectexplorer/customwizard/customwizardpage.cpp +++ b/src/plugins/projectexplorer/customwizard/customwizardpage.cpp @@ -303,7 +303,7 @@ void CustomWizardFieldPage::initializePage() { QWizardPage::initializePage(); clearError(); - foreach (const LineEditData &led, m_lineEdits) { + for (const LineEditData &led : qAsConst(m_lineEdits)) { if (!led.userChange.isNull()) { led.lineEdit->setText(led.userChange); } else if (!led.defaultText.isEmpty()) { @@ -314,7 +314,7 @@ void CustomWizardFieldPage::initializePage() if (!led.placeholderText.isEmpty()) led.lineEdit->setPlaceholderText(led.placeholderText); } - foreach (const TextEditData &ted, m_textEdits) { + for (const TextEditData &ted : qAsConst(m_textEdits)) { if (!ted.userChange.isNull()) { ted.textEdit->setText(ted.userChange); } else if (!ted.defaultText.isEmpty()) { @@ -323,13 +323,13 @@ void CustomWizardFieldPage::initializePage() ted.textEdit->setText(defaultText); } } - foreach (const PathChooserData &ped, m_pathChoosers) { + for (const PathChooserData &ped : qAsConst(m_pathChoosers)) { if (!ped.userChange.isNull()) { - ped.pathChooser->setPath(ped.userChange); + ped.pathChooser->setFilePath(FilePath::fromUserInput(ped.userChange)); } else if (!ped.defaultText.isEmpty()) { QString defaultText = ped.defaultText; CustomWizardContext::replaceFields(m_context->baseReplacements, &defaultText); - ped.pathChooser->setPath(defaultText); + ped.pathChooser->setFilePath(FilePath::fromUserInput(defaultText)); } } }