forked from qt-creator/qt-creator
ProjectExplorer: Replace Node::setNodeType by virtual functions
Not the usual direction of change, but currently there are several systems to identify or invoke node functionality. Virtual functions are likely to stay in this context, so this here attempts to help consolidation by reducing the influence of the node type flags, hopefully leading to full removal by making remaining functionality available through the other mechanisms (virtual functions, asFooNode() 'casts', less so the FileType flag). Change-Id: I12a17ce30b3c8883995b29b4720408020ee0fa3e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -66,21 +66,9 @@ void PxNodeUtilities::setDiagramSceneController(qmt::DiagramSceneController *dia
|
||||
QString PxNodeUtilities::calcRelativePath(const ProjectExplorer::Node *node,
|
||||
const QString &anchorFolder)
|
||||
{
|
||||
QString nodePath;
|
||||
|
||||
switch (node->nodeType()) {
|
||||
case ProjectExplorer::NodeType::File:
|
||||
{
|
||||
QFileInfo fileInfo = node->filePath().toFileInfo();
|
||||
nodePath = fileInfo.path();
|
||||
break;
|
||||
}
|
||||
case ProjectExplorer::NodeType::Folder:
|
||||
case ProjectExplorer::NodeType::VirtualFolder:
|
||||
case ProjectExplorer::NodeType::Project:
|
||||
nodePath = node->filePath().toString();
|
||||
break;
|
||||
}
|
||||
const QString nodePath = node->isFileNodeType()
|
||||
? node->filePath().toFileInfo().path()
|
||||
: node->filePath().toString();
|
||||
|
||||
return qmt::NameController::calcRelativePath(nodePath, anchorFolder);
|
||||
}
|
||||
|
@@ -39,18 +39,16 @@ NimProjectNode::NimProjectNode(NimProject &project,
|
||||
|
||||
bool NimProjectNode::supportsAction(ProjectAction action, const Node *node) const
|
||||
{
|
||||
switch (node->nodeType()) {
|
||||
case NodeType::File:
|
||||
if (node->isFileNodeType()) {
|
||||
return action == ProjectAction::Rename
|
||||
|| action == ProjectAction::RemoveFile;
|
||||
case NodeType::Folder:
|
||||
case NodeType::Project:
|
||||
}
|
||||
if (node->isFolderNodeType() || node->isProjectNodeType()) {
|
||||
return action == ProjectAction::AddNewFile
|
||||
|| action == ProjectAction::RemoveFile
|
||||
|| action == ProjectAction::AddExistingFile;
|
||||
default:
|
||||
return ProjectNode::supportsAction(action, node);
|
||||
}
|
||||
return ProjectNode::supportsAction(action, node);
|
||||
}
|
||||
|
||||
bool NimProjectNode::addFiles(const QStringList &filePaths, QStringList *)
|
||||
|
@@ -201,7 +201,8 @@ static QVector<FolderNode *> renamableFolderNodes(const Utils::FileName &before,
|
||||
{
|
||||
QVector<FolderNode *> folderNodes;
|
||||
ProjectTree::forEachNode([&](Node *node) {
|
||||
if (node->nodeType() == NodeType::File && node->filePath() == before
|
||||
if (node->isFileNodeType()
|
||||
&& node->filePath() == before
|
||||
&& node->parentFolderNode()
|
||||
&& node->parentFolderNode()->canRenameFile(before.toString(), after.toString())) {
|
||||
folderNodes.append(node->parentFolderNode());
|
||||
@@ -531,7 +532,8 @@ static QVector<FolderNode *> removableFolderNodes(const Utils::FileName &filePat
|
||||
{
|
||||
QVector<FolderNode *> folderNodes;
|
||||
ProjectTree::forEachNode([&](Node *node) {
|
||||
if (node->nodeType() == NodeType::File && node->filePath() == filePath
|
||||
if (node->isFileNodeType()
|
||||
&& node->filePath() == filePath
|
||||
&& node->parentFolderNode()
|
||||
&& node->parentFolderNode()->supportsAction(RemoveFile, node)) {
|
||||
folderNodes.append(node->parentFolderNode());
|
||||
|
@@ -1460,7 +1460,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
|
||||
|
||||
connect(dd->m_filePropertiesAction, &QAction::triggered, this, []() {
|
||||
const Node *currentNode = ProjectTree::findCurrentNode();
|
||||
QTC_ASSERT(currentNode && currentNode->nodeType() == NodeType::File, return);
|
||||
QTC_ASSERT(currentNode && currentNode->isFileNodeType(), return);
|
||||
DocumentManager::showFilePropertiesDialog(currentNode->filePath());
|
||||
});
|
||||
connect(dd->m_removeFileAction, &QAction::triggered,
|
||||
@@ -2324,7 +2324,7 @@ static QString pathOrDirectoryFor(const Node *node, bool dir)
|
||||
Utils::FileName path = node->filePath();
|
||||
QString location;
|
||||
const FolderNode *folder = node->asFolderNode();
|
||||
if (node->nodeType() == NodeType::VirtualFolder && folder) {
|
||||
if (node->isVirtualFolderType() && folder) {
|
||||
// Virtual Folder case
|
||||
// If there are files directly below or no subfolders, take the folder path
|
||||
if (!folder->fileNodes().isEmpty() || folder->folderNodes().isEmpty()) {
|
||||
@@ -3207,12 +3207,12 @@ void ProjectExplorerPluginPrivate::updateContextMenuActions()
|
||||
// Also handles ProjectNode
|
||||
m_addNewFileAction->setEnabled(supports(AddNewFile)
|
||||
&& !ICore::isNewItemDialogRunning());
|
||||
m_addNewSubprojectAction->setEnabled(currentNode->nodeType() == NodeType::Project
|
||||
m_addNewSubprojectAction->setEnabled(currentNode->isProjectNodeType()
|
||||
&& supports(AddSubProject)
|
||||
&& !ICore::isNewItemDialogRunning());
|
||||
m_addExistingProjectsAction->setEnabled(currentNode->nodeType() == NodeType::Project
|
||||
m_addExistingProjectsAction->setEnabled(currentNode->isProjectNodeType()
|
||||
&& supports(AddExistingProject));
|
||||
m_removeProjectAction->setEnabled(currentNode->nodeType() == NodeType::Project
|
||||
m_removeProjectAction->setEnabled(currentNode->isProjectNodeType()
|
||||
&& supports(RemoveSubProject));
|
||||
m_addExistingFilesAction->setEnabled(supports(AddExistingFile));
|
||||
m_addExistingDirectoryAction->setEnabled(supports(AddExistingDirectory));
|
||||
@@ -3338,7 +3338,7 @@ void ProjectExplorerPluginPrivate::addNewSubproject()
|
||||
QTC_ASSERT(currentNode, return);
|
||||
QString location = directoryFor(currentNode);
|
||||
|
||||
if (currentNode->nodeType() == NodeType::Project
|
||||
if (currentNode->isProjectNodeType()
|
||||
&& currentNode->supportsAction(AddSubProject, currentNode)) {
|
||||
QVariantMap map;
|
||||
map.insert(QLatin1String(Constants::PREFERRED_PROJECT_NODE), QVariant::fromValue(currentNode));
|
||||
@@ -3507,7 +3507,7 @@ void ProjectExplorerPluginPrivate::openTerminalHere(const EnvironmentGetter &env
|
||||
void ProjectExplorerPluginPrivate::removeFile()
|
||||
{
|
||||
const Node *currentNode = ProjectTree::findCurrentNode();
|
||||
QTC_ASSERT(currentNode && currentNode->nodeType() == NodeType::File, return);
|
||||
QTC_ASSERT(currentNode && currentNode->isFileNodeType(), return);
|
||||
|
||||
const Utils::FileName filePath = currentNode->filePath();
|
||||
Utils::RemoveFileDialog removeFileDialog(filePath.toString(), ICore::mainWindow());
|
||||
@@ -3518,7 +3518,7 @@ void ProjectExplorerPluginPrivate::removeFile()
|
||||
// Re-read the current node, in case the project is re-parsed while the dialog is open
|
||||
if (currentNode != ProjectTree::findCurrentNode()) {
|
||||
currentNode = ProjectTreeWidget::nodeForFile(filePath);
|
||||
QTC_ASSERT(currentNode && currentNode->nodeType() == NodeType::File, return);
|
||||
QTC_ASSERT(currentNode && currentNode->isFileNodeType(), return);
|
||||
}
|
||||
|
||||
// remove from project
|
||||
@@ -3542,7 +3542,7 @@ void ProjectExplorerPluginPrivate::removeFile()
|
||||
void ProjectExplorerPluginPrivate::duplicateFile()
|
||||
{
|
||||
Node *currentNode = ProjectTree::findCurrentNode();
|
||||
QTC_ASSERT(currentNode && currentNode->nodeType() == NodeType::File, return);
|
||||
QTC_ASSERT(currentNode && currentNode->isFileNodeType(), return);
|
||||
|
||||
FileNode *fileNode = currentNode->asFileNode();
|
||||
QString filePath = currentNode->filePath().toString();
|
||||
@@ -3573,7 +3573,7 @@ void ProjectExplorerPluginPrivate::duplicateFile()
|
||||
void ProjectExplorerPluginPrivate::deleteFile()
|
||||
{
|
||||
Node *currentNode = ProjectTree::findCurrentNode();
|
||||
QTC_ASSERT(currentNode && currentNode->nodeType() == NodeType::File, return);
|
||||
QTC_ASSERT(currentNode && currentNode->isFileNodeType(), return);
|
||||
|
||||
FileNode *fileNode = currentNode->asFileNode();
|
||||
|
||||
|
@@ -165,7 +165,16 @@ Node::~Node() = default;
|
||||
|
||||
NodeType Node::nodeType() const
|
||||
{
|
||||
return m_nodeType;
|
||||
if (isFileNodeType())
|
||||
return NodeType::File;
|
||||
if (isFolderNodeType())
|
||||
return NodeType::Folder;
|
||||
if (isProjectNodeType())
|
||||
return NodeType::Project;
|
||||
if (isVirtualFolderType())
|
||||
return NodeType::VirtualFolder;
|
||||
QTC_CHECK(false);
|
||||
return NodeType::File;
|
||||
}
|
||||
|
||||
int Node::priority() const
|
||||
@@ -308,11 +317,6 @@ FileType Node::fileTypeForFileName(const Utils::FileName &file)
|
||||
Utils::MimeMatchMode::MatchExtension));
|
||||
}
|
||||
|
||||
void Node::setNodeType(NodeType nodeType)
|
||||
{
|
||||
m_nodeType = nodeType;
|
||||
}
|
||||
|
||||
/*!
|
||||
\class ProjectExplorer::FileNode
|
||||
|
||||
@@ -434,7 +438,6 @@ QString FileNode::displayName() const
|
||||
*/
|
||||
FolderNode::FolderNode(const Utils::FileName &folderPath)
|
||||
{
|
||||
setNodeType(NodeType::Folder);
|
||||
setFilePath(folderPath);
|
||||
setPriority(DefaultFolderPriority);
|
||||
setListInProject(false);
|
||||
@@ -793,7 +796,6 @@ bool FolderNode::showWhenEmpty() const
|
||||
VirtualFolderNode::VirtualFolderNode(const Utils::FileName &folderPath) :
|
||||
FolderNode(folderPath)
|
||||
{
|
||||
setNodeType(NodeType::VirtualFolder);
|
||||
}
|
||||
|
||||
QString VirtualFolderNode::addFileFilter() const
|
||||
@@ -819,7 +821,6 @@ QString VirtualFolderNode::addFileFilter() const
|
||||
ProjectNode::ProjectNode(const Utils::FileName &projectFilePath) :
|
||||
FolderNode(projectFilePath)
|
||||
{
|
||||
setNodeType(NodeType::Project);
|
||||
setPriority(DefaultProjectPriority);
|
||||
setListInProject(true);
|
||||
setDisplayName(projectFilePath.fileName());
|
||||
@@ -930,7 +931,6 @@ void FolderNode::handleSubTreeChanged(FolderNode *node)
|
||||
ContainerNode::ContainerNode(Project *project)
|
||||
: FolderNode(project->projectDirectory()), m_project(project)
|
||||
{
|
||||
setNodeType(NodeType::Project);
|
||||
}
|
||||
|
||||
QString ContainerNode::displayName() const
|
||||
|
@@ -112,6 +112,11 @@ public:
|
||||
|
||||
virtual ~Node();
|
||||
|
||||
virtual bool isFileNodeType() const { return false; }
|
||||
virtual bool isFolderNodeType() const { return false; }
|
||||
virtual bool isProjectNodeType() const { return false; }
|
||||
virtual bool isVirtualFolderType() const { return false; }
|
||||
|
||||
NodeType nodeType() const;
|
||||
int priority() const;
|
||||
|
||||
@@ -165,7 +170,6 @@ protected:
|
||||
Node(const Node &other) = delete;
|
||||
bool operator=(const Node &other) = delete;
|
||||
|
||||
void setNodeType(NodeType nodeType);
|
||||
void setFilePath(const Utils::FileName &filePath);
|
||||
|
||||
private:
|
||||
@@ -173,7 +177,6 @@ private:
|
||||
Utils::FileName m_filePath;
|
||||
int m_line = -1;
|
||||
int m_priority = DefaultPriority;
|
||||
NodeType m_nodeType = NodeType::File;
|
||||
|
||||
enum NodeFlag : quint16 {
|
||||
FlagNone = 0,
|
||||
@@ -196,6 +199,8 @@ public:
|
||||
FileNode *asFileNode() final { return this; }
|
||||
const FileNode *asFileNode() const final { return this; }
|
||||
|
||||
bool isFileNodeType() const final { return true; }
|
||||
|
||||
static QList<FileNode *>
|
||||
scanForFiles(const Utils::FileName &directory,
|
||||
const std::function<FileNode *(const Utils::FileName &fileName)> factory,
|
||||
@@ -216,6 +221,8 @@ public:
|
||||
QString displayName() const override;
|
||||
QIcon icon() const;
|
||||
|
||||
bool isFolderNodeType() const override { return true; }
|
||||
|
||||
Node *findNode(const std::function<bool(Node *)> &filter);
|
||||
QList<Node *> findNodes(const std::function<bool(Node *)> &filter);
|
||||
|
||||
@@ -313,6 +320,9 @@ class PROJECTEXPLORER_EXPORT VirtualFolderNode : public FolderNode
|
||||
public:
|
||||
explicit VirtualFolderNode(const Utils::FileName &folderPath);
|
||||
|
||||
bool isFolderNodeType() const override { return false; }
|
||||
bool isVirtualFolderType() const override { return true; }
|
||||
|
||||
void setAddFileFilter(const QString &filter) { m_addFileFilter = filter; }
|
||||
QString addFileFilter() const override;
|
||||
|
||||
@@ -334,6 +344,9 @@ public:
|
||||
return Utils::nullopt;
|
||||
}
|
||||
|
||||
bool isFolderNodeType() const override { return false; }
|
||||
bool isProjectNodeType() const override { return true; }
|
||||
|
||||
bool addFiles(const QStringList &filePaths, QStringList *notAdded = nullptr) override;
|
||||
bool removeFiles(const QStringList &filePaths, QStringList *notRemoved = nullptr) override;
|
||||
bool deleteFiles(const QStringList &filePaths) override;
|
||||
@@ -368,6 +381,9 @@ public:
|
||||
QString displayName() const final;
|
||||
bool supportsAction(ProjectAction action, const Node *node) const final;
|
||||
|
||||
bool isFolderNodeType() const override { return false; }
|
||||
bool isProjectNodeType() const override { return true; }
|
||||
|
||||
ContainerNode *asContainerNode() final { return this; }
|
||||
const ContainerNode *asContainerNode() const final { return this; }
|
||||
|
||||
|
@@ -333,26 +333,16 @@ void ProjectTree::showContextMenu(ProjectTreeWidget *focus, const QPoint &global
|
||||
|
||||
if (!node) {
|
||||
contextMenu = Core::ActionManager::actionContainer(Constants::M_SESSIONCONTEXT)->menu();
|
||||
} else {
|
||||
switch (node->nodeType()) {
|
||||
case NodeType::Project: {
|
||||
} else if (node->isProjectNodeType()) {
|
||||
if ((node->parentFolderNode() && node->parentFolderNode()->asContainerNode())
|
||||
|| node->asContainerNode())
|
||||
contextMenu = Core::ActionManager::actionContainer(Constants::M_PROJECTCONTEXT)->menu();
|
||||
else
|
||||
contextMenu = Core::ActionManager::actionContainer(Constants::M_SUBPROJECTCONTEXT)->menu();
|
||||
break;
|
||||
}
|
||||
case NodeType::VirtualFolder:
|
||||
case NodeType::Folder:
|
||||
} else if (node->isVirtualFolderType() || node->isFolderNodeType()) {
|
||||
contextMenu = Core::ActionManager::actionContainer(Constants::M_FOLDERCONTEXT)->menu();
|
||||
break;
|
||||
case NodeType::File:
|
||||
} else if (node->isFileNodeType()) {
|
||||
contextMenu = Core::ActionManager::actionContainer(Constants::M_FILECONTEXT)->menu();
|
||||
break;
|
||||
default:
|
||||
qWarning("ProjectExplorerPlugin::showContextMenu - Missing handler for node type");
|
||||
}
|
||||
}
|
||||
|
||||
if (contextMenu && contextMenu->actions().count() > 0) {
|
||||
@@ -435,7 +425,7 @@ Node *ProjectTree::nodeForFile(const FileName &fileName)
|
||||
projectNode->forEachGenericNode([&](Node *n) {
|
||||
if (n->filePath() == fileName) {
|
||||
// prefer file nodes
|
||||
if (!node || (node->nodeType() != NodeType::File && n->nodeType() == NodeType::File))
|
||||
if (!node || (!node->isFileNodeType() && n->isFileNodeType()))
|
||||
node = n;
|
||||
}
|
||||
});
|
||||
|
@@ -524,7 +524,7 @@ void ProjectTreeWidget::showContextMenu(const QPoint &pos)
|
||||
void ProjectTreeWidget::openItem(const QModelIndex &mainIndex)
|
||||
{
|
||||
Node *node = m_model->nodeForIndex(mainIndex);
|
||||
if (!node || node->nodeType() != NodeType::File)
|
||||
if (!node || !node->isFileNodeType())
|
||||
return;
|
||||
IEditor *editor = EditorManager::openEditor(node->filePath().toString());
|
||||
if (editor && node->line() >= 0)
|
||||
|
@@ -171,7 +171,7 @@ BestNodeSelector::BestNodeSelector(const QString &commonDirectory, const QString
|
||||
void BestNodeSelector::inspect(AddNewTree *tree, bool isContextNode)
|
||||
{
|
||||
FolderNode *node = tree->node();
|
||||
if (node->nodeType() == NodeType::Project) {
|
||||
if (node->isProjectNodeType()) {
|
||||
if (static_cast<ProjectNode *>(node)->deploysFolder(m_commonDirectory)) {
|
||||
m_deploys = true;
|
||||
m_deployText += tree->displayName() + QLatin1Char('\n');
|
||||
|
@@ -623,18 +623,16 @@ QString PythonProjectNode::addFileFilter() const
|
||||
|
||||
bool PythonProjectNode::supportsAction(ProjectAction action, const Node *node) const
|
||||
{
|
||||
switch (node->nodeType()) {
|
||||
case NodeType::File:
|
||||
if (node->isFileNodeType()) {
|
||||
return action == ProjectAction::Rename
|
||||
|| action == ProjectAction::RemoveFile;
|
||||
case NodeType::Folder:
|
||||
case NodeType::Project:
|
||||
}
|
||||
if (node->isFolderNodeType() || node->isProjectNodeType()) {
|
||||
return action == ProjectAction::AddNewFile
|
||||
|| action == ProjectAction::RemoveFile
|
||||
|| action == ProjectAction::AddExistingFile;
|
||||
default:
|
||||
return ProjectNode::supportsAction(action, node);
|
||||
}
|
||||
return ProjectNode::supportsAction(action, node);
|
||||
}
|
||||
|
||||
bool PythonProjectNode::addFiles(const QStringList &filePaths, QStringList *)
|
||||
|
@@ -223,7 +223,7 @@ static bool supportsNodeAction(ProjectAction action, const Node *node)
|
||||
};
|
||||
|
||||
if (action == RemoveFile || action == Rename) {
|
||||
if (node->nodeType() == ProjectExplorer::NodeType::File)
|
||||
if (node->isFileNodeType())
|
||||
return !Utils::contains(project->qbsProject().buildSystemFiles(), equalsNodeFilePath);
|
||||
}
|
||||
|
||||
|
@@ -286,7 +286,7 @@ void QbsProjectManagerPlugin::updateContextActions()
|
||||
&& project && !project->isParsing()
|
||||
&& node && node->isEnabled();
|
||||
|
||||
bool isFile = project && node && (node->nodeType() == NodeType::File);
|
||||
const bool isFile = project && node && node->isFileNodeType();
|
||||
const bool isProduct = project && node && dynamic_cast<const QbsProductNode *>(node);
|
||||
const auto subproject = dynamic_cast<const QbsProjectNode *>(node);
|
||||
bool isSubproject = project && subproject && subproject != project->rootProjectNode();
|
||||
|
@@ -112,7 +112,7 @@ bool QmakePriFileNode::supportsAction(ProjectAction action, const Node *node) co
|
||||
return !(pro && pro->knowsFile(node->filePath()));
|
||||
|
||||
bool addExistingFiles = true;
|
||||
if (node->nodeType() == NodeType::VirtualFolder) {
|
||||
if (node->isVirtualFolderType()) {
|
||||
// A virtual folder, we do what the projectexplorer does
|
||||
const FolderNode *folder = node->asFolderNode();
|
||||
if (folder) {
|
||||
@@ -171,7 +171,7 @@ bool QmakePriFileNode::addFiles(const QStringList &filePaths, QStringList *notAd
|
||||
if (!pri)
|
||||
return false;
|
||||
QList<Node *> matchingNodes = findNodes([filePaths](const Node *n) {
|
||||
return n->nodeType() == NodeType::File && filePaths.contains(n->filePath().toString());
|
||||
return n->isFileNodeType() && filePaths.contains(n->filePath().toString());
|
||||
});
|
||||
matchingNodes = filtered(matchingNodes, [](const Node *n) {
|
||||
for (const Node *parent = n->parentFolderNode(); parent;
|
||||
|
@@ -398,7 +398,7 @@ void DocumentManager::findPathToIsoProFile(bool *iconResourceFileAlreadyExists,
|
||||
qCDebug(documentManagerLog) << "Checking" << node->displayName()
|
||||
<< "(" << node << static_cast<int>(node->nodeType()) << ")";
|
||||
|
||||
if (node->nodeType() == ProjectExplorer::NodeType::VirtualFolder && node->displayName() == "Resources") {
|
||||
if (node->isVirtualFolderType() && node->displayName() == "Resources") {
|
||||
auto virtualFolderNode = dynamic_cast<ProjectExplorer::VirtualFolderNode*>(node);
|
||||
|
||||
for (int subFolderIndex = 0; subFolderIndex < virtualFolderNode->folderNodes().size() && !iconQrcFileNode; ++subFolderIndex) {
|
||||
@@ -408,8 +408,7 @@ void DocumentManager::findPathToIsoProFile(bool *iconResourceFileAlreadyExists,
|
||||
<< subFolderNode << static_cast<int>(subFolderNode->nodeType())
|
||||
<< ") is" << isoIconsQrcFile;
|
||||
|
||||
if (subFolderNode->nodeType() == ProjectExplorer::NodeType::Folder
|
||||
&& subFolderNode->displayName() == isoIconsQrcFile) {
|
||||
if (subFolderNode->isFolderNodeType() && subFolderNode->displayName() == isoIconsQrcFile) {
|
||||
qCDebug(documentManagerLog) << "Found" << isoIconsQrcFile << "in" << virtualFolderNode->filePath();
|
||||
|
||||
iconQrcFileNode = subFolderNode;
|
||||
|
@@ -298,7 +298,7 @@ void QmlPreviewPlugin::setFileLoader(QmlPreviewFileLoader fileLoader)
|
||||
void QmlPreviewPlugin::previewCurrentFile()
|
||||
{
|
||||
const Node *currentNode = ProjectTree::findCurrentNode();
|
||||
if (!currentNode || currentNode->nodeType() != NodeType::File
|
||||
if (!currentNode || !currentNode->isFileNodeType()
|
||||
|| currentNode->asFileNode()->fileType() != FileType::QML)
|
||||
return;
|
||||
|
||||
|
@@ -64,7 +64,7 @@ bool QmlProjectNode::supportsAction(ProjectAction action, const Node *node) cons
|
||||
return true;
|
||||
QTC_ASSERT(node, return false);
|
||||
|
||||
if (action == Rename && node->nodeType() == NodeType::File) {
|
||||
if (action == Rename && node->isFileNodeType()) {
|
||||
const FileNode *fileNode = node->asFileNode();
|
||||
QTC_ASSERT(fileNode, return false);
|
||||
return fileNode->fileType() != FileType::Project;
|
||||
|
Reference in New Issue
Block a user