From 63e418024225f104c7bc51110ac2b12dec4d23ba Mon Sep 17 00:00:00 2001 From: Ville Nummela Date: Tue, 18 Jun 2019 14:39:38 +0300 Subject: ProjectExplorer: Add special handling for removing files ... from a project which are pulled in via wildcards. Such files cannot be removed from a project file, because they are not listed verbatim. This kind of failure should not be reported to the user if the file is also deleted, as the file list will have the correct state after the next reparse. Fixes: QTCREATORBUG-22586 Done-with: Christian Kandeler Change-Id: I3dc66fe9a6594be7d0b86f46d830cd099ee49fd7 Reviewed-by: hjk --- src/plugins/pythoneditor/pythoneditorplugin.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/plugins/pythoneditor/pythoneditorplugin.cpp') diff --git a/src/plugins/pythoneditor/pythoneditorplugin.cpp b/src/plugins/pythoneditor/pythoneditorplugin.cpp index 8dd87ebbda..bae2a90f7b 100644 --- a/src/plugins/pythoneditor/pythoneditorplugin.cpp +++ b/src/plugins/pythoneditor/pythoneditorplugin.cpp @@ -123,7 +123,8 @@ public: bool supportsAction(ProjectAction action, const Node *node) const override; bool addFiles(const QStringList &filePaths, QStringList *) override; - bool removeFiles(const QStringList &filePaths, QStringList *) override; + ProjectExplorer::RemovedFilesFromProject removeFiles(const QStringList &filePaths, + QStringList *) override; bool deleteFiles(const QStringList &) override; bool renameFile(const QString &filePath, const QString &newFilePath) override; @@ -692,9 +693,10 @@ bool PythonProjectNode::addFiles(const QStringList &filePaths, QStringList *) return m_project->addFiles(filePaths); } -bool PythonProjectNode::removeFiles(const QStringList &filePaths, QStringList *) +RemovedFilesFromProject PythonProjectNode::removeFiles(const QStringList &filePaths, QStringList *) { - return m_project->removeFiles(filePaths); + return m_project->removeFiles(filePaths) ? RemovedFilesFromProject::Ok + : RemovedFilesFromProject::Error; } bool PythonProjectNode::deleteFiles(const QStringList &) -- cgit v1.2.1