diff --git a/src/plugins/cppcheck/cppcheckrunner.cpp b/src/plugins/cppcheck/cppcheckrunner.cpp index 7ee44bbb365..4f9b23646c5 100644 --- a/src/plugins/cppcheck/cppcheckrunner.cpp +++ b/src/plugins/cppcheck/cppcheckrunner.cpp @@ -140,7 +140,7 @@ void CppcheckRunner::handleDone() if (m_process.result() == ProcessResult::FinishedWithSuccess) m_tool.finishParsing(); else - Core::MessageManager::writeSilently(m_process.exitMessage()); + m_tool.finishWithFail(m_process.exitMessage()); m_currentFiles.clear(); m_process.close(); diff --git a/src/plugins/cppcheck/cppchecktool.cpp b/src/plugins/cppcheck/cppchecktool.cpp index 5bfcf941a3f..84479a78be5 100644 --- a/src/plugins/cppcheck/cppchecktool.cpp +++ b/src/plugins/cppcheck/cppchecktool.cpp @@ -304,4 +304,12 @@ void CppcheckTool::finishParsing() m_progress->reportFinished(); } +void CppcheckTool::finishWithFail(const QString &exitMessage) +{ + if (!exitMessage.isEmpty()) + Core::MessageManager::writeSilently(exitMessage); + QTC_ASSERT(m_progress, return); + m_progress->cancelAndFinish(); +} + } // Cppcheck::Internal diff --git a/src/plugins/cppcheck/cppchecktool.h b/src/plugins/cppcheck/cppchecktool.h index d14485fd5e8..e8e61efaef9 100644 --- a/src/plugins/cppcheck/cppchecktool.h +++ b/src/plugins/cppcheck/cppchecktool.h @@ -42,6 +42,7 @@ public: void parseOutputLine(const QString &line); void parseErrorLine(const QString &line); void finishParsing(); + void finishWithFail(const QString &exitMessage); private: void updateArguments();