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 <eike.ziller@qt.io>
This commit is contained in:
hjk
2024-06-13 11:24:01 +02:00
parent 282960528e
commit 39570fb675
18 changed files with 26 additions and 26 deletions

View File

@@ -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

View File

@@ -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);

View File

@@ -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())

View File

@@ -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()) {

View File

@@ -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

View File

@@ -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();

View File

@@ -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<PathChooser *>(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<QComboBox *>(editor);

View File

@@ -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()));

View File

@@ -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();

View File

@@ -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)

View File

@@ -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);

View File

@@ -90,7 +90,7 @@ public:
&Utils::PathChooser::textChanged,
bc,
[bc, buildDirectoryInput](const QString &) {
bc->setBuildDirectory(buildDirectoryInput->rawFilePath());
bc->setBuildDirectory(buildDirectoryInput->unexpandedFilePath());
});
}
};

View File

@@ -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();
});
}

View File

@@ -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] {

View File

@@ -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<NimToolchain *>(toolchain());
QTC_ASSERT(tc, return);
tc->setCompilerCommand(path);

View File

@@ -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);
});

View File

@@ -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);
}

View File

@@ -1036,7 +1036,7 @@ void QtSettingsPageWidget::linkWithQt()
dialog.exec();
if (dialog.result() == QDialog::Accepted) {
const std::optional<FilePath> settingsDir = settingsDirForQtDir(pathInput->baseDirectory(),
pathInput->rawFilePath());
pathInput->unexpandedFilePath());
if (QTC_GUARD(settingsDir)) {
const QString settingsFilePath = settingsFile(ICore::resourcePath().toString());
QSettings settings(settingsFilePath, QSettings::IniFormat);