Cppcheck: Finish progress bar on fail

Fixes: QTCREATORBUG-27961
Change-Id: If1bbd5b14ec77e8bde1617c692388a2868e3ce0f
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
Christian Stenger
2024-05-28 11:03:51 +02:00
parent fbdc246ea8
commit 67f18a1a56
3 changed files with 10 additions and 1 deletions

View File

@@ -140,7 +140,7 @@ void CppcheckRunner::handleDone()
if (m_process.result() == ProcessResult::FinishedWithSuccess) if (m_process.result() == ProcessResult::FinishedWithSuccess)
m_tool.finishParsing(); m_tool.finishParsing();
else else
Core::MessageManager::writeSilently(m_process.exitMessage()); m_tool.finishWithFail(m_process.exitMessage());
m_currentFiles.clear(); m_currentFiles.clear();
m_process.close(); m_process.close();

View File

@@ -304,4 +304,12 @@ void CppcheckTool::finishParsing()
m_progress->reportFinished(); 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 } // Cppcheck::Internal

View File

@@ -42,6 +42,7 @@ public:
void parseOutputLine(const QString &line); void parseOutputLine(const QString &line);
void parseErrorLine(const QString &line); void parseErrorLine(const QString &line);
void finishParsing(); void finishParsing();
void finishWithFail(const QString &exitMessage);
private: private:
void updateArguments(); void updateArguments();