Comments (4)
diff --git a/src/QtcCppcheckPlugin.cpp b/src/QtcCppcheckPlugin.cpp
index 77b7b87..5d597a6 100644
--- a/src/QtcCppcheckPlugin.cpp
+++ b/src/QtcCppcheckPlugin.cpp
@@ -7,6 +7,7 @@
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/editormanager/editormanager.h>
+#include <coreplugin/idocument.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/projectnodes.h>
@@ -14,6 +15,7 @@
#include <projectexplorer/taskhub.h>
#include <projectexplorer/buildmanager.h>
#include <projectexplorer/session.h>
+#include <projectexplorer/projecttree.h>
#include <QtPlugin>
@@ -23,6 +25,7 @@
#include "OptionsPage.h"
#include "TaskInfo.h"
#include "CppcheckRunner.h"
+#include <QMenu>
using namespace QtcCppcheck::Internal;
@@ -45,7 +48,7 @@ namespace
bool isFileNodeCheckable (const FileNode* node)
{
static QStringList extensions = supportedExtensions ();
- QFileInfo info (node->path());
+ QFileInfo info (node->path().toString());
QString extension = info.completeSuffix ();
return (extensions.contains (extension));
}
@@ -212,7 +215,7 @@ void QtcCppcheckPlugin::checkCurrentDocument()
return;
}
// Check event if it not belongs to active project.
- checkFiles (QStringList () << document->filePath ());
+ checkFiles (QStringList () << document->filePath().toString());
}
void QtcCppcheckPlugin::checkActiveProject()
@@ -225,7 +228,8 @@ void QtcCppcheckPlugin::checkActiveProject()
void QtcCppcheckPlugin::checkCurrentNode()
{
- Node* node = ProjectExplorerPlugin::instance ()->currentNode ();
+ //Node* node = ProjectExplorerPlugin::instance ()->currentNode ();
+ Node* node = ProjectTree::currentNode();
if (node == NULL)
{
return;
@@ -248,7 +252,7 @@ QStringList QtcCppcheckPlugin::checkableFiles(const Node *node, bool forceSelect
const FileNode* file = (const FileNode*) node;
if (forceSelected || isFileNodeCheckable (file))
{
- files << file->path ();
+ files << file->path().toString();
}
}
break;
@@ -390,10 +394,10 @@ void QtcCppcheckPlugin::checkActiveProjectDocuments(int beginRow, int endRow,
{
continue;
}
- if (projectFileList_.contains (document->filePath ()) &&
+ if (projectFileList_.contains (document->filePath().toString()) &&
document->isModified () == modifiedFlag)
{
- filesToCheck << document->filePath ();
+ filesToCheck << document->filePath().toString();
}
}
from qtc-cppcheck.
I'll watch for it when QTC 3.4 will be officially released.
Looks like assert triggers because binary file has not been set in plugin's options. It should be just a check, not an assertion. So you can safely replace it with if/return.
from qtc-cppcheck.
Ah, yes, you are right. When I fill in the path of cppcheck in the options dialog, the assert does not occur.
So looks like the attached patch is all that is needed for QtCreator 3.4.0RC1 .
from qtc-cppcheck.
Source updated. Thanks for patch.
from qtc-cppcheck.
Related Issues (20)
- Support for Qt Creator 4.0.0>=beta1 HOT 5
- Missing install instructions HOT 1
- Ability to exclude files from check HOT 2
- Qt Creator 4.1.0 Support HOT 3
- "Check current project" doesn't work in QtCreator 4.1.0 for Linux (x64) HOT 3
- Qtcreator 4.3 error in Arch linux HOT 2
- Custom parameters not added to cppcheck command line HOT 2
- Excluding files does not work HOT 4
- Document how to use plugin HOT 2
- symbol _ZdlPvm, version Qt_5 not defined in file libQt5Core.so.5 HOT 1
- Cannot integrate qtc-cppcheck HOT 2
- Analysis of project with v4.5.0 (Windows) is significantly slower than CppCheck GUI HOT 11
- Qtcreator-4.5.0 failing to load QtcCppcheck4.dll HOT 2
- Decide how to continue with with Qt Creator >= 4.8 HOT 1
- Cannot install to QT 4.5.2.. HOT 1
- Does not work with Qt Creator 3.2.1 HOT 2
- QtCreator 3.3 can't enable this plugin HOT 1
- Failed to build on Linux. HOT 1
- QtCreator crashes when I change branch or stash changes from command line HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qtc-cppcheck.