Giter Club home page Giter Club logo

Comments (4)

 avatar commented on August 24, 2024
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.

OneMoreGres avatar OneMoreGres commented on August 24, 2024

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.

 avatar commented on August 24, 2024

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.

OneMoreGres avatar OneMoreGres commented on August 24, 2024

Source updated. Thanks for patch.

from qtc-cppcheck.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.