forked from qt-creator/qt-creator
ProjectNode: Rename path() to filePath()
Change-Id: I78bb73f8c9457fd74c470eacbf54eb9195ac9681 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
@@ -275,7 +275,7 @@ void AutotoolsProject::buildFileNodeTree(const QDir &directory,
|
||||
// nodes later.
|
||||
QHash<QString, Node *> nodeHash;
|
||||
foreach (Node * node, nodes(m_rootNode))
|
||||
nodeHash.insert(node->path().toString(), node);
|
||||
nodeHash.insert(node->filePath().toString(), node);
|
||||
|
||||
// Add the sources to the filenode project tree. Sources
|
||||
// inside the same directory are grouped into a folder-node.
|
||||
@@ -356,7 +356,7 @@ void AutotoolsProject::buildFileNodeTree(const QDir &directory,
|
||||
FolderNode *AutotoolsProject::insertFolderNode(const QDir &nodeDir, QHash<QString, Node *> &nodes)
|
||||
{
|
||||
const Utils::FileName nodePath = Utils::FileName::fromString(nodeDir.absolutePath());
|
||||
QFileInfo rootInfo = m_rootNode->path().toFileInfo();
|
||||
QFileInfo rootInfo = m_rootNode->filePath().toFileInfo();
|
||||
const Utils::FileName rootPath = Utils::FileName::fromString(rootInfo.absolutePath());
|
||||
|
||||
// Do not create a folder for the root node
|
||||
@@ -370,7 +370,7 @@ FolderNode *AutotoolsProject::insertFolderNode(const QDir &nodeDir, QHash<QStrin
|
||||
// Get parent-folder. If it does not exist, create it recursively.
|
||||
// Take care that the m_rootNode is considered as top folder.
|
||||
FolderNode *parentFolder = m_rootNode;
|
||||
if ((rootPath != folder->path()) && dir.cdUp()) {
|
||||
if ((rootPath != folder->filePath()) && dir.cdUp()) {
|
||||
const QString parentDir = dir.absolutePath();
|
||||
if (!nodes.contains(parentDir)) {
|
||||
FolderNode *insertedFolder = insertFolderNode(parentDir, nodes);
|
||||
|
||||
@@ -729,7 +729,7 @@ QStringList Parser::projectNodeFileList(const FolderNode *node) const
|
||||
if (file->isGenerated())
|
||||
continue;
|
||||
|
||||
list << file->path().toString();
|
||||
list << file->filePath().toString();
|
||||
}
|
||||
|
||||
foreach (const FolderNode *folder, subFolderNodes) {
|
||||
@@ -754,7 +754,7 @@ QStringList Parser::addProjectNode(const ParserTreeItem::Ptr &item, const Projec
|
||||
if (!node)
|
||||
return projectList;
|
||||
|
||||
const QString nodePath = node->path().toString();
|
||||
const QString nodePath = node->filePath().toString();
|
||||
|
||||
// our own files
|
||||
QStringList fileList;
|
||||
@@ -768,8 +768,8 @@ QStringList Parser::addProjectNode(const ParserTreeItem::Ptr &item, const Projec
|
||||
d->cachedPrjFileLists[nodePath] = fileList;
|
||||
}
|
||||
if (fileList.count() > 0) {
|
||||
addProject(item, fileList, node->path().toString());
|
||||
projectList << node->path().toString();
|
||||
addProject(item, fileList, node->filePath().toString());
|
||||
projectList << node->filePath().toString();
|
||||
}
|
||||
|
||||
// subnodes
|
||||
@@ -777,7 +777,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().toString());
|
||||
SymbolInformation information(project->displayName(), project->filePath().toString());
|
||||
|
||||
projectList += addProjectNode(itemPrj, project);
|
||||
|
||||
@@ -798,7 +798,7 @@ QStringList Parser::getAllFiles(const ProjectNode *node)
|
||||
if (!node)
|
||||
return fileList;
|
||||
|
||||
const QString nodePath = node->path().toString();
|
||||
const QString nodePath = node->filePath().toString();
|
||||
|
||||
CitCachedPrjFileLists cit = d->cachedPrjFileLists.constFind(nodePath);
|
||||
// try to improve parsing speed by internal cache
|
||||
@@ -825,7 +825,7 @@ void Parser::addFlatTree(const ParserTreeItem::Ptr &item, const ProjectNode *nod
|
||||
fileList.removeDuplicates();
|
||||
|
||||
if (fileList.count() > 0) {
|
||||
addProject(item, fileList, node->path().toString());
|
||||
addProject(item, fileList, node->filePath().toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ void CMakeCbpParser::sortFiles()
|
||||
{
|
||||
QLoggingCategory log("qtc.cmakeprojectmanager.filetargetmapping");
|
||||
QList<FileName> fileNames = Utils::transform(m_fileList, [] (FileNode *node) {
|
||||
return node->path();
|
||||
return node->filePath();
|
||||
});
|
||||
|
||||
Utils::sort(fileNames);
|
||||
|
||||
@@ -299,7 +299,7 @@ bool CMakeProject::parseCMakeLists()
|
||||
if (cbpparser.hasCMakeFiles()) {
|
||||
fileList.append(cbpparser.cmakeFileList());
|
||||
foreach (const ProjectExplorer::FileNode *node, cbpparser.cmakeFileList())
|
||||
projectFiles.insert(node->path());
|
||||
projectFiles.insert(node->filePath());
|
||||
} else {
|
||||
// Manually add the CMakeLists.txt file
|
||||
FileName cmakeListTxt = projectDirectory().appendPath(QLatin1String("CMakeLists.txt"));
|
||||
@@ -312,7 +312,7 @@ bool CMakeProject::parseCMakeLists()
|
||||
|
||||
m_files.clear();
|
||||
foreach (ProjectExplorer::FileNode *fn, fileList)
|
||||
m_files.append(fn->path().toString());
|
||||
m_files.append(fn->filePath().toString());
|
||||
m_files.sort();
|
||||
|
||||
buildTree(m_rootNode, fileList);
|
||||
@@ -432,7 +432,7 @@ void CMakeProject::gatherFileNodes(ProjectExplorer::FolderNode *parent, QList<Pr
|
||||
|
||||
bool sortNodesByPath(Node *a, Node *b)
|
||||
{
|
||||
return a->path() < b->path();
|
||||
return a->filePath() < b->filePath();
|
||||
}
|
||||
|
||||
void CMakeProject::buildTree(CMakeProjectNode *rootNode, QList<ProjectExplorer::FileNode *> newList)
|
||||
@@ -454,7 +454,7 @@ void CMakeProject::buildTree(CMakeProjectNode *rootNode, QList<ProjectExplorer::
|
||||
foreach (ProjectExplorer::FileNode *fn, added) {
|
||||
// qDebug()<<"added"<<fn->path();
|
||||
// Get relative path to rootNode
|
||||
QString parentDir = fn->path().toFileInfo().absolutePath();
|
||||
QString parentDir = fn->filePath().toFileInfo().absolutePath();
|
||||
ProjectExplorer::FolderNode *folder = findOrCreateFolder(rootNode, parentDir);
|
||||
folder->addFileNodes(QList<ProjectExplorer::FileNode *>()<< fn);
|
||||
}
|
||||
@@ -477,7 +477,7 @@ void CMakeProject::buildTree(CMakeProjectNode *rootNode, QList<ProjectExplorer::
|
||||
|
||||
ProjectExplorer::FolderNode *CMakeProject::findOrCreateFolder(CMakeProjectNode *rootNode, QString directory)
|
||||
{
|
||||
FileName path = rootNode->path().parentDir();
|
||||
FileName path = rootNode->filePath().parentDir();
|
||||
QDir rootParentDir(path.toString());
|
||||
QString relativePath = rootParentDir.relativeFilePath(directory);
|
||||
if (relativePath == QLatin1String("."))
|
||||
@@ -489,7 +489,7 @@ ProjectExplorer::FolderNode *CMakeProject::findOrCreateFolder(CMakeProjectNode *
|
||||
// Find folder in subFolders
|
||||
bool found = false;
|
||||
foreach (ProjectExplorer::FolderNode *folder, parent->subFolderNodes()) {
|
||||
if (folder->path() == path) {
|
||||
if (folder->filePath() == path) {
|
||||
// yeah found something :)
|
||||
parent = folder;
|
||||
found = true;
|
||||
|
||||
@@ -74,10 +74,10 @@ void QrcFilesVisitor::visitFolderNode(FolderNode *folderNode)
|
||||
{
|
||||
foreach (const FileNode *fileNode, folderNode->fileNodes()) {
|
||||
if (fileNode->fileType() == ResourceType)
|
||||
m_qrcFiles.append(fileNode->path().toString());
|
||||
m_qrcFiles.append(fileNode->filePath().toString());
|
||||
}
|
||||
if (dynamic_cast<ResourceEditor::ResourceTopLevelNode *>(folderNode))
|
||||
m_qrcFiles.append(folderNode->path().toString());
|
||||
m_qrcFiles.append(folderNode->filePath().toString());
|
||||
}
|
||||
|
||||
// ------------ ResourceHandler
|
||||
@@ -155,7 +155,7 @@ void ResourceHandler::updateResourcesHelper(bool updateProjectResources)
|
||||
m_form->setResourceFileSaveMode(QDesignerFormWindowInterface::SaveOnlyUsedResourceFiles);
|
||||
if (Designer::Constants::Internal::debug)
|
||||
qDebug() << "ResourceHandler::updateResources()" << fileName
|
||||
<< " associated with project" << project->rootProjectNode()->path()
|
||||
<< " associated with project" << project->rootProjectNode()->filePath()
|
||||
<< " using project qrc files" << projectQrcFiles.size();
|
||||
} else {
|
||||
// Use resource file originally used in form
|
||||
|
||||
@@ -93,7 +93,7 @@ void GenericProjectNode::refresh(QSet<QString> oldFileList)
|
||||
QSet<QString> added = newFileList;
|
||||
added.subtract(oldFileList);
|
||||
|
||||
QString baseDir = path().toFileInfo().absolutePath();
|
||||
QString baseDir = filePath().toFileInfo().absolutePath();
|
||||
FilesInPathHash filesInPaths = sortFilesIntoPaths(baseDir, added);
|
||||
|
||||
FilesInPathHashConstIt cend = filesInPaths.constEnd();
|
||||
@@ -131,7 +131,7 @@ void GenericProjectNode::refresh(QSet<QString> oldFileList)
|
||||
QList<FileNode *> fileNodes;
|
||||
foreach (const QString &file, it.value()) {
|
||||
foreach (FileNode *fn, folder->fileNodes()) {
|
||||
if (fn->path().toString() == file)
|
||||
if (fn->filePath().toString() == file)
|
||||
fileNodes.append(fn);
|
||||
}
|
||||
}
|
||||
@@ -166,7 +166,7 @@ FolderNode *GenericProjectNode::createFolderByName(const QStringList &components
|
||||
|
||||
const QString component = components.at(end - 1);
|
||||
|
||||
const Utils::FileName folderPath = path().parentDir().appendPath(folderName);
|
||||
const Utils::FileName folderPath = filePath().parentDir().appendPath(folderName);
|
||||
FolderNode *folder = new FolderNode(folderPath);
|
||||
folder->setDisplayName(component);
|
||||
|
||||
@@ -194,9 +194,9 @@ FolderNode *GenericProjectNode::findFolderByName(const QStringList &components,
|
||||
if (!parent)
|
||||
return 0;
|
||||
|
||||
const QString baseDir = path().toFileInfo().path();
|
||||
const QString baseDir = filePath().toFileInfo().path();
|
||||
foreach (FolderNode *fn, parent->subFolderNodes()) {
|
||||
if (fn->path().toString() == baseDir + QLatin1Char('/') + folderName)
|
||||
if (fn->filePath().toString() == baseDir + QLatin1Char('/') + folderName)
|
||||
return fn;
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -135,7 +135,7 @@ void IosRunConfiguration::deviceChanges() {
|
||||
void IosRunConfiguration::proFileUpdated(QmakeProFileNode *pro, bool success,
|
||||
bool parseInProgress)
|
||||
{
|
||||
if (m_profilePath != pro->path())
|
||||
if (m_profilePath != pro->filePath())
|
||||
return;
|
||||
m_parseSuccess = success;
|
||||
m_parseInProgress = parseInProgress;
|
||||
|
||||
@@ -135,7 +135,7 @@ QList<RunConfiguration *> IosRunConfigurationFactory::runConfigurationsForNode(T
|
||||
QList<RunConfiguration *> result;
|
||||
foreach (RunConfiguration *rc, t->runConfigurations()) {
|
||||
if (IosRunConfiguration *qt4c = qobject_cast<IosRunConfiguration *>(rc)) {
|
||||
if (qt4c->profilePath() == n->path())
|
||||
if (qt4c->profilePath() == n->filePath())
|
||||
result << rc;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -295,11 +295,11 @@ void UpdateIncludeDependenciesVisitor::collectElementPaths(const ProjectExplorer
|
||||
QMultiHash<QString, Node> *filePathsMap)
|
||||
{
|
||||
foreach (const ProjectExplorer::FileNode *fileNode, folderNode->fileNodes()) {
|
||||
QString elementName = qmt::NameController::convertFileNameToElementName(fileNode->path().toString());
|
||||
QFileInfo fileInfo(fileNode->path().toString());
|
||||
QString elementName = qmt::NameController::convertFileNameToElementName(fileNode->filePath().toString());
|
||||
QFileInfo fileInfo(fileNode->filePath().toString());
|
||||
QString nodePath = fileInfo.path();
|
||||
QStringList elementsPath = qmt::NameController::buildElementsPath(nodePath, false);
|
||||
filePathsMap->insertMulti(elementName, Node(fileNode->path().toString(), elementsPath));
|
||||
filePathsMap->insertMulti(elementName, Node(fileNode->filePath().toString(), elementsPath));
|
||||
}
|
||||
foreach (const ProjectExplorer::FolderNode *subNode, folderNode->subFolderNodes())
|
||||
collectElementPaths(subNode, filePathsMap);
|
||||
@@ -385,10 +385,10 @@ void ComponentViewController::createComponentModel(const ProjectExplorer::Folder
|
||||
const QString anchorFolder)
|
||||
{
|
||||
foreach (const ProjectExplorer::FileNode *fileNode, folderNode->fileNodes()) {
|
||||
QString componentName = qmt::NameController::convertFileNameToElementName(fileNode->path().toString());
|
||||
QString componentName = qmt::NameController::convertFileNameToElementName(fileNode->filePath().toString());
|
||||
qmt::MComponent *component = 0;
|
||||
bool isSource = false;
|
||||
CppTools::ProjectFile::Kind kind = CppTools::ProjectFile::classify(fileNode->path().toString());
|
||||
CppTools::ProjectFile::Kind kind = CppTools::ProjectFile::classify(fileNode->filePath().toString());
|
||||
switch (kind) {
|
||||
case CppTools::ProjectFile::CHeader:
|
||||
case CppTools::ProjectFile::CSource:
|
||||
|
||||
@@ -457,9 +457,9 @@ QString ModelIndexer::findFirstModel(ProjectExplorer::FolderNode *folderNode)
|
||||
{
|
||||
foreach (ProjectExplorer::FileNode *fileNode, folderNode->fileNodes()) {
|
||||
Utils::MimeType mimeType = Utils::MimeDatabase().mimeTypeForFile(
|
||||
fileNode->path().toFileInfo());
|
||||
fileNode->filePath().toFileInfo());
|
||||
if (mimeType.name() == QLatin1String(Constants::MIME_TYPE_MODEL))
|
||||
return fileNode->path().toString();
|
||||
return fileNode->filePath().toString();
|
||||
}
|
||||
foreach (ProjectExplorer::FolderNode *subFolderNode, folderNode->subFolderNodes()) {
|
||||
QString modelFileName = findFirstModel(subFolderNode);
|
||||
|
||||
@@ -139,13 +139,13 @@ void PxNodeController::addExplorerNode(const ProjectExplorer::Node *node,
|
||||
QTC_ASSERT(diagram, return);
|
||||
|
||||
QString elementName = qmt::NameController::convertFileNameToElementName(
|
||||
node->path().toString());
|
||||
node->filePath().toString());
|
||||
|
||||
switch (node->nodeType()) {
|
||||
case ProjectExplorer::FileNodeType:
|
||||
{
|
||||
QStringList classNames = d->classViewController->findClassDeclarations(
|
||||
node->path().toString()).toList();
|
||||
node->filePath().toString()).toList();
|
||||
auto menu = new QMenu;
|
||||
menu->addAction(new MenuAction(tr("Add Component %1").arg(elementName), elementName,
|
||||
MenuAction::TYPE_ADD_COMPONENT, menu));
|
||||
|
||||
@@ -76,14 +76,14 @@ QString PxNodeUtilities::calcRelativePath(const ProjectExplorer::Node *node,
|
||||
switch (node->nodeType()) {
|
||||
case ProjectExplorer::FileNodeType:
|
||||
{
|
||||
QFileInfo fileInfo(node->path().toString());
|
||||
QFileInfo fileInfo(node->filePath().toString());
|
||||
nodePath = fileInfo.path();
|
||||
break;
|
||||
}
|
||||
case ProjectExplorer::FolderNodeType:
|
||||
case ProjectExplorer::VirtualFolderNodeType:
|
||||
case ProjectExplorer::ProjectNodeType:
|
||||
nodePath = node->path().toString();
|
||||
nodePath = node->filePath().toString();
|
||||
break;
|
||||
case ProjectExplorer::SessionNodeType:
|
||||
QTC_ASSERT(false, return QString());
|
||||
|
||||
@@ -183,7 +183,7 @@ void JsonSummaryPage::addToProject(const JsonWizard::GeneratorFiles &files)
|
||||
QMessageBox::critical(m_wizard, tr("Failed to Add to Project"),
|
||||
tr("Failed to add subproject \"%1\"\nto project \"%2\".")
|
||||
.arg(QDir::toNativeSeparators(generatedProject))
|
||||
.arg(folder->path().toUserOutput()));
|
||||
.arg(folder->filePath().toUserOutput()));
|
||||
return;
|
||||
}
|
||||
m_wizard->removeAttributeFromAllFiles(GeneratedFile::OpenProjectAttribute);
|
||||
@@ -195,7 +195,7 @@ void JsonSummaryPage::addToProject(const JsonWizard::GeneratorFiles &files)
|
||||
QStringList nativeFilePaths = Utils::transform(filePaths, &QDir::toNativeSeparators);
|
||||
QMessageBox::critical(wizard(), tr("Failed to Add to Project"),
|
||||
tr("Failed to add one or more files to project\n\"%1\" (%2).")
|
||||
.arg(folder->path().toUserOutput(),
|
||||
.arg(folder->filePath().toUserOutput(),
|
||||
nativeFilePaths.join(QLatin1String(", "))));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -93,10 +93,10 @@ void FindNodesForFileVisitor::visitProjectNode(ProjectNode *node)
|
||||
|
||||
void FindNodesForFileVisitor::visitFolderNode(FolderNode *node)
|
||||
{
|
||||
if (node->path() == m_path)
|
||||
if (node->filePath() == m_path)
|
||||
m_nodes << node;
|
||||
foreach (FileNode *fileNode, node->fileNodes()) {
|
||||
if (fileNode->path() == m_path)
|
||||
if (fileNode->filePath() == m_path)
|
||||
m_nodes << fileNode;
|
||||
}
|
||||
}
|
||||
@@ -124,9 +124,9 @@ void FindAllFilesVisitor::visitProjectNode(ProjectNode *projectNode)
|
||||
|
||||
void FindAllFilesVisitor::visitFolderNode(FolderNode *folderNode)
|
||||
{
|
||||
m_filePaths.append(folderNode->path());
|
||||
m_filePaths.append(folderNode->filePath());
|
||||
foreach (const FileNode *fileNode, folderNode->fileNodes())
|
||||
m_filePaths.append(fileNode->path());
|
||||
m_filePaths.append(fileNode->filePath());
|
||||
}
|
||||
|
||||
NodesVisitor::~NodesVisitor()
|
||||
|
||||
@@ -2081,7 +2081,7 @@ void ProjectExplorerPluginPrivate::runConfigurationConfigurationFinished()
|
||||
|
||||
static QString pathOrDirectoryFor(Node *node, bool dir)
|
||||
{
|
||||
Utils::FileName path = node->path();
|
||||
Utils::FileName path = node->filePath();
|
||||
QString location;
|
||||
FolderNode *folder = node->asFolderNode();
|
||||
if (node->nodeType() == VirtualFolderNodeType && folder) {
|
||||
@@ -2093,7 +2093,7 @@ static QString pathOrDirectoryFor(Node *node, bool dir)
|
||||
// Otherwise we figure out a commonPath from the subfolders
|
||||
QStringList list;
|
||||
foreach (FolderNode *f, folder->subFolderNodes())
|
||||
list << f->path().toString() + QLatin1Char('/');
|
||||
list << f->filePath().toString() + QLatin1Char('/');
|
||||
location = Utils::commonPath(list);
|
||||
}
|
||||
|
||||
@@ -3066,7 +3066,7 @@ void ProjectExplorerPluginPrivate::updateContextMenuActions()
|
||||
m_renameFileAction->setEnabled(actions.contains(Rename));
|
||||
|
||||
EditorManager::populateOpenWithMenu(m_openWithMenu,
|
||||
ProjectTree::currentNode()->path().toString());
|
||||
ProjectTree::currentNode()->filePath().toString());
|
||||
}
|
||||
|
||||
if (actions.contains(HidePathActions)) {
|
||||
@@ -3191,17 +3191,17 @@ void ProjectExplorerPluginPrivate::removeProject()
|
||||
return;
|
||||
ProjectNode *projectNode = subProjectNode->parentFolderNode()->asProjectNode();
|
||||
if (projectNode) {
|
||||
RemoveFileDialog removeFileDialog(subProjectNode->path().toString(), ICore::mainWindow());
|
||||
RemoveFileDialog removeFileDialog(subProjectNode->filePath().toString(), ICore::mainWindow());
|
||||
removeFileDialog.setDeleteFileVisible(false);
|
||||
if (removeFileDialog.exec() == QDialog::Accepted)
|
||||
projectNode->removeSubProjects(QStringList() << subProjectNode->path().toString());
|
||||
projectNode->removeSubProjects(QStringList() << subProjectNode->filePath().toString());
|
||||
}
|
||||
}
|
||||
|
||||
void ProjectExplorerPluginPrivate::openFile()
|
||||
{
|
||||
QTC_ASSERT(ProjectTree::currentNode(), return);
|
||||
EditorManager::openEditor(ProjectTree::currentNode()->path().toString());
|
||||
EditorManager::openEditor(ProjectTree::currentNode()->filePath().toString());
|
||||
}
|
||||
|
||||
void ProjectExplorerPluginPrivate::searchOnFileSystem()
|
||||
@@ -3229,7 +3229,7 @@ void ProjectExplorerPluginPrivate::removeFile()
|
||||
|
||||
FileNode *fileNode = currentNode->asFileNode();
|
||||
|
||||
QString filePath = currentNode->path().toString();
|
||||
QString filePath = currentNode->filePath().toString();
|
||||
RemoveFileDialog removeFileDialog(filePath, ICore::mainWindow());
|
||||
|
||||
if (removeFileDialog.exec() == QDialog::Accepted) {
|
||||
@@ -3260,7 +3260,7 @@ void ProjectExplorerPluginPrivate::deleteFile()
|
||||
|
||||
FileNode *fileNode = currentNode->asFileNode();
|
||||
|
||||
QString filePath = currentNode->path().toString();
|
||||
QString filePath = currentNode->filePath().toString();
|
||||
QMessageBox::StandardButton button =
|
||||
QMessageBox::question(ICore::mainWindow(),
|
||||
tr("Delete File"),
|
||||
@@ -3305,9 +3305,9 @@ void ProjectExplorerPluginPrivate::handleRenameFile()
|
||||
|
||||
void ProjectExplorerPlugin::renameFile(Node *node, const QString &newFilePath)
|
||||
{
|
||||
QString orgFilePath = node->path().toFileInfo().absoluteFilePath();
|
||||
QString orgFilePath = node->filePath().toFileInfo().absoluteFilePath();
|
||||
FolderNode *folderNode = node->parentFolderNode();
|
||||
QString projectFileName = folderNode->projectNode()->path().fileName();
|
||||
QString projectFileName = folderNode->projectNode()->filePath().fileName();
|
||||
|
||||
if (!folderNode->canRenameFile(orgFilePath, newFilePath)) {
|
||||
QTimer::singleShot(0, [orgFilePath, newFilePath, projectFileName] {
|
||||
|
||||
@@ -199,7 +199,7 @@ bool ProjectFileWizardExtension::processProject(
|
||||
if (m_context->wizard->kind() == IWizardFactory::ProjectWizard) {
|
||||
if (!static_cast<ProjectNode *>(folder)->addSubProjects(QStringList(generatedProject))) {
|
||||
*errorMessage = tr("Failed to add subproject \"%1\"\nto project \"%2\".")
|
||||
.arg(generatedProject).arg(folder->path().toUserOutput());
|
||||
.arg(generatedProject).arg(folder->filePath().toUserOutput());
|
||||
return false;
|
||||
}
|
||||
*removeOpenProjectAttribute = true;
|
||||
@@ -207,7 +207,7 @@ bool ProjectFileWizardExtension::processProject(
|
||||
QStringList filePaths = Utils::transform(files, &GeneratedFile::path);
|
||||
if (!folder->addFiles(filePaths)) {
|
||||
*errorMessage = tr("Failed to add one or more files to project\n\"%1\" (%2).").
|
||||
arg(folder->path().toUserOutput(), filePaths.join(QLatin1Char(',')));
|
||||
arg(folder->filePath().toUserOutput(), filePaths.join(QLatin1Char(',')));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,8 +65,8 @@ bool sortNodes(Node *n1, Node *n2)
|
||||
FileNode *file2 = n2->asFileNode();
|
||||
if (file1 && file1->fileType() == ProjectFileType) {
|
||||
if (file2 && file2->fileType() == ProjectFileType) {
|
||||
const QString fileName1 = file1->path().fileName();
|
||||
const QString fileName2 = file2->path().fileName();
|
||||
const QString fileName1 = file1->filePath().fileName();
|
||||
const QString fileName2 = file2->filePath().fileName();
|
||||
|
||||
int result = caseFriendlyCompare(fileName1, fileName2);
|
||||
if (result != 0)
|
||||
@@ -91,7 +91,8 @@ bool sortNodes(Node *n1, Node *n2)
|
||||
if (result != 0)
|
||||
return result < 0;
|
||||
|
||||
result = caseFriendlyCompare(project1->path().toString(), project2->path().toString());
|
||||
result = caseFriendlyCompare(project1->filePath().toString(),
|
||||
project2->filePath().toString());
|
||||
if (result != 0)
|
||||
return result < 0;
|
||||
return project1 < project2; // sort by pointer value
|
||||
@@ -111,7 +112,8 @@ bool sortNodes(Node *n1, Node *n2)
|
||||
return true;
|
||||
if (folder1->priority() < folder2->priority())
|
||||
return false;
|
||||
int result = caseFriendlyCompare(folder1->path().toString(), folder2->path().toString());
|
||||
int result = caseFriendlyCompare(folder1->filePath().toString(),
|
||||
folder2->filePath().toString());
|
||||
if (result != 0)
|
||||
return result < 0;
|
||||
else
|
||||
@@ -130,7 +132,8 @@ bool sortNodes(Node *n1, Node *n2)
|
||||
FolderNode *folder1 = static_cast<FolderNode*>(n1);
|
||||
FolderNode *folder2 = static_cast<FolderNode*>(n2);
|
||||
|
||||
int result = caseFriendlyCompare(folder1->path().toString(), folder2->path().toString());
|
||||
int result = caseFriendlyCompare(folder1->filePath().toString(),
|
||||
folder2->filePath().toString());
|
||||
if (result != 0)
|
||||
return result < 0;
|
||||
else
|
||||
@@ -148,11 +151,11 @@ bool sortNodes(Node *n1, Node *n2)
|
||||
if (result != 0)
|
||||
return result < 0;
|
||||
|
||||
const QString filePath1 = n1->path().toString();
|
||||
const QString filePath2 = n2->path().toString();
|
||||
const QString filePath1 = n1->filePath().toString();
|
||||
const QString filePath2 = n2->filePath().toString();
|
||||
|
||||
const QString fileName1 = Utils::FileName::fromString(filePath1).fileName();
|
||||
const QString fileName2 = Utils::FileName::fromString(filePath2).fileName();
|
||||
const QString fileName1 = n1->filePath().fileName();
|
||||
const QString fileName2 = n2->filePath().fileName();
|
||||
|
||||
result = caseFriendlyCompare(fileName1, fileName2);
|
||||
if (result != 0) {
|
||||
@@ -272,7 +275,7 @@ QVariant FlatModel::data(const QModelIndex &index, int role) const
|
||||
break;
|
||||
}
|
||||
case Qt::EditRole: {
|
||||
result = node->path().fileName();
|
||||
result = node->filePath().fileName();
|
||||
break;
|
||||
}
|
||||
case Qt::ToolTipRole: {
|
||||
@@ -283,7 +286,7 @@ QVariant FlatModel::data(const QModelIndex &index, int role) const
|
||||
if (folderNode)
|
||||
result = folderNode->icon();
|
||||
else
|
||||
result = Core::FileIconProvider::icon(node->path().toString());
|
||||
result = Core::FileIconProvider::icon(node->filePath().toString());
|
||||
break;
|
||||
}
|
||||
case Qt::FontRole: {
|
||||
@@ -294,7 +297,7 @@ QVariant FlatModel::data(const QModelIndex &index, int role) const
|
||||
break;
|
||||
}
|
||||
case Project::FilePathRole: {
|
||||
result = node->path().toString();
|
||||
result = node->filePath().toString();
|
||||
break;
|
||||
}
|
||||
case Project::EnabledRole: {
|
||||
@@ -336,7 +339,7 @@ bool FlatModel::setData(const QModelIndex &index, const QVariant &value, int rol
|
||||
|
||||
Node *node = nodeForIndex(index);
|
||||
|
||||
Utils::FileName orgFilePath = node->path();
|
||||
Utils::FileName orgFilePath = node->filePath();
|
||||
Utils::FileName newFilePath = orgFilePath.parentDir().appendPath(value.toString());
|
||||
|
||||
ProjectExplorerPlugin::renameFile(node, newFilePath.toString());
|
||||
@@ -426,7 +429,7 @@ void FlatModel::recursiveAddFileNodes(FolderNode *startNode, QList<Node *> *list
|
||||
|
||||
QList<Node*> FlatModel::childNodes(FolderNode *parentNode, const QSet<Node*> &blackList) const
|
||||
{
|
||||
qCDebug(logger()) << " FlatModel::childNodes for " << parentNode->path();
|
||||
qCDebug(logger()) << " FlatModel::childNodes for " << parentNode->filePath();
|
||||
QList<Node*> nodeList;
|
||||
|
||||
if (parentNode->nodeType() == SessionNodeType) {
|
||||
@@ -498,7 +501,7 @@ QMimeData *FlatModel::mimeData(const QModelIndexList &indexes) const
|
||||
foreach (const QModelIndex &index, indexes) {
|
||||
Node *node = nodeForIndex(index);
|
||||
if (node->asFileNode())
|
||||
data->addFile(node->path().toString());
|
||||
data->addFile(node->filePath().toString());
|
||||
data->addValue(QVariant::fromValue(node));
|
||||
}
|
||||
return data;
|
||||
@@ -614,7 +617,7 @@ bool isSorted(const QList<Node *> &nodes)
|
||||
/// slots and all the fun
|
||||
void FlatModel::added(FolderNode* parentNode, const QList<Node*> &newNodeList)
|
||||
{
|
||||
qCDebug(logger()) << "FlatModel::added" << parentNode->path() << newNodeList.size() << "nodes";
|
||||
qCDebug(logger()) << "FlatModel::added" << parentNode->filePath() << newNodeList.size() << "nodes";
|
||||
QModelIndex parentIndex = indexForNode(parentNode);
|
||||
// Old list
|
||||
|
||||
@@ -650,9 +653,8 @@ void FlatModel::added(FolderNode* parentNode, const QList<Node*> &newNodeList)
|
||||
if (!emptyDifference.isEmpty()) {
|
||||
// This should not happen...
|
||||
qDebug() << "FlatModel::added, old Node list should be subset of newNode list, found files in old list which were not part of new list";
|
||||
foreach (Node *n, emptyDifference) {
|
||||
qDebug()<<n->path();
|
||||
}
|
||||
foreach (Node *n, emptyDifference)
|
||||
qDebug()<<n->filePath();
|
||||
Q_ASSERT(false);
|
||||
}
|
||||
|
||||
@@ -718,7 +720,7 @@ void FlatModel::added(FolderNode* parentNode, const QList<Node*> &newNodeList)
|
||||
|
||||
void FlatModel::removed(FolderNode* parentNode, const QList<Node*> &newNodeList)
|
||||
{
|
||||
qCDebug(logger()) << "FlatModel::removed" << parentNode->path() << newNodeList.size() << "nodes";
|
||||
qCDebug(logger()) << "FlatModel::removed" << parentNode->filePath() << newNodeList.size() << "nodes";
|
||||
QModelIndex parentIndex = indexForNode(parentNode);
|
||||
// Old list
|
||||
QHash<FolderNode*, QList<Node*> >::const_iterator it = m_childNodes.constFind(parentNode);
|
||||
@@ -740,9 +742,8 @@ void FlatModel::removed(FolderNode* parentNode, const QList<Node*> &newNodeList)
|
||||
if (!emptyDifference.isEmpty()) {
|
||||
// This should not happen...
|
||||
qDebug() << "FlatModel::removed, new Node list should be subset of oldNode list, found files in new list which were not part of old list";
|
||||
foreach (Node *n, emptyDifference) {
|
||||
qDebug()<<n->path();
|
||||
}
|
||||
foreach (Node *n, emptyDifference)
|
||||
qDebug()<<n->filePath();
|
||||
Q_ASSERT(false);
|
||||
}
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ Node::Node(NodeType nodeType, const Utils::FileName &filePath, int line)
|
||||
m_line(line),
|
||||
m_projectNode(0),
|
||||
m_folderNode(0),
|
||||
m_path(filePath)
|
||||
m_filePath(filePath)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -91,40 +91,13 @@ void Node::emitNodeSortKeyChanged()
|
||||
ProjectTree::instance()->emitNodeSortKeyChanged(this);
|
||||
}
|
||||
|
||||
/*!
|
||||
* The path of the file representing this node.
|
||||
*
|
||||
* This function does not emit any signals. That has to be done by the calling
|
||||
* class.
|
||||
*/
|
||||
void Node::setPath(const Utils::FileName &path)
|
||||
void Node::setAbsoluteFilePathAndLine(const Utils::FileName &path, int line)
|
||||
{
|
||||
if (m_path == path)
|
||||
if (m_filePath == path && m_line == line)
|
||||
return;
|
||||
|
||||
emitNodeSortKeyAboutToChange();
|
||||
m_path = path;
|
||||
emitNodeSortKeyChanged();
|
||||
emitNodeUpdated();
|
||||
}
|
||||
|
||||
void Node::setLine(int line)
|
||||
{
|
||||
if (m_line == line)
|
||||
return;
|
||||
emitNodeSortKeyAboutToChange();
|
||||
m_line = line;
|
||||
emitNodeSortKeyChanged();
|
||||
emitNodeUpdated();
|
||||
}
|
||||
|
||||
void Node::setPathAndLine(const Utils::FileName &path, int line)
|
||||
{
|
||||
if (m_path == path
|
||||
&& m_line == line)
|
||||
return;
|
||||
emitNodeSortKeyAboutToChange();
|
||||
m_path = path;
|
||||
m_filePath = path;
|
||||
m_line = line;
|
||||
emitNodeSortKeyChanged();
|
||||
emitNodeUpdated();
|
||||
@@ -155,9 +128,9 @@ FolderNode *Node::parentFolderNode() const
|
||||
/*!
|
||||
The path of the file or folder in the filesystem the node represents.
|
||||
*/
|
||||
const Utils::FileName &Node::path() const
|
||||
const Utils::FileName &Node::filePath() const
|
||||
{
|
||||
return m_path;
|
||||
return m_filePath;
|
||||
}
|
||||
|
||||
int Node::line() const
|
||||
@@ -167,12 +140,12 @@ int Node::line() const
|
||||
|
||||
QString Node::displayName() const
|
||||
{
|
||||
return path().fileName();
|
||||
return filePath().fileName();
|
||||
}
|
||||
|
||||
QString Node::tooltip() const
|
||||
{
|
||||
return path().toUserOutput();
|
||||
return filePath().toUserOutput();
|
||||
}
|
||||
|
||||
bool Node::isEnabled() const
|
||||
@@ -584,7 +557,7 @@ ProjectNode::ProjectNode(const Utils::FileName &projectFilePath)
|
||||
|
||||
QString ProjectNode::vcsTopic() const
|
||||
{
|
||||
const QString dir = path().toFileInfo().absolutePath();
|
||||
const QString dir = filePath().toFileInfo().absolutePath();
|
||||
|
||||
if (Core::IVersionControl *const vc =
|
||||
Core::VcsManager::findVersionControlForDirectory(dir))
|
||||
|
||||
@@ -112,7 +112,7 @@ public:
|
||||
NodeType nodeType() const;
|
||||
ProjectNode *projectNode() const; // managing project
|
||||
FolderNode *parentFolderNode() const; // parent folder or project
|
||||
const Utils::FileName &path() const; // file system path
|
||||
const Utils::FileName &filePath() const; // file system path
|
||||
int line() const;
|
||||
virtual QString displayName() const;
|
||||
virtual QString tooltip() const;
|
||||
@@ -120,9 +120,8 @@ public:
|
||||
|
||||
virtual QList<ProjectAction> supportedActions(Node *node) const;
|
||||
|
||||
void setPath(const Utils::FileName &path);
|
||||
void setLine(int line);
|
||||
void setPathAndLine(const Utils::FileName &path, int line);
|
||||
void setAbsoluteFilePathAndLine(const Utils::FileName &filePath, int line);
|
||||
|
||||
void emitNodeUpdated();
|
||||
|
||||
virtual FileNode *asFileNode();
|
||||
@@ -131,7 +130,7 @@ public:
|
||||
virtual SessionNode *asSessionNode();
|
||||
|
||||
protected:
|
||||
Node(NodeType nodeType, const Utils::FileName &path, int line = -1);
|
||||
Node(NodeType nodeType, const Utils::FileName &filePath, int line = -1);
|
||||
|
||||
void setProjectNode(ProjectNode *project);
|
||||
void setParentFolderNode(FolderNode *parentFolder);
|
||||
@@ -144,7 +143,7 @@ private:
|
||||
int m_line;
|
||||
ProjectNode *m_projectNode;
|
||||
FolderNode *m_folderNode;
|
||||
Utils::FileName m_path;
|
||||
Utils::FileName m_filePath;
|
||||
};
|
||||
|
||||
class PROJECTEXPLORER_EXPORT FileNode : public Node
|
||||
|
||||
@@ -185,7 +185,7 @@ void ProjectTree::updateFromDocumentManager(bool invalidCurrentNode)
|
||||
const FileName fileName = document ? document->filePath() : FileName();
|
||||
|
||||
Node *currentNode = 0;
|
||||
if (!invalidCurrentNode && m_currentNode && m_currentNode->path() == fileName)
|
||||
if (!invalidCurrentNode && m_currentNode && m_currentNode->filePath() == fileName)
|
||||
currentNode = m_currentNode;
|
||||
else
|
||||
currentNode = ProjectTreeWidget::nodeForFile(fileName);
|
||||
@@ -393,7 +393,7 @@ void ProjectTree::emitFilesAdded(FolderNode *folder)
|
||||
const FileName fileName = document ? document->filePath() : FileName();
|
||||
|
||||
int index = Utils::indexOf(m_filesAdded, [&fileName](FileNode *node) {
|
||||
return node->path() == fileName;
|
||||
return node->filePath() == fileName;
|
||||
});
|
||||
|
||||
if (index == -1)
|
||||
|
||||
@@ -279,7 +279,7 @@ void ProjectTreeWidget::rowsInserted(const QModelIndex &parent, int start, int e
|
||||
{
|
||||
Node *node = m_model->nodeForIndex(parent);
|
||||
QTC_ASSERT(node, return);
|
||||
const QString path = node->path().toString();
|
||||
const QString path = node->filePath().toString();
|
||||
const QString displayName = node->displayName();
|
||||
|
||||
auto it = m_toExpand.find(ExpandData(path, displayName));
|
||||
@@ -291,7 +291,7 @@ void ProjectTreeWidget::rowsInserted(const QModelIndex &parent, int start, int e
|
||||
while (i <= end) {
|
||||
QModelIndex idx = m_model->index(i, 0, parent);
|
||||
Node *n = m_model->nodeForIndex(idx);
|
||||
if (n && n->path() == m_delayedRename) {
|
||||
if (n && n->filePath() == m_delayedRename) {
|
||||
m_view->setCurrentIndex(idx);
|
||||
m_delayedRename.clear();
|
||||
break;
|
||||
@@ -355,7 +355,7 @@ void ProjectTreeWidget::loadExpandData()
|
||||
void ProjectTreeWidget::recursiveLoadExpandData(const QModelIndex &index, QSet<ExpandData> &data)
|
||||
{
|
||||
Node *node = m_model->nodeForIndex(index);
|
||||
const QString path = node->path().toString();
|
||||
const QString path = node->filePath().toString();
|
||||
const QString displayName = node->displayName();
|
||||
auto it = data.find(ExpandData(path, displayName));
|
||||
if (it != data.end()) {
|
||||
@@ -382,7 +382,7 @@ void ProjectTreeWidget::recursiveSaveExpandData(const QModelIndex &index, QList<
|
||||
// Note: We store the path+displayname of the node, which isn't unique for e.g. .pri files
|
||||
// but works for most nodes
|
||||
Node *node = m_model->nodeForIndex(index);
|
||||
const QStringList &list = ExpandData(node->path().toString(), node->displayName()).toStringList();
|
||||
const QStringList &list = ExpandData(node->filePath().toString(), node->displayName()).toStringList();
|
||||
data->append(QVariant::fromValue(list));
|
||||
int count = m_model->rowCount(index);
|
||||
for (int i = 0; i < count; ++i)
|
||||
@@ -421,7 +421,7 @@ void ProjectTreeWidget::setAutoSynchronization(bool sync)
|
||||
Utils::FileName fileName;
|
||||
if (IDocument *doc = EditorManager::currentDocument())
|
||||
fileName = doc->filePath();
|
||||
if (!currentNode() || currentNode()->path() != fileName)
|
||||
if (!currentNode() || currentNode()->filePath() != fileName)
|
||||
setCurrentItem(ProjectTreeWidget::nodeForFile(fileName));
|
||||
}
|
||||
}
|
||||
@@ -442,7 +442,7 @@ void ProjectTreeWidget::editCurrentItem()
|
||||
void ProjectTreeWidget::renamed(const Utils::FileName &oldPath, const Utils::FileName &newPath)
|
||||
{
|
||||
Q_UNUSED(oldPath);
|
||||
if (!currentNode() || currentNode()->path() != newPath) {
|
||||
if (!currentNode() || currentNode()->filePath() != newPath) {
|
||||
// try to find the node
|
||||
Node *node = nodeForFile(newPath);
|
||||
if (node)
|
||||
@@ -546,7 +546,7 @@ void ProjectTreeWidget::openItem(const QModelIndex &mainIndex)
|
||||
Node *node = m_model->nodeForIndex(mainIndex);
|
||||
if (node->nodeType() != FileNodeType)
|
||||
return;
|
||||
IEditor *editor = EditorManager::openEditor(node->path().toString());
|
||||
IEditor *editor = EditorManager::openEditor(node->filePath().toString());
|
||||
if (editor && node->line() >= 0)
|
||||
editor->gotoLine(node->line());
|
||||
}
|
||||
|
||||
@@ -936,7 +936,7 @@ void PythonProjectNode::refresh(QSet<QString> oldFileList)
|
||||
QSet<QString> added = newFileList;
|
||||
added.subtract(oldFileList);
|
||||
|
||||
QString baseDir = path().toFileInfo().absolutePath();
|
||||
QString baseDir = filePath().toFileInfo().absolutePath();
|
||||
FilesInPathHash filesInPaths = sortFilesIntoPaths(baseDir, added);
|
||||
|
||||
FilesInPathHashConstIt cend = filesInPaths.constEnd();
|
||||
@@ -974,7 +974,7 @@ void PythonProjectNode::refresh(QSet<QString> oldFileList)
|
||||
QList<FileNode *> fileNodes;
|
||||
foreach (const QString &file, it.value()) {
|
||||
foreach (FileNode *fn, folder->fileNodes()) {
|
||||
if (fn->path().toString() == file)
|
||||
if (fn->filePath().toString() == file)
|
||||
fileNodes.append(fn);
|
||||
}
|
||||
}
|
||||
@@ -1009,7 +1009,7 @@ FolderNode *PythonProjectNode::createFolderByName(const QStringList &components,
|
||||
|
||||
const QString component = components.at(end - 1);
|
||||
|
||||
const FileName folderPath = path().parentDir().appendPath(folderName);
|
||||
const FileName folderPath = filePath().parentDir().appendPath(folderName);
|
||||
FolderNode *folder = new FolderNode(folderPath);
|
||||
folder->setDisplayName(component);
|
||||
|
||||
@@ -1037,9 +1037,9 @@ FolderNode *PythonProjectNode::findFolderByName(const QStringList &components, i
|
||||
if (!parent)
|
||||
return 0;
|
||||
|
||||
const QString baseDir = path().toFileInfo().path();
|
||||
const QString baseDir = filePath().toFileInfo().path();
|
||||
foreach (FolderNode *fn, parent->subFolderNodes()) {
|
||||
if (fn->path().toString() == baseDir + QLatin1Char('/') + folderName)
|
||||
if (fn->filePath().toString() == baseDir + QLatin1Char('/') + folderName)
|
||||
return fn;
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -257,7 +257,7 @@ static QList<ProjectExplorer::ProjectAction> supportedNodeActions(ProjectExplore
|
||||
if (managesFiles)
|
||||
actions << ProjectExplorer::AddNewFile << ProjectExplorer::AddExistingFile;
|
||||
if (node->nodeType() == ProjectExplorer::FileNodeType
|
||||
&& !project->qbsProject().buildSystemFiles().contains(node->path().toString())) {
|
||||
&& !project->qbsProject().buildSystemFiles().contains(node->filePath().toString())) {
|
||||
actions << ProjectExplorer::RemoveFile << ProjectExplorer::Rename;
|
||||
}
|
||||
return actions;
|
||||
@@ -419,7 +419,7 @@ void QbsGroupNode::updateQbsGroupData(const qbs::GroupData &grp, const QString &
|
||||
m_productPath = productPath;
|
||||
m_qbsGroupData = grp;
|
||||
|
||||
setPath(Utils::FileName::fromString(grp.location().filePath()));
|
||||
setAbsoluteFilePathAndLine(Utils::FileName::fromString(grp.location().filePath()), line());
|
||||
setDisplayName(grp.name());
|
||||
|
||||
QbsFileNode *idx = 0;
|
||||
@@ -429,7 +429,7 @@ void QbsGroupNode::updateQbsGroupData(const qbs::GroupData &grp, const QString &
|
||||
break;
|
||||
}
|
||||
QTC_ASSERT(idx, return);
|
||||
idx->setPathAndLine(Utils::FileName::fromString(grp.location().filePath()),
|
||||
idx->setAbsoluteFilePathAndLine(Utils::FileName::fromString(grp.location().filePath()),
|
||||
grp.location().line());
|
||||
|
||||
setupFiles(this, grp, grp.allFilePaths(), productPath, updateExisting);
|
||||
@@ -493,7 +493,7 @@ void QbsGroupNode::setupFolder(ProjectExplorer::FolderNode *root, const qbs::Gro
|
||||
ProjectExplorer::FileNode *fn = 0;
|
||||
foreach (ProjectExplorer::FileNode *f, root->fileNodes()) {
|
||||
// There can be one match only here!
|
||||
if (f->path() != path || f->fileType() != newFileType)
|
||||
if (f->filePath() != path || f->fileType() != newFileType)
|
||||
continue;
|
||||
fn = f;
|
||||
break;
|
||||
@@ -511,7 +511,7 @@ void QbsGroupNode::setupFolder(ProjectExplorer::FolderNode *root, const qbs::Gro
|
||||
ProjectExplorer::FolderNode *fn = 0;
|
||||
foreach (ProjectExplorer::FolderNode *f, root->subFolderNodes()) {
|
||||
// There can be one match only here!
|
||||
if (f->path() != path)
|
||||
if (f->filePath() != path)
|
||||
continue;
|
||||
fn = f;
|
||||
break;
|
||||
@@ -666,7 +666,7 @@ void QbsProductNode::setQbsProductData(const qbs::Project &project, const qbs::P
|
||||
bool updateExisting = productWasEnabled != productIsEnabled;
|
||||
|
||||
setDisplayName(QbsProject::productDisplayName(project, prd));
|
||||
setPath(Utils::FileName::fromString(prd.location().filePath()));
|
||||
setAbsoluteFilePathAndLine(Utils::FileName::fromString(prd.location().filePath()), line());
|
||||
const QString &productPath = QFileInfo(prd.location().filePath()).absolutePath();
|
||||
|
||||
// Find the QbsFileNode we added earlier:
|
||||
@@ -677,7 +677,7 @@ void QbsProductNode::setQbsProductData(const qbs::Project &project, const qbs::P
|
||||
break;
|
||||
}
|
||||
QTC_ASSERT(idx, return);
|
||||
idx->setPathAndLine(Utils::FileName::fromString(prd.location().filePath()),
|
||||
idx->setAbsoluteFilePathAndLine(Utils::FileName::fromString(prd.location().filePath()),
|
||||
prd.location().line());
|
||||
|
||||
QList<ProjectExplorer::ProjectNode *> toAdd;
|
||||
@@ -812,7 +812,7 @@ void QbsProjectNode::ctor()
|
||||
|
||||
setIcon(m_projectIcon);
|
||||
addFileNodes(QList<ProjectExplorer::FileNode *>()
|
||||
<< new ProjectExplorer::FileNode(path(), ProjectExplorer::ProjectFileType, false));
|
||||
<< new ProjectExplorer::FileNode(filePath(), ProjectExplorer::ProjectFileType, false));
|
||||
}
|
||||
|
||||
QbsProductNode *QbsProjectNode::findProductNode(const QString &uniqueName)
|
||||
|
||||
@@ -76,7 +76,7 @@ class QbsGroupNode;
|
||||
class QbsBaseProjectNode : public ProjectExplorer::ProjectNode
|
||||
{
|
||||
public:
|
||||
explicit QbsBaseProjectNode(const Utils::FileName &path);
|
||||
explicit QbsBaseProjectNode(const Utils::FileName &absoluteFilePath);
|
||||
|
||||
bool showInSimpleTree() const override;
|
||||
|
||||
@@ -156,7 +156,7 @@ private:
|
||||
class QbsProjectNode : public QbsBaseProjectNode
|
||||
{
|
||||
public:
|
||||
explicit QbsProjectNode(const Utils::FileName &path);
|
||||
explicit QbsProjectNode(const Utils::FileName &absoluteFilePath);
|
||||
~QbsProjectNode() override;
|
||||
|
||||
virtual QbsProject *project() const;
|
||||
|
||||
@@ -288,7 +288,7 @@ void QbsProjectManagerPlugin::updateBuildActions()
|
||||
&& !BuildManager::isBuilding(m_editorProject)
|
||||
&& !m_editorProject->isParsing();
|
||||
|
||||
fileName = m_editorNode->path().fileName();
|
||||
fileName = m_editorNode->filePath().fileName();
|
||||
fileVisible = m_editorProject && m_editorNode && dynamic_cast<QbsBaseProjectNode *>(m_editorNode->projectNode());
|
||||
|
||||
QbsProductNode *productNode
|
||||
@@ -361,7 +361,7 @@ void QbsProjectManagerPlugin::buildFileContextMenu()
|
||||
QTC_ASSERT(m_selectedNode, return);
|
||||
QTC_ASSERT(m_selectedProject, return);
|
||||
|
||||
buildSingleFile(m_selectedProject, m_selectedNode->path().toString());
|
||||
buildSingleFile(m_selectedProject, m_selectedNode->filePath().toString());
|
||||
}
|
||||
|
||||
void QbsProjectManagerPlugin::buildFile()
|
||||
@@ -369,7 +369,7 @@ void QbsProjectManagerPlugin::buildFile()
|
||||
if (!m_editorProject || !m_editorNode)
|
||||
return;
|
||||
|
||||
buildSingleFile(m_editorProject, m_editorNode->path().toString());
|
||||
buildSingleFile(m_editorProject, m_editorNode->filePath().toString());
|
||||
}
|
||||
|
||||
void QbsProjectManagerPlugin::buildProductContextMenu()
|
||||
|
||||
@@ -155,7 +155,7 @@ void AndroidExtraLibraryListModel::addEntries(const QStringList &list)
|
||||
|
||||
foreach (const QString &path, list)
|
||||
m_entries += QLatin1String("$$PWD/")
|
||||
+ node->path().toFileInfo().absoluteDir().relativeFilePath(path);
|
||||
+ node->filePath().toFileInfo().absoluteDir().relativeFilePath(path);
|
||||
|
||||
node->setProVariable(QLatin1String("ANDROID_EXTRA_LIBS"), m_entries, m_scope,
|
||||
QmakeProjectManager::Internal::ProWriter::ReplaceValues
|
||||
|
||||
@@ -156,7 +156,7 @@ ChooseDirectoryPage::ChooseDirectoryPage(CreateAndroidManifestWizard *wizard)
|
||||
|
||||
void ChooseDirectoryPage::checkPackageSourceDir()
|
||||
{
|
||||
QString projectDir = m_wizard->node()->path().toFileInfo().absolutePath();
|
||||
QString projectDir = m_wizard->node()->filePath().toFileInfo().absolutePath();
|
||||
QString newDir = m_androidPackageSourceDir->path();
|
||||
bool isComplete = QFileInfo(projectDir) != QFileInfo(newDir);
|
||||
|
||||
@@ -182,7 +182,7 @@ void ChooseDirectoryPage::initializePage()
|
||||
"The files in the Android package source directory are copied to the build directory's "
|
||||
"Android directory and the default files are overwritten."));
|
||||
|
||||
m_androidPackageSourceDir->setPath(m_wizard->node()->path().toFileInfo().absolutePath().append(QLatin1String("/android")));
|
||||
m_androidPackageSourceDir->setPath(m_wizard->node()->filePath().toFileInfo().absolutePath().append(QLatin1String("/android")));
|
||||
connect(m_androidPackageSourceDir, SIGNAL(rawPathChanged(QString)),
|
||||
this, SLOT(checkPackageSourceDir()));
|
||||
} else {
|
||||
@@ -343,14 +343,14 @@ void CreateAndroidManifestWizard::createAndroidTemplateFiles()
|
||||
if (m_node->singleVariableValue(QmakeProjectManager::AndroidPackageSourceDir).isEmpty()) {
|
||||
// and now time for some magic
|
||||
QString value = QLatin1String("$$PWD/")
|
||||
+ m_node->path().toFileInfo().absoluteDir().relativeFilePath(m_directory);
|
||||
+ m_node->filePath().toFileInfo().absoluteDir().relativeFilePath(m_directory);
|
||||
bool result =
|
||||
m_node->setProVariable(QLatin1String("ANDROID_PACKAGE_SOURCE_DIR"), QStringList(value));
|
||||
|
||||
if (!result) {
|
||||
QMessageBox::warning(this, tr("Project File not Updated"),
|
||||
tr("Could not update the .pro file %1.")
|
||||
.arg(m_node->path().toUserOutput()));
|
||||
.arg(m_node->filePath().toUserOutput()));
|
||||
}
|
||||
}
|
||||
Core::EditorManager::openEditor(m_directory + QLatin1String("/AndroidManifest.xml"));
|
||||
|
||||
@@ -100,7 +100,7 @@ QVariantMap QmakeAndroidRunConfiguration::toMap() const
|
||||
if (m_proFilePath.isEmpty()) {
|
||||
if (!target()->project()->rootProjectNode())
|
||||
return QVariantMap();
|
||||
m_proFilePath = target()->project()->rootProjectNode()->path();
|
||||
m_proFilePath = target()->project()->rootProjectNode()->filePath();
|
||||
}
|
||||
|
||||
const QDir projectDir = QDir(target()->project()->projectDirectory().toString());
|
||||
@@ -141,10 +141,10 @@ QString QmakeAndroidRunConfiguration::disabledReason() const
|
||||
void QmakeAndroidRunConfiguration::proFileUpdated(QmakeProjectManager::QmakeProFileNode *pro, bool success, bool parseInProgress)
|
||||
{
|
||||
if (m_proFilePath.isEmpty() && target()->project()->rootProjectNode()) {
|
||||
m_proFilePath = target()->project()->rootProjectNode()->path();
|
||||
m_proFilePath = target()->project()->rootProjectNode()->filePath();
|
||||
}
|
||||
|
||||
if (m_proFilePath != pro->path())
|
||||
if (m_proFilePath != pro->filePath())
|
||||
return;
|
||||
|
||||
bool enabled = isEnabled();
|
||||
|
||||
@@ -141,7 +141,7 @@ QList<RunConfiguration *> QmakeAndroidRunConfigurationFactory::runConfigurations
|
||||
QList<RunConfiguration *> result;
|
||||
foreach (RunConfiguration *rc, t->runConfigurations())
|
||||
if (QmakeAndroidRunConfiguration *qt4c = qobject_cast<QmakeAndroidRunConfiguration *>(rc))
|
||||
if (qt4c->proFilePath() == n->path())
|
||||
if (qt4c->proFilePath() == n->filePath())
|
||||
result << rc;
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ QString DesktopQmakeRunConfiguration::disabledReason() const
|
||||
|
||||
void DesktopQmakeRunConfiguration::proFileUpdated(QmakeProFileNode *pro, bool success, bool parseInProgress)
|
||||
{
|
||||
if (m_proFilePath != pro->path())
|
||||
if (m_proFilePath != pro->filePath())
|
||||
return;
|
||||
bool enabled = isEnabled();
|
||||
QString reason = disabledReason();
|
||||
@@ -750,7 +750,7 @@ QList<RunConfiguration *> DesktopQmakeRunConfigurationFactory::runConfigurations
|
||||
QList<RunConfiguration *> result;
|
||||
foreach (RunConfiguration *rc, t->runConfigurations())
|
||||
if (DesktopQmakeRunConfiguration *qt4c = qobject_cast<DesktopQmakeRunConfiguration *>(rc))
|
||||
if (qt4c->proFilePath() == n->path())
|
||||
if (qt4c->proFilePath() == n->filePath())
|
||||
result << rc;
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1013,7 +1013,7 @@ QString InternalLibraryDetailsController::suggestedIncludePath() const
|
||||
const int currentIndex = libraryDetailsWidget()->libraryComboBox->currentIndex();
|
||||
if (currentIndex >= 0) {
|
||||
QmakeProFileNode *proFileNode = m_proFileNodes.at(currentIndex);
|
||||
return proFileNode->path().toFileInfo().absolutePath();
|
||||
return proFileNode->filePath().toFileInfo().absolutePath();
|
||||
}
|
||||
return QString();
|
||||
}
|
||||
@@ -1039,12 +1039,12 @@ void InternalLibraryDetailsController::updateProFile()
|
||||
setIgnoreGuiSignals(true);
|
||||
|
||||
ProjectExplorer::ProjectNode *rootProject = project->rootProjectNode();
|
||||
m_rootProjectPath = rootProject->path().toFileInfo().absolutePath();
|
||||
m_rootProjectPath = rootProject->filePath().toFileInfo().absolutePath();
|
||||
QDir rootDir(m_rootProjectPath);
|
||||
FindQmakeProFiles findQt4ProFiles;
|
||||
QList<QmakeProFileNode *> proFiles = findQt4ProFiles(rootProject);
|
||||
foreach (QmakeProFileNode *proFileNode, proFiles) {
|
||||
const QString proFilePath = proFileNode->path().toString();
|
||||
const QString proFilePath = proFileNode->filePath().toString();
|
||||
QmakeProjectManager::QmakeProjectType type = proFileNode->projectType();
|
||||
if (type == SharedLibraryTemplate || type == StaticLibraryTemplate) {
|
||||
const QStringList configVar = proFileNode->variableValue(ConfigVar);
|
||||
|
||||
@@ -237,7 +237,7 @@ bool MakeStep::init()
|
||||
if (!relObjectsDir.isEmpty())
|
||||
relObjectsDir += QLatin1Char('/');
|
||||
QString objectFile = relObjectsDir +
|
||||
bc->fileNodeBuild()->path().toFileInfo().baseName() +
|
||||
bc->fileNodeBuild()->filePath().toFileInfo().baseName() +
|
||||
subNode->objectExtension();
|
||||
Utils::QtcProcess::addArg(&args, objectFile);
|
||||
}
|
||||
|
||||
@@ -112,11 +112,11 @@ class SortByPath
|
||||
{
|
||||
public:
|
||||
bool operator()(Node *a, Node *b)
|
||||
{ return operator()(a->path(), b->path()); }
|
||||
{ return operator()(a->filePath(), b->filePath()); }
|
||||
bool operator()(Node *a, const FileName &b)
|
||||
{ return operator()(a->path(), b); }
|
||||
{ return operator()(a->filePath(), b); }
|
||||
bool operator()(const FileName &a, Node *b)
|
||||
{ return operator()(a, b->path()); }
|
||||
{ return operator()(a, b->filePath()); }
|
||||
// Compare as strings to correctly detect case-only file rename
|
||||
bool operator()(const FileName &a, const FileName &b)
|
||||
{ return a.toString() < b.toString(); }
|
||||
@@ -254,7 +254,7 @@ QmakePriFile::QmakePriFile(QmakeProjectManager::QmakePriFileNode *qmakePriFile)
|
||||
{
|
||||
setId("Qmake.PriFile");
|
||||
setMimeType(QLatin1String(QmakeProjectManager::Constants::PROFILE_MIMETYPE));
|
||||
setFilePath(m_priFile->path());
|
||||
setFilePath(m_priFile->filePath());
|
||||
}
|
||||
|
||||
bool QmakePriFile::save(QString *errorString, const QString &fileName, bool autoSave)
|
||||
@@ -468,7 +468,7 @@ struct InternalNode
|
||||
QMultiMap<QString, FolderNode *> existingFolderNodes;
|
||||
foreach (FolderNode *node, folder->subFolderNodes())
|
||||
if (node->nodeType() != ProjectNodeType && !dynamic_cast<ResourceEditor::ResourceTopLevelNode *>(node))
|
||||
existingFolderNodes.insert(node->path().toString(), node);
|
||||
existingFolderNodes.insert(node->filePath().toString(), node);
|
||||
|
||||
QList<FolderNode *> foldersToRemove;
|
||||
QList<FolderNode *> foldersToAdd;
|
||||
@@ -929,7 +929,7 @@ QList<ProjectAction> QmakePriFileNode::supportedActions(Node *node) const
|
||||
// work on a subset of the file types according to project type.
|
||||
|
||||
actions << AddNewFile;
|
||||
if (m_recursiveEnumerateFiles.contains(node->path()))
|
||||
if (m_recursiveEnumerateFiles.contains(node->filePath()))
|
||||
actions << EraseFile;
|
||||
else
|
||||
actions << RemoveFile;
|
||||
@@ -941,13 +941,13 @@ QList<ProjectAction> QmakePriFileNode::supportedActions(Node *node) const
|
||||
if (folder) {
|
||||
QStringList list;
|
||||
foreach (FolderNode *f, folder->subFolderNodes())
|
||||
list << f->path().toString() + QLatin1Char('/');
|
||||
list << f->filePath().toString() + QLatin1Char('/');
|
||||
if (deploysFolder(Utils::commonPath(list)))
|
||||
addExistingFiles = false;
|
||||
}
|
||||
}
|
||||
|
||||
addExistingFiles = addExistingFiles && !deploysFolder(node->path().toString());
|
||||
addExistingFiles = addExistingFiles && !deploysFolder(node->filePath().toString());
|
||||
|
||||
if (addExistingFiles)
|
||||
actions << AddExistingFile << AddExistingDirectory;
|
||||
@@ -1139,7 +1139,7 @@ bool QmakePriFileNode::renameFile(const QString &filePath, const QString &newFil
|
||||
FolderNode::AddNewInformation QmakePriFileNode::addNewInformation(const QStringList &files, Node *context) const
|
||||
{
|
||||
Q_UNUSED(files)
|
||||
return FolderNode::AddNewInformation(path().fileName(), context && context->projectNode() == this ? 120 : 90);
|
||||
return FolderNode::AddNewInformation(filePath().fileName(), context && context->projectNode() == this ? 120 : 90);
|
||||
}
|
||||
|
||||
bool QmakePriFileNode::priFileWritable(const QString &path)
|
||||
@@ -1586,7 +1586,7 @@ namespace {
|
||||
|
||||
QmakeProFileNode *QmakeProFileNode::findProFileFor(const FileName &fileName) const
|
||||
{
|
||||
if (fileName == path())
|
||||
if (fileName == filePath())
|
||||
return const_cast<QmakeProFileNode *>(this);
|
||||
foreach (ProjectNode *pn, subProjectNodes())
|
||||
if (QmakeProFileNode *qmakeProFileNode = dynamic_cast<QmakeProFileNode *>(pn))
|
||||
@@ -1686,7 +1686,7 @@ bool QmakeProFileNode::showInSimpleTree() const
|
||||
FolderNode::AddNewInformation QmakeProFileNode::addNewInformation(const QStringList &files, Node *context) const
|
||||
{
|
||||
Q_UNUSED(files)
|
||||
return AddNewInformation(path().fileName(), context && context->projectNode() == this ? 120 : 100);
|
||||
return AddNewInformation(filePath().fileName(), context && context->projectNode() == this ? 120 : 100);
|
||||
}
|
||||
|
||||
bool QmakeProFileNode::showInSimpleTree(QmakeProjectType projectType) const
|
||||
@@ -2087,7 +2087,7 @@ void QmakeProFileNode::applyAsyncEvaluate()
|
||||
|
||||
bool sortByNodes(Node *a, Node *b)
|
||||
{
|
||||
return a->path() < b->path();
|
||||
return a->filePath() < b->filePath();
|
||||
}
|
||||
|
||||
void QmakeProFileNode::applyEvaluate(EvalResult *evalResult)
|
||||
@@ -2191,12 +2191,12 @@ void QmakeProFileNode::applyEvaluate(EvalResult *evalResult)
|
||||
break; // we are done, hurray!
|
||||
|
||||
if (! existingAtEnd
|
||||
&& (newAtEnd || (*existingIt)->path() < (*newIt)->name)) {
|
||||
&& (newAtEnd || (*existingIt)->filePath() < (*newIt)->name)) {
|
||||
// Remove case
|
||||
toRemove << *existingIt;
|
||||
++existingIt;
|
||||
} else if (! newAtEnd
|
||||
&& (existingAtEnd || (*newIt)->name < (*existingIt)->path())) {
|
||||
&& (existingAtEnd || (*newIt)->name < (*existingIt)->filePath())) {
|
||||
// Adding a node
|
||||
IncludedPriFile *nodeToAdd = *newIt;
|
||||
++newIt;
|
||||
@@ -2208,7 +2208,7 @@ void QmakeProFileNode::applyEvaluate(EvalResult *evalResult)
|
||||
bool loop = false;
|
||||
Node *n = pn;
|
||||
while ((n = n->parentFolderNode())) {
|
||||
if (dynamic_cast<QmakePriFileNode *>(n) && n->path() == nodeToAdd->name) {
|
||||
if (dynamic_cast<QmakePriFileNode *>(n) && n->filePath() == nodeToAdd->name) {
|
||||
loop = true;
|
||||
break;
|
||||
}
|
||||
@@ -2228,7 +2228,7 @@ void QmakeProFileNode::applyEvaluate(EvalResult *evalResult)
|
||||
QmakeProFileNode *qmakeProFileNode = new QmakeProFileNode(m_project, nodeToAdd->name);
|
||||
qmakeProFileNode->setParentFolderNode(pn); // Needed for loop detection
|
||||
qmakeProFileNode->setIncludedInExactParse(
|
||||
result->exactSubdirs.contains(qmakeProFileNode->path())
|
||||
result->exactSubdirs.contains(qmakeProFileNode->filePath())
|
||||
&& pn->includedInExactParse());
|
||||
qmakeProFileNode->asyncUpdate();
|
||||
toAdd << qmakeProFileNode;
|
||||
@@ -2248,7 +2248,7 @@ void QmakeProFileNode::applyEvaluate(EvalResult *evalResult)
|
||||
// the .pro file is included in this .pro file
|
||||
// So to compare that later parse with the sync one
|
||||
QmakeProFileNode *proFileNode = static_cast<QmakeProFileNode *>(*existingIt);
|
||||
proFileNode->setIncludedInExactParse(result->exactSubdirs.contains(proFileNode->path())
|
||||
proFileNode->setIncludedInExactParse(result->exactSubdirs.contains(proFileNode->filePath())
|
||||
&& pn->includedInExactParse());
|
||||
proFileNode->asyncUpdate();
|
||||
}
|
||||
@@ -2568,9 +2568,9 @@ void QmakeProFileNode::updateUiFiles(const QString &buildDir)
|
||||
const Utils::FileName uiDir = uiDirectory(Utils::FileName::fromString(buildDir));
|
||||
const QString uiExtensions = singleVariableValue(UiHeaderExtensionVar);
|
||||
foreach (const FileNode *uiFile, uiFiles) {
|
||||
QString headerFile = uiHeaderFile(uiDir, uiFile->path(), uiExtensions);
|
||||
QString headerFile = uiHeaderFile(uiDir, uiFile->filePath(), uiExtensions);
|
||||
if (!headerFile.isEmpty())
|
||||
m_uiFiles.insert(uiFile->path().toString(), headerFile);
|
||||
m_uiFiles.insert(uiFile->filePath().toString(), headerFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@ private:
|
||||
static QPair<ProFile *, QStringList> readProFile(const QString &file);
|
||||
static QPair<ProFile *, QStringList> readProFileFromContents(const QString &contents);
|
||||
void save(const QStringList &lines);
|
||||
bool priFileWritable(const QString &path);
|
||||
bool priFileWritable(const QString &absoluteFilePath);
|
||||
bool saveModifiedEditors();
|
||||
QStringList formResources(const QString &formFile) const;
|
||||
static QStringList baseVPaths(QtSupport::ProFileReader *reader, const QString &projectDir, const QString &buildDir);
|
||||
|
||||
@@ -232,19 +232,19 @@ void ProjectFilesVisitor::findProjectFiles(QmakeProFileNode *rootNode, QmakeProj
|
||||
|
||||
void ProjectFilesVisitor::visitProjectNode(ProjectNode *projectNode)
|
||||
{
|
||||
m_files->proFiles.append(projectNode->path().toString());
|
||||
m_files->proFiles.append(projectNode->filePath().toString());
|
||||
visitFolderNode(projectNode);
|
||||
}
|
||||
|
||||
void ProjectFilesVisitor::visitFolderNode(FolderNode *folderNode)
|
||||
{
|
||||
if (dynamic_cast<ResourceEditor::ResourceTopLevelNode *>(folderNode))
|
||||
m_files->files[ResourceType].push_back(folderNode->path().toString());
|
||||
m_files->files[ResourceType].push_back(folderNode->filePath().toString());
|
||||
|
||||
foreach (FileNode *fileNode, folderNode->fileNodes()) {
|
||||
const int type = fileNode->fileType();
|
||||
QStringList &targetList = fileNode->isGenerated() ? m_files->generatedFiles[type] : m_files->files[type];
|
||||
targetList.push_back(fileNode->path().toString());
|
||||
targetList.push_back(fileNode->filePath().toString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -463,7 +463,7 @@ void QmakeProject::updateCppCodeModel()
|
||||
ProjectPart::Ptr templatePart(new ProjectPart);
|
||||
templatePart->project = this;
|
||||
templatePart->displayName = pro->displayName();
|
||||
templatePart->projectFile = pro->path().toString();
|
||||
templatePart->projectFile = pro->filePath().toString();
|
||||
templatePart->selectedForBuilding = pro->includedInExactParse();
|
||||
|
||||
if (pro->variableValue(ConfigVar).contains(QLatin1String("qt")))
|
||||
@@ -619,7 +619,7 @@ void QmakeProject::scheduleAsyncUpdate(QmakeProFileNode *node, QmakeProFileNode:
|
||||
return;
|
||||
|
||||
if (debug)
|
||||
qDebug()<<"schduleAsyncUpdate (node)"<<node->path();
|
||||
qDebug()<<"schduleAsyncUpdate (node)"<<node->filePath();
|
||||
|
||||
if (m_cancelEvaluate) {
|
||||
if (debug)
|
||||
@@ -873,7 +873,7 @@ QStringList QmakeProject::files(FilesMode fileMode) const
|
||||
static FolderNode *folderOf(FolderNode *in, FileType fileType, const FileName &fileName)
|
||||
{
|
||||
foreach (FileNode *fn, in->fileNodes())
|
||||
if (fn->fileType() == fileType && fn->path() == fileName)
|
||||
if (fn->fileType() == fileType && fn->filePath() == fileName)
|
||||
return in;
|
||||
foreach (FolderNode *folder, in->subFolderNodes())
|
||||
if (FolderNode *pn = folderOf(folder, fileType, fileName))
|
||||
@@ -1058,7 +1058,7 @@ bool QmakeProject::hasApplicationProFile(const FileName &path) const
|
||||
|
||||
QList<QmakeProFileNode *> list = applicationProFiles();
|
||||
foreach (QmakeProFileNode * node, list)
|
||||
if (node->path() == path)
|
||||
if (node->filePath() == path)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
@@ -1077,7 +1077,7 @@ QList<QmakeProFileNode *> QmakeProject::nodesWithQtcRunnable(QList<QmakeProFileN
|
||||
QList<Core::Id> QmakeProject::idsForNodes(Core::Id base, const QList<QmakeProFileNode *> &nodes)
|
||||
{
|
||||
return Utils::transform(nodes, [&base](QmakeProFileNode *node) {
|
||||
return base.withSuffix(node->path().toString());
|
||||
return base.withSuffix(node->filePath().toString());
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1101,7 +1101,7 @@ void QmakeProject::activeTargetWasChanged()
|
||||
|
||||
bool QmakeProject::hasSubNode(QmakePriFileNode *root, const FileName &path)
|
||||
{
|
||||
if (root->path() == path)
|
||||
if (root->filePath() == path)
|
||||
return true;
|
||||
foreach (FolderNode *fn, root->subFolderNodes()) {
|
||||
if (dynamic_cast<QmakeProFileNode *>(fn)) {
|
||||
@@ -1193,7 +1193,7 @@ QSet<QString> CentralizedFolderWatcher::recursiveDirs(const QString &folder)
|
||||
void CentralizedFolderWatcher::watchFolders(const QList<QString> &folders, QmakePriFileNode *node)
|
||||
{
|
||||
if (debugCFW)
|
||||
qDebug()<<"CFW::watchFolders()"<<folders<<"for node"<<node->path();
|
||||
qDebug()<<"CFW::watchFolders()"<<folders<<"for node"<<node->filePath();
|
||||
m_watcher.addPaths(folders);
|
||||
|
||||
const QChar slash = QLatin1Char('/');
|
||||
@@ -1218,7 +1218,7 @@ void CentralizedFolderWatcher::watchFolders(const QList<QString> &folders, Qmake
|
||||
void CentralizedFolderWatcher::unwatchFolders(const QList<QString> &folders, QmakePriFileNode *node)
|
||||
{
|
||||
if (debugCFW)
|
||||
qDebug()<<"CFW::unwatchFolders()"<<folders<<"for node"<<node->path();
|
||||
qDebug()<<"CFW::unwatchFolders()"<<folders<<"for node"<<node->filePath();
|
||||
const QChar slash = QLatin1Char('/');
|
||||
foreach (const QString &f, folders) {
|
||||
QString folder = f;
|
||||
@@ -1411,14 +1411,14 @@ void QmakeProject::updateBuildSystemData()
|
||||
foreach (const QmakeProFileNode * const node, applicationProFiles()) {
|
||||
appTargetList.list << BuildTargetInfo(node->targetInformation().target,
|
||||
FileName::fromString(executableFor(node)),
|
||||
node->path());
|
||||
node->filePath());
|
||||
}
|
||||
target->setApplicationTargets(appTargetList);
|
||||
}
|
||||
|
||||
void QmakeProject::collectData(const QmakeProFileNode *node, DeploymentData &deploymentData)
|
||||
{
|
||||
if (!node->isSubProjectDeployable(node->path().toString()))
|
||||
if (!node->isSubProjectDeployable(node->filePath().toString()))
|
||||
return;
|
||||
|
||||
const InstallsList &installsList = node->installsList();
|
||||
|
||||
@@ -135,7 +135,7 @@ void QmakeManager::addLibraryContextMenu()
|
||||
{
|
||||
Node *node = ProjectTree::currentNode();
|
||||
if (dynamic_cast<QmakeProFileNode *>(node))
|
||||
addLibrary(node->path().toString());
|
||||
addLibrary(node->filePath().toString());
|
||||
}
|
||||
|
||||
void QmakeManager::addLibrary(const QString &fileName, BaseTextEditor *editor)
|
||||
|
||||
@@ -339,7 +339,7 @@ void QmakeProjectManagerPlugin::updateContextActions(ProjectExplorer::Node *node
|
||||
m_rebuildSubProjectAction->setParameter(subProjectName);
|
||||
m_cleanSubProjectAction->setParameter(subProjectName);
|
||||
m_buildSubProjectContextMenu->setParameter(subProjectName);
|
||||
m_buildFileAction->setParameter(buildFilePossible ? fileNode->path().fileName() : QString());
|
||||
m_buildFileAction->setParameter(buildFilePossible ? fileNode->filePath().fileName() : QString());
|
||||
|
||||
QmakeBuildConfiguration *buildConfiguration = (qmakeProject && qmakeProject->activeTarget()) ?
|
||||
static_cast<QmakeBuildConfiguration *>(qmakeProject->activeTarget()->activeBuildConfiguration()) : 0;
|
||||
|
||||
@@ -126,7 +126,7 @@ QString QMakeStep::allArguments(bool shorted)
|
||||
QmakeBuildConfiguration *bc = qmakeBuildConfiguration();
|
||||
QStringList arguments;
|
||||
if (bc->subNodeBuild())
|
||||
arguments << bc->subNodeBuild()->path().toUserOutput();
|
||||
arguments << bc->subNodeBuild()->filePath().toUserOutput();
|
||||
else if (shorted)
|
||||
arguments << project()->projectFilePath().fileName();
|
||||
else
|
||||
@@ -235,7 +235,7 @@ bool QMakeStep::init()
|
||||
QmakeProFileNode *node = static_cast<QmakeProject *>(qt4bc->target()->project())->rootQmakeProjectNode();
|
||||
if (qt4bc->subNodeBuild())
|
||||
node = qt4bc->subNodeBuild();
|
||||
QString proFile = node->path().toString();
|
||||
QString proFile = node->filePath().toString();
|
||||
|
||||
QList<ProjectExplorer::Task> tasks = qtVersion->reportIssues(proFile, workingDirectory);
|
||||
Utils::sort(tasks);
|
||||
|
||||
@@ -421,10 +421,10 @@ void DocumentManager::findPathToIsoProFile(bool *iconResourceFileAlreadyExists,
|
||||
|
||||
if (subFolderNode->nodeType() == ProjectExplorer::FolderNodeType
|
||||
&& subFolderNode->displayName() == isoIconsQrcFile) {
|
||||
qCDebug(documentManagerLog) << "Found" << isoIconsQrcFile << "in" << virtualFolderNode->path();
|
||||
qCDebug(documentManagerLog) << "Found" << isoIconsQrcFile << "in" << virtualFolderNode->filePath();
|
||||
|
||||
iconQrcFileNode = subFolderNode;
|
||||
*resourceFileProPath = iconQrcFileNode->projectNode()->path().toString();
|
||||
*resourceFileProPath = iconQrcFileNode->projectNode()->filePath().toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -442,7 +442,7 @@ void DocumentManager::findPathToIsoProFile(bool *iconResourceFileAlreadyExists,
|
||||
|
||||
// We assume that the .pro containing the QML file is an acceptable place to add the .qrc file.
|
||||
ProjectExplorer::ProjectNode *projectNode = ProjectExplorer::SessionManager::nodeForFile(qmlFileName)->projectNode();
|
||||
*resourceFileProPath = projectNode->path().toString();
|
||||
*resourceFileProPath = projectNode->filePath().toString();
|
||||
} else {
|
||||
// We found the QRC file that we want.
|
||||
QString projectDirectory = ProjectExplorer::SessionManager::projectForNode(iconQrcFileNode)->projectDirectory().toString();
|
||||
|
||||
@@ -125,7 +125,7 @@ ProjectExplorer::FolderNode *QmlProjectNode::findOrCreateFolderByName(const QStr
|
||||
if (! end)
|
||||
return 0;
|
||||
|
||||
Utils::FileName folderPath = path().parentDir();
|
||||
Utils::FileName folderPath = filePath().parentDir();
|
||||
|
||||
QString folderName;
|
||||
for (int i = 0; i < end; ++i) {
|
||||
|
||||
@@ -104,7 +104,7 @@ ProjectExplorer::RunConfiguration *QnxRunConfigurationFactory::doCreate(ProjectE
|
||||
QTC_ASSERT(qt4Project, return 0);
|
||||
foreach (const QmakeProjectManager::QmakeProFileNode * const node,
|
||||
qt4Project->applicationProFiles()) {
|
||||
if (node->path() == projectFilePath)
|
||||
if (node->filePath() == projectFilePath)
|
||||
return new QnxRunConfiguration(parent, id, node->targetInformation().target);
|
||||
}
|
||||
QTC_CHECK(false);
|
||||
|
||||
@@ -272,7 +272,7 @@ void ResourceEditorPlugin::renameFileContextMenu()
|
||||
void ResourceEditorPlugin::removeFileContextMenu()
|
||||
{
|
||||
ResourceFolderNode *rfn = static_cast<ResourceFolderNode *>(ProjectTree::currentNode());
|
||||
QString path = rfn->path().toString();
|
||||
QString path = rfn->filePath().toString();
|
||||
FolderNode *parent = rfn->parentFolderNode();
|
||||
if (!parent->removeFiles(QStringList() << path))
|
||||
QMessageBox::warning(Core::ICore::mainWindow(),
|
||||
@@ -282,7 +282,7 @@ void ResourceEditorPlugin::removeFileContextMenu()
|
||||
|
||||
void ResourceEditorPlugin::openEditorContextMenu()
|
||||
{
|
||||
Core::EditorManager::openEditor(ProjectTree::currentNode()->path().toString());
|
||||
Core::EditorManager::openEditor(ProjectTree::currentNode()->filePath().toString());
|
||||
}
|
||||
|
||||
void ResourceEditorPlugin::copyPathContextMenu()
|
||||
@@ -345,7 +345,7 @@ void ResourceEditorPlugin::updateContextActions(Node *node, Project *)
|
||||
m_removeNonExisting->setVisible(isResourceNode);
|
||||
|
||||
if (isResourceNode)
|
||||
Core::EditorManager::populateOpenWithMenu(m_openWithMenu, node->path().toString());
|
||||
Core::EditorManager::populateOpenWithMenu(m_openWithMenu, node->filePath().toString());
|
||||
else
|
||||
m_openWithMenu->clear();
|
||||
m_openWithMenu->menuAction()->setVisible(!m_openWithMenu->actions().isEmpty());
|
||||
|
||||
@@ -110,7 +110,7 @@ static bool sortByPrefixAndLang(ProjectExplorer::FolderNode *a, ProjectExplorer:
|
||||
|
||||
static bool sortNodesByPath(ProjectExplorer::Node *a, ProjectExplorer::Node *b)
|
||||
{
|
||||
return a->path() < b->path();
|
||||
return a->filePath() < b->filePath();
|
||||
}
|
||||
|
||||
ResourceTopLevelNode::ResourceTopLevelNode(const Utils::FileName &filePath, FolderNode *parent)
|
||||
@@ -120,7 +120,7 @@ ResourceTopLevelNode::ResourceTopLevelNode(const Utils::FileName &filePath, Fold
|
||||
m_document = new ResourceFileWatcher(this);
|
||||
Core::DocumentManager::addDocument(m_document);
|
||||
|
||||
Utils::FileName base = parent->path();
|
||||
Utils::FileName base = parent->filePath();
|
||||
if (filePath.isChildOf(base))
|
||||
setDisplayName(filePath.relativeChildPath(base).toString());
|
||||
else
|
||||
@@ -138,7 +138,7 @@ void ResourceTopLevelNode::update()
|
||||
QList<ProjectExplorer::FolderNode *> newFolderList;
|
||||
QMap<QPair<QString, QString>, QList<ProjectExplorer::FileNode *> > filesToAdd;
|
||||
|
||||
ResourceFile file(path().toString());
|
||||
ResourceFile file(filePath().toString());
|
||||
if (file.load() == Core::IDocument::OpenResult::Success) {
|
||||
QSet<QPair<QString, QString > > prefixes;
|
||||
|
||||
@@ -160,7 +160,7 @@ void ResourceTopLevelNode::update()
|
||||
const QString &fileName = file.file(i, j);
|
||||
QString alias = file.alias(i, j);
|
||||
if (alias.isEmpty())
|
||||
alias = path().toFileInfo().absoluteDir().relativeFilePath(fileName);
|
||||
alias = filePath().toFileInfo().absoluteDir().relativeFilePath(fileName);
|
||||
if (fileNames.contains(fileName)) {
|
||||
// The file name is duplicated, skip it
|
||||
// Note: this is wrong, but the qrceditor doesn't allow it either
|
||||
@@ -215,7 +215,7 @@ QList<ProjectExplorer::ProjectAction> ResourceTopLevelNode::supportedActions(Pro
|
||||
|
||||
bool ResourceTopLevelNode::addFiles(const QStringList &filePaths, QStringList *notAdded)
|
||||
{
|
||||
return addFilesToResource(path(), filePaths, notAdded, QLatin1String("/"), QString());
|
||||
return addFilesToResource(filePath(), filePaths, notAdded, QLatin1String("/"), QString());
|
||||
}
|
||||
|
||||
bool ResourceTopLevelNode::removeFiles(const QStringList &filePaths, QStringList *notRemoved)
|
||||
@@ -225,31 +225,31 @@ bool ResourceTopLevelNode::removeFiles(const QStringList &filePaths, QStringList
|
||||
|
||||
bool ResourceTopLevelNode::addPrefix(const QString &prefix, const QString &lang)
|
||||
{
|
||||
ResourceFile file(path().toString());
|
||||
ResourceFile file(filePath().toString());
|
||||
if (file.load() != Core::IDocument::OpenResult::Success)
|
||||
return false;
|
||||
int index = file.addPrefix(prefix, lang);
|
||||
if (index == -1)
|
||||
return false;
|
||||
Core::DocumentManager::expectFileChange(path().toString());
|
||||
Core::DocumentManager::expectFileChange(filePath().toString());
|
||||
file.save();
|
||||
Core::DocumentManager::unexpectFileChange(path().toString());
|
||||
Core::DocumentManager::unexpectFileChange(filePath().toString());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ResourceTopLevelNode::removePrefix(const QString &prefix, const QString &lang)
|
||||
{
|
||||
ResourceFile file(path().toString());
|
||||
ResourceFile file(filePath().toString());
|
||||
if (file.load() != Core::IDocument::OpenResult::Success)
|
||||
return false;
|
||||
for (int i = 0; i < file.prefixCount(); ++i) {
|
||||
if (file.prefix(i) == prefix
|
||||
&& file.lang(i) == lang) {
|
||||
file.removePrefix(i);
|
||||
Core::DocumentManager::expectFileChange(path().toString());
|
||||
Core::DocumentManager::expectFileChange(filePath().toString());
|
||||
file.save();
|
||||
Core::DocumentManager::unexpectFileChange(path().toString());
|
||||
Core::DocumentManager::unexpectFileChange(filePath().toString());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -258,7 +258,7 @@ bool ResourceTopLevelNode::removePrefix(const QString &prefix, const QString &la
|
||||
|
||||
bool ResourceTopLevelNode::removeNonExistingFiles()
|
||||
{
|
||||
ResourceFile file(path().toString());
|
||||
ResourceFile file(filePath().toString());
|
||||
if (file.load() != Core::IDocument::OpenResult::Success)
|
||||
return false;
|
||||
|
||||
@@ -273,16 +273,16 @@ bool ResourceTopLevelNode::removeNonExistingFiles()
|
||||
}
|
||||
}
|
||||
|
||||
Core::DocumentManager::expectFileChange(path().toString());
|
||||
Core::DocumentManager::expectFileChange(filePath().toString());
|
||||
file.save();
|
||||
Core::DocumentManager::unexpectFileChange(path().toString());
|
||||
Core::DocumentManager::unexpectFileChange(filePath().toString());
|
||||
return true;
|
||||
}
|
||||
|
||||
ProjectExplorer::FolderNode::AddNewInformation ResourceTopLevelNode::addNewInformation(const QStringList &files, Node *context) const
|
||||
{
|
||||
QString name = QCoreApplication::translate("ResourceTopLevelNode", "%1 Prefix: %2")
|
||||
.arg(path().fileName())
|
||||
.arg(filePath().fileName())
|
||||
.arg(QLatin1Char('/'));
|
||||
|
||||
int p = -1;
|
||||
@@ -309,7 +309,7 @@ bool ResourceTopLevelNode::showInSimpleTree() const
|
||||
}
|
||||
|
||||
ResourceFolderNode::ResourceFolderNode(const QString &prefix, const QString &lang, ResourceTopLevelNode *parent)
|
||||
: ProjectExplorer::FolderNode(Utils::FileName(parent->path()).appendPath(prefix)),
|
||||
: ProjectExplorer::FolderNode(Utils::FileName(parent->filePath()).appendPath(prefix)),
|
||||
// TOOD Why add existing directory doesn't work
|
||||
m_topLevelNode(parent),
|
||||
m_prefix(prefix),
|
||||
@@ -344,14 +344,14 @@ QList<ProjectExplorer::ProjectAction> ResourceFolderNode::supportedActions(Proje
|
||||
|
||||
bool ResourceFolderNode::addFiles(const QStringList &filePaths, QStringList *notAdded)
|
||||
{
|
||||
return addFilesToResource(m_topLevelNode->path(), filePaths, notAdded, m_prefix, m_lang);
|
||||
return addFilesToResource(m_topLevelNode->filePath(), filePaths, notAdded, m_prefix, m_lang);
|
||||
}
|
||||
|
||||
bool ResourceFolderNode::removeFiles(const QStringList &filePaths, QStringList *notRemoved)
|
||||
{
|
||||
if (notRemoved)
|
||||
*notRemoved = filePaths;
|
||||
ResourceFile file(m_topLevelNode->path().toString());
|
||||
ResourceFile file(m_topLevelNode->filePath().toString());
|
||||
if (file.load() != Core::IDocument::OpenResult::Success)
|
||||
return false;
|
||||
int index = file.indexOfPrefix(m_prefix, m_lang);
|
||||
@@ -366,16 +366,16 @@ bool ResourceFolderNode::removeFiles(const QStringList &filePaths, QStringList *
|
||||
file.removeFile(index, j);
|
||||
--j;
|
||||
}
|
||||
Core::DocumentManager::expectFileChange(m_topLevelNode->path().toString());
|
||||
Core::DocumentManager::expectFileChange(m_topLevelNode->filePath().toString());
|
||||
file.save();
|
||||
Core::DocumentManager::unexpectFileChange(m_topLevelNode->path().toString());
|
||||
Core::DocumentManager::unexpectFileChange(m_topLevelNode->filePath().toString());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ResourceFolderNode::renameFile(const QString &filePath, const QString &newFilePath)
|
||||
{
|
||||
ResourceFile file(m_topLevelNode->path().toString());
|
||||
ResourceFile file(m_topLevelNode->filePath().toString());
|
||||
if (file.load() != Core::IDocument::OpenResult::Success)
|
||||
return false;
|
||||
int index = file.indexOfPrefix(m_prefix, m_lang);
|
||||
@@ -385,9 +385,9 @@ bool ResourceFolderNode::renameFile(const QString &filePath, const QString &newF
|
||||
for (int j = 0; j < file.fileCount(index); ++j) {
|
||||
if (file.file(index, j) == filePath) {
|
||||
file.replaceFile(index, j, newFilePath);
|
||||
Core::DocumentManager::expectFileChange(m_topLevelNode->path().toString());
|
||||
Core::DocumentManager::expectFileChange(m_topLevelNode->filePath().toString());
|
||||
file.save();
|
||||
Core::DocumentManager::unexpectFileChange(m_topLevelNode->path().toString());
|
||||
Core::DocumentManager::unexpectFileChange(m_topLevelNode->filePath().toString());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -397,7 +397,7 @@ bool ResourceFolderNode::renameFile(const QString &filePath, const QString &newF
|
||||
|
||||
bool ResourceFolderNode::renamePrefix(const QString &prefix, const QString &lang)
|
||||
{
|
||||
ResourceFile file(m_topLevelNode->path().toString());
|
||||
ResourceFile file(m_topLevelNode->filePath().toString());
|
||||
if (file.load() != Core::IDocument::OpenResult::Success)
|
||||
return false;
|
||||
int index = file.indexOfPrefix(m_prefix, m_lang);
|
||||
@@ -407,16 +407,16 @@ bool ResourceFolderNode::renamePrefix(const QString &prefix, const QString &lang
|
||||
if (!file.replacePrefixAndLang(index, prefix, lang))
|
||||
return false;
|
||||
|
||||
Core::DocumentManager::expectFileChange(m_topLevelNode->path().toString());
|
||||
Core::DocumentManager::expectFileChange(m_topLevelNode->filePath().toString());
|
||||
file.save();
|
||||
Core::DocumentManager::unexpectFileChange(m_topLevelNode->path().toString());
|
||||
Core::DocumentManager::unexpectFileChange(m_topLevelNode->filePath().toString());
|
||||
return true;
|
||||
}
|
||||
|
||||
ProjectExplorer::FolderNode::AddNewInformation ResourceFolderNode::addNewInformation(const QStringList &files, Node *context) const
|
||||
{
|
||||
QString name = QCoreApplication::translate("ResourceTopLevelNode", "%1 Prefix: %2")
|
||||
.arg(m_topLevelNode->path().fileName())
|
||||
.arg(m_topLevelNode->filePath().fileName())
|
||||
.arg(displayName());
|
||||
|
||||
int p = -1; // never the default
|
||||
@@ -473,7 +473,7 @@ ResourceFileWatcher::ResourceFileWatcher(ResourceTopLevelNode *node)
|
||||
{
|
||||
setId("ResourceNodeWatcher");
|
||||
setMimeType(QLatin1String(ResourceEditor::Constants::C_RESOURCE_MIMETYPE));
|
||||
setFilePath(node->path());
|
||||
setFilePath(node->filePath());
|
||||
}
|
||||
|
||||
bool ResourceFileWatcher::save(QString *errorString, const QString &fileName, bool autoSave)
|
||||
@@ -526,7 +526,7 @@ ResourceFileNode::ResourceFileNode(const Utils::FileName &filePath, const QStrin
|
||||
m_qrcPath(qrcPath)
|
||||
|
||||
{
|
||||
QDir baseDir = topLevel->path().toFileInfo().absoluteDir();
|
||||
QDir baseDir = topLevel->filePath().toFileInfo().absoluteDir();
|
||||
m_displayName = QDir(baseDir).relativeFilePath(filePath.toString());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user