Utils: Hide some uses of FilePath::rawPath()

This basically inlines the current rawPath() implementation
on the user code side, keeping behavior the same.

Baby steps towards the originally intended swap of rawPath()
and rawFilePath() implementations.

Change-Id: Ib61887bfdc4485a17856c0dbc7c7c5dba7c3e0e3
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
hjk
2022-06-29 15:20:34 +02:00
parent a12169a006
commit e22f50814d
6 changed files with 7 additions and 6 deletions

View File

@@ -93,7 +93,6 @@ public:
FilePath filePath() const; // Close to what's in the line edit.
FilePath absoluteFilePath() const; // Relative paths resolved wrt the specified base dir.
QString rawPath() const; // The raw unexpanded input.
FilePath rawFilePath() const; // The raw unexpanded input as FilePath.
static QString expandedDirectory(const QString &input, const Environment &env,
@@ -158,7 +157,9 @@ public:
// input value during validation if the real value is empty
// setting an empty QString will disable this and clear the placeHolderText
void setDefaultValue(const QString &defaultValue);
private:
QString rawPath() const; // The raw unexpanded input.
bool validatePath(FancyLineEdit *edit, QString *errorMessage) const;
// Returns overridden title or the one from <title>
QString makeDialogTitle(const QString &title);

View File

@@ -100,7 +100,7 @@ SettingsPageWidget::SettingsPageWidget()
void SettingsPageWidget::apply()
{
ClearCaseSettings rc;
rc.ccCommand = m_ui.commandPathChooser->rawPath();
rc.ccCommand = m_ui.commandPathChooser->rawFilePath().toString();
rc.ccBinaryPath = m_ui.commandPathChooser->filePath().toString();
rc.timeOutS = m_ui.timeOutSpinBox->value();
rc.autoCheckOut = m_ui.autoCheckOutCheckBox->isChecked();

View File

@@ -114,7 +114,7 @@ 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<Utils::PathChooser *>(editor);
if (edit->rawPath() != data.value)
if (edit->rawFilePath().toString() != data.value)
model->setData(index, edit->filePath().toString(), Qt::EditRole);
return;
} else if (!data.values.isEmpty()) {

View File

@@ -334,7 +334,7 @@ QString DebuggerSourcePathMappingWidget::editSourceField() const
QString DebuggerSourcePathMappingWidget::editTargetField() const
{
return m_targetChooser->rawPath();
return m_targetChooser->rawFilePath().toString();
}
void DebuggerSourcePathMappingWidget::setEditFieldMapping(const Mapping &m)

View File

@@ -796,7 +796,7 @@ void QbsBuildStepConfigWidget::changeUseDefaultInstallDir(bool useDefault)
if (useDefault)
config.remove(Constants::QBS_INSTALL_ROOT_KEY);
else
config.insert(Constants::QBS_INSTALL_ROOT_KEY, installDirChooser->rawPath());
config.insert(Constants::QBS_INSTALL_ROOT_KEY, installDirChooser->rawFilePath().toString());
m_qbsStep->setQbsConfiguration(config);
m_ignoreChange = false;
}

View File

@@ -1011,7 +1011,7 @@ void QtOptionsPageWidget::linkWithQt()
dialog.exec();
if (dialog.result() == QDialog::Accepted) {
const Utils::optional<QString> settingsDir = settingsDirForQtDir(pathInput->rawPath());
const Utils::optional<QString> settingsDir = settingsDirForQtDir(pathInput->rawFilePath().toString());
if (QTC_GUARD(settingsDir)) {
QSettings(settingsFile(Core::ICore::resourcePath().toString()), QSettings::IniFormat)
.setValue(kInstallSettingsKey, *settingsDir);