diff options
author | Tobias Hunger <tobias.hunger@digia.com> | 2014-05-02 12:53:36 +0200 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@digia.com> | 2014-05-06 11:48:10 +0200 |
commit | dc61b989acaa88c892b682ea17985315f3f9206f (patch) | |
tree | 32bf7437b1beb9eed01e74db029113c9c9088e44 /src/plugins/projectexplorer | |
parent | 0814cc112abac5c18e873dcfa388f54ecac7b8a8 (diff) | |
download | qt-creator-dc61b989acaa88c892b682ea17985315f3f9206f.tar.gz |
Project: Use Utils::FileName as return type for projectDirectory(...)
Change-Id: I3ea10aa204b1ea41702edab09884b416cd6d9e06
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Diffstat (limited to 'src/plugins/projectexplorer')
-rw-r--r-- | src/plugins/projectexplorer/buildconfiguration.cpp | 4 | ||||
-rw-r--r-- | src/plugins/projectexplorer/localapplicationrunconfiguration.cpp | 2 | ||||
-rw-r--r-- | src/plugins/projectexplorer/project.cpp | 11 | ||||
-rw-r--r-- | src/plugins/projectexplorer/project.h | 4 | ||||
-rw-r--r-- | src/plugins/projectexplorer/projectexplorer.cpp | 2 | ||||
-rw-r--r-- | src/plugins/projectexplorer/settingsaccessor.cpp | 4 | ||||
-rw-r--r-- | src/plugins/projectexplorer/targetsettingspanel.cpp | 2 |
7 files changed, 14 insertions, 15 deletions
diff --git a/src/plugins/projectexplorer/buildconfiguration.cpp b/src/plugins/projectexplorer/buildconfiguration.cpp index 15d4242ba8..f5392a5e92 100644 --- a/src/plugins/projectexplorer/buildconfiguration.cpp +++ b/src/plugins/projectexplorer/buildconfiguration.cpp @@ -65,7 +65,7 @@ private: bool BuildConfigMacroExpander::resolveMacro(const QString &name, QString *ret) { if (name == QLatin1String("sourceDir")) { - *ret = QDir::toNativeSeparators(m_bc->target()->project()->projectDirectory()); + *ret = m_bc->target()->project()->projectDirectory().toUserOutput(); return true; } if (name == QLatin1String("buildDir")) { @@ -125,7 +125,7 @@ BuildConfiguration::~BuildConfiguration() Utils::FileName BuildConfiguration::buildDirectory() const { QString path = QDir::cleanPath(environment().expandVariables(m_buildDirectory.toString())); - return Utils::FileName::fromString(QDir::cleanPath(QDir(target()->project()->projectDirectory()).absoluteFilePath(path))); + return Utils::FileName::fromString(QDir::cleanPath(QDir(target()->project()->projectDirectory().toString()).absoluteFilePath(path))); } Utils::FileName BuildConfiguration::rawBuildDirectory() const diff --git a/src/plugins/projectexplorer/localapplicationrunconfiguration.cpp b/src/plugins/projectexplorer/localapplicationrunconfiguration.cpp index a646f1d7e9..18aca44940 100644 --- a/src/plugins/projectexplorer/localapplicationrunconfiguration.cpp +++ b/src/plugins/projectexplorer/localapplicationrunconfiguration.cpp @@ -52,7 +52,7 @@ private: bool FallBackMacroExpander::resolveMacro(const QString &name, QString *ret) { if (name == QLatin1String("sourceDir")) { - *ret = QDir::toNativeSeparators(m_target->project()->projectDirectory()); + *ret = m_target->project()->projectDirectory().toUserOutput(); return true; } *ret = Core::VariableManager::value(name.toUtf8()); diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp index 3348b45ae2..207ce827f5 100644 --- a/src/plugins/projectexplorer/project.cpp +++ b/src/plugins/projectexplorer/project.cpp @@ -346,17 +346,16 @@ QVariantMap Project::toMap() const return map; } -QString Project::projectDirectory() const +Utils::FileName Project::projectDirectory() const { - return projectDirectory(document()->filePath()); + return projectDirectory(projectFilePath()); } -QString Project::projectDirectory(const QString &top) +Utils::FileName Project::projectDirectory(const Utils::FileName &top) { if (top.isEmpty()) - return QString(); - QFileInfo info(top); - return info.absoluteDir().path(); + return Utils::FileName(); + return Utils::FileName::fromString(top.toFileInfo().absoluteDir().path()); } diff --git a/src/plugins/projectexplorer/project.h b/src/plugins/projectexplorer/project.h index 4a33c12ed4..e64d275965 100644 --- a/src/plugins/projectexplorer/project.h +++ b/src/plugins/projectexplorer/project.h @@ -116,8 +116,8 @@ public: virtual QVariantMap toMap() const; // The directory that holds the project. This includes the absolute path. - QString projectDirectory() const; - static QString projectDirectory(const QString &top); + Utils::FileName projectDirectory() const; + static Utils::FileName projectDirectory(const Utils::FileName &top); Core::Context projectContext() const; Core::Context projectLanguages() const; diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 03356fc87e..401f677344 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -1791,7 +1791,7 @@ void ProjectExplorerPlugin::updateExternalFileWarning() if (!d->m_currentProject || !infoBar->canInfoBeAdded(externalFileId)) return; Utils::FileName fileName = Utils::FileName::fromString(document->filePath()); - Utils::FileName projectDir = Utils::FileName::fromString(d->m_currentProject->projectDirectory()); + Utils::FileName projectDir = d->m_currentProject->projectDirectory(); if (projectDir.isEmpty() || fileName.isChildOf(projectDir)) return; // External file. Test if it under the same VCS diff --git a/src/plugins/projectexplorer/settingsaccessor.cpp b/src/plugins/projectexplorer/settingsaccessor.cpp index 56de60867b..895b4a5913 100644 --- a/src/plugins/projectexplorer/settingsaccessor.cpp +++ b/src/plugins/projectexplorer/settingsaccessor.cpp @@ -712,7 +712,7 @@ void SettingsAccessor::addVersionUpgrader(VersionUpgrader *handler) QStringList SettingsAccessor::findSettingsFiles(const QString &suffix) const { const QString defaultName = defaultFileName(suffix); - QDir projectDir = QDir(project()->projectDirectory()); + QDir projectDir = QDir(project()->projectDirectory().toString()); QStringList result; if (QFileInfo(defaultName).exists()) @@ -1991,7 +1991,7 @@ QVariantMap UserFileVersion11Upgrader::upgrade(const QVariantMap &map) addBuildConfiguration(k, bc, bcPos, activeBc); addDeployConfiguration(k, dc, dcPos, activeDc); - addRunConfigurations(k, rcs, activeRc, m_accessor->project()->projectDirectory()); + addRunConfigurations(k, rcs, activeRc, m_accessor->project()->projectDirectory().toString()); if (targetPos == activeTarget && bcPos == activeBc && dcPos == activeDc) m_targets[k].insert(QLatin1String("Update.IsActive"), true); } // dcs diff --git a/src/plugins/projectexplorer/targetsettingspanel.cpp b/src/plugins/projectexplorer/targetsettingspanel.cpp index a5eeadc61d..43940ddcdc 100644 --- a/src/plugins/projectexplorer/targetsettingspanel.cpp +++ b/src/plugins/projectexplorer/targetsettingspanel.cpp @@ -639,7 +639,7 @@ void TargetSettingsPanelWidget::openTargetPreferences() void TargetSettingsPanelWidget::importTarget() { - QString toImport = QFileDialog::getExistingDirectory(this, tr("Import directory"), m_project->projectDirectory()); + QString toImport = QFileDialog::getExistingDirectory(this, tr("Import directory"), m_project->projectDirectory().toString()); importTarget(Utils::FileName::fromString(toImport)); } |