Commit dc61b989 authored by Tobias Hunger's avatar Tobias Hunger

Project: Use Utils::FileName as return type for projectDirectory(...)

Change-Id: I3ea10aa204b1ea41702edab09884b416cd6d9e06
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent 0814cc11
......@@ -98,6 +98,7 @@ public:
QString baseDirectory() const;
void setBaseDirectory(const QString &directory);
Utils::FileName baseFileName() const;
void setBaseFileName(const Utils::FileName &base);
......
......@@ -59,7 +59,7 @@ RunControl *AndroidAnalyzeSupport::createAnalyzeRunControl(AndroidRunConfigurati
params.displayName = AndroidManager::packageName(target);
params.sysroot = SysRootKitInformation::sysRoot(target->kit()).toString();
// TODO: Not sure if these are the right paths.
params.workingDirectory = target->project()->projectDirectory();
params.workingDirectory = target->project()->projectDirectory().toString();
if (runMode == ProjectExplorer::QmlProfilerRunMode) {
QTcpServer server;
QTC_ASSERT(server.listen(QHostAddress::LocalHost)
......
......@@ -119,7 +119,7 @@ RunControl *AndroidDebugSupport::createDebugRunControl(AndroidRunConfiguration *
params.qmlServerAddress = server.serverAddress().toString();
params.remoteSetupNeeded = true;
//TODO: Not sure if these are the right paths.
params.projectSourceDirectory = project->projectDirectory();
params.projectSourceDirectory = project->projectDirectory().toString();
params.projectSourceFiles = project->files(QmakeProject::ExcludeGeneratedFiles);
params.projectBuildDirectory = project->rootQmakeProjectNode()->buildDir();
}
......
......@@ -170,7 +170,7 @@ void AndroidDeployQtStep::ctor()
bool AndroidDeployQtStep::init()
{
if (AndroidManager::checkForQt51Files(project()->projectDirectory()))
if (AndroidManager::checkForQt51Files(project()->projectDirectory().toString()))
emit addOutput(tr("Found old folder \"android\" in source directory. Qt 5.2 does not use that folder by default."), ErrorOutput);
m_targetArch = AndroidManager::targetArch(target());
......
......@@ -98,7 +98,7 @@ AndroidDeployQtWidget::AndroidDeployQtWidget(AndroidDeployQtStep *step)
m_ui->verboseOutputCheckBox->setChecked(m_step->verboseOutput());
m_ui->openPackageLocationCheckBox->setChecked(m_step->openPackageLocation());
bool oldFiles = AndroidManager::checkForQt51Files(m_step->project()->projectDirectory());
bool oldFiles = AndroidManager::checkForQt51Files(m_step->project()->projectDirectory().toString());
m_ui->oldFilesWarningIcon->setVisible(oldFiles);
m_ui->oldFilesWarningLabel->setVisible(oldFiles);
......@@ -346,7 +346,7 @@ void AndroidDeployQtWidget::addAndroidExtraLib()
{
QStringList fileNames = QFileDialog::getOpenFileNames(this,
tr("Select additional libraries"),
m_currentBuildConfiguration->target()->project()->projectDirectory(),
m_currentBuildConfiguration->target()->project()->projectDirectory().toString(),
tr("Libraries (*.so)"));
if (!fileNames.isEmpty())
......
......@@ -126,7 +126,7 @@ void AndroidExtraLibraryListModel::addEntries(const QStringList &list)
beginInsertRows(QModelIndex(), m_entries.size(), m_entries.size() + list.size());
foreach (const QString &path, list)
m_entries += QLatin1String("$$PWD/") + QDir(m_project->projectDirectory()).relativeFilePath(path);
m_entries += QLatin1String("$$PWD/") + QDir(m_project->projectDirectory().toString()).relativeFilePath(path);
QmakeProjectManager::QmakeProFileNode *node = m_project->rootQmakeProjectNode();
node->setProVariable(QLatin1String("ANDROID_EXTRA_LIBS"), m_entries, m_scope,
......
......@@ -274,7 +274,8 @@ Utils::FileName AndroidManager::dirPath(ProjectExplorer::Target *target)
QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitInformation::qtVersion(target->kit());
if (qtVersion && qtVersion->qtVersion() >= QtSupport::QtVersionNumber(5, 2, 0))
return target->activeBuildConfiguration()->buildDirectory().appendPath(QLatin1String(Constants::ANDROID_BUILDDIRECTORY));
return Utils::FileName::fromString(target->project()->projectDirectory()).appendPath(AndroidDirName);
Utils::FileName dir = target->project()->projectDirectory();
return dir.appendPath(AndroidDirName);
}
Utils::FileName AndroidManager::manifestPath(ProjectExplorer::Target *target)
......@@ -539,7 +540,7 @@ bool AndroidManager::createAndroidTemplatesIfNecessary(ProjectExplorer::Target *
Utils::FileName javaSrcPath
= Utils::FileName::fromString(version->qmakeProperty("QT_INSTALL_PREFIX"))
.appendPath(QLatin1String("src/android/java"));
QDir projectDir(qmakeProject->projectDirectory());
QDir projectDir(qmakeProject->projectDirectory().toString());
Utils::FileName androidPath = dirPath(target);
QStringList m_ignoreFiles;
......
......@@ -90,7 +90,7 @@ Project *androidProject(const QString &file)
continue;
Kit *kit = project->activeTarget()->kit();
if (DeviceTypeKitInformation::deviceTypeId(kit) == Android::Constants::ANDROID_DEVICE_TYPE
&& fileName.isChildOf(Utils::FileName::fromString(project->projectDirectory())))
&& fileName.isChildOf(project->projectDirectory()))
return project;
}
return 0;
......
......@@ -80,7 +80,7 @@ void AndroidRunConfiguration::init()
bool AndroidRunConfiguration::fromMap(const QVariantMap &map)
{
const QDir projectDir = QDir(target()->project()->projectDirectory());
const QDir projectDir = QDir(target()->project()->projectDirectory().toString());
m_proFilePath = QDir::cleanPath(projectDir.filePath(map.value(QLatin1String(PRO_FILE_KEY)).toString()));
m_parseSuccess = static_cast<QmakeProject *>(target()->project())->validParse(m_proFilePath);
m_parseInProgress = static_cast<QmakeProject *>(target()->project())->parseInProgress(m_proFilePath);
......@@ -90,7 +90,7 @@ bool AndroidRunConfiguration::fromMap(const QVariantMap &map)
QVariantMap AndroidRunConfiguration::toMap() const
{
const QDir projectDir = QDir(target()->project()->projectDirectory());
const QDir projectDir = QDir(target()->project()->projectDirectory().toString());
QVariantMap map(RunConfiguration::toMap());
map.insert(QLatin1String(PRO_FILE_KEY), projectDir.relativeFilePath(m_proFilePath));
return map;
......
......@@ -250,7 +250,7 @@ void CreateAndroidManifestWizard::createAndroidManifestFile()
// and now time for some magic
QString dir = QFileInfo(fileName).absolutePath();
QString value = QLatin1String("$$PWD/")
+ QDir(m_target->project()->projectDirectory()).relativeFilePath(dir);
+ QDir(m_target->project()->projectDirectory().toString()).relativeFilePath(dir);
bool result =
m_node->setProVariable(QLatin1String("ANDROID_PACKAGE_SOURCE_DIR"), QStringList(value));
QStringList unChanged;
......
......@@ -97,8 +97,7 @@ int AutotoolsBuildConfigurationFactory::priority(const Target *parent) const
QList<BuildInfo *> AutotoolsBuildConfigurationFactory::availableBuilds(const Target *parent) const
{
QList<BuildInfo *> result;
result << createBuildInfo(parent->kit(),
Utils::FileName::fromString(parent->project()->projectDirectory()));
result << createBuildInfo(parent->kit(), parent->project()->projectDirectory());
return result;
}
......@@ -135,7 +134,7 @@ BuildConfiguration *AutotoolsBuildConfigurationFactory::create(Target *parent, c
// ### Build Steps Build ###
// autogen.sh or autoreconf
QFile autogenFile(parent->project()->projectDirectory() + QLatin1String("/autogen.sh"));
QFile autogenFile(parent->project()->projectDirectory().toString() + QLatin1String("/autogen.sh"));
if (autogenFile.exists()) {
AutogenStep *autogenStep = new AutogenStep(buildSteps);
buildSteps->insertStep(0, autogenStep);
......
......@@ -59,13 +59,13 @@ AutotoolsBuildSettingsWidget::AutotoolsBuildSettingsWidget(AutotoolsBuildConfigu
m_pathChooser = new Utils::PathChooser(this);
m_pathChooser->setEnabled(true);
m_pathChooser->setExpectedKind(Utils::PathChooser::Directory);
m_pathChooser->setBaseDirectory(bc->target()->project()->projectDirectory());
m_pathChooser->setBaseFileName(bc->target()->project()->projectDirectory());
m_pathChooser->setEnvironment(bc->environment());
m_pathChooser->setHistoryCompleter(QLatin1String("AutoTools.BuildDir.History"));
fl->addRow(tr("Build directory:"), m_pathChooser);
connect(m_pathChooser, SIGNAL(changed(QString)), this, SLOT(buildDirectoryChanged()));
m_pathChooser->setBaseDirectory(bc->target()->project()->projectDirectory());
m_pathChooser->setBaseFileName(bc->target()->project()->projectDirectory());
m_pathChooser->setPath(m_buildConfiguration->rawBuildDirectory().toString());
setDisplayName(tr("Autotools Manager"));
......
......@@ -131,7 +131,7 @@ QVariantMap BareMetalRunConfiguration::toMap() const
{
QVariantMap map(RunConfiguration::toMap());
map.insert(QLatin1String(ArgumentsKey), d->arguments);
const QDir dir = QDir(target()->project()->projectDirectory());
const QDir dir = QDir(target()->project()->projectDirectory().toString());
map.insert(QLatin1String(ProFileKey), dir.relativeFilePath(d->projectFilePath));
map.insert(QLatin1String(WorkingDirectoryKey), d->workingDirectory);
return map;
......@@ -143,7 +143,7 @@ bool BareMetalRunConfiguration::fromMap(const QVariantMap &map)
return false;
d->arguments = map.value(QLatin1String(ArgumentsKey)).toString();
const QDir dir = QDir(target()->project()->projectDirectory());
const QDir dir = QDir(target()->project()->projectDirectory().toString());
d->projectFilePath
= QDir::cleanPath(dir.filePath(map.value(QLatin1String(ProFileKey)).toString()));
d->workingDirectory = map.value(QLatin1String(WorkingDirectoryKey)).toString();
......
......@@ -93,7 +93,7 @@ DebuggerStartParameters BareMetalRunControlFactory::startParameters(const BareMe
params.remoteSetupNeeded = false; //FIXME probably start debugserver with that, how?
params.displayName = runConfig->displayName();
if (const Project *project = target->project()) {
params.projectSourceDirectory = project->projectDirectory();
params.projectSourceDirectory = project->projectDirectory().toString();
if (const BuildConfiguration *buildConfig = target->activeBuildConfiguration())
params.projectBuildDirectory = buildConfig->buildDirectory().toString();
params.projectSourceFiles = project->files(Project::ExcludeGeneratedFiles);
......
......@@ -2028,7 +2028,7 @@ void ClearCasePlugin::projectChanged(Project *project)
disconnect(ICore::mainWindow(), SIGNAL(windowActivated()), this, SLOT(syncSlot()));
ProgressManager::cancelTasks(ClearCase::Constants::TASK_INDEX);
if (project) {
QString projDir = project->projectDirectory();
QString projDir = project->projectDirectory().toString();
QString topLevel = findTopLevel(projDir);
m_topLevel = topLevel;
if (topLevel.isEmpty())
......
......@@ -132,7 +132,7 @@ QList<ProjectExplorer::BuildInfo *> CMakeBuildConfigurationFactory::availableBui
QList<ProjectExplorer::BuildInfo *> result;
CMakeBuildInfo *info = createBuildInfo(parent->kit(),
parent->project()->projectDirectory());
parent->project()->projectDirectory().toString());
result << info;
return result;
}
......@@ -147,7 +147,7 @@ QList<ProjectExplorer::BuildInfo *> CMakeBuildConfigurationFactory::availableSet
const QString &projectPath) const
{
QList<ProjectExplorer::BuildInfo *> result;
CMakeBuildInfo *info = createBuildInfo(k, ProjectExplorer::Project::projectDirectory(projectPath));
CMakeBuildInfo *info = createBuildInfo(k, ProjectExplorer::Project::projectDirectory(Utils::FileName::fromString(projectPath)).toString());
//: The name of the build configuration created by default for a cmake project.
info->displayName = tr("Default");
info->buildDirectory
......
......@@ -57,7 +57,7 @@ public:
useNinja = bc->useNinja();
QTC_ASSERT(bc->target()->project(), return);
sourceDirectory = bc->target()->project()->projectDirectory();
sourceDirectory = bc->target()->project()->projectDirectory().toString();
}
Utils::Environment environment;
......
......@@ -184,7 +184,7 @@ QString CMakeProject::shadowBuildDirectory(const QString &projectFilePath, const
const QString projectName = QFileInfo(info.absolutePath()).fileName();
ProjectExplorer::ProjectMacroExpander expander(projectFilePath, projectName, k, bcName);
QDir projectDir = QDir(projectDirectory(projectFilePath));
QDir projectDir = QDir(projectDirectory(Utils::FileName::fromString(projectFilePath)).toString());
QString buildPath = Utils::expandMacros(Core::DocumentManager::buildDirectory(), &expander);
return QDir::cleanPath(projectDir.absoluteFilePath(buildPath));
}
......@@ -239,7 +239,7 @@ bool CMakeProject::parseCMakeLists()
projectFiles.insert(node->path());
} else {
// Manually add the CMakeLists.txt file
QString cmakeListTxt = projectDirectory() + QLatin1String("/CMakeLists.txt");
QString cmakeListTxt = projectDirectory().toString() + QLatin1String("/CMakeLists.txt");
bool generated = false;
fileList.append(new ProjectExplorer::FileNode(cmakeListTxt, ProjectExplorer::ProjectFileType, generated));
projectFiles.insert(cmakeListTxt);
......@@ -343,7 +343,7 @@ bool CMakeProject::parseCMakeLists()
part->projectFile = projectFilePath().toString();
// This explicitly adds -I. to the include paths
part->includePaths += projectDirectory();
part->includePaths += projectDirectory().toString();
foreach (const QString &includeFile, cbpparser.includeFiles()) {
// CodeBlocks is utterly ignorant of frameworks on Mac, and won't report framework
......@@ -531,7 +531,7 @@ bool CMakeProject::fromMap(const QVariantMap &map)
bool hasUserFile = activeTarget();
if (!hasUserFile) {
CMakeOpenProjectWizard copw(Core::ICore::mainWindow(), m_manager, projectDirectory(), Utils::Environment::systemEnvironment());
CMakeOpenProjectWizard copw(Core::ICore::mainWindow(), m_manager, projectDirectory().toString(), Utils::Environment::systemEnvironment());
if (copw.exec() != QDialog::Accepted)
return false;
Kit *k = copw.kit();
......@@ -614,7 +614,7 @@ CMakeBuildTarget CMakeProject::buildTargetForTitle(const QString &title)
QString CMakeProject::uiHeaderFile(const QString &uiFile)
{
QFileInfo fi(uiFile);
Utils::FileName project = Utils::FileName::fromString(projectDirectory());
Utils::FileName project = projectDirectory();
Utils::FileName baseDirectory = Utils::FileName::fromString(fi.absolutePath());
while (baseDirectory.isChildOf(project)) {
......@@ -710,7 +710,7 @@ void CMakeProject::updateApplicationAndDeploymentTargets()
QString deploymentPrefix;
QDir sourceDir;
sourceDir.setPath(t->project()->projectDirectory());
sourceDir.setPath(t->project()->projectDirectory().toString());
deploymentFile.setFileName(sourceDir.filePath(QLatin1String("QtCreatorDeployment.txt")));
if (deploymentFile.open(QFile::ReadOnly | QFile::Text)) {
deploymentStream.setDevice(&deploymentFile);
......@@ -845,7 +845,7 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc)
m_buildConfiguration = bc;
m_pathLineEdit->setText(m_buildConfiguration->rawBuildDirectory().toString());
if (m_buildConfiguration->buildDirectory().toString() == bc->target()->project()->projectDirectory())
if (m_buildConfiguration->buildDirectory() == bc->target()->project()->projectDirectory())
m_changeButton->setEnabled(false);
else
m_changeButton->setEnabled(true);
......
......@@ -248,7 +248,7 @@ CMakeRunConfigurationWidget::CMakeRunConfigurationWidget(CMakeRunConfiguration *
m_workingDirectoryEdit = new Utils::PathChooser();
m_workingDirectoryEdit->setExpectedKind(Utils::PathChooser::Directory);
m_workingDirectoryEdit->setBaseDirectory(m_cmakeRunConfiguration->target()->project()->projectDirectory());
m_workingDirectoryEdit->setBaseFileName(m_cmakeRunConfiguration->target()->project()->projectDirectory());
m_workingDirectoryEdit->setPath(m_cmakeRunConfiguration->baseWorkingDirectory());
m_workingDirectoryEdit->setHistoryCompleter(QLatin1String("CMake.WorkingDir.History"));
ProjectExplorer::EnvironmentAspect *aspect
......
......@@ -1817,7 +1817,7 @@ void DebuggerPluginPrivate::attachToQmlPort()
sourceFiles << project->files(Project::ExcludeGeneratedFiles);
sp.projectSourceDirectory =
!projects.isEmpty() ? projects.first()->projectDirectory() : QString();
!projects.isEmpty() ? projects.first()->projectDirectory().toString() : QString();
sp.projectSourceFiles = sourceFiles;
sp.sysRoot = SysRootKitInformation::sysRoot(kit).toString();
DebuggerRunControlFactory::createAndScheduleRun(sp);
......
......@@ -353,7 +353,7 @@ static DebuggerStartParameters localStartParameters(RunConfiguration *runConfigu
if (target) {
if (const Project *project = target->project()) {
sp.projectSourceDirectory = project->projectDirectory();
sp.projectSourceDirectory = project->projectDirectory().toString();
if (const BuildConfiguration *buildConfig = target->activeBuildConfiguration())
sp.projectBuildDirectory = buildConfig->buildDirectory().toString();
sp.projectSourceFiles = project->files(Project::ExcludeGeneratedFiles);
......
......@@ -174,7 +174,7 @@ void UnstartedAppWatcherDialog::selectExecutable()
project->activeTarget()->activeBuildConfiguration()) {
path = project->activeTarget()->activeBuildConfiguration()->buildDirectory().toString();
} else if (project) {
path = project->projectDirectory();
path = project->projectDirectory().toString();
}
}
m_pathChooser->setInitialBrowsePathBackup(path);
......
......@@ -95,7 +95,7 @@ int GenericBuildConfigurationFactory::priority(const Target *parent) const
QList<BuildInfo *> GenericBuildConfigurationFactory::availableBuilds(const Target *parent) const
{
QList<ProjectExplorer::BuildInfo *> result;
BuildInfo *info = createBuildInfo(parent->kit(), Utils::FileName::fromString(parent->project()->projectDirectory()));
BuildInfo *info = createBuildInfo(parent->kit(), parent->project()->projectDirectory());
result << info;
return result;
}
......@@ -109,7 +109,7 @@ int GenericBuildConfigurationFactory::priority(const Kit *k, const QString &proj
QList<BuildInfo *> GenericBuildConfigurationFactory::availableSetups(const Kit *k, const QString &projectPath) const
{
QList<BuildInfo *> result;
BuildInfo *info = createBuildInfo(k, Utils::FileName::fromString(ProjectExplorer::Project::projectDirectory(projectPath)));
BuildInfo *info = createBuildInfo(k, ProjectExplorer::Project::projectDirectory(Utils::FileName::fromString(projectPath)));
//: The name of the build configuration created by default for a generic project.
info->displayName = tr("Default");
result << info;
......@@ -217,7 +217,7 @@ GenericBuildSettingsWidget::GenericBuildSettingsWidget(GenericBuildConfiguration
connect(m_pathChooser, SIGNAL(changed(QString)), this, SLOT(buildDirectoryChanged()));
m_buildConfiguration = bc;
m_pathChooser->setBaseDirectory(bc->target()->project()->projectDirectory());
m_pathChooser->setBaseFileName(bc->target()->project()->projectDirectory());
m_pathChooser->setEnvironment(bc->environment());
m_pathChooser->setPath(m_buildConfiguration->rawBuildDirectory().toString());
setDisplayName(tr("Generic Manager"));
......
......@@ -162,7 +162,7 @@ RunControl *IosDebugSupport::createDebugRunControl(IosRunConfiguration *runConfi
}
if (qmlDebug) {
params.languages |= QmlLanguage;
params.projectSourceDirectory = project->projectDirectory();
params.projectSourceDirectory = project->projectDirectory().toString();
params.projectSourceFiles = project->files(QmakeProject::ExcludeGeneratedFiles);
params.projectBuildDirectory = project->rootQmakeProjectNode()->buildDir();
if (!cppDebug)
......
......@@ -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
......
......@@ -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());
......
......@@ -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());
}
......
......@@ -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;
......
......@@ -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
......
......@@ -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
......
......@@ -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));
}
......
......@@ -309,7 +309,7 @@ ProjectExplorer::BuildConfiguration *QbsBuildConfigurationFactory::create(Projec
Utils::FileName buildDir = info->buildDirectory;
if (buildDir.isEmpty())
buildDir = QbsProject::defaultBuildDirectory(parent->project()->projectDirectory(),
buildDir = QbsProject::defaultBuildDirectory(parent->project()->projectDirectory().toString(),
parent->kit(), info->displayName);
ProjectExplorer::BuildConfiguration *bc
......
......@@ -65,7 +65,7 @@ QbsBuildConfigurationWidget::QbsBuildConfigurationWidget(QbsProjectManager::Inte
m_buildDirChooser = new Utils::PathChooser;
m_buildDirChooser->setExpectedKind(Utils::PathChooser::Directory);
m_buildDirChooser->setBaseDirectory(bc->target()->project()->projectDirectory());
m_buildDirChooser->setBaseFileName(bc->target()->project()->projectDirectory());
m_buildDirChooser->setEnvironment(bc->environment());
layout->addWidget(m_buildDirChooser, 0, 1);
......
......@@ -253,7 +253,7 @@ Utils::FileName QbsProject::defaultBuildDirectory(const QString &projectFilePath
{
const QString projectName = QFileInfo(projectFilePath).completeBaseName();
ProjectExplorer::ProjectMacroExpander expander(projectFilePath, projectName, k, bcName);
QString projectDir = projectDirectory(projectFilePath);
QString projectDir = projectDirectory(Utils::FileName::fromString(projectFilePath)).toString();
QString buildPath = Utils::expandMacros(Core::DocumentManager::buildDirectory(), &expander);
return Utils::FileName::fromString(Utils::FileUtils::resolvePath(projectDir, buildPath));
}
......
......@@ -476,7 +476,7 @@ void QbsRunConfigurationWidget::targetInformationHasChanged()
m_executableLineEdit->setText(m_rc->executable());
m_workingDirectoryEdit->setPath(m_rc->baseWorkingDirectory());
m_workingDirectoryEdit->setBaseDirectory(m_rc->target()->project()->projectDirectory());
m_workingDirectoryEdit->setBaseFileName(m_rc->target()->project()->projectDirectory());
m_ignoreChange = false;
}
......
......@@ -220,7 +220,7 @@ DesktopQmakeRunConfigurationWidget::DesktopQmakeRunConfigurationWidget(DesktopQm
m_workingDirectoryEdit->setExpectedKind(PathChooser::Directory);
m_workingDirectoryEdit->setHistoryCompleter(QLatin1String("Qmake.WorkingDir.History"));
m_workingDirectoryEdit->setPath(m_qmakeRunConfiguration->baseWorkingDirectory());
m_workingDirectoryEdit->setBaseDirectory(m_qmakeRunConfiguration->target()->project()->projectDirectory());
m_workingDirectoryEdit->setBaseFileName(m_qmakeRunConfiguration->target()->project()->projectDirectory());
EnvironmentAspect *aspect = qmakeRunConfiguration->extraAspect<EnvironmentAspect>();
if (aspect) {
connect(aspect, SIGNAL(environmentChanged()), this, SLOT(environmentWasChanged()));
......@@ -412,7 +412,7 @@ QWidget *DesktopQmakeRunConfiguration::createConfigurationWidget()
QVariantMap DesktopQmakeRunConfiguration::toMap() const
{
const QDir projectDir = QDir(target()->project()->projectDirectory());
const QDir projectDir = QDir(target()->project()->projectDirectory().toString());
QVariantMap map(LocalApplicationRunConfiguration::toMap());
map.insert(QLatin1String(COMMAND_LINE_ARGUMENTS_KEY), m_commandLineArguments);
map.insert(QLatin1String(PRO_FILE_KEY), projectDir.relativeFilePath(m_proFilePath));
......@@ -424,7 +424,7 @@ QVariantMap DesktopQmakeRunConfiguration::toMap() const
bool DesktopQmakeRunConfiguration::fromMap(const QVariantMap &map)
{
const QDir projectDir = QDir(target()->project()->projectDirectory());
const QDir projectDir = QDir(target()->project()->projectDirectory().toString());
m_commandLineArguments = map.value(QLatin1String(COMMAND_LINE_ARGUMENTS_KEY)).toString();
m_proFilePath = QDir::cleanPath(projectDir.filePath(map.value(QLatin1String(PRO_FILE_KEY)).toString()));
m_runMode = map.value(QLatin1String(USE_TERMINAL_KEY), false).toBool() ? Console : Gui;
......
......@@ -133,7 +133,7 @@ bool ExternalQtEditor::getEditorLaunchData(const QString &fileName,
if (const ProjectExplorer::Target *target = project->activeTarget()) {
if (const QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitInformation::qtVersion(target->kit())) {
data->binary = (qtVersion->*commandAccessor)();
data->workingDirectory = project->projectDirectory();
data->workingDirectory = project->projectDirectory().toString();
}
}
}
......
......@@ -68,7 +68,7 @@ static Utils::FileName defaultBuildDirectory(bool supportsShadowBuild,
{
if (supportsShadowBuild)
return Utils::FileName::fromString(QmakeProject::shadowBuildDirectory(projectPath, k, suffix));
return Utils::FileName::fromString(ProjectExplorer::Project::projectDirectory(projectPath));
return ProjectExplorer::Project::projectDirectory(Utils::FileName::fromString(projectPath));
}
using namespace Internal;
......@@ -186,7 +186,7 @@ void QmakeBuildConfiguration::updateShadowBuild()
bool currentShadowBuild = supportsShadowBuilds();
if (currentShadowBuild != m_qtVersionSupportsShadowBuilds) {
if (!currentShadowBuild)
setBuildDirectory(Utils::FileName::fromString(target()->project()->projectDirectory()));
setBuildDirectory(target()->project()->projectDirectory());
m_qtVersionSupportsShadowBuilds = currentShadowBuild;
}
}
......@@ -244,7 +244,7 @@ void QmakeBuildConfiguration::setFileNodeBuild(FileNode *node)
/// still is a in-source build
bool QmakeBuildConfiguration::isShadowBuild() const
{
return buildDirectory().toString() != target()->project()->projectDirectory();
return buildDirectory() != target()->project()->projectDirectory();
}
void QmakeBuildConfiguration::setBuildDirectory(const FileName &directory)
......@@ -254,7 +254,7 @@ void QmakeBuildConfiguration::setBuildDirectory(const FileName &directory)
BuildConfiguration::setBuildDirectory(directory);
QTC_CHECK(supportsShadowBuilds()
|| (!supportsShadowBuilds()
&& buildDirectory().toString() == target()->project()->projectDirectory()));
&& buildDirectory() == target()->project()->projectDirectory()));
emitProFileEvaluateNeeded();
}
......
......@@ -1442,7 +1442,7 @@ QString QmakeProject::shadowBuildDirectory(const QString &proFilePath, const Kit
const QString projectName = QFileInfo(proFilePath).completeBaseName();
ProjectExplorer::ProjectMacroExpander expander(proFilePath, projectName, k, suffix);
QString projectDir = projectDirectory(proFilePath);
QString projectDir = projectDirectory(Utils::FileName::fromString(proFilePath)).toString();
QString buildPath = Utils::expandMacros(Core::DocumentManager::buildDirectory(), &expander);
return Utils::FileUtils::resolvePath(projectDir, buildPath);
}
......
......@@ -69,7 +69,7 @@ QmakeProjectConfigWidget::QmakeProjectConfigWidget(QmakeBuildConfiguration *bc)
m_ui->shadowBuildDirEdit->setExpectedKind(Utils::PathChooser::ExistingDirectory);
m_ui->shadowBuildDirEdit->setHistoryCompleter(QLatin1String("Qmake.BuildDir.History"));
m_ui->shadowBuildDirEdit->setEnvironment(bc->environment());
m_ui->shadowBuildDirEdit->setBaseDirectory(bc->target()->project()->projectDirectory());
m_ui->shadowBuildDirEdit->setBaseFileName(bc->target()->project()->projectDirectory());
bool isShadowBuild = bc->isShadowBuild();
if (isShadowBuild) {
m_ui->shadowBuildDirEdit->setPath(bc->rawBuildDirectory().toString());
......@@ -78,7 +78,7 @@ QmakeProjectConfigWidget::QmakeProjectConfigWidget(QmakeBuildConfiguration *bc)
m_ui->shadowBuildDirEdit->setPath(m_defaultShadowBuildDir);
m_ui->shadowBuildDirEdit->setVisible(false);
}
m_ui->inSourceBuildDirEdit->setPath(bc->target()->project()->projectDirectory());
m_ui->inSourceBuildDirEdit->setFileName(bc->target()->project()->projectDirectory());
m_ui->inSourceBuildDirEdit->setReadOnly(true);
m_ui->inSourceBuildDirEdit->setEnabled(false);
......@@ -155,9 +155,9 @@ void QmakeProjectConfigWidget::buildDirectoryChanged()