Commit 8d5e4b32 authored by Tobias Hunger's avatar Tobias Hunger

Project: Use Utils::FileName as return type for projectFilePath()

Change-Id: If304d5e95cd9ac714100abaae35d60e3e1050eb2
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent faab380c
...@@ -415,7 +415,7 @@ void AutotoolsProject::updateCppCodeModel() ...@@ -415,7 +415,7 @@ void AutotoolsProject::updateCppCodeModel()
CppTools::ProjectPart::Ptr part(new CppTools::ProjectPart); CppTools::ProjectPart::Ptr part(new CppTools::ProjectPart);
part->project = this; part->project = this;
part->displayName = displayName(); part->displayName = displayName();
part->projectFile = projectFilePath(); part->projectFile = projectFilePath().toString();
if (activeTarget()) { if (activeTarget()) {
ProjectExplorer::Kit *k = activeTarget()->kit(); ProjectExplorer::Kit *k = activeTarget()->kit();
......
...@@ -287,7 +287,7 @@ ParserTreeItem::ConstPtr Parser::parse() ...@@ -287,7 +287,7 @@ ParserTreeItem::ConstPtr Parser::parse()
QString prjName(prj->displayName()); QString prjName(prj->displayName());
QString prjType(prjName); QString prjType(prjName);
if (prj->document()) if (prj->document())
prjType = prj->projectFilePath(); prjType = prj->projectFilePath().toString();
SymbolInformation inf(prjName, prjType); SymbolInformation inf(prjName, prjType);
QStringList projectList = addProjectNode(item, prj->rootProjectNode()); QStringList projectList = addProjectNode(item, prj->rootProjectNode());
......
...@@ -56,7 +56,7 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(ProjectExplorer::Target *parent ...@@ -56,7 +56,7 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(ProjectExplorer::Target *parent
BuildConfiguration(parent, Core::Id(Constants::CMAKE_BC_ID)), m_useNinja(false) BuildConfiguration(parent, Core::Id(Constants::CMAKE_BC_ID)), m_useNinja(false)
{ {
CMakeProject *project = static_cast<CMakeProject *>(parent->project()); CMakeProject *project = static_cast<CMakeProject *>(parent->project());
setBuildDirectory(Utils::FileName::fromString(project->shadowBuildDirectory(project->projectFilePath(), setBuildDirectory(Utils::FileName::fromString(project->shadowBuildDirectory(project->projectFilePath().toString(),
parent->kit(), parent->kit(),
displayName()))); displayName())));
} }
...@@ -169,7 +169,7 @@ ProjectExplorer::BuildConfiguration *CMakeBuildConfigurationFactory::create(Proj ...@@ -169,7 +169,7 @@ ProjectExplorer::BuildConfiguration *CMakeBuildConfigurationFactory::create(Proj
if (copy.buildDirectory.isEmpty()) if (copy.buildDirectory.isEmpty())
copy.buildDirectory copy.buildDirectory
= Utils::FileName::fromString(project->shadowBuildDirectory(project->projectFilePath(), = Utils::FileName::fromString(project->shadowBuildDirectory(project->projectFilePath().toString(),
parent->kit(), parent->kit(),
copy.displayName)); copy.displayName));
......
...@@ -74,9 +74,8 @@ QList<Core::LocatorFilterEntry> CMakeLocatorFilter::matchesFor(QFutureInterface< ...@@ -74,9 +74,8 @@ QList<Core::LocatorFilterEntry> CMakeLocatorFilter::matchesFor(QFutureInterface<
if (cmakeProject) { if (cmakeProject) {
foreach (const CMakeBuildTarget &ct, cmakeProject->buildTargets()) { foreach (const CMakeBuildTarget &ct, cmakeProject->buildTargets()) {
if (ct.title.contains(entry)) { if (ct.title.contains(entry)) {
Core::LocatorFilterEntry entry(this, ct.title, cmakeProject->projectFilePath()); Core::LocatorFilterEntry entry(this, ct.title, cmakeProject->projectFilePath().toString());
entry.extraInfo = FileUtils::shortNativePath( entry.extraInfo = FileUtils::shortNativePath(cmakeProject->projectFilePath());
FileName::fromString(cmakeProject->projectFilePath()));
result.append(entry); result.append(entry);
} }
} }
...@@ -93,7 +92,7 @@ void CMakeLocatorFilter::accept(Core::LocatorFilterEntry selection) const ...@@ -93,7 +92,7 @@ void CMakeLocatorFilter::accept(Core::LocatorFilterEntry selection) const
foreach (Project *p, SessionManager::projects()) { foreach (Project *p, SessionManager::projects()) {
cmakeProject = qobject_cast<CMakeProject *>(p); cmakeProject = qobject_cast<CMakeProject *>(p);
if (cmakeProject && cmakeProject->projectFilePath() == selection.internalData.toString()) if (cmakeProject && cmakeProject->projectFilePath().toString() == selection.internalData.toString())
break; break;
cmakeProject = 0; cmakeProject = 0;
} }
......
...@@ -340,7 +340,7 @@ bool CMakeProject::parseCMakeLists() ...@@ -340,7 +340,7 @@ bool CMakeProject::parseCMakeLists()
CppTools::ProjectPart::Ptr part(new CppTools::ProjectPart); CppTools::ProjectPart::Ptr part(new CppTools::ProjectPart);
part->project = this; part->project = this;
part->displayName = displayName(); part->displayName = displayName();
part->projectFile = projectFilePath(); 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();
......
...@@ -1612,15 +1612,14 @@ void CppCodeModelInspectorDialog::updateProjectPartData(const ProjectPart::Ptr & ...@@ -1612,15 +1612,14 @@ void CppCodeModelInspectorDialog::updateProjectPartData(const ProjectPart::Ptr &
QString projectFilePath = QLatin1String("<None>"); QString projectFilePath = QLatin1String("<None>");
if (ProjectExplorer::Project *project = part->project) { if (ProjectExplorer::Project *project = part->project) {
projectName = project->displayName(); projectName = project->displayName();
projectFilePath = project->projectFilePath(); projectFilePath = project->projectFilePath().toUserOutput();
} }
KeyValueModel::Table table = KeyValueModel::Table() KeyValueModel::Table table = KeyValueModel::Table()
<< qMakePair(QString::fromLatin1("Project Part Name"), part->displayName) << qMakePair(QString::fromLatin1("Project Part Name"), part->displayName)
<< qMakePair(QString::fromLatin1("Project Part File"), << qMakePair(QString::fromLatin1("Project Part File"),
QDir::toNativeSeparators(part->projectFile)) QDir::toNativeSeparators(part->projectFile))
<< qMakePair(QString::fromLatin1("Project Name"), projectName) << qMakePair(QString::fromLatin1("Project Name"), projectName)
<< qMakePair(QString::fromLatin1("Project File"), << qMakePair(QString::fromLatin1("Project File"), projectFilePath)
QDir::toNativeSeparators(projectFilePath))
<< qMakePair(QString::fromLatin1("C Version"), << qMakePair(QString::fromLatin1("C Version"),
CMI::Utils::toString(part->cVersion)) CMI::Utils::toString(part->cVersion))
<< qMakePair(QString::fromLatin1("CXX Version"), << qMakePair(QString::fromLatin1("CXX Version"),
......
...@@ -467,8 +467,8 @@ void Dumper::dumpProjectInfos( const QList<CppModelManagerInterface::ProjectInfo ...@@ -467,8 +467,8 @@ void Dumper::dumpProjectInfos( const QList<CppModelManagerInterface::ProjectInfo
m_out << "Projects loaded: " << projectInfos.size() << "{{{1\n"; m_out << "Projects loaded: " << projectInfos.size() << "{{{1\n";
foreach (const CppModelManagerInterface::ProjectInfo &info, projectInfos) { foreach (const CppModelManagerInterface::ProjectInfo &info, projectInfos) {
const QPointer<ProjectExplorer::Project> project = info.project(); const QPointer<ProjectExplorer::Project> project = info.project();
m_out << i1 << "Project " << project->displayName() << " (" << project->projectFilePath() m_out << i1 << "Project " << project->displayName()
<< "){{{2\n"; << " (" << project->projectFilePath().toUserOutput() << "){{{2\n";
const QList<ProjectPart::Ptr> projectParts = info.projectParts(); const QList<ProjectPart::Ptr> projectParts = info.projectParts();
foreach (const ProjectPart::Ptr &part, projectParts) { foreach (const ProjectPart::Ptr &part, projectParts) {
...@@ -476,7 +476,7 @@ void Dumper::dumpProjectInfos( const QList<CppModelManagerInterface::ProjectInfo ...@@ -476,7 +476,7 @@ void Dumper::dumpProjectInfos( const QList<CppModelManagerInterface::ProjectInfo
QString projectFilePath = QLatin1String("<None>"); QString projectFilePath = QLatin1String("<None>");
if (ProjectExplorer::Project *project = part->project) { if (ProjectExplorer::Project *project = part->project) {
projectName = project->displayName(); projectName = project->displayName();
projectFilePath = project->projectFilePath(); projectFilePath = project->projectFilePath().toUserOutput();
} }
if (!part->projectConfigFile.isEmpty()) if (!part->projectConfigFile.isEmpty())
m_out << i3 << "Project Config File: " << part->projectConfigFile << "\n"; m_out << i3 << "Project Config File: " << part->projectConfigFile << "\n";
......
...@@ -3526,7 +3526,7 @@ void DebuggerPluginPrivate::testProjectLoaded(Project *project) ...@@ -3526,7 +3526,7 @@ void DebuggerPluginPrivate::testProjectLoaded(Project *project)
void DebuggerPluginPrivate::testProjectEvaluated() void DebuggerPluginPrivate::testProjectEvaluated()
{ {
QString fileName = m_testProject->projectFilePath(); QString fileName = m_testProject->projectFilePath().toUserOutput();
QVERIFY(!fileName.isEmpty()); QVERIFY(!fileName.isEmpty());
qWarning("Project %s loaded", qPrintable(fileName)); qWarning("Project %s loaded", qPrintable(fileName));
connect(BuildManager::instance(), SIGNAL(buildQueueFinished(bool)), connect(BuildManager::instance(), SIGNAL(buildQueueFinished(bool)),
......
...@@ -244,7 +244,7 @@ void GenericProject::refresh(RefreshOptions options) ...@@ -244,7 +244,7 @@ void GenericProject::refresh(RefreshOptions options)
CppTools::ProjectPart::Ptr part(new CppTools::ProjectPart); CppTools::ProjectPart::Ptr part(new CppTools::ProjectPart);
part->project = this; part->project = this;
part->displayName = displayName(); part->displayName = displayName();
part->projectFile = projectFilePath(); part->projectFile = projectFilePath().toString();
part->includePaths += projectIncludePaths(); part->includePaths += projectIncludePaths();
......
...@@ -110,7 +110,7 @@ void GenericProjectPlugin::updateContextMenu(ProjectExplorer::Project *project, ...@@ -110,7 +110,7 @@ void GenericProjectPlugin::updateContextMenu(ProjectExplorer::Project *project,
void GenericProjectPlugin::editFiles() void GenericProjectPlugin::editFiles()
{ {
GenericProject *genericProject = static_cast<GenericProject *>(m_contextMenuProject); GenericProject *genericProject = static_cast<GenericProject *>(m_contextMenuProject);
ProjectExplorer::SelectableFilesDialogEditFiles sfd(QFileInfo(genericProject->projectFilePath()).path(), genericProject->files(), ProjectExplorer::SelectableFilesDialogEditFiles sfd(genericProject->projectFilePath().toFileInfo().path(), genericProject->files(),
Core::ICore::mainWindow()); Core::ICore::mainWindow());
if (sfd.exec() == QDialog::Accepted) if (sfd.exec() == QDialog::Accepted)
genericProject->setFiles(sfd.selectedFiles()); genericProject->setFiles(sfd.selectedFiles());
......
...@@ -83,7 +83,7 @@ Utils::FileIterator *CurrentProjectFind::files(const QStringList &nameFilters, ...@@ -83,7 +83,7 @@ Utils::FileIterator *CurrentProjectFind::files(const QStringList &nameFilters,
return new Utils::FileIterator(QStringList(), QList<QTextCodec *>())); return new Utils::FileIterator(QStringList(), QList<QTextCodec *>()));
QString projectFile = additionalParameters.toString(); QString projectFile = additionalParameters.toString();
foreach (Project *project, SessionManager::projects()) { foreach (Project *project, SessionManager::projects()) {
if (project->document() && projectFile == project->projectFilePath()) if (project->document() && projectFile == project->projectFilePath().toString())
return filesForProjects(nameFilters, QList<Project *>() << project); return filesForProjects(nameFilters, QList<Project *>() << project);
} }
return new Utils::FileIterator(QStringList(), QList<QTextCodec *>()); return new Utils::FileIterator(QStringList(), QList<QTextCodec *>());
...@@ -107,7 +107,7 @@ void CurrentProjectFind::recheckEnabled() ...@@ -107,7 +107,7 @@ void CurrentProjectFind::recheckEnabled()
return; return;
QString projectFile = getAdditionalParameters(search).toString(); QString projectFile = getAdditionalParameters(search).toString();
foreach (Project *project, SessionManager::projects()) { foreach (Project *project, SessionManager::projects()) {
if (projectFile == project->projectFilePath()) { if (projectFile == project->projectFilePath().toString()) {
search->setSearchAgainEnabled(true); search->setSearchAgainEnabled(true);
return; return;
} }
......
...@@ -98,7 +98,7 @@ QVariant DependenciesModel::data(const QModelIndex &index, int role) const ...@@ -98,7 +98,7 @@ QVariant DependenciesModel::data(const QModelIndex &index, int role) const
case Qt::CheckStateRole: case Qt::CheckStateRole:
return SessionManager::hasDependency(m_project, p) ? Qt::Checked : Qt::Unchecked; return SessionManager::hasDependency(m_project, p) ? Qt::Checked : Qt::Unchecked;
case Qt::DecorationRole: case Qt::DecorationRole:
return Core::FileIconProvider::icon(p->projectFilePath()); return Core::FileIconProvider::icon(p->projectFilePath().toString());
default: default:
return QVariant(); return QVariant();
} }
......
...@@ -261,7 +261,7 @@ QListWidgetItem *ProjectListWidget::itemForProject(Project *project) ...@@ -261,7 +261,7 @@ QListWidgetItem *ProjectListWidget::itemForProject(Project *project)
QString ProjectListWidget::fullName(ProjectExplorer::Project *project) QString ProjectListWidget::fullName(ProjectExplorer::Project *project)
{ {
return tr("%1 (%2)").arg(project->displayName(), project->projectFilePath()); return tr("%1 (%2)").arg(project->displayName(), project->projectFilePath().toUserOutput());
} }
void ProjectListWidget::addProject(Project *project) void ProjectListWidget::addProject(Project *project)
...@@ -1512,7 +1512,7 @@ void MiniProjectTargetSelector::updateActionAndSummary() ...@@ -1512,7 +1512,7 @@ void MiniProjectTargetSelector::updateActionAndSummary()
projectName = project->displayName(); projectName = project->displayName();
foreach (Project *p, SessionManager::projects()) { foreach (Project *p, SessionManager::projects()) {
if (p != project && p->displayName() == projectName) { if (p != project && p->displayName() == projectName) {
fileName = project->projectFilePath(); fileName = project->projectFilePath().toUserOutput();
break; break;
} }
} }
......
...@@ -120,9 +120,9 @@ Core::Id Project::id() const ...@@ -120,9 +120,9 @@ Core::Id Project::id() const
return d->m_id; return d->m_id;
} }
QString Project::projectFilePath() const Utils::FileName Project::projectFilePath() const
{ {
return document()->filePath(); return Utils::FileName::fromString(document()->filePath());
} }
bool Project::hasActiveBuildSettings() const bool Project::hasActiveBuildSettings() const
......
...@@ -34,6 +34,8 @@ ...@@ -34,6 +34,8 @@
#include <coreplugin/id.h> #include <coreplugin/id.h>
#include <utils/fileutils.h>
#include <QObject> #include <QObject>
#include <QFileSystemModel> #include <QFileSystemModel>
...@@ -77,7 +79,7 @@ public: ...@@ -77,7 +79,7 @@ public:
virtual Core::IDocument *document() const = 0; virtual Core::IDocument *document() const = 0;
virtual IProjectManager *projectManager() const = 0; virtual IProjectManager *projectManager() const = 0;
QString projectFilePath() const; Utils::FileName projectFilePath() const;
bool hasActiveBuildSettings() const; bool hasActiveBuildSettings() const;
......
...@@ -1381,7 +1381,7 @@ QList<Project *> ProjectExplorerPlugin::openProjects(const QStringList &fileName ...@@ -1381,7 +1381,7 @@ QList<Project *> ProjectExplorerPlugin::openProjects(const QStringList &fileName
filePath = fi.canonicalFilePath(); filePath = fi.canonicalFilePath();
bool found = false; bool found = false;
foreach (Project *pi, SessionManager::projects()) { foreach (Project *pi, SessionManager::projects()) {
if (filePath == pi->projectFilePath()) { if (filePath == pi->projectFilePath().toString()) {
found = true; found = true;
break; break;
} }
...@@ -2370,7 +2370,7 @@ void ProjectExplorerPlugin::projectRemoved(ProjectExplorer::Project * pro) ...@@ -2370,7 +2370,7 @@ void ProjectExplorerPlugin::projectRemoved(ProjectExplorer::Project * pro)
void ProjectExplorerPlugin::projectDisplayNameChanged(Project *pro) void ProjectExplorerPlugin::projectDisplayNameChanged(Project *pro)
{ {
addToRecentProjects(pro->projectFilePath(), pro->displayName()); addToRecentProjects(pro->projectFilePath().toString(), pro->displayName());
updateActions(); updateActions();
} }
......
...@@ -347,7 +347,7 @@ void ProjectWindow::registerProject(ProjectExplorer::Project *project) ...@@ -347,7 +347,7 @@ void ProjectWindow::registerProject(ProjectExplorer::Project *project)
} }
m_tabIndexToProject.insert(index, project); m_tabIndexToProject.insert(index, project);
m_tabWidget->insertTab(index, project->displayName(), project->projectFilePath(), subtabs); m_tabWidget->insertTab(index, project->displayName(), project->projectFilePath().toString(), subtabs);
connect(project, SIGNAL(removedTarget(ProjectExplorer::Target*)), connect(project, SIGNAL(removedTarget(ProjectExplorer::Target*)),
this, SLOT(removedTarget(ProjectExplorer::Target*))); this, SLOT(removedTarget(ProjectExplorer::Target*)));
......
...@@ -200,7 +200,7 @@ bool SessionManagerPrivate::recursiveDependencyCheck(const QString &newDep, cons ...@@ -200,7 +200,7 @@ bool SessionManagerPrivate::recursiveDependencyCheck(const QString &newDep, cons
QList<Project *> SessionManager::dependencies(const Project *project) QList<Project *> SessionManager::dependencies(const Project *project)
{ {
const QString proName = project->projectFilePath(); const QString proName = project->projectFilePath().toString();
const QStringList proDeps = d->m_depMap.value(proName); const QStringList proDeps = d->m_depMap.value(proName);
QList<Project *> projects; QList<Project *> projects;
...@@ -214,8 +214,8 @@ QList<Project *> SessionManager::dependencies(const Project *project) ...@@ -214,8 +214,8 @@ QList<Project *> SessionManager::dependencies(const Project *project)
bool SessionManager::hasDependency(const Project *project, const Project *depProject) bool SessionManager::hasDependency(const Project *project, const Project *depProject)
{ {
const QString proName = project->projectFilePath(); const QString proName = project->projectFilePath().toString();
const QString depName = depProject->projectFilePath(); const QString depName = depProject->projectFilePath().toString();
const QStringList proDeps = d->m_depMap.value(proName); const QStringList proDeps = d->m_depMap.value(proName);
return proDeps.contains(depName); return proDeps.contains(depName);
...@@ -223,16 +223,16 @@ bool SessionManager::hasDependency(const Project *project, const Project *depPro ...@@ -223,16 +223,16 @@ bool SessionManager::hasDependency(const Project *project, const Project *depPro
bool SessionManager::canAddDependency(const Project *project, const Project *depProject) bool SessionManager::canAddDependency(const Project *project, const Project *depProject)
{ {
const QString newDep = project->projectFilePath(); const QString newDep = project->projectFilePath().toString();
const QString checkDep = depProject->projectFilePath(); const QString checkDep = depProject->projectFilePath().toString();
return d->recursiveDependencyCheck(newDep, checkDep); return d->recursiveDependencyCheck(newDep, checkDep);
} }
bool SessionManager::addDependency(Project *project, Project *depProject) bool SessionManager::addDependency(Project *project, Project *depProject)
{ {
const QString proName = project->projectFilePath(); const QString proName = project->projectFilePath().toString();
const QString depName = depProject->projectFilePath(); const QString depName = depProject->projectFilePath().toString();
// check if this dependency is valid // check if this dependency is valid
if (!d->recursiveDependencyCheck(proName, depName)) if (!d->recursiveDependencyCheck(proName, depName))
...@@ -250,8 +250,8 @@ bool SessionManager::addDependency(Project *project, Project *depProject) ...@@ -250,8 +250,8 @@ bool SessionManager::addDependency(Project *project, Project *depProject)
void SessionManager::removeDependency(Project *project, Project *depProject) void SessionManager::removeDependency(Project *project, Project *depProject)
{ {
const QString proName = project->projectFilePath(); const QString proName = project->projectFilePath().toString();
const QString depName = depProject->projectFilePath(); const QString depName = depProject->projectFilePath().toString();
QStringList proDeps = d->m_depMap.value(proName); QStringList proDeps = d->m_depMap.value(proName);
proDeps.removeAll(depName); proDeps.removeAll(depName);
...@@ -347,7 +347,7 @@ bool SessionManager::save() ...@@ -347,7 +347,7 @@ bool SessionManager::save()
QVariantMap data; QVariantMap data;
// save the startup project // save the startup project
if (d->m_startupProject) if (d->m_startupProject)
data.insert(QLatin1String("StartupProject"), d->m_startupProject->projectFilePath()); data.insert(QLatin1String("StartupProject"), d->m_startupProject->projectFilePath().toString());
QColor c = StyleHelper::requestedBaseColor(); QColor c = StyleHelper::requestedBaseColor();
if (c.isValid()) { if (c.isValid()) {
...@@ -360,7 +360,7 @@ bool SessionManager::save() ...@@ -360,7 +360,7 @@ bool SessionManager::save()
QStringList projectFiles; QStringList projectFiles;
foreach (Project *pro, d->m_projects) foreach (Project *pro, d->m_projects)
projectFiles << pro->projectFilePath(); projectFiles << pro->projectFilePath().toString();
// Restore infromation on projects that failed to load: // Restore infromation on projects that failed to load:
// don't readd projects to the list, which the user loaded // don't readd projects to the list, which the user loaded
...@@ -449,7 +449,7 @@ QStringList SessionManagerPrivate::dependenciesOrder() const ...@@ -449,7 +449,7 @@ QStringList SessionManagerPrivate::dependenciesOrder() const
// copy the map to a temporary list // copy the map to a temporary list
foreach (Project *pro, m_projects) { foreach (Project *pro, m_projects) {
const QString &proName = pro->projectFilePath(); const QString &proName = pro->projectFilePath().toString();
unordered << QPair<QString, QStringList>(proName, m_depMap.value(proName)); unordered << QPair<QString, QStringList>(proName, m_depMap.value(proName));
} }
...@@ -481,13 +481,13 @@ QList<Project *> SessionManager::projectOrder(Project *project) ...@@ -481,13 +481,13 @@ QList<Project *> SessionManager::projectOrder(Project *project)
QStringList pros; QStringList pros;
if (project) if (project)
pros = d->dependencies(project->projectFilePath()); pros = d->dependencies(project->projectFilePath().toString());
else else
pros = d->dependenciesOrder(); pros = d->dependenciesOrder();
foreach (const QString &proFile, pros) { foreach (const QString &proFile, pros) {
foreach (Project *pro, projects()) { foreach (Project *pro, projects()) {
if (pro->projectFilePath() == proFile) { if (pro->projectFilePath().toString() == proFile) {
result << pro; result << pro;
break; break;
} }
...@@ -605,7 +605,7 @@ void SessionManager::removeProjects(QList<Project *> remove) ...@@ -605,7 +605,7 @@ void SessionManager::removeProjects(QList<Project *> remove)
QSet<QString> projectFiles; QSet<QString> projectFiles;
foreach (Project *pro, projects()) { foreach (Project *pro, projects()) {
if (!remove.contains(pro)) if (!remove.contains(pro))
projectFiles.insert(pro->projectFilePath()); projectFiles.insert(pro->projectFilePath().toString());
} }
QSet<QString>::const_iterator i = projectFiles.begin(); QSet<QString>::const_iterator i = projectFiles.begin();
...@@ -807,7 +807,7 @@ void SessionManagerPrivate::restoreStartupProject(const PersistentSettingsReader ...@@ -807,7 +807,7 @@ void SessionManagerPrivate::restoreStartupProject(const PersistentSettingsReader
const QString startupProject = reader.restoreValue(QLatin1String("StartupProject")).toString(); const QString startupProject = reader.restoreValue(QLatin1String("StartupProject")).toString();
if (!startupProject.isEmpty()) { if (!startupProject.isEmpty()) {
foreach (Project *pro, d->m_projects) { foreach (Project *pro, d->m_projects) {
if (QDir::cleanPath(pro->projectFilePath()) == startupProject) { if (pro->projectFilePath().toString() == startupProject) {
m_instance->setStartupProject(pro); m_instance->setStartupProject(pro);
break; break;
} }
...@@ -844,7 +844,7 @@ void SessionManagerPrivate::restoreProjects(const QStringList &fileList) ...@@ -844,7 +844,7 @@ void SessionManagerPrivate::restoreProjects(const QStringList &fileList)
if (!errors.isEmpty()) if (!errors.isEmpty())
QMessageBox::critical(Core::ICore::mainWindow(), SessionManager::tr("Failed to open project"), errors); QMessageBox::critical(Core::ICore::mainWindow(), SessionManager::tr("Failed to open project"), errors);
foreach (Project *p, projects) foreach (Project *p, projects)
m_failedProjects.removeAll(p->projectFilePath()); m_failedProjects.removeAll(p->projectFilePath().toString());
} }
} }
......
...@@ -736,7 +736,7 @@ QByteArray SettingsAccessor::creatorId() ...@@ -736,7 +736,7 @@ QByteArray SettingsAccessor::creatorId()
QString SettingsAccessor::defaultFileName(const QString &suffix) const QString SettingsAccessor::defaultFileName(const QString &suffix) const
{ {
return project()->projectFilePath() + suffix; return project()->projectFilePath().toString() + suffix;
} }
int SettingsAccessor::currentVersion() const int SettingsAccessor::currentVersion() const
...@@ -836,7 +836,7 @@ QVariantMap SettingsAccessor::readUserSettings(QWidget *parent) const ...@@ -836,7 +836,7 @@ QVariantMap SettingsAccessor::readUserSettings(QWidget *parent) const
QVariantMap SettingsAccessor::readSharedSettings(QWidget *parent) const QVariantMap SettingsAccessor::readSharedSettings(QWidget *parent) const
{ {
SettingsAccessorPrivate::Settings sharedSettings; SettingsAccessorPrivate::Settings sharedSettings;
QString fn = project()->projectFilePath() + m_sharedSuffix; QString fn = project()->projectFilePath().toString() + m_sharedSuffix;
sharedSettings.path = FileName::fromString(fn); sharedSettings.path = FileName::fromString(fn);
sharedSettings.map = readFile(sharedSettings.path); sharedSettings.map = readFile(sharedSettings.path);
......
...@@ -530,7 +530,7 @@ void Target::updateDefaultBuildConfigurations() ...@@ -530,7 +530,7 @@ void Target::updateDefaultBuildConfigurations()
qWarning("No build configuration factory found for target id '%s'.", qPrintable(id().toString())); qWarning("No build configuration factory found for target id '%s'.", qPrintable(id().toString()));
return; return;
} }
QList<BuildInfo *> infoList = bcFactory->availableSetups(this->kit(), project()->projectFilePath()); QList<BuildInfo *> infoList = bcFactory->availableSetups(this->kit(), project()->projectFilePath().toString());
foreach (BuildInfo *info, infoList) { foreach (BuildInfo *info, infoList) {
BuildConfiguration *bc = bcFactory->create(this, info); BuildConfiguration *bc = bcFactory->create(this, info);
if (!bc) if (!bc)
......
...@@ -97,7 +97,7 @@ TargetSetupPageWrapper::TargetSetupPageWrapper(Project *project) : ...@@ -97,7 +97,7 @@ TargetSetupPageWrapper::TargetSetupPageWrapper(Project *project) :
m_targetSetupPage = new TargetSetupPage(this); m_targetSetupPage = new TargetSetupPage(this);
m_targetSetupPage->setProjectImporter(project->createProjectImporter()); m_targetSetupPage->setProjectImporter(project->createProjectImporter());
m_targetSetupPage->setUseScrollArea(false); m_targetSetupPage->setUseScrollArea(false);
m_targetSetupPage->setProjectPath(project->projectFilePath()); m_targetSetupPage->setProjectPath(project->projectFilePath().toString());
m_targetSetupPage->setRequiredKitMatcher(project->createRequiredKitMatcher());