forked from qt-creator/qt-creator
Cppcheck: Kill current check process only when needed
Kill only if it processes specified files Change-Id: I5dee99ec8aeaf3bf4d9dbf6aad195f54176170a2 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -87,17 +87,19 @@ void CppcheckRunner::addToQueue(const Utils::FileNameList &files,
|
||||
}
|
||||
|
||||
if (m_isRunning) {
|
||||
if (existing == m_currentFiles)
|
||||
m_process->kill(); // Further processing in handleFinished
|
||||
stop(existing);
|
||||
return;
|
||||
}
|
||||
|
||||
m_queueTimer.start();
|
||||
}
|
||||
|
||||
void CppcheckRunner::stop()
|
||||
void CppcheckRunner::stop(const Utils::FileNameList &files)
|
||||
{
|
||||
if (m_isRunning)
|
||||
if (!m_isRunning)
|
||||
return;
|
||||
|
||||
if (files.isEmpty() || m_currentFiles == files)
|
||||
m_process->kill();
|
||||
}
|
||||
|
||||
|
@@ -51,7 +51,7 @@ public:
|
||||
void addToQueue(const Utils::FileNameList &files,
|
||||
const QString &additionalArguments = {});
|
||||
void removeFromQueue(const Utils::FileNameList &files);
|
||||
void stop();
|
||||
void stop(const Utils::FileNameList &files = {});
|
||||
|
||||
const Utils::FileNameList ¤tFiles() const;
|
||||
QString currentCommand() const;
|
||||
|
@@ -229,7 +229,7 @@ void CppcheckTool::addToQueue(const Utils::FileNameList &files, CppTools::Projec
|
||||
void CppcheckTool::stop(const Utils::FileNameList &files)
|
||||
{
|
||||
m_runner->removeFromQueue(files);
|
||||
m_runner->stop();
|
||||
m_runner->stop(files);
|
||||
}
|
||||
|
||||
void CppcheckTool::startParsing()
|
||||
|
Reference in New Issue
Block a user