Debugger: Dissolve AnalyzerUtils::logToIssuesPane()

If the Error + popup combo is generic it should live in TaskHub.
If it is not, end user code should decide when to popup.
Not an intermediate level.

Change-Id: I195ba8c17c5cc192ff9762ed6f45629143bcbb35
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2016-05-31 16:09:48 +02:00
parent 3a9332812d
commit a8eb924a2a
5 changed files with 21 additions and 28 deletions

View File

@@ -30,7 +30,7 @@
#include "clangstaticanalyzersettings.h"
#include "clangstaticanalyzerutils.h"
#include <debugger/analyzer/analyzerutils.h>
#include <debugger/analyzer/analyzerconstants.h>
#include <clangcodemodel/clangutils.h>
@@ -419,7 +419,8 @@ void ClangStaticAnalyzerRunControl::start()
const QString errorMessage = tr("Clang Static Analyzer: Invalid executable \"%1\", stop.")
.arg(executable);
appendMessage(errorMessage + QLatin1Char('\n'), Utils::ErrorMessageFormat);
AnalyzerUtils::logToIssuesPane(Task::Error, errorMessage);
TaskHub::addTask(Task::Error, errorMessage, Debugger::Constants::ANALYZERTASK_ID);
TaskHub::requestPopup();
emit finished();
return;
}
@@ -432,7 +433,8 @@ void ClangStaticAnalyzerRunControl::start()
const QString errorMessage
= tr("Clang Static Analyzer: Failed to create temporary dir, stop.");
appendMessage(errorMessage + QLatin1Char('\n'), Utils::ErrorMessageFormat);
AnalyzerUtils::logToIssuesPane(Task::Error, errorMessage);
TaskHub::addTask(Task::Error, errorMessage, Debugger::Constants::ANALYZERTASK_ID);
TaskHub::requestPopup();
emit finished();
return;
}
@@ -571,8 +573,8 @@ void ClangStaticAnalyzerRunControl::onRunnerFinishedWithFailure(const QString &e
+ QLatin1Char('\n')
, Utils::StdErrFormat);
appendMessage(errorDetails, Utils::StdErrFormat);
AnalyzerUtils::logToIssuesPane(Task::Warning, errorMessage);
AnalyzerUtils::logToIssuesPane(Task::Warning, errorDetails);
TaskHub::addTask(Task::Warning, errorMessage, Debugger::Constants::ANALYZERTASK_ID);
TaskHub::addTask(Task::Warning, errorDetails, Debugger::Constants::ANALYZERTASK_ID);
handleFinished();
}
@@ -605,8 +607,9 @@ void ClangStaticAnalyzerRunControl::finalize()
Utils::NormalMessageFormat);
if (m_filesNotAnalyzed != 0) {
AnalyzerUtils::logToIssuesPane(Task::Error,
tr("Clang Static Analyzer: Not all files could be analyzed."));
QString msg = tr("Clang Static Analyzer: Not all files could be analyzed.");
TaskHub::addTask(Task::Error, msg, Debugger::Constants::ANALYZERTASK_ID);
TaskHub::requestPopup();
}
m_progress.reportFinished();