Utils: Use FilePath for PathChooser::m_baseDirectory

... and collapse the two accessor versions to one.

Change-Id: I282753a0092601cff073684053ff914016452645
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2019-12-17 11:53:58 +01:00
parent b519a5b482
commit 84d0e3dda8
12 changed files with 25 additions and 39 deletions

View File

@@ -107,7 +107,7 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc)
auto project = bc->project();
auto buildDirChooser = new Utils::PathChooser;
buildDirChooser->setBaseFileName(project->projectDirectory());
buildDirChooser->setBaseDirectory(project->projectDirectory());
buildDirChooser->setFileName(bc->buildDirectory());
connect(buildDirChooser, &Utils::PathChooser::rawPathChanged, this,
[this](const QString &path) {

View File

@@ -463,7 +463,7 @@ CMakeToolItemConfigWidget::CMakeToolItemConfigWidget(CMakeToolItemModel *model)
connect(m_binaryChooser, &PathChooser::rawPathChanged, this, [this]() {
updateQchFilePath();
m_qchFileChooser->setBaseFileName(m_binaryChooser->fileName().parentDir());
m_qchFileChooser->setBaseDirectory(m_binaryChooser->fileName().parentDir());
store();
});
connect(m_qchFileChooser, &PathChooser::rawPathChanged, this, &CMakeToolItemConfigWidget::store);
@@ -508,7 +508,7 @@ void CMakeToolItemConfigWidget::load(const CMakeToolTreeItem *item)
m_binaryChooser->setFileName(item->m_executable);
m_qchFileChooser->setReadOnly(item->m_autodetected);
m_qchFileChooser->setBaseFileName(item->m_executable.parentDir());
m_qchFileChooser->setBaseDirectory(item->m_executable.parentDir());
m_qchFileChooser->setFileName(item->m_qchFile);
m_autoRunCheckBox->setChecked(item->m_isAutoRun);

View File

@@ -42,7 +42,7 @@ QWidget *ConfigModelItemDelegate::createEditor(QWidget *parent, const QStyleOpti
if (data.type == ConfigModel::DataItem::FILE || data.type == ConfigModel::DataItem::DIRECTORY) {
auto edit = new Utils::PathChooser(parent);
edit->setFocusPolicy(Qt::StrongFocus);
edit->setBaseFileName(m_base);
edit->setBaseDirectory(m_base);
edit->setAutoFillBackground(true);
if (data.type == ConfigModel::DataItem::FILE) {
edit->setExpectedKind(Utils::PathChooser::File);