From 39570fb675e16ff8f5f5feff9029af3d25797934 Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 13 Jun 2024 11:24:01 +0200 Subject: [PATCH] Utils: Rename PathChooser::rawFilePath() to unxepandedFilePath() That's what the implementation does, and judging from the using code wasn't quite clear. Change-Id: I4ca776ba4da83a36162adad2dd595eb39eb0f43d Reviewed-by: Eike Ziller --- src/libs/utils/pathchooser.cpp | 4 ++-- src/libs/utils/pathchooser.h | 4 ++-- src/plugins/android/androidbuildapkstep.cpp | 2 +- src/plugins/android/createandroidmanifestwizard.cpp | 2 +- src/plugins/clangtools/settingswidget.cpp | 4 ++-- src/plugins/clearcase/settingspage.cpp | 2 +- src/plugins/cmakeprojectmanager/configmodelitemdelegate.cpp | 4 ++-- src/plugins/coreplugin/dialogs/externaltoolconfig.cpp | 6 +++--- src/plugins/coreplugin/locator/spotlightlocatorfilter.cpp | 2 +- src/plugins/debugger/debuggersourcepathmappingwidget.cpp | 2 +- src/plugins/debugger/loadcoredialog.cpp | 4 ++-- src/plugins/haskell/haskellbuildconfiguration.cpp | 2 +- src/plugins/incredibuild/commandbuilderaspect.cpp | 2 +- src/plugins/mcusupport/mcupackage.cpp | 2 +- src/plugins/nim/project/nimtoolchain.cpp | 2 +- src/plugins/projectexplorer/runconfigurationaspects.cpp | 2 +- src/plugins/qbsprojectmanager/qbsbuildstep.cpp | 4 ++-- src/plugins/qtsupport/qtoptionspage.cpp | 2 +- 18 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/libs/utils/pathchooser.cpp b/src/libs/utils/pathchooser.cpp index 9b2177fedb6..8e941f52a34 100644 --- a/src/libs/utils/pathchooser.cpp +++ b/src/libs/utils/pathchooser.cpp @@ -342,14 +342,14 @@ void PathChooser::setEnvironment(const Environment &env) } } -FilePath PathChooser::rawFilePath() const +FilePath PathChooser::unexpandedFilePath() const { return FilePath::fromUserInput(d->m_lineEdit->text()); } FilePath PathChooser::filePath() const { - return d->expandedPath(rawFilePath()); + return d->expandedPath(unexpandedFilePath()); } FilePath PathChooser::absoluteFilePath() const diff --git a/src/libs/utils/pathchooser.h b/src/libs/utils/pathchooser.h index a3e259a748d..b0d70e90b8f 100644 --- a/src/libs/utils/pathchooser.h +++ b/src/libs/utils/pathchooser.h @@ -67,10 +67,10 @@ public: bool isValid() const; QString errorMessage() const; - FilePath filePath() const; // Close to what's in the line edit. + FilePath filePath() const; // Close to what's in the line edit. Expands macros. FilePath absoluteFilePath() const; // Relative paths resolved wrt the specified base dir. - FilePath rawFilePath() const; // The raw unexpanded input as FilePath. + FilePath unexpandedFilePath() const; // The raw unexpanded input as FilePath. FilePath baseDirectory() const; void setBaseDirectory(const FilePath &base); diff --git a/src/plugins/android/androidbuildapkstep.cpp b/src/plugins/android/androidbuildapkstep.cpp index 51f73180971..3ad6a4ba849 100644 --- a/src/plugins/android/androidbuildapkstep.cpp +++ b/src/plugins/android/androidbuildapkstep.cpp @@ -140,7 +140,7 @@ AndroidBuildApkWidget::AndroidBuildApkWidget(AndroidBuildApkStep *step) keystoreLocationChooser->setPromptDialogFilter(Tr::tr("Keystore files (*.keystore *.jks)")); keystoreLocationChooser->setPromptDialogTitle(Tr::tr("Select Keystore File")); connect(keystoreLocationChooser, &PathChooser::textChanged, this, [this, keystoreLocationChooser] { - const FilePath file = keystoreLocationChooser->rawFilePath(); + const FilePath file = keystoreLocationChooser->unexpandedFilePath(); m_step->setKeystorePath(file); m_signPackageCheckBox->setChecked(!file.isEmpty()); if (!file.isEmpty()) diff --git a/src/plugins/android/createandroidmanifestwizard.cpp b/src/plugins/android/createandroidmanifestwizard.cpp index 8f50666419a..18a7872e08d 100644 --- a/src/plugins/android/createandroidmanifestwizard.cpp +++ b/src/plugins/android/createandroidmanifestwizard.cpp @@ -151,7 +151,7 @@ ChooseDirectoryPage::ChooseDirectoryPage(CreateAndroidManifestWizard *wizard) m_layout->addRow(m_sourceDirectoryWarning); connect(m_androidPackageSourceDir, &PathChooser::textChanged, m_wizard, [this] { - m_wizard->setDirectory(m_androidPackageSourceDir->rawFilePath()); + m_wizard->setDirectory(m_androidPackageSourceDir->unexpandedFilePath()); }); if (wizard->copyGradle()) { diff --git a/src/plugins/clangtools/settingswidget.cpp b/src/plugins/clangtools/settingswidget.cpp index 113373f57e0..4b686e61ac9 100644 --- a/src/plugins/clangtools/settingswidget.cpp +++ b/src/plugins/clangtools/settingswidget.cpp @@ -99,12 +99,12 @@ SettingsWidget::~SettingsWidget() FilePath SettingsWidget::clangTidyPath() const { - return m_clangTidyPathChooser->rawFilePath(); + return m_clangTidyPathChooser->unexpandedFilePath(); } FilePath SettingsWidget::clazyStandalonePath() const { - return m_clazyStandalonePathChooser->rawFilePath(); + return m_clazyStandalonePathChooser->unexpandedFilePath(); } // ClangToolsOptionsPage diff --git a/src/plugins/clearcase/settingspage.cpp b/src/plugins/clearcase/settingspage.cpp index 010d3d1e98e..713ef78c344 100644 --- a/src/plugins/clearcase/settingspage.cpp +++ b/src/plugins/clearcase/settingspage.cpp @@ -177,7 +177,7 @@ SettingsPageWidget::SettingsPageWidget() void SettingsPageWidget::apply() { ClearCaseSettings rc; - rc.ccCommand = commandPathChooser->rawFilePath().toString(); + rc.ccCommand = commandPathChooser->unexpandedFilePath().toString(); rc.ccBinaryPath = commandPathChooser->filePath(); rc.timeOutS = timeOutSpinBox->value(); rc.autoCheckOut = autoCheckOutCheckBox->isChecked(); diff --git a/src/plugins/cmakeprojectmanager/configmodelitemdelegate.cpp b/src/plugins/cmakeprojectmanager/configmodelitemdelegate.cpp index c8db1a85cb6..d9e7a943c3d 100644 --- a/src/plugins/cmakeprojectmanager/configmodelitemdelegate.cpp +++ b/src/plugins/cmakeprojectmanager/configmodelitemdelegate.cpp @@ -94,8 +94,8 @@ void ConfigModelItemDelegate::setModelData(QWidget *editor, QAbstractItemModel * ConfigModel::DataItem data = ConfigModel::dataItemFromIndex(index); if (data.type == ConfigModel::DataItem::FILE || data.type == ConfigModel::DataItem::DIRECTORY) { auto edit = static_cast(editor); - if (edit->rawFilePath().toString() != data.value) - model->setData(index, edit->rawFilePath().toString(), Qt::EditRole); + if (edit->unexpandedFilePath().toString() != data.value) + model->setData(index, edit->unexpandedFilePath().toString(), Qt::EditRole); return; } else if (!data.values.isEmpty()) { auto edit = static_cast(editor); diff --git a/src/plugins/coreplugin/dialogs/externaltoolconfig.cpp b/src/plugins/coreplugin/dialogs/externaltoolconfig.cpp index 76ff935975d..a758adf1053 100644 --- a/src/plugins/coreplugin/dialogs/externaltoolconfig.cpp +++ b/src/plugins/coreplugin/dialogs/externaltoolconfig.cpp @@ -700,12 +700,12 @@ void ExternalToolConfig::updateItem(const QModelIndex &index) tool->setDescription(m_description->text()); FilePaths executables = tool->executables(); if (executables.size() > 0) - executables[0] = m_executable->rawFilePath(); + executables[0] = m_executable->unexpandedFilePath(); else - executables << m_executable->rawFilePath(); + executables << m_executable->unexpandedFilePath(); tool->setExecutables(executables); tool->setArguments(m_arguments->text()); - tool->setWorkingDirectory(m_workingDirectory->rawFilePath()); + tool->setWorkingDirectory(m_workingDirectory->unexpandedFilePath()); tool->setBaseEnvironmentProviderId(Id::fromSetting(m_baseEnvironment->currentData())); tool->setEnvironmentUserChanges(m_environment); tool->setOutputHandling(ExternalTool::OutputHandling(m_outputBehavior->currentIndex())); diff --git a/src/plugins/coreplugin/locator/spotlightlocatorfilter.cpp b/src/plugins/coreplugin/locator/spotlightlocatorfilter.cpp index d8f07178b43..259ffb6aa4a 100644 --- a/src/plugins/coreplugin/locator/spotlightlocatorfilter.cpp +++ b/src/plugins/coreplugin/locator/spotlightlocatorfilter.cpp @@ -231,7 +231,7 @@ bool SpotlightLocatorFilter::openConfigDialog(QWidget *parent, bool &needsRefres chooser->addSupportedWidget(caseSensitiveArgumentsEdit); const bool accepted = ILocatorFilter::openConfigDialog(parent, &configWidget); if (accepted) { - m_command = commandEdit->rawFilePath().toString(); + m_command = commandEdit->unexpandedFilePath().toString(); m_arguments = argumentsEdit->text(); m_caseSensitiveArguments = caseSensitiveArgumentsEdit->text(); m_sortResults = sortResults->isChecked(); diff --git a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp index 98b84e2020e..e8f231473b2 100644 --- a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp +++ b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp @@ -309,7 +309,7 @@ QString DebuggerSourcePathMappingWidget::editSourceField() const QString DebuggerSourcePathMappingWidget::editTargetField() const { - return m_targetChooser->rawFilePath().toString(); + return m_targetChooser->unexpandedFilePath().toString(); } void DebuggerSourcePathMappingWidget::setEditFieldMapping(const Mapping &m) diff --git a/src/plugins/debugger/loadcoredialog.cpp b/src/plugins/debugger/loadcoredialog.cpp index 4c006199700..937c77b8e19 100644 --- a/src/plugins/debugger/loadcoredialog.cpp +++ b/src/plugins/debugger/loadcoredialog.cpp @@ -163,10 +163,10 @@ int AttachCoreDialog::exec() { connect(d->symbolFileName, &PathChooser::validChanged, this, &AttachCoreDialog::changed); connect(d->coreFileName, &PathChooser::validChanged, this, [this] { - coreFileChanged(d->coreFileName->rawFilePath()); + coreFileChanged(d->coreFileName->unexpandedFilePath()); }); connect(d->coreFileName, &PathChooser::textChanged, this, [this] { - coreFileChanged(d->coreFileName->rawFilePath()); + coreFileChanged(d->coreFileName->unexpandedFilePath()); }); connect(d->kitChooser, &KitChooser::currentIndexChanged, this, &AttachCoreDialog::changed); connect(d->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); diff --git a/src/plugins/haskell/haskellbuildconfiguration.cpp b/src/plugins/haskell/haskellbuildconfiguration.cpp index 1434833ff65..bb8ef948705 100644 --- a/src/plugins/haskell/haskellbuildconfiguration.cpp +++ b/src/plugins/haskell/haskellbuildconfiguration.cpp @@ -90,7 +90,7 @@ public: &Utils::PathChooser::textChanged, bc, [bc, buildDirectoryInput](const QString &) { - bc->setBuildDirectory(buildDirectoryInput->rawFilePath()); + bc->setBuildDirectory(buildDirectoryInput->unexpandedFilePath()); }); } }; diff --git a/src/plugins/incredibuild/commandbuilderaspect.cpp b/src/plugins/incredibuild/commandbuilderaspect.cpp index 38d0d858e8e..83476af36ff 100644 --- a/src/plugins/incredibuild/commandbuilderaspect.cpp +++ b/src/plugins/incredibuild/commandbuilderaspect.cpp @@ -132,7 +132,7 @@ void CommandBuilderAspect::addToLayout(Layouting::Layout &parent) d->makePathChooser->setBaseDirectory(PathChooser::homePath()); d->makePathChooser->setHistoryCompleter("IncrediBuild.BuildConsole.MakeCommand.History"); connect(d->makePathChooser, &PathChooser::rawPathChanged, this, [this] { - d->m_activeCommandBuilder->setCommand(d->makePathChooser->rawFilePath()); + d->m_activeCommandBuilder->setCommand(d->makePathChooser->unexpandedFilePath()); updateGui(); }); } diff --git a/src/plugins/mcusupport/mcupackage.cpp b/src/plugins/mcusupport/mcupackage.cpp index 2ccc4bcc1a0..20ee020ae32 100644 --- a/src/plugins/mcusupport/mcupackage.cpp +++ b/src/plugins/mcusupport/mcupackage.cpp @@ -314,7 +314,7 @@ QWidget *McuPackage::widget() QObject::connect(this, &McuPackage::statusChanged, widget, [this] { updateStatusUi(); }); QObject::connect(m_fileChooser, &PathChooser::textChanged, this, [this] { - setPath(m_fileChooser->rawFilePath()); + setPath(m_fileChooser->unexpandedFilePath()); }); connect(this, &McuPackage::changed, m_fileChooser, [this] { diff --git a/src/plugins/nim/project/nimtoolchain.cpp b/src/plugins/nim/project/nimtoolchain.cpp index 80036592644..701883de0c0 100644 --- a/src/plugins/nim/project/nimtoolchain.cpp +++ b/src/plugins/nim/project/nimtoolchain.cpp @@ -141,7 +141,7 @@ public: // Connect connect(m_compilerCommand, &PathChooser::validChanged, this, [this] { - const FilePath path = m_compilerCommand->rawFilePath(); + const FilePath path = m_compilerCommand->unexpandedFilePath(); auto tc = static_cast(toolchain()); QTC_ASSERT(tc, return); tc->setCompilerCommand(path); diff --git a/src/plugins/projectexplorer/runconfigurationaspects.cpp b/src/plugins/projectexplorer/runconfigurationaspects.cpp index a383438c8b5..01003a97668 100644 --- a/src/plugins/projectexplorer/runconfigurationaspects.cpp +++ b/src/plugins/projectexplorer/runconfigurationaspects.cpp @@ -186,7 +186,7 @@ void WorkingDirectoryAspect::addToLayout(Layout &builder) m_chooser->setBaseDirectory(m_defaultWorkingDirectory); m_chooser->setFilePath(m_workingDirectory.isEmpty() ? m_defaultWorkingDirectory : m_workingDirectory); connect(m_chooser.data(), &PathChooser::textChanged, this, [this] { - m_workingDirectory = m_chooser->rawFilePath(); + m_workingDirectory = m_chooser->unexpandedFilePath(); m_resetButton->setEnabled(m_workingDirectory != m_defaultWorkingDirectory); }); diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp index 9d0a9f642cf..c079f007b16 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp @@ -610,7 +610,7 @@ void QbsBuildStepConfigWidget::changeUseDefaultInstallDir(bool useDefault) if (useDefault) config.remove(Constants::QBS_INSTALL_ROOT_KEY); else - config.insert(Constants::QBS_INSTALL_ROOT_KEY, installDirChooser->rawFilePath().toString()); + config.insert(Constants::QBS_INSTALL_ROOT_KEY, installDirChooser->unexpandedFilePath().toString()); m_qbsStep->setQbsConfiguration(config); } @@ -620,7 +620,7 @@ void QbsBuildStepConfigWidget::changeInstallDir() return; const GuardLocker locker(m_ignoreChanges); Store config = m_qbsStep->qbsConfiguration(QbsBuildStep::PreserveVariables); - config.insert(Constants::QBS_INSTALL_ROOT_KEY, installDirChooser->rawFilePath().toString()); + config.insert(Constants::QBS_INSTALL_ROOT_KEY, installDirChooser->unexpandedFilePath().toString()); m_qbsStep->setQbsConfiguration(config); } diff --git a/src/plugins/qtsupport/qtoptionspage.cpp b/src/plugins/qtsupport/qtoptionspage.cpp index 7b08db2351a..3be1bc2570b 100644 --- a/src/plugins/qtsupport/qtoptionspage.cpp +++ b/src/plugins/qtsupport/qtoptionspage.cpp @@ -1036,7 +1036,7 @@ void QtSettingsPageWidget::linkWithQt() dialog.exec(); if (dialog.result() == QDialog::Accepted) { const std::optional settingsDir = settingsDirForQtDir(pathInput->baseDirectory(), - pathInput->rawFilePath()); + pathInput->unexpandedFilePath()); if (QTC_GUARD(settingsDir)) { const QString settingsFilePath = settingsFile(ICore::resourcePath().toString()); QSettings settings(settingsFilePath, QSettings::IniFormat);