From 78c2a142dd296001e17fcad2c60f0b27fb0d4696 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Jen=C3=9Fen?= Date: Fri, 9 May 2025 14:49:45 +0200 Subject: [PATCH] =?UTF-8?q?StudioWelcome:=20use=20Utils::FilePath=20and=20?= =?UTF-8?q?avoid=20QString=20round=E2=80=91trips?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit setProjectLocation() is invoked from QML and therefore keeps its QString parameter. The value is now converted only once to Utils::FilePath. No functional change. Change-Id: I1d12f1b5493c6b9be3bc8b6d9e9c7029671b80eb Reviewed-by: Tim Jenssen --- src/plugins/studiowelcome/qdsnewdialog.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/plugins/studiowelcome/qdsnewdialog.cpp b/src/plugins/studiowelcome/qdsnewdialog.cpp index 08748b2c882..447a4fea023 100644 --- a/src/plugins/studiowelcome/qdsnewdialog.cpp +++ b/src/plugins/studiowelcome/qdsnewdialog.cpp @@ -133,7 +133,7 @@ void QdsNewDialog::setProjectName(const QString &name) void QdsNewDialog::setProjectLocation(const QString &location) { - m_qmlProjectLocation = Utils::FilePath::fromString(QDir::toNativeSeparators(location)); + m_qmlProjectLocation = Utils::FilePath::fromString(location); m_wizard.setProjectLocation(m_qmlProjectLocation); } @@ -238,8 +238,8 @@ void QdsNewDialog::onWizardCreated(QStandardItemModel *screenSizeModel, QStandar updateScreenSizes(); - setProjectName(m_qmlProjectName); - setProjectLocation(m_qmlProjectLocation.toUrlishString()); + m_wizard.setProjectName(m_qmlProjectName); + m_wizard.setProjectLocation(m_qmlProjectLocation); } } @@ -330,12 +330,9 @@ void QdsNewDialog::setWizardFactories(QList factories_, return; // TODO: some message box? const Core::IWizardFactory *first = factories.front(); - Utils::FilePath projectLocation = first->runPath(defaultLocation); - - m_qmlProjectName = uniqueProjectName(projectLocation.toUrlishString()); + m_qmlProjectLocation = first->runPath(defaultLocation); + m_qmlProjectName = uniqueProjectName(m_qmlProjectLocation.toUrlishString()); emit projectNameChanged(); // So that QML knows to update the field - - m_qmlProjectLocation = Utils::FilePath::fromString(QDir::toNativeSeparators(projectLocation.toUrlishString())); emit projectLocationChanged(); // So that QML knows to update the field /* NOTE: