aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/utils/projectintropage.cpp
diff options
context:
space:
mode:
authorhjk <[email protected]>2021-08-09 15:10:21 +0200
committerhjk <[email protected]>2021-08-11 11:49:16 +0000
commit6405f9c436bbe39c7a36dd3f3551d304665d000a (patch)
tree863b56cdd1c72fae786b813780ed6c8d4753c01e /src/libs/utils/projectintropage.cpp
parent9312963f5ec9bbe18c77594fb64f9f5a7b922f6e (diff)
Utils: User FilePath in ProjectIntroPage
... and fix some fallout. Change-Id: I8f4ae8304e29614417f7d6b664e165f618b57f71 Reviewed-by: Christian Stenger <[email protected]>
Diffstat (limited to 'src/libs/utils/projectintropage.cpp')
-rw-r--r--src/libs/utils/projectintropage.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/libs/utils/projectintropage.cpp b/src/libs/utils/projectintropage.cpp
index e5890ac2edf..07470ab6d2b 100644
--- a/src/libs/utils/projectintropage.cpp
+++ b/src/libs/utils/projectintropage.cpp
@@ -114,14 +114,14 @@ QString ProjectIntroPage::projectName() const
return d->m_ui.nameLineEdit->text();
}
-QString ProjectIntroPage::path() const
+FilePath ProjectIntroPage::filePath() const
{
- return d->m_ui.pathChooser->filePath().toString();
+ return d->m_ui.pathChooser->filePath();
}
-void ProjectIntroPage::setPath(const QString &path)
+void ProjectIntroPage::setFilePath(const FilePath &path)
{
- d->m_ui.pathChooser->setPath(path);
+ d->m_ui.pathChooser->setFilePath(path);
}
void ProjectIntroPage::setProjectNameRegularExpression(const QRegularExpression &regEx)
@@ -178,14 +178,15 @@ bool ProjectIntroPage::validate()
}
// Check existence of the directory
- const QFileInfo projectDirFile(path() + QLatin1Char('/')
- + QDir::fromNativeSeparators(d->m_ui.nameLineEdit->text()));
- if (!projectDirFile.exists()) { // All happy
+ const FilePath projectDir =
+ filePath().pathAppended(QDir::fromNativeSeparators(d->m_ui.nameLineEdit->text()));
+
+ if (!projectDir.exists()) { // All happy
hideStatusLabel();
return true;
}
- if (projectDirFile.isDir()) {
+ if (projectDir.isDir()) {
displayStatusMessage(InfoLabel::Warning, tr("The project already exists."));
return true;
}