Commit 88e7f935 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

ProjectExplorer: Use FileName for Node::path

Change-Id: I4a41cfb629be8bb06b4b0616cd4475525e617a51
Reviewed-by: default avatarBogDan Vatra <bogdan@kde.org>
Reviewed-by: default avatarEike Ziller <eike.ziller@theqtcompany.com>
parent 033a628c
......@@ -87,9 +87,8 @@ bool checkPackageName(const QString &packageName)
return QRegExp(packageNameRegExp).exactMatch(packageName);
}
Project *androidProject(const QString &file)
Project *androidProject(const Utils::FileName &fileName)
{
Utils::FileName fileName = Utils::FileName::fromString(file);
foreach (Project *project, SessionManager::projects()) {
if (!project->activeTarget())
continue;
......@@ -476,8 +475,7 @@ bool AndroidManifestEditorWidget::eventFilter(QObject *obj, QEvent *event)
void AndroidManifestEditorWidget::updateTargetComboBox()
{
const QString docPath(m_textEditorWidget->textDocument()->filePath().toString());
Project *project = androidProject(docPath);
Project *project = androidProject(m_textEditorWidget->textDocument()->filePath());
QStringList items;
if (project) {
Kit *kit = project->activeTarget()->kit();
......@@ -696,7 +694,6 @@ void AndroidManifestEditorWidget::updateInfoBar()
void AndroidManifestEditorWidget::updateSdkVersions()
{
const QString docPath(m_textEditorWidget->textDocument()->filePath().toString());
QPair<int, int> apiLevels = AndroidManager::apiLevelRange();
for (int i = apiLevels.first; i < apiLevels.second + 1; ++i)
m_androidMinSdkVersion->addItem(tr("API %1: %2")
......
......@@ -272,7 +272,7 @@ void AutotoolsProject::buildFileNodeTree(const QDir &directory,
// nodes later.
QHash<QString, Node *> nodeHash;
foreach (Node * node, nodes(m_rootNode))
nodeHash.insert(node->path(), node);
nodeHash.insert(node->path().toString(), node);
// Add the sources to the filenode project tree. Sources
// inside the same directory are grouped into a folder-node.
......@@ -317,11 +317,12 @@ void AutotoolsProject::buildFileNodeTree(const QDir &directory,
const QString filePath = directory.absoluteFilePath(file);
if (nodeHash.contains(filePath)) {
nodeHash.remove(filePath);
} else if (file == QLatin1String("Makefile.am") || file == QLatin1String("configure.ac")) {
fileNodes.append(new FileNode(Utils::FileName::fromString(filePath),
ProjectFileType, false));
} else {
if (file == QLatin1String("Makefile.am") || file == QLatin1String("configure.ac"))
fileNodes.append(new FileNode(filePath, ProjectFileType, false));
else
fileNodes.append(new FileNode(filePath, ResourceType, false));
fileNodes.append(new FileNode(Utils::FileName::fromString(filePath),
ResourceType, false));
}
}
......@@ -351,9 +352,9 @@ void AutotoolsProject::buildFileNodeTree(const QDir &directory,
FolderNode *AutotoolsProject::insertFolderNode(const QDir &nodeDir, QHash<QString, Node *> &nodes)
{
const QString nodePath = nodeDir.absolutePath();
QFileInfo rootInfo(m_rootNode->path());
const QString rootPath = rootInfo.absolutePath();
const Utils::FileName nodePath = Utils::FileName::fromString(nodeDir.absolutePath());
QFileInfo rootInfo = m_rootNode->path().toFileInfo();
const Utils::FileName rootPath = Utils::FileName::fromString(rootInfo.absolutePath());
// Do not create a folder for the root node
if (rootPath == nodePath)
......@@ -379,7 +380,7 @@ FolderNode *AutotoolsProject::insertFolderNode(const QDir &nodeDir, QHash<QStrin
}
parentFolder->addFolderNodes(QList<FolderNode *>() << folder);
nodes.insert(nodePath, folder);
nodes.insert(nodePath.toString(), folder);
return folder;
}
......
......@@ -40,7 +40,7 @@ using namespace AutotoolsProjectManager::Internal;
using namespace ProjectExplorer;
AutotoolsProjectNode::AutotoolsProjectNode(AutotoolsProject *project, Core::IDocument *projectFile) :
ProjectNode(projectFile->filePath().toString()),
ProjectNode(projectFile->filePath()),
m_project(project),
m_projectFile(projectFile)
{
......
......@@ -731,7 +731,7 @@ QStringList Parser::projectNodeFileList(const FolderNode *node) const
if (file->isGenerated())
continue;
list << file->path();
list << file->path().toString();
}
foreach (const FolderNode *folder, subFolderNodes) {
......@@ -756,7 +756,7 @@ QStringList Parser::addProjectNode(const ParserTreeItem::Ptr &item, const Projec
if (!node)
return projectList;
const QString &nodePath = node->path();
const QString nodePath = node->path().toString();
// our own files
QStringList fileList;
......@@ -770,8 +770,8 @@ QStringList Parser::addProjectNode(const ParserTreeItem::Ptr &item, const Projec
d->cachedPrjFileLists[nodePath] = fileList;
}
if (fileList.count() > 0) {
addProject(item, fileList, node->path());
projectList << node->path();
addProject(item, fileList, node->path().toString());
projectList << node->path().toString();
}
// subnodes
......@@ -779,7 +779,7 @@ QStringList Parser::addProjectNode(const ParserTreeItem::Ptr &item, const Projec
foreach (const ProjectNode *project, projectNodes) {
ParserTreeItem::Ptr itemPrj(new ParserTreeItem());
SymbolInformation information(project->displayName(), project->path());
SymbolInformation information(project->displayName(), project->path().toString());
projectList += addProjectNode(itemPrj, project);
......@@ -800,7 +800,7 @@ QStringList Parser::getAllFiles(const ProjectNode *node)
if (!node)
return fileList;
const QString &nodePath = node->path();
const QString nodePath = node->path().toString();
CitCachedPrjFileLists cit = d->cachedPrjFileLists.find(nodePath);
// try to improve parsing speed by internal cache
......@@ -827,7 +827,7 @@ void Parser::addFlatTree(const ParserTreeItem::Ptr &item, const ProjectNode *nod
fileList.removeDuplicates();
if (fileList.count() > 0) {
addProject(item, fileList, node->path());
addProject(item, fileList, node->path().toString());
}
}
......
......@@ -85,7 +85,7 @@ void CMakeEditor::finalizeInitialization()
info.setCustomButtonInfo(tr("Build now"), [document]() {
foreach (Project *p, SessionManager::projects()) {
if (CMakeProject *cmakeProject = qobject_cast<CMakeProject *>(p)) {
if (cmakeProject->isProjectFile(document->filePath().toString())) {
if (cmakeProject->isProjectFile(document->filePath())) {
ProjectExplorerPlugin::buildProject(cmakeProject);
break;
}
......
......@@ -85,7 +85,7 @@ using namespace Utils;
/*!
\class CMakeProject
*/
CMakeProject::CMakeProject(CMakeManager *manager, const QString &fileName)
CMakeProject::CMakeProject(CMakeManager *manager, const FileName &fileName)
: m_manager(manager),
m_activeTarget(0),
m_fileName(fileName),
......@@ -96,7 +96,7 @@ CMakeProject::CMakeProject(CMakeManager *manager, const QString &fileName)
setProjectContext(Core::Context(CMakeProjectManager::Constants::PROJECTCONTEXT));
setProjectLanguages(Core::Context(ProjectExplorer::Constants::LANG_CXX));
m_projectName = QFileInfo(fileName).absoluteDir().dirName();
m_projectName = fileName.parentDir().fileName();
m_file = new CMakeFile(this, fileName);
......@@ -133,8 +133,8 @@ void CMakeProject::changeActiveBuildConfiguration(ProjectExplorer::BuildConfigur
if (!cbpFileFi.exists()) {
mode = CMakeOpenProjectWizard::NeedToCreate;
} else {
foreach (const QString &file, m_watchedFiles) {
if (QFileInfo(file).lastModified() > cbpFileFi.lastModified()) {
foreach (const FileName &file, m_watchedFiles) {
if (file.toFileInfo().lastModified() > cbpFileFi.lastModified()) {
mode = CMakeOpenProjectWizard::NeedToUpdate;
break;
}
......@@ -234,7 +234,7 @@ bool CMakeProject::parseCMakeLists()
CMakeBuildConfiguration *activeBC = static_cast<CMakeBuildConfiguration *>(activeTarget()->activeBuildConfiguration());
foreach (Core::IDocument *document, Core::DocumentModel::openedDocuments())
if (isProjectFile(document->filePath().toString()))
if (isProjectFile(document->filePath()))
document->infoBar()->removeInfo("CMakeEditor.RunCMake");
// Find cbp file
......@@ -268,14 +268,14 @@ bool CMakeProject::parseCMakeLists()
//qDebug()<<"Building Tree";
QList<ProjectExplorer::FileNode *> fileList = cbpparser.fileList();
QSet<QString> projectFiles;
QSet<FileName> projectFiles;
if (cbpparser.hasCMakeFiles()) {
fileList.append(cbpparser.cmakeFileList());
foreach (const ProjectExplorer::FileNode *node, cbpparser.cmakeFileList())
projectFiles.insert(node->path());
} else {
// Manually add the CMakeLists.txt file
QString cmakeListTxt = projectDirectory().toString() + QLatin1String("/CMakeLists.txt");
FileName cmakeListTxt = projectDirectory().appendPath(QLatin1String("CMakeLists.txt"));
bool generated = false;
fileList.append(new ProjectExplorer::FileNode(cmakeListTxt, ProjectExplorer::ProjectFileType, generated));
projectFiles.insert(cmakeListTxt);
......@@ -285,7 +285,7 @@ bool CMakeProject::parseCMakeLists()
m_files.clear();
foreach (ProjectExplorer::FileNode *fn, fileList)
m_files.append(fn->path());
m_files.append(fn->path().toString());
m_files.sort();
buildTree(m_rootNode, fileList);
......@@ -347,7 +347,7 @@ bool CMakeProject::parseCMakeLists()
return true;
}
bool CMakeProject::isProjectFile(const QString &fileName)
bool CMakeProject::isProjectFile(const FileName &fileName)
{
return m_watchedFiles.contains(fileName);
}
......@@ -409,7 +409,7 @@ void CMakeProject::buildTree(CMakeProjectNode *rootNode, QList<ProjectExplorer::
foreach (ProjectExplorer::FileNode *fn, added) {
// qDebug()<<"added"<<fn->path();
// Get relative path to rootNode
QString parentDir = QFileInfo(fn->path()).absolutePath();
QString parentDir = fn->path().toFileInfo().absolutePath();
ProjectExplorer::FolderNode *folder = findOrCreateFolder(rootNode, parentDir);
folder->addFileNodes(QList<ProjectExplorer::FileNode *>()<< fn);
}
......@@ -432,13 +432,13 @@ void CMakeProject::buildTree(CMakeProjectNode *rootNode, QList<ProjectExplorer::
ProjectExplorer::FolderNode *CMakeProject::findOrCreateFolder(CMakeProjectNode *rootNode, QString directory)
{
QString relativePath = QDir(QFileInfo(rootNode->path()).path()).relativeFilePath(directory);
FileName path = rootNode->path().parentDir();
QDir rootParentDir(path.toString());
QString relativePath = rootParentDir.relativeFilePath(directory);
QStringList parts = relativePath.split(QLatin1Char('/'), QString::SkipEmptyParts);
ProjectExplorer::FolderNode *parent = rootNode;
QString path = QFileInfo(rootNode->path()).path();
foreach (const QString &part, parts) {
path += QLatin1Char('/');
path += part;
path.appendPath(part);
// Find folder in subFolders
bool found = false;
foreach (ProjectExplorer::FolderNode *folder, parent->subFolderNodes()) {
......@@ -522,7 +522,6 @@ bool CMakeProject::fromMap(const QVariantMap &map)
} else {
// We have a user file, but we could still be missing the cbp file
// or simply run createXml with the saved settings
QFileInfo sourceFileInfo(m_fileName);
CMakeBuildConfiguration *activeBC = qobject_cast<CMakeBuildConfiguration *>(activeTarget()->activeBuildConfiguration());
if (!activeBC)
return false;
......@@ -532,7 +531,7 @@ bool CMakeProject::fromMap(const QVariantMap &map)
CMakeOpenProjectWizard::Mode mode = CMakeOpenProjectWizard::Nothing;
if (!cbpFileFi.exists())
mode = CMakeOpenProjectWizard::NeedToCreate;
else if (cbpFileFi.lastModified() < sourceFileInfo.lastModified())
else if (cbpFileFi.lastModified() < m_fileName.toFileInfo().lastModified())
mode = CMakeOpenProjectWizard::NeedToUpdate;
if (mode != CMakeOpenProjectWizard::Nothing) {
......@@ -737,12 +736,12 @@ void CMakeProject::createUiCodeModelSupport()
// CMakeFile
CMakeFile::CMakeFile(CMakeProject *parent, QString fileName)
CMakeFile::CMakeFile(CMakeProject *parent, const FileName &fileName)
: Core::IDocument(parent), m_project(parent)
{
setId("Cmake.ProjectFile");
setMimeType(QLatin1String(Constants::CMAKEPROJECTMIMETYPE));
setFilePath(FileName::fromString(fileName));
setFilePath(fileName);
}
bool CMakeFile::save(QString *errorString, const QString &fileName, bool autoSave)
......@@ -873,7 +872,7 @@ void CMakeCbpParser::sortFiles()
{
QLoggingCategory log("qtc.cmakeprojectmanager.filetargetmapping");
QList<FileName> fileNames = Utils::transform(m_fileList, [] (FileNode *node) {
return FileName::fromString(node->path());
return node->path();
});
Utils::sort(fileNames);
......@@ -1203,7 +1202,8 @@ void CMakeCbpParser::parseAdd()
void CMakeCbpParser::parseUnit()
{
//qDebug()<<stream.attributes().value("filename");
QString fileName = attributes().value(QLatin1String("filename")).toString();
FileName fileName =
FileName::fromUserInput(attributes().value(QLatin1String("filename")).toString());
m_parsingCmakeUnit = false;
while (!atEnd()) {
readNext();
......@@ -1214,7 +1214,7 @@ void CMakeCbpParser::parseUnit()
m_cmakeFileList.append( new ProjectExplorer::FileNode(fileName, ProjectExplorer::ProjectFileType, false));
} else {
bool generated = false;
QString onlyFileName = FileName::fromString(fileName).fileName();
QString onlyFileName = fileName.fileName();
if ( (onlyFileName.startsWith(QLatin1String("moc_")) && onlyFileName.endsWith(QLatin1String(".cxx")))
|| (onlyFileName.startsWith(QLatin1String("ui_")) && onlyFileName.endsWith(QLatin1String(".h")))
|| (onlyFileName.startsWith(QLatin1String("qrc_")) && onlyFileName.endsWith(QLatin1String(".cxx"))))
......
......@@ -44,6 +44,8 @@
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/editormanager/ieditor.h>
#include <utils/fileutils.h>
#include <QFuture>
#include <QXmlStreamReader>
#include <QPushButton>
......@@ -92,7 +94,7 @@ class CMakeProject : public ProjectExplorer::Project
// for changeBuildDirectory
friend class CMakeBuildSettingsWidget;
public:
CMakeProject(CMakeManager *manager, const QString &filename);
CMakeProject(CMakeManager *manager, const Utils::FileName &filename);
~CMakeProject();
QString displayName() const;
......@@ -108,7 +110,7 @@ public:
CMakeBuildTarget buildTargetForTitle(const QString &title);
bool isProjectFile(const QString &fileName);
bool isProjectFile(const Utils::FileName &fileName);
bool parseCMakeLists();
......@@ -142,7 +144,7 @@ private:
CMakeManager *m_manager;
ProjectExplorer::Target *m_activeTarget;
QString m_fileName;
Utils::FileName m_fileName;
CMakeFile *m_file;
QString m_projectName;
......@@ -151,7 +153,7 @@ private:
QStringList m_files;
QList<CMakeBuildTarget> m_buildTargets;
QFileSystemWatcher *m_watcher;
QSet<QString> m_watchedFiles;
QSet<Utils::FileName> m_watchedFiles;
QFuture<void> m_codeModelFuture;
};
......@@ -185,7 +187,7 @@ private:
QList<ProjectExplorer::FileNode *> m_fileList;
QList<ProjectExplorer::FileNode *> m_cmakeFileList;
QSet<QString> m_processedUnits;
QSet<Utils::FileName> m_processedUnits;
bool m_parsingCmakeUnit;
CMakeBuildTarget m_buildTarget;
......@@ -200,7 +202,7 @@ class CMakeFile : public Core::IDocument
{
Q_OBJECT
public:
CMakeFile(CMakeProject *parent, QString fileName);
CMakeFile(CMakeProject *parent, const Utils::FileName &fileName);
bool save(QString *errorString, const QString &fileName, bool autoSave);
......
......@@ -112,14 +112,15 @@ void CMakeManager::runCMake(ProjectExplorer::Project *project)
ProjectExplorer::Project *CMakeManager::openProject(const QString &fileName, QString *errorString)
{
if (!QFileInfo(fileName).isFile()) {
Utils::FileName file = Utils::FileName::fromString(fileName);
if (!file.toFileInfo().isFile()) {
if (errorString)
*errorString = tr("Failed opening project \"%1\": Project is not a file")
.arg(fileName);
.arg(file.toUserOutput());
return 0;
}
return new CMakeProject(this, fileName);
return new CMakeProject(this, file);
}
QString CMakeManager::mimeType() const
......
......@@ -33,7 +33,7 @@
using namespace CMakeProjectManager;
using namespace CMakeProjectManager::Internal;
CMakeProjectNode::CMakeProjectNode(const QString &fileName)
CMakeProjectNode::CMakeProjectNode(const Utils::FileName &fileName)
: ProjectExplorer::ProjectNode(fileName)
{
}
......
......@@ -40,7 +40,7 @@ class CMakeProjectNode : public ProjectExplorer::ProjectNode
{
friend class CMakeProject;
public:
CMakeProjectNode(const QString &fileName);
CMakeProjectNode(const Utils::FileName &fileName);
virtual bool showInSimpleTree() const;
virtual QList<ProjectExplorer::ProjectAction> supportedActions(Node *node) const;
......
......@@ -51,8 +51,10 @@ static const char setupUiC[] = "setupUi";
// Find the generated "ui_form.h" header of the form via project.
static QString generatedHeaderOf(const QString &uiFileName)
{
if (const ProjectExplorer::Project *uiProject = ProjectExplorer::SessionManager::projectForFile(uiFileName))
if (const ProjectExplorer::Project *uiProject =
ProjectExplorer::SessionManager::projectForFile(Utils::FileName::fromString(uiFileName))) {
return uiProject->generatedUiHeader(uiFileName);
}
return QString();
}
......
......@@ -513,16 +513,17 @@ bool QtCreatorIntegration::navigateToSlot(const QString &objectName,
{
typedef QMap<int, Document::Ptr> DocumentMap;
const QString currentUiFile = FormEditorW::activeEditor()->document()->filePath().toString();
const Utils::FileName currentUiFile = FormEditorW::activeEditor()->document()->filePath();
#if 0
return Designer::Internal::navigateToSlot(currentUiFile, objectName, signalSignature, parameterNames, errorMessage);
return Designer::Internal::navigateToSlot(currentUiFile.toString(), objectName,
signalSignature, parameterNames, errorMessage);
#endif
// TODO: we should pass to findDocumentsIncluding an absolute path to generated .h file from ui.
// Currently we are guessing the name of ui_<>.h file and pass the file name only to the findDocumentsIncluding().
// The idea is that the .pro file knows if the .ui files is inside, and the .pro file knows it will
// be generating the ui_<>.h file for it, and the .pro file knows what the generated file's name and its absolute path will be.
// So we should somehow get that info from project manager (?)
const QFileInfo fi(currentUiFile);
const QFileInfo fi = currentUiFile.toFileInfo();
const QString uiFolder = fi.absolutePath();
const QString uicedName = QLatin1String("ui_") + fi.completeBaseName() + QLatin1String(".h");
......@@ -532,7 +533,7 @@ bool QtCreatorIntegration::navigateToSlot(const QString &objectName,
const Project *uiProject = SessionManager::projectForFile(currentUiFile);
if (uiProject) {
for (Snapshot::const_iterator i = docTable.begin(), ei = docTable.end(); i != ei; ++i) {
const Project *project = SessionManager::projectForFile(i.key().toString());
const Project *project = SessionManager::projectForFile(i.key());
if (project == uiProject)
newDocTable.insert(i.value());
}
......
......@@ -74,10 +74,10 @@ void QrcFilesVisitor::visitFolderNode(FolderNode *folderNode)
{
foreach (const FileNode *fileNode, folderNode->fileNodes()) {
if (fileNode->fileType() == ResourceType)
m_qrcFiles.append(fileNode->path());
m_qrcFiles.append(fileNode->path().toString());
}
if (dynamic_cast<ResourceEditor::ResourceTopLevelNode *>(folderNode))
m_qrcFiles.append(folderNode->path());
m_qrcFiles.append(folderNode->path().toString());
}
// ------------ ResourceHandler
......@@ -125,7 +125,8 @@ void ResourceHandler::updateResources(bool updateProjectResources)
qDebug() << "ResourceHandler::updateResources()" << fileName;
// Filename could change in the meantime.
Project *project = SessionManager::projectForFile(fileName);
Project *project = SessionManager::projectForFile(
Utils::FileName::fromUserInput(QDir::fromNativeSeparators(fileName)));
const bool dirty = m_form->property("_q_resourcepathchanged").toBool();
if (dirty)
m_form->setDirty(true);
......
......@@ -94,15 +94,15 @@ GenericProject::GenericProject(Manager *manager, const QString &fileName)
m_rootNode = new GenericProjectNode(this, m_creatorIDocument);
FileNode *projectFilesNode = new FileNode(m_filesFileName,
FileNode *projectFilesNode = new FileNode(Utils::FileName::fromString(m_filesFileName),
ProjectFileType,
/* generated = */ false);
FileNode *projectIncludesNode = new FileNode(m_includesFileName,
FileNode *projectIncludesNode = new FileNode(Utils::FileName::fromString(m_includesFileName),
ProjectFileType,
/* generated = */ false);
FileNode *projectConfigNode = new FileNode(m_configFileName,
FileNode *projectConfigNode = new FileNode(Utils::FileName::fromString(m_configFileName),
ProjectFileType,
/* generated = */ false);
......
......@@ -43,7 +43,7 @@ namespace GenericProjectManager {
namespace Internal {
GenericProjectNode::GenericProjectNode(GenericProject *project, Core::IDocument *projectFile)
: ProjectNode(projectFile->filePath().toString())
: ProjectNode(projectFile->filePath())
, m_project(project)
, m_projectFile(projectFile)
{
......@@ -104,7 +104,7 @@ void GenericProjectNode::refresh(QSet<QString> oldFileList)
QSet<QString> added = newFileList;
added.subtract(oldFileList);
QString baseDir = QFileInfo(path()).absolutePath();
QString baseDir = path().toFileInfo().absolutePath();
FilesInPathHash filesInPaths = sortFilesIntoPaths(baseDir, added);
FilesInPathHashConstIt cend = filesInPaths.constEnd();
......@@ -120,7 +120,8 @@ void GenericProjectNode::refresh(QSet<QString> oldFileList)
QList<FileNode *> fileNodes;
foreach (const QString &file, it.value()) {
FileType fileType = SourceType; // ### FIXME
FileNode *fileNode = new FileNode(file, fileType, /*generated = */ false);
FileNode *fileNode = new FileNode(Utils::FileName::fromString(file),
fileType, /*generated = */ false);
fileNodes.append(fileNode);
}
......@@ -138,9 +139,10 @@ void GenericProjectNode::refresh(QSet<QString> oldFileList)
QList<FileNode *> fileNodes;
foreach (const QString &file, it.value()) {
foreach (FileNode *fn, folder->fileNodes())
if (fn->path() == file)
foreach (FileNode *fn, folder->fileNodes()) {
if (fn->path().toString() == file)
fileNodes.append(fn);
}
}
folder->removeFileNodes(fileNodes);
......@@ -173,8 +175,8 @@ FolderNode *GenericProjectNode::createFolderByName(const QStringList &components
const QString component = components.at(end - 1);
const QString baseDir = QFileInfo(path()).path();
FolderNode *folder = new FolderNode(baseDir + QLatin1Char('/') + folderName);
const Utils::FileName folderPath = path().parentDir().appendPath(folderName);
FolderNode *folder = new FolderNode(folderPath);
folder->setDisplayName(component);
FolderNode *parent = findFolderByName(components, end - 1);
......@@ -201,10 +203,11 @@ FolderNode *GenericProjectNode::findFolderByName(const QStringList &components,
if (!parent)
return 0;
const QString baseDir = QFileInfo(path()).path();
foreach (FolderNode *fn, parent->subFolderNodes())
if (fn->path() == baseDir + QLatin1Char('/') + folderName)
const QString baseDir = path().toFileInfo().path();
foreach (FolderNode *fn, parent->subFolderNodes()) {
if (fn->path().toString() == baseDir + QLatin1Char('/') + folderName)
return fn;
}
return 0;
}
......
......@@ -85,7 +85,7 @@ private:
QStandardItemModel m_deviceTypeModel;
};
IosRunConfiguration::IosRunConfiguration(Target *parent, Core::Id id, const QString &path)
IosRunConfiguration::IosRunConfiguration(Target *parent, Core::Id id, const FileName &path)
: RunConfiguration(parent, id)
, m_profilePath(path)
{
......@@ -190,7 +190,7 @@ IosDeployStep *IosRunConfiguration::deployStep() const
return step;
}
QString IosRunConfiguration::profilePath() const
FileName IosRunConfiguration::profilePath() const
{
return m_profilePath;
}
......@@ -302,8 +302,7 @@ bool IosRunConfiguration::isEnabled() const
QString IosRunConfiguration::disabledReason() const
{
if (m_parseInProgress)
return tr("The .pro file \"%1\" is currently being parsed.")
.arg(FileName::fromString(m_profilePath).fileName());
return tr("The .pro file \"%1\" is currently being parsed.").arg(m_profilePath.fileName());