Commit c9ee7ee3 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

ProjectExplorer: Shorten NodeType enum



Use a class enum with a type quint16 for the NodeType. Frees 2 bytes
per node that can be used for better things now.

Change-Id: Ib84bf8629e9f4a5fb0793355eff0f0d6302167dd
Reviewed-by: Tobias Hunger's avatarTobias Hunger <tobias.hunger@qt.io>
parent ed6abae4
......@@ -205,7 +205,7 @@ FolderNode *AppManagerProject::findFolderFor(const QStringList &path)
// Folder not found. Add it
QString newFolderPath = QDir::cleanPath(currentPath + QDir::separator() + part);
auto newFolder = new FolderNode(FileName::fromString(newFolderPath),
FolderNodeType,
NodeType::Folder,
part);
folder->addFolderNodes({newFolder});
folder = newFolder;
......
......@@ -47,10 +47,10 @@ QList<ProjectAction> AppManagerProjectNode::supportedActions(Node *node) const
ProjectAction::RemoveFile
};
switch (node->nodeType()) {
case FileNodeType:
case NodeType::File:
return fileActions;
case FolderNodeType:
case ProjectNodeType:
case NodeType::Folder:
case NodeType::Project:
return folderActions;
default:
return ProjectNode::supportedActions(node);
......
......@@ -728,7 +728,7 @@ QStringList Parser::projectNodeFileList(const FolderNode *node) const
}
foreach (const FolderNode *folder, subFolderNodes) {
if (folder->nodeType() != FolderNodeType && folder->nodeType() != VirtualFolderNodeType)
if (folder->nodeType() != NodeType::Folder && folder->nodeType() != NodeType::VirtualFolder)
continue;
list << projectNodeFileList(folder);
}
......
......@@ -137,7 +137,7 @@ void PxNodeController::addExplorerNode(const ProjectExplorer::Node *node,
node->filePath().toString());
switch (node->nodeType()) {
case ProjectExplorer::FileNodeType:
case ProjectExplorer::NodeType::File:
{
QStringList classNames = d->classViewController->findClassDeclarations(
node->filePath().toString()).toList();
......@@ -162,16 +162,16 @@ void PxNodeController::addExplorerNode(const ProjectExplorer::Node *node,
menu->popup(QCursor::pos());
break;
}
case ProjectExplorer::FolderNodeType:
case ProjectExplorer::VirtualFolderNodeType:
case ProjectExplorer::ProjectNodeType:
case ProjectExplorer::NodeType::Folder:
case ProjectExplorer::NodeType::VirtualFolder:
case ProjectExplorer::NodeType::Project:
{
QString stereotype;
switch (node->nodeType()) {
case ProjectExplorer::VirtualFolderNodeType:
case ProjectExplorer::NodeType::VirtualFolder:
stereotype = QStringLiteral("virtual folder");
break;
case ProjectExplorer::ProjectNodeType:
case ProjectExplorer::NodeType::Project:
stereotype = QStringLiteral("project");
break;
default:
......@@ -198,7 +198,7 @@ void PxNodeController::addExplorerNode(const ProjectExplorer::Node *node,
menu->popup(QCursor::pos());
break;
}
case ProjectExplorer::SessionNodeType:
case ProjectExplorer::NodeType::Session:
break;
}
}
......
......@@ -69,18 +69,18 @@ QString PxNodeUtilities::calcRelativePath(const ProjectExplorer::Node *node,
QString nodePath;
switch (node->nodeType()) {
case ProjectExplorer::FileNodeType:
case ProjectExplorer::NodeType::File:
{
QFileInfo fileInfo = node->filePath().toFileInfo();
nodePath = fileInfo.path();
break;
}
case ProjectExplorer::FolderNodeType:
case ProjectExplorer::VirtualFolderNodeType:
case ProjectExplorer::ProjectNodeType:
case ProjectExplorer::NodeType::Folder:
case ProjectExplorer::NodeType::VirtualFolder:
case ProjectExplorer::NodeType::Project:
nodePath = node->filePath().toString();
break;
case ProjectExplorer::SessionNodeType:
case ProjectExplorer::NodeType::Session:
QTC_ASSERT(false, return QString());
break;
}
......
......@@ -44,10 +44,10 @@ QList<ProjectAction> NimProjectNode::supportedActions(Node *node) const
ProjectAction::RemoveFile
};
switch (node->nodeType()) {
case FileNodeType:
case NodeType::File:
return fileActions;
case FolderNodeType:
case ProjectNodeType:
case NodeType::Folder:
case NodeType::Project:
return folderActions;
default:
return ProjectNode::supportedActions(node);
......
......@@ -1999,7 +1999,7 @@ static QString pathOrDirectoryFor(Node *node, bool dir)
Utils::FileName path = node->filePath();
QString location;
FolderNode *folder = node->asFolderNode();
if (node->nodeType() == VirtualFolderNodeType && folder) {
if (node->nodeType() == NodeType::VirtualFolder && folder) {
// Virtual Folder case
// If there are files directly below or no subfolders, take the folder path
if (!folder->fileNodes().isEmpty() || folder->subFolderNodes().isEmpty()) {
......@@ -2942,10 +2942,10 @@ void ProjectExplorerPluginPrivate::updateContextMenuActions()
// Also handles ProjectNode
m_addNewFileAction->setEnabled(actions.contains(AddNewFile)
&& !ICore::isNewItemDialogRunning());
m_addNewSubprojectAction->setEnabled(currentNode->nodeType() == ProjectNodeType
m_addNewSubprojectAction->setEnabled(currentNode->nodeType() == NodeType::Project
&& actions.contains(AddSubProject)
&& !ICore::isNewItemDialogRunning());
m_removeProjectAction->setEnabled(currentNode->nodeType() == ProjectNodeType
m_removeProjectAction->setEnabled(currentNode->nodeType() == NodeType::Project
&& actions.contains(RemoveSubProject));
m_addExistingFilesAction->setEnabled(actions.contains(AddExistingFile));
m_addExistingDirectoryAction->setEnabled(actions.contains(AddExistingDirectory));
......@@ -3018,7 +3018,7 @@ void ProjectExplorerPluginPrivate::addNewSubproject()
Node *currentNode = ProjectTree::currentNode();
QString location = directoryFor(currentNode);
if (currentNode->nodeType() == ProjectNodeType
if (currentNode->nodeType() == NodeType::Project
&& currentNode->supportedActions(
currentNode).contains(AddSubProject)) {
QVariantMap map;
......@@ -3139,7 +3139,7 @@ void ProjectExplorerPluginPrivate::openTerminalHere()
void ProjectExplorerPluginPrivate::removeFile()
{
Node *currentNode = ProjectTree::currentNode();
QTC_ASSERT(currentNode && currentNode->nodeType() == FileNodeType, return);
QTC_ASSERT(currentNode && currentNode->nodeType() == NodeType::File, return);
FileNode *fileNode = currentNode->asFileNode();
......@@ -3170,7 +3170,7 @@ void ProjectExplorerPluginPrivate::removeFile()
void ProjectExplorerPluginPrivate::duplicateFile()
{
Node *currentNode = ProjectTree::currentNode();
QTC_ASSERT(currentNode && currentNode->nodeType() == FileNodeType, return);
QTC_ASSERT(currentNode && currentNode->nodeType() == NodeType::File, return);
FileNode *fileNode = currentNode->asFileNode();
QString filePath = currentNode->filePath().toString();
......@@ -3201,7 +3201,7 @@ void ProjectExplorerPluginPrivate::duplicateFile()
void ProjectExplorerPluginPrivate::deleteFile()
{
Node *currentNode = ProjectTree::currentNode();
QTC_ASSERT(currentNode && currentNode->nodeType() == FileNodeType, return);
QTC_ASSERT(currentNode && currentNode->nodeType() == NodeType::File, return);
FileNode *fileNode = currentNode->asFileNode();
......
......@@ -77,8 +77,8 @@ bool sortNodes(Node *n1, Node *n2)
}
// projects
if (n1Type == ProjectNodeType) {
if (n2Type == ProjectNodeType) {
if (n1Type == NodeType::Project) {
if (n2Type == NodeType::Project) {
auto project1 = static_cast<ProjectNode*>(n1);
auto project2 = static_cast<ProjectNode*>(n2);
......@@ -95,11 +95,11 @@ bool sortNodes(Node *n1, Node *n2)
return true; // project is before folder & file
}
}
if (n2Type == ProjectNodeType)
if (n2Type == NodeType::Project)
return false;
if (n1Type == VirtualFolderNodeType) {
if (n2Type == VirtualFolderNodeType) {
if (n1Type == NodeType::VirtualFolder) {
if (n2Type == NodeType::VirtualFolder) {
auto folder1 = static_cast<VirtualFolderNode *>(n1);
auto folder2 = static_cast<VirtualFolderNode *>(n2);
......@@ -118,12 +118,12 @@ bool sortNodes(Node *n1, Node *n2)
}
}
if (n2Type == VirtualFolderNodeType)
if (n2Type == NodeType::VirtualFolder)
return false;
if (n1Type == FolderNodeType) {
if (n2Type == FolderNodeType) {
if (n1Type == NodeType::Folder) {
if (n2Type == NodeType::Folder) {
auto folder1 = static_cast<FolderNode*>(n1);
auto folder2 = static_cast<FolderNode*>(n2);
......@@ -137,35 +137,32 @@ bool sortNodes(Node *n1, Node *n2)
return true; // folder is before file
}
}
if (n2Type == FolderNodeType)
if (n2Type == NodeType::Folder)
return false;
// must be file nodes
{
int result = caseFriendlyCompare(n1->displayName(), n2->displayName());
if (result != 0)
return result < 0;
int result = caseFriendlyCompare(n1->displayName(), n2->displayName());
if (result != 0)
return result < 0;
const QString filePath1 = n1->filePath().toString();
const QString filePath2 = n2->filePath().toString();
const QString filePath1 = n1->filePath().toString();
const QString filePath2 = n2->filePath().toString();
const QString fileName1 = n1->filePath().fileName();
const QString fileName2 = n2->filePath().fileName();
const QString fileName1 = n1->filePath().fileName();
const QString fileName2 = n2->filePath().fileName();
result = caseFriendlyCompare(fileName1, fileName2);
if (result != 0) {
return result < 0; // sort by filename
} else {
result = caseFriendlyCompare(filePath1, filePath2);
if (result != 0)
return result < 0; // sort by filepath
result = caseFriendlyCompare(fileName1, fileName2);
if (result != 0) {
return result < 0; // sort by filename
} else {
result = caseFriendlyCompare(filePath1, filePath2);
if (result != 0)
return result < 0; // sort by filepath
if (n1->line() != n2->line())
return n1->line() < n2->line(); // sort by line numbers
return n1 < n2; // sort by pointer value
}
if (n1->line() != n2->line())
return n1->line() < n2->line(); // sort by line numbers
return n1 < n2; // sort by pointer value
}
return false;
}
} // namespace anon
......@@ -252,9 +249,9 @@ QVariant FlatModel::data(const QModelIndex &index, int role) const
case Qt::DisplayRole: {
QString name = node->displayName();
if (node->nodeType() == ProjectNodeType
if (node->nodeType() == NodeType::Project
&& node->parentFolderNode()
&& node->parentFolderNode()->nodeType() == SessionNodeType) {
&& node->parentFolderNode()->nodeType() == NodeType::Session) {
const QString vcsTopic = static_cast<ProjectNode *>(node)->vcsTopic();
if (!vcsTopic.isEmpty())
......@@ -422,7 +419,7 @@ QList<Node*> FlatModel::childNodes(FolderNode *parentNode, const QSet<Node*> &bl
qCDebug(logger()) << " FlatModel::childNodes for " << parentNode->filePath();
QList<Node*> nodeList;
if (parentNode->nodeType() == SessionNodeType) {
if (parentNode->nodeType() == NodeType::Session) {
auto sessionNode = static_cast<SessionNode*>(parentNode);
QList<ProjectNode*> projectList = sessionNode->projectNodes();
for (int i = 0; i < projectList.size(); ++i) {
......
......@@ -60,12 +60,7 @@ namespace ProjectExplorer {
*/
Node::Node(NodeType nodeType, const Utils::FileName &filePath, int line) :
m_nodeType(nodeType),
m_line(line),
m_filePath(filePath)
{ }
Node::~Node()
m_filePath(filePath), m_line(line), m_nodeType(nodeType)
{ }
void Node::emitNodeSortKeyAboutToChange()
......@@ -197,7 +192,7 @@ void Node::setParentFolderNode(FolderNode *parentFolder)
FileNode::FileNode(const Utils::FileName &filePath,
const FileType fileType,
bool generated, int line) : Node(FileNodeType, filePath, line),
bool generated, int line) : Node(NodeType::File, filePath, line),
m_fileType(fileType),
m_generated(generated)
{ }
......@@ -585,7 +580,7 @@ void FolderNode::addFolderNodes(const QList<FolderNode*> &subFolders)
}
// project nodes have to be added via addProjectNodes
QTC_ASSERT(folder->nodeType() != ProjectNodeType,
QTC_ASSERT(folder->nodeType() != NodeType::Project,
qDebug("project nodes have to be added via addProjectNodes"));
}
......@@ -613,7 +608,7 @@ void FolderNode::removeFolderNodes(const QList<FolderNode*> &subFolders)
auto toRemoveIter = toRemove.constBegin();
auto folderIter = m_subFolderNodes.begin();
for (; toRemoveIter != toRemove.constEnd(); ++toRemoveIter) {
QTC_ASSERT((*toRemoveIter)->nodeType() != ProjectNodeType,
QTC_ASSERT((*toRemoveIter)->nodeType() != NodeType::Project,
qDebug("project nodes have to be removed via removeProjectNodes"));
while (*folderIter != *toRemoveIter) {
++folderIter;
......@@ -649,7 +644,7 @@ bool FolderNode::showInSimpleTree() const
\sa ProjectExplorer::FileNode, ProjectExplorer::ProjectNode
*/
VirtualFolderNode::VirtualFolderNode(const Utils::FileName &folderPath, int priority) :
FolderNode(folderPath, VirtualFolderNodeType),
FolderNode(folderPath, NodeType::VirtualFolder),
m_priority(priority)
{ }
......@@ -672,7 +667,7 @@ int VirtualFolderNode::priority() const
Creates an uninitialized project node object.
*/
ProjectNode::ProjectNode(const Utils::FileName &projectFilePath) :
FolderNode(projectFilePath, ProjectNodeType)
FolderNode(projectFilePath, NodeType::Project)
{
// project node "manages" itself
setProjectNode(this);
......@@ -849,7 +844,7 @@ ProjectNode *ProjectNode::asProjectNode()
*/
SessionNode::SessionNode() :
FolderNode(Utils::FileName::fromString("session"), SessionNodeType)
FolderNode(Utils::FileName::fromString("session"), NodeType::Session)
{ }
QList<ProjectAction> SessionNode::supportedActions(Node *node) const
......
......@@ -45,12 +45,12 @@ QT_END_NAMESPACE
namespace ProjectExplorer {
class RunConfiguration;
enum NodeType {
FileNodeType = 1,
FolderNodeType,
VirtualFolderNodeType,
ProjectNodeType,
SessionNodeType
enum class NodeType : quint16 {
File = 1,
Folder,
VirtualFolder,
Project,
Session
};
// File types common for qt projects
......@@ -107,7 +107,7 @@ class SessionManager;
class PROJECTEXPLORER_EXPORT Node
{
public:
virtual ~Node();
virtual ~Node() = default;
NodeType nodeType() const;
ProjectNode *projectNode() const; // managing project
FolderNode *parentFolderNode() const; // parent folder or project
......@@ -138,11 +138,11 @@ protected:
void emitNodeSortKeyChanged();
private:
NodeType m_nodeType;
int m_line;
ProjectNode *m_projectNode = nullptr;
FolderNode *m_folderNode = nullptr;
Utils::FileName m_filePath;
int m_line;
NodeType m_nodeType;
};
class PROJECTEXPLORER_EXPORT FileNode : public Node
......@@ -172,7 +172,7 @@ private:
class PROJECTEXPLORER_EXPORT FolderNode : public Node
{
public:
explicit FolderNode(const Utils::FileName &folderPath, NodeType nodeType = FolderNodeType,
explicit FolderNode(const Utils::FileName &folderPath, NodeType nodeType = NodeType::Folder,
const QString &displayName = QString());
~FolderNode() override;
......
......@@ -492,22 +492,22 @@ void ProjectTree::showContextMenu(ProjectTreeWidget *focus, const QPoint &global
if (!node)
node = SessionManager::sessionNode();
if (node->nodeType() != SessionNodeType) {
if (node->nodeType() != NodeType::Session) {
Project *project = SessionManager::projectForNode(node);
emit s_instance->aboutToShowContextMenu(project, node);
switch (node->nodeType()) {
case ProjectNodeType:
case NodeType::Project:
if (node->parentFolderNode() == SessionManager::sessionNode())
contextMenu = Core::ActionManager::actionContainer(Constants::M_PROJECTCONTEXT)->menu();
else
contextMenu = Core::ActionManager::actionContainer(Constants::M_SUBPROJECTCONTEXT)->menu();
break;
case VirtualFolderNodeType:
case FolderNodeType:
case NodeType::VirtualFolder:
case NodeType::Folder:
contextMenu = Core::ActionManager::actionContainer(Constants::M_FOLDERCONTEXT)->menu();
break;
case FileNodeType:
case NodeType::File:
contextMenu = Core::ActionManager::actionContainer(Constants::M_FILECONTEXT)->menu();
break;
default:
......
......@@ -533,7 +533,7 @@ void ProjectTreeWidget::initView()
void ProjectTreeWidget::openItem(const QModelIndex &mainIndex)
{
Node *node = m_model->nodeForIndex(mainIndex);
if (node->nodeType() != FileNodeType)
if (node->nodeType() != NodeType::File)
return;
IEditor *editor = EditorManager::openEditor(node->filePath().toString());
if (editor && node->line() >= 0)
......
......@@ -170,7 +170,7 @@ BestNodeSelector::BestNodeSelector(const QString &commonDirectory, const QString
void BestNodeSelector::inspect(AddNewTree *tree, bool isContextNode)
{
FolderNode *node = tree->node();
if (node->nodeType() == ProjectNodeType) {
if (node->nodeType() == NodeType::Project) {
if (static_cast<ProjectNode *>(node)->deploysFolder(m_commonDirectory)) {
m_deploys = true;
m_deployText += tree->displayName() + QLatin1Char('\n');
......
......@@ -610,7 +610,7 @@ Node *SessionManager::nodeForFile(const Utils::FileName &fileName)
Node *node = nullptr;
foreach (Node *n, nodesForFile(fileName)) {
// prefer file nodes
if (!node || (node->nodeType() != FileNodeType && n->nodeType() == FileNodeType))
if (!node || (node->nodeType() != NodeType::File && n->nodeType() == NodeType::File))
node = n;
}
return node;
......
......@@ -252,7 +252,7 @@ static QList<ProjectExplorer::ProjectAction> supportedNodeActions(ProjectExplore
return actions;
if (managesFiles)
actions << ProjectExplorer::AddNewFile << ProjectExplorer::AddExistingFile;
if (node->nodeType() == ProjectExplorer::FileNodeType
if (node->nodeType() == ProjectExplorer::NodeType::File
&& !project->qbsProject().buildSystemFiles().contains(node->filePath().toString())) {
actions << ProjectExplorer::RemoveFile << ProjectExplorer::Rename;
}
......@@ -482,7 +482,7 @@ void QbsGroupNode::setupFolder(ProjectExplorer::FolderNode *root,
QList<ProjectExplorer::FolderNode *> foldersToRemove;
foreach (ProjectExplorer::FolderNode *fn, root->subFolderNodes()) {
if (fn->nodeType() == ProjectExplorer::ProjectNodeType)
if (fn->nodeType() == ProjectExplorer::NodeType::Project)
continue; // Skip ProjectNodes mixed into the folders...
const auto * const qbsFolder = dynamic_cast<QbsFolderNode *>(fn);
if (qbsFolder && qbsFolder->isGeneratedFilesFolder())
......@@ -530,7 +530,7 @@ void QbsGroupNode::setupFolder(ProjectExplorer::FolderNode *root,
fn = new ResourceTopLevelNode(Utils::FileName::fromString(c->path()), QString(), root);
} else {
fn = new QbsFolderNode(Utils::FileName::fromString(c->path()),
ProjectExplorer::FolderNodeType,
ProjectExplorer::NodeType::Folder,
displayNameFromPath(c->path(), baseDir), false);
}
root->addFolderNodes(QList<FolderNode *>() << fn);
......@@ -581,7 +581,7 @@ ProjectExplorer::FileType QbsGroupNode::fileType(const qbs::ArtifactData &artifa
QbsProductNode::QbsProductNode(const qbs::Project &project, const qbs::ProductData &prd) :
QbsBaseProjectNode(Utils::FileName::fromString(prd.location().filePath())),
m_generatedFilesNode(new QbsFolderNode(Utils::FileName::fromString(prd.buildDirectory()),
ProjectExplorer::FolderNodeType,
ProjectExplorer::NodeType::Folder,
QCoreApplication::translate("QbsProductNode", "Generated files"), true))
{
if (m_productIcon.isNull())
......@@ -859,7 +859,7 @@ QbsRootProjectNode::QbsRootProjectNode(QbsProject *project) :
QbsProjectNode(project->projectFilePath()),
m_project(project),
m_buildSystemFiles(new ProjectExplorer::FolderNode(project->projectDirectory(),
ProjectExplorer::FolderNodeType,
ProjectExplorer::NodeType::Folder,
QCoreApplication::translate("QbsRootProjectNode", "Qbs files")))
{
addFolderNodes(QList<FolderNode *>() << m_buildSystemFiles);
......
......@@ -258,7 +258,7 @@ void QbsProjectManagerPlugin::updateContextActions()
&& m_selectedProject && !m_selectedProject->isParsing()
&& m_selectedNode && m_selectedNode->isEnabled();
bool isFile = m_selectedProject && m_selectedNode && (m_selectedNode->nodeType() == FileNodeType);
bool isFile = m_selectedProject && m_selectedNode && (m_selectedNode->nodeType() == NodeType::File);
bool isProduct = m_selectedProject && m_selectedNode && dynamic_cast<QbsProductNode *>(m_selectedNode->projectNode());
QbsProjectNode *subproject = dynamic_cast<QbsProjectNode *>(m_selectedNode);
bool isSubproject = m_selectedProject && subproject && subproject != m_selectedProject->rootProjectNode();
......
......@@ -448,7 +448,7 @@ struct InternalNode
// updateFolders
QMultiMap<QString, FolderNode *> existingFolderNodes;
foreach (FolderNode *node, folder->subFolderNodes())
if (node->nodeType() != ProjectNodeType && !dynamic_cast<ResourceEditor::ResourceTopLevelNode *>(node))
if (node->nodeType() != NodeType::Project && !dynamic_cast<ResourceEditor::ResourceTopLevelNode *>(node))
existingFolderNodes.insert(node->filePath().toString(), node);
QList<FolderNode *> foldersToRemove;
......@@ -466,7 +466,7 @@ struct InternalNode
QMultiMap<QString, FolderNode *>::const_iterator oldit
= existingFolderNodes.constFind(path);
while (oldit != existingFolderNodes.constEnd() && oldit.key() == path) {
if (oldit.value()->nodeType() == VirtualFolderNodeType) {
if (oldit.value()->nodeType() == NodeType::VirtualFolder) {
VirtualFolderNode *vfn = dynamic_cast<VirtualFolderNode *>(oldit.value());
if (vfn->priority() == (*it)->priority) {
found = true;
......@@ -495,7 +495,7 @@ struct InternalNode
QMultiMap<QString, FolderNode *>::const_iterator oldit
= existingFolderNodes.constFind(path);
while (oldit != existingFolderNodes.constEnd() && oldit.key() == path) {
if (oldit.value()->nodeType() == FolderNodeType) {
if (oldit.value()->nodeType() == NodeType::Folder) {
found = true;
break;
}
......@@ -904,7 +904,7 @@ QList<ProjectAction> QmakePriFileNode::supportedActions(Node *node) const
actions << RemoveFile;
bool addExistingFiles = true;
if (node->nodeType() == VirtualFolderNodeType) {
if (node->nodeType() == NodeType::VirtualFolder) {
// A virtual folder, we do what the projectexplorer does
FolderNode *folder = node->asFolderNode();
if (folder) {
......
......@@ -381,18 +381,20 @@ void DocumentManager::findPathToIsoProFile(bool *iconResourceFileAlreadyExists,
ProjectExplorer::Node *iconQrcFileNode = nullptr;
while (node && !iconQrcFileNode) {
qCDebug(documentManagerLog) << "Checking" << node->displayName() << "(" << node << node->nodeType() << ")";
qCDebug(documentManagerLog) << "Checking" << node->displayName()
<< "(" << node << static_cast<int>(node->nodeType()) << ")";
if (node->nodeType() == ProjectExplorer::VirtualFolderNodeType && node->displayName() == "Resources") {
if (node->nodeType() == ProjectExplorer::NodeType::VirtualFolder && node->displayName() == "Resources") {
ProjectExplorer::VirtualFolderNode *virtualFolderNode = dynamic_cast<ProjectExplorer::VirtualFolderNode*>(node);
for (int subFolderIndex = 0; subFolderIndex < virtualFolderNode->subFolderNodes().size() && !iconQrcFileNode; ++subFolderIndex) {
ProjectExplorer::FolderNode *subFolderNode = virtualFolderNode->subFolderNodes().at(subFolderIndex);
qCDebug(documentManagerLog) << "Checking if" << subFolderNode->displayName() << "("
<< subFolderNode << subFolderNode->nodeType() << ") is" << isoIconsQrcFile;
<< subFolderNode << static_cast<int>(subFolderNode->nodeType())
<< ") is" << isoIconsQrcFile;
if (subFolderNode->nodeType() == ProjectExplorer::FolderNodeType
if (subFolderNode->nodeType() == ProjectExplorer::NodeType::Folder
&& subFolderNode->displayName() == isoIconsQrcFile) {
qCDebug(documentManagerLog) << "Found" << isoIconsQrcFile << "in" << virtualFolderNode->filePath();
......
......@@ -87,7 +87,7 @@ QList<ProjectExplorer::ProjectAction> QmlProjectNode::supportedActions(Node *nod
QList<ProjectExplorer::ProjectAction> actions;