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: ...@@ -98,6 +98,7 @@ public:
QString baseDirectory() const; QString baseDirectory() const;
void setBaseDirectory(const QString &directory); void setBaseDirectory(const QString &directory);
Utils::FileName baseFileName() const; Utils::FileName baseFileName() const;
void setBaseFileName(const Utils::FileName &base); void setBaseFileName(const Utils::FileName &base);
......
...@@ -59,7 +59,7 @@ RunControl *AndroidAnalyzeSupport::createAnalyzeRunControl(AndroidRunConfigurati ...@@ -59,7 +59,7 @@ RunControl *AndroidAnalyzeSupport::createAnalyzeRunControl(AndroidRunConfigurati
params.displayName = AndroidManager::packageName(target); params.displayName = AndroidManager::packageName(target);
params.sysroot = SysRootKitInformation::sysRoot(target->kit()).toString(); params.sysroot = SysRootKitInformation::sysRoot(target->kit()).toString();
// TODO: Not sure if these are the right paths. // TODO: Not sure if these are the right paths.
params.workingDirectory = target->project()->projectDirectory(); params.workingDirectory = target->project()->projectDirectory().toString();
if (runMode == ProjectExplorer::QmlProfilerRunMode) { if (runMode == ProjectExplorer::QmlProfilerRunMode) {
QTcpServer server; QTcpServer server;
QTC_ASSERT(server.listen(QHostAddress::LocalHost) QTC_ASSERT(server.listen(QHostAddress::LocalHost)
......
...@@ -119,7 +119,7 @@ RunControl *AndroidDebugSupport::createDebugRunControl(AndroidRunConfiguration * ...@@ -119,7 +119,7 @@ RunControl *AndroidDebugSupport::createDebugRunControl(AndroidRunConfiguration *
params.qmlServerAddress = server.serverAddress().toString(); params.qmlServerAddress = server.serverAddress().toString();
params.remoteSetupNeeded = true; params.remoteSetupNeeded = true;
//TODO: Not sure if these are the right paths. //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.projectSourceFiles = project->files(QmakeProject::ExcludeGeneratedFiles);
params.projectBuildDirectory = project->rootQmakeProjectNode()->buildDir(); params.projectBuildDirectory = project->rootQmakeProjectNode()->buildDir();
} }
......
...@@ -170,7 +170,7 @@ void AndroidDeployQtStep::ctor() ...@@ -170,7 +170,7 @@ void AndroidDeployQtStep::ctor()
bool AndroidDeployQtStep::init() 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); 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()); m_targetArch = AndroidManager::targetArch(target());
......
...@@ -98,7 +98,7 @@ AndroidDeployQtWidget::AndroidDeployQtWidget(AndroidDeployQtStep *step) ...@@ -98,7 +98,7 @@ AndroidDeployQtWidget::AndroidDeployQtWidget(AndroidDeployQtStep *step)
m_ui->verboseOutputCheckBox->setChecked(m_step->verboseOutput()); m_ui->verboseOutputCheckBox->setChecked(m_step->verboseOutput());
m_ui->openPackageLocationCheckBox->setChecked(m_step->openPackageLocation()); 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->oldFilesWarningIcon->setVisible(oldFiles);
m_ui->oldFilesWarningLabel->setVisible(oldFiles); m_ui->oldFilesWarningLabel->setVisible(oldFiles);
...@@ -346,7 +346,7 @@ void AndroidDeployQtWidget::addAndroidExtraLib() ...@@ -346,7 +346,7 @@ void AndroidDeployQtWidget::addAndroidExtraLib()
{ {
QStringList fileNames = QFileDialog::getOpenFileNames(this, QStringList fileNames = QFileDialog::getOpenFileNames(this,
tr("Select additional libraries"), tr("Select additional libraries"),
m_currentBuildConfiguration->target()->project()->projectDirectory(), m_currentBuildConfiguration->target()->project()->projectDirectory().toString(),
tr("Libraries (*.so)")); tr("Libraries (*.so)"));
if (!fileNames.isEmpty()) if (!fileNames.isEmpty())
......
...@@ -126,7 +126,7 @@ void AndroidExtraLibraryListModel::addEntries(const QStringList &list) ...@@ -126,7 +126,7 @@ void AndroidExtraLibraryListModel::addEntries(const QStringList &list)
beginInsertRows(QModelIndex(), m_entries.size(), m_entries.size() + list.size()); beginInsertRows(QModelIndex(), m_entries.size(), m_entries.size() + list.size());
foreach (const QString &path, list) 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(); QmakeProjectManager::QmakeProFileNode *node = m_project->rootQmakeProjectNode();
node->setProVariable(QLatin1String("ANDROID_EXTRA_LIBS"), m_entries, m_scope, node->setProVariable(QLatin1String("ANDROID_EXTRA_LIBS"), m_entries, m_scope,
......
...@@ -274,7 +274,8 @@ Utils::FileName AndroidManager::dirPath(ProjectExplorer::Target *target) ...@@ -274,7 +274,8 @@ Utils::FileName AndroidManager::dirPath(ProjectExplorer::Target *target)
QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitInformation::qtVersion(target->kit()); QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitInformation::qtVersion(target->kit());
if (qtVersion && qtVersion->qtVersion() >= QtSupport::QtVersionNumber(5, 2, 0)) if (qtVersion && qtVersion->qtVersion() >= QtSupport::QtVersionNumber(5, 2, 0))
return target->activeBuildConfiguration()->buildDirectory().appendPath(QLatin1String(Constants::ANDROID_BUILDDIRECTORY)); 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) Utils::FileName AndroidManager::manifestPath(ProjectExplorer::Target *target)
...@@ -539,7 +540,7 @@ bool AndroidManager::createAndroidTemplatesIfNecessary(ProjectExplorer::Target * ...@@ -539,7 +540,7 @@ bool AndroidManager::createAndroidTemplatesIfNecessary(ProjectExplorer::Target *
Utils::FileName javaSrcPath Utils::FileName javaSrcPath
= Utils::FileName::fromString(version->qmakeProperty("QT_INSTALL_PREFIX")) = Utils::FileName::fromString(version->qmakeProperty("QT_INSTALL_PREFIX"))
.appendPath(QLatin1String("src/android/java")); .appendPath(QLatin1String("src/android/java"));
QDir projectDir(qmakeProject->projectDirectory()); QDir projectDir(qmakeProject->projectDirectory().toString());
Utils::FileName androidPath = dirPath(target); Utils::FileName androidPath = dirPath(target);
QStringList m_ignoreFiles; QStringList m_ignoreFiles;
......
...@@ -90,7 +90,7 @@ Project *androidProject(const QString &file) ...@@ -90,7 +90,7 @@ Project *androidProject(const QString &file)
continue; continue;
Kit *kit = project->activeTarget()->kit(); Kit *kit = project->activeTarget()->kit();
if (DeviceTypeKitInformation::deviceTypeId(kit) == Android::Constants::ANDROID_DEVICE_TYPE if (DeviceTypeKitInformation::deviceTypeId(kit) == Android::Constants::ANDROID_DEVICE_TYPE
&& fileName.isChildOf(Utils::FileName::fromString(project->projectDirectory()))) && fileName.isChildOf(project->projectDirectory()))
return project; return project;
} }
return 0; return 0;
......
...@@ -80,7 +80,7 @@ void AndroidRunConfiguration::init() ...@@ -80,7 +80,7 @@ void AndroidRunConfiguration::init()
bool AndroidRunConfiguration::fromMap(const QVariantMap &map) 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_proFilePath = QDir::cleanPath(projectDir.filePath(map.value(QLatin1String(PRO_FILE_KEY)).toString()));
m_parseSuccess = static_cast<QmakeProject *>(target()->project())->validParse(m_proFilePath); m_parseSuccess = static_cast<QmakeProject *>(target()->project())->validParse(m_proFilePath);
m_parseInProgress = static_cast<QmakeProject *>(target()->project())->parseInProgress(m_proFilePath); m_parseInProgress = static_cast<QmakeProject *>(target()->project())->parseInProgress(m_proFilePath);
...@@ -90,7 +90,7 @@ bool AndroidRunConfiguration::fromMap(const QVariantMap &map) ...@@ -90,7 +90,7 @@ bool AndroidRunConfiguration::fromMap(const QVariantMap &map)
QVariantMap AndroidRunConfiguration::toMap() const QVariantMap AndroidRunConfiguration::toMap() const
{ {
const QDir projectDir = QDir(target()->project()->projectDirectory()); const QDir projectDir = QDir(target()->project()->projectDirectory().toString());
QVariantMap map(RunConfiguration::toMap()); QVariantMap map(RunConfiguration::toMap());
map.insert(QLatin1String(PRO_FILE_KEY), projectDir.relativeFilePath(m_proFilePath)); map.insert(QLatin1String(PRO_FILE_KEY), projectDir.relativeFilePath(m_proFilePath));
return map; return map;
......
...@@ -250,7 +250,7 @@ void CreateAndroidManifestWizard::createAndroidManifestFile() ...@@ -250,7 +250,7 @@ void CreateAndroidManifestWizard::createAndroidManifestFile()
// and now time for some magic // and now time for some magic
QString dir = QFileInfo(fileName).absolutePath(); QString dir = QFileInfo(fileName).absolutePath();
QString value = QLatin1String("$$PWD/") QString value = QLatin1String("$$PWD/")
+ QDir(m_target->project()->projectDirectory()).relativeFilePath(dir); + QDir(m_target->project()->projectDirectory().toString()).relativeFilePath(dir);
bool result = bool result =
m_node->setProVariable(QLatin1String("ANDROID_PACKAGE_SOURCE_DIR"), QStringList(value)); m_node->setProVariable(QLatin1String("ANDROID_PACKAGE_SOURCE_DIR"), QStringList(value));
QStringList unChanged; QStringList unChanged;
......
...@@ -97,8 +97,7 @@ int AutotoolsBuildConfigurationFactory::priority(const Target *parent) const ...@@ -97,8 +97,7 @@ int AutotoolsBuildConfigurationFactory::priority(const Target *parent) const
QList<BuildInfo *> AutotoolsBuildConfigurationFactory::availableBuilds(const Target *parent) const QList<BuildInfo *> AutotoolsBuildConfigurationFactory::availableBuilds(const Target *parent) const
{ {
QList<BuildInfo *> result; QList<BuildInfo *> result;
result << createBuildInfo(parent->kit(), result << createBuildInfo(parent->kit(), parent->project()->projectDirectory());
Utils::FileName::fromString(parent->project()->projectDirectory()));
return result; return result;
} }
...@@ -135,7 +134,7 @@ BuildConfiguration *AutotoolsBuildConfigurationFactory::create(Target *parent, c ...@@ -135,7 +134,7 @@ BuildConfiguration *AutotoolsBuildConfigurationFactory::create(Target *parent, c
// ### Build Steps Build ### // ### Build Steps Build ###
// autogen.sh or autoreconf // autogen.sh or autoreconf
QFile autogenFile(parent->project()->projectDirectory() + QLatin1String("/autogen.sh")); QFile autogenFile(parent->project()->projectDirectory().toString() + QLatin1String("/autogen.sh"));
if (autogenFile.exists()) { if (autogenFile.exists()) {
AutogenStep *autogenStep = new AutogenStep(buildSteps); AutogenStep *autogenStep = new AutogenStep(buildSteps);
buildSteps->insertStep(0, autogenStep); buildSteps->insertStep(0, autogenStep);
......
...@@ -59,13 +59,13 @@ AutotoolsBuildSettingsWidget::AutotoolsBuildSettingsWidget(AutotoolsBuildConfigu ...@@ -59,13 +59,13 @@ AutotoolsBuildSettingsWidget::AutotoolsBuildSettingsWidget(AutotoolsBuildConfigu
m_pathChooser = new Utils::PathChooser(this); m_pathChooser = new Utils::PathChooser(this);
m_pathChooser->setEnabled(true); m_pathChooser->setEnabled(true);
m_pathChooser->setExpectedKind(Utils::PathChooser::Directory); 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->setEnvironment(bc->environment());
m_pathChooser->setHistoryCompleter(QLatin1String("AutoTools.BuildDir.History")); m_pathChooser->setHistoryCompleter(QLatin1String("AutoTools.BuildDir.History"));
fl->addRow(tr("Build directory:"), m_pathChooser); fl->addRow(tr("Build directory:"), m_pathChooser);
connect(m_pathChooser, SIGNAL(changed(QString)), this, SLOT(buildDirectoryChanged())); 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()); m_pathChooser->setPath(m_buildConfiguration->rawBuildDirectory().toString());
setDisplayName(tr("Autotools Manager")); setDisplayName(tr("Autotools Manager"));
......
...@@ -131,7 +131,7 @@ QVariantMap BareMetalRunConfiguration::toMap() const ...@@ -131,7 +131,7 @@ QVariantMap BareMetalRunConfiguration::toMap() const
{ {
QVariantMap map(RunConfiguration::toMap()); QVariantMap map(RunConfiguration::toMap());
map.insert(QLatin1String(ArgumentsKey), d->arguments); 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(ProFileKey), dir.relativeFilePath(d->projectFilePath));
map.insert(QLatin1String(WorkingDirectoryKey), d->workingDirectory); map.insert(QLatin1String(WorkingDirectoryKey), d->workingDirectory);
return map; return map;
...@@ -143,7 +143,7 @@ bool BareMetalRunConfiguration::fromMap(const QVariantMap &map) ...@@ -143,7 +143,7 @@ bool BareMetalRunConfiguration::fromMap(const QVariantMap &map)
return false; return false;
d->arguments = map.value(QLatin1String(ArgumentsKey)).toString(); d->arguments = map.value(QLatin1String(ArgumentsKey)).toString();
const QDir dir = QDir(target()->project()->projectDirectory()); const QDir dir = QDir(target()->project()->projectDirectory().toString());
d->projectFilePath d->projectFilePath
= QDir::cleanPath(dir.filePath(map.value(QLatin1String(ProFileKey)).toString())); = QDir::cleanPath(dir.filePath(map.value(QLatin1String(ProFileKey)).toString()));
d->workingDirectory = map.value(QLatin1String(WorkingDirectoryKey)).toString(); d->workingDirectory = map.value(QLatin1String(WorkingDirectoryKey)).toString();
......
...@@ -93,7 +93,7 @@ DebuggerStartParameters BareMetalRunControlFactory::startParameters(const BareMe ...@@ -93,7 +93,7 @@ DebuggerStartParameters BareMetalRunControlFactory::startParameters(const BareMe
params.remoteSetupNeeded = false; //FIXME probably start debugserver with that, how? params.remoteSetupNeeded = false; //FIXME probably start debugserver with that, how?
params.displayName = runConfig->displayName(); params.displayName = runConfig->displayName();
if (const Project *project = target->project()) { if (const Project *project = target->project()) {
params.projectSourceDirectory = project->projectDirectory(); params.projectSourceDirectory = project->projectDirectory().toString();
if (const BuildConfiguration *buildConfig = target->activeBuildConfiguration()) if (const BuildConfiguration *buildConfig = target->activeBuildConfiguration())
params.projectBuildDirectory = buildConfig->buildDirectory().toString(); params.projectBuildDirectory = buildConfig->buildDirectory().toString();
params.projectSourceFiles = project->files(Project::ExcludeGeneratedFiles); params.projectSourceFiles = project->files(Project::ExcludeGeneratedFiles);
......
...@@ -2028,7 +2028,7 @@ void ClearCasePlugin::projectChanged(Project *project) ...@@ -2028,7 +2028,7 @@ void ClearCasePlugin::projectChanged(Project *project)
disconnect(ICore::mainWindow(), SIGNAL(windowActivated()), this, SLOT(syncSlot())); disconnect(ICore::mainWindow(), SIGNAL(windowActivated()), this, SLOT(syncSlot()));
ProgressManager::cancelTasks(ClearCase::Constants::TASK_INDEX); ProgressManager::cancelTasks(ClearCase::Constants::TASK_INDEX);
if (project) { if (project) {
QString projDir = project->projectDirectory(); QString projDir = project->projectDirectory().toString();
QString topLevel = findTopLevel(projDir); QString topLevel = findTopLevel(projDir);
m_topLevel = topLevel; m_topLevel = topLevel;
if (topLevel.isEmpty()) if (topLevel.isEmpty())
......
...@@ -132,7 +132,7 @@ QList<ProjectExplorer::BuildInfo *> CMakeBuildConfigurationFactory::availableBui ...@@ -132,7 +132,7 @@ QList<ProjectExplorer::BuildInfo *> CMakeBuildConfigurationFactory::availableBui
QList<ProjectExplorer::BuildInfo *> result; QList<ProjectExplorer::BuildInfo *> result;
CMakeBuildInfo *info = createBuildInfo(parent->kit(), CMakeBuildInfo *info = createBuildInfo(parent->kit(),
parent->project()->projectDirectory()); parent->project()->projectDirectory().toString());
result << info; result << info;
return result; return result;
} }
...@@ -147,7 +147,7 @@ QList<ProjectExplorer::BuildInfo *> CMakeBuildConfigurationFactory::availableSet ...@@ -147,7 +147,7 @@ QList<ProjectExplorer::BuildInfo *> CMakeBuildConfigurationFactory::availableSet
const QString &projectPath) const const QString &projectPath) const
{ {
QList<ProjectExplorer::BuildInfo *> result; 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. //: The name of the build configuration created by default for a cmake project.
info->displayName = tr("Default"); info->displayName = tr("Default");
info->buildDirectory info->buildDirectory
......
...@@ -57,7 +57,7 @@ public: ...@@ -57,7 +57,7 @@ public:
useNinja = bc->useNinja(); useNinja = bc->useNinja();
QTC_ASSERT(bc->target()->project(), return); QTC_ASSERT(bc->target()->project(), return);
sourceDirectory = bc->target()->project()->projectDirectory(); sourceDirectory = bc->target()->project()->projectDirectory().toString();
} }
Utils::Environment environment; Utils::Environment environment;
......
...@@ -184,7 +184,7 @@ QString CMakeProject::shadowBuildDirectory(const QString &projectFilePath, const ...@@ -184,7 +184,7 @@ QString CMakeProject::shadowBuildDirectory(const QString &projectFilePath, const
const QString projectName = QFileInfo(info.absolutePath()).fileName(); const QString projectName = QFileInfo(info.absolutePath()).fileName();
ProjectExplorer::ProjectMacroExpander expander(projectFilePath, projectName, k, bcName); 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); QString buildPath = Utils::expandMacros(Core::DocumentManager::buildDirectory(), &expander);
return QDir::cleanPath(projectDir.absoluteFilePath(buildPath)); return QDir::cleanPath(projectDir.absoluteFilePath(buildPath));
} }
...@@ -239,7 +239,7 @@ bool CMakeProject::parseCMakeLists() ...@@ -239,7 +239,7 @@ bool CMakeProject::parseCMakeLists()
projectFiles.insert(node->path()); projectFiles.insert(node->path());
} else { } else {
// Manually add the CMakeLists.txt file // Manually add the CMakeLists.txt file
QString cmakeListTxt = projectDirectory() + QLatin1String("/CMakeLists.txt"); QString cmakeListTxt = projectDirectory().toString() + QLatin1String("/CMakeLists.txt");
bool generated = false; bool generated = false;
fileList.append(new ProjectExplorer::FileNode(cmakeListTxt, ProjectExplorer::ProjectFileType, generated)); fileList.append(new ProjectExplorer::FileNode(cmakeListTxt, ProjectExplorer::ProjectFileType, generated));
projectFiles.insert(cmakeListTxt); projectFiles.insert(cmakeListTxt);
...@@ -343,7 +343,7 @@ bool CMakeProject::parseCMakeLists() ...@@ -343,7 +343,7 @@ bool CMakeProject::parseCMakeLists()
part->projectFile = projectFilePath().toString(); part->projectFile = projectFilePath().toString();
// This explicitly adds -I. to the include paths // This explicitly adds -I. to the include paths
part->includePaths += projectDirectory(); part->includePaths += projectDirectory().toString();
foreach (const QString &includeFile, cbpparser.includeFiles()) { foreach (const QString &includeFile, cbpparser.includeFiles()) {
// CodeBlocks is utterly ignorant of frameworks on Mac, and won't report framework // CodeBlocks is utterly ignorant of frameworks on Mac, and won't report framework
...@@ -531,7 +531,7 @@ bool CMakeProject::fromMap(const QVariantMap &map) ...@@ -531,7 +531,7 @@ bool CMakeProject::fromMap(const QVariantMap &map)
bool hasUserFile = activeTarget(); bool hasUserFile = activeTarget();
if (!hasUserFile) { 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) if (copw.exec() != QDialog::Accepted)
return false; return false;
Kit *k = copw.kit(); Kit *k = copw.kit();
...@@ -614,7 +614,7 @@ CMakeBuildTarget CMakeProject::buildTargetForTitle(const QString &title) ...@@ -614,7 +614,7 @@ CMakeBuildTarget CMakeProject::buildTargetForTitle(const QString &title)
QString CMakeProject::uiHeaderFile(const QString &uiFile) QString CMakeProject::uiHeaderFile(const QString &uiFile)
{ {
QFileInfo fi(uiFile); QFileInfo fi(uiFile);
Utils::FileName project = Utils::FileName::fromString(projectDirectory()); Utils::FileName project = projectDirectory();
Utils::FileName baseDirectory = Utils::FileName::fromString(fi.absolutePath()); Utils::FileName baseDirectory = Utils::FileName::fromString(fi.absolutePath());
while (baseDirectory.isChildOf(project)) { while (baseDirectory.isChildOf(project)) {
...@@ -710,7 +710,7 @@ void CMakeProject::updateApplicationAndDeploymentTargets() ...@@ -710,7 +710,7 @@ void CMakeProject::updateApplicationAndDeploymentTargets()
QString deploymentPrefix; QString deploymentPrefix;
QDir sourceDir; QDir sourceDir;
sourceDir.setPath(t->project()->projectDirectory()); sourceDir.setPath(t->project()->projectDirectory().toString());
deploymentFile.setFileName(sourceDir.filePath(QLatin1String("QtCreatorDeployment.txt"))); deploymentFile.setFileName(sourceDir.filePath(QLatin1String("QtCreatorDeployment.txt")));
if (deploymentFile.open(QFile::ReadOnly | QFile::Text)) { if (deploymentFile.open(QFile::ReadOnly | QFile::Text)) {
deploymentStream.setDevice(&deploymentFile); deploymentStream.setDevice(&deploymentFile);
...@@ -845,7 +845,7 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc) ...@@ -845,7 +845,7 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc)
m_buildConfiguration = bc; m_buildConfiguration = bc;
m_pathLineEdit->setText(m_buildConfiguration->rawBuildDirectory().toString()); 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); m_changeButton->setEnabled(false);
else else
m_changeButton->setEnabled(true); m_changeButton->setEnabled(true);
......
...@@ -248,7 +248,7 @@ CMakeRunConfigurationWidget::CMakeRunConfigurationWidget(CMakeRunConfiguration * ...@@ -248,7 +248,7 @@ CMakeRunConfigurationWidget::CMakeRunConfigurationWidget(CMakeRunConfiguration *
m_workingDirectoryEdit = new Utils::PathChooser(); m_workingDirectoryEdit = new Utils::PathChooser();
m_workingDirectoryEdit->setExpectedKind(Utils::PathChooser::Directory); 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->setPath(m_cmakeRunConfiguration->baseWorkingDirectory());
m_workingDirectoryEdit->setHistoryCompleter(QLatin1String("CMake.WorkingDir.History")); m_workingDirectoryEdit->setHistoryCompleter(QLatin1String("CMake.WorkingDir.History"));
ProjectExplorer::EnvironmentAspect *aspect ProjectExplorer::EnvironmentAspect *aspect
......
...@@ -1817,7 +1817,7 @@ void DebuggerPluginPrivate::attachToQmlPort() ...@@ -1817,7 +1817,7 @@ void DebuggerPluginPrivate::attachToQmlPort()
sourceFiles << project->files(Project::ExcludeGeneratedFiles); sourceFiles << project->files(Project::ExcludeGeneratedFiles);
sp.projectSourceDirectory = sp.projectSourceDirectory =
!projects.isEmpty() ? projects.first()->projectDirectory() : QString(); !projects.isEmpty() ? projects.first()->projectDirectory().toString() : QString();
sp.projectSourceFiles = sourceFiles; sp.projectSourceFiles = sourceFiles;
sp.sysRoot = SysRootKitInformation::sysRoot(kit).toString(); sp.sysRoot = SysRootKitInformation::sysRoot(kit).toString();
DebuggerRunControlFactory::createAndScheduleRun(sp); DebuggerRunControlFactory::createAndScheduleRun(sp);
......
...@@ -353,7 +353,7 @@ static DebuggerStartParameters localStartParameters(RunConfiguration *runConfigu ...@@ -353,7 +353,7 @@ static DebuggerStartParameters localStartParameters(RunConfiguration *runConfigu
if (target) { if (target) {
if (const Project *project = target->project()) { if (const Project *project = target->project()) {
sp.projectSourceDirectory = project->projectDirectory(); sp.projectSourceDirectory = project->projectDirectory().toString();
if (const BuildConfiguration *buildConfig = target->activeBuildConfiguration()) if (const BuildConfiguration *buildConfig = target->activeBuildConfiguration())
sp.projectBuildDirectory = buildConfig->buildDirectory().toString(); sp.projectBuildDirectory = buildConfig->buildDirectory().toString();
sp.projectSourceFiles = project->files(Project::ExcludeGeneratedFiles); sp.projectSourceFiles = project->files(Project::ExcludeGeneratedFiles);
......
...@@ -174,7 +174,7 @@ void UnstartedAppWatcherDialog::selectExecutable() ...@@ -174,7 +174,7 @@ void UnstartedAppWatcherDialog::selectExecutable()
project->activeTarget()->activeBuildConfiguration()) { project->activeTarget()->activeBuildConfiguration()) {
path = project->activeTarget()->activeBuildConfiguration()->buildDirectory().toString(); path = project->activeTarget()->activeBuildConfiguration()->buildDirectory().toString();
} else if (project) { } else if (project) {
path = project->projectDirectory(); path = project->projectDirectory().toString();
} }
} }
m_pathChooser->setInitialBrowsePathBackup(path); m_pathChooser->setInitialBrowsePathBackup(path);
......
...@@ -95,7 +95,7 @@ int GenericBuildConfigurationFactory::priority(const Target *parent) const ...@@ -95,7 +95,7 @@ int GenericBuildConfigurationFactory::priority(const Target *parent) const
QList<BuildInfo *> GenericBuildConfigurationFactory::availableBuilds(const Target *parent) const QList<BuildInfo *> GenericBuildConfigurationFactory::availableBuilds(const Target *parent) const
{ {
QList<ProjectExplorer::BuildInfo *> result; 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; result << info;
return result; return result;
} }
...@@ -109,7 +109,7 @@ int GenericBuildConfigurationFactory::priority(const Kit *k, const QString &proj ...@@ -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 *> GenericBuildConfigurationFactory::availableSetups(const Kit *k, const QString &projectPath) const
{ {
QList<BuildInfo *> result; 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. //: The name of the build configuration created by default for a generic project.
info->displayName = tr("Default"); info->displayName = tr("Default");
result << info; result << info;
...@@ -217,7 +217,7 @@ GenericBuildSettingsWidget::GenericBuildSettingsWidget(GenericBuildConfiguration ...@@ -217,7 +217,7 @@ GenericBuildSettingsWidget::GenericBuildSettingsWidget(GenericBuildConfiguration
connect(m_pathChooser, SIGNAL(changed(QString)), this, SLOT(buildDirectoryChanged())); connect(m_pathChooser, SIGNAL(changed(QString)), this, SLOT(buildDirectoryChanged()));
m_buildConfiguration = bc; m_buildConfiguration = bc;
m_pathChooser->setBaseDirectory(bc->target()->project()->projectDirectory()); m_pathChooser->setBaseFileName(bc->target()->project()->projectDirectory());
m_pathChooser->setEnvironment(bc->environment()); m_pathChooser->setEnvironment(bc->environment());
m_pathChooser->setPath(m_buildConfiguration->rawBuildDirectory().toString()); m_pathChooser->setPath(m_buildConfiguration->rawBuildDirectory().toString());
setDisplayName(tr("Generic Manager")); setDisplayName(tr("Generic Manager"));
......
...@@ -162,7 +162,7 @@ RunControl *IosDebugSupport::createDebugRunControl(IosRunConfiguration *runConfi ...@@ -162,7 +162,7 @@ RunControl *IosDebugSupport::createDebugRunControl(IosRunConfiguration *runConfi
} }
if (qmlDebug) { if (qmlDebug) {
params.languages |= QmlLanguage; params.languages |= QmlLanguage;
params.projectSourceDirectory = project->projectDirectory(); params.projectSourceDirectory = project->projectDirectory().toString();
params.projectSourceFiles = project->files(QmakeProject::ExcludeGeneratedFiles); params.projectSourceFiles = project->files(QmakeProject::ExcludeGeneratedFiles);
params.projectBuildDirectory = project->rootQmakeProjectNode()->buildDir(); params.projectBuildDirectory = project->rootQmakeProjectNode()->buildDir();
if (!cppDebug) if (!cppDebug)
......
...@@ -65,7 +65,7 @@ private: ...@@ -65,7 +65,7 @@ private:
bool BuildConfigMacroExpander::resolveMacro(const QString &name, QString *ret) bool BuildConfigMacroExpander::resolveMacro(const QString &name, QString *ret)
{ {
if (name == QLatin1String("sourceDir")) { if (name == QLatin1String("sourceDir")) {
*ret = QDir::toNativeSeparators(m_bc->target()->project()->projectDirectory()); *ret = m_bc->target()->project()->projectDirectory().toUserOutput();
return true; return true;
} }
if (name == QLatin1String("buildDir")) { if (name == QLatin1String("buildDir")) {
...@@ -125,7 +125,7 @@ BuildConfiguration::~BuildConfiguration() ...@@ -125,7 +125,7 @@ BuildConfiguration::~BuildConfiguration()
Utils::FileName BuildConfiguration::buildDirectory() const Utils::FileName BuildConfiguration::buildDirectory() const
{