Use new AnalyzerUtils::logToIssuesPane().

Change-Id: I9820a81f67c06b7bb54720772467263bfa9fc8f3
Reviewed-by: Andre Poenitz <andre.poenitz@theqtcompany.com>
This commit is contained in:
Christian Kandeler
2015-03-04 17:33:06 +01:00
committed by Andre Poenitz
parent d2fa3e9902
commit 5b1a7f3756

View File

@@ -23,8 +23,8 @@
#include "clangstaticanalyzersettings.h" #include "clangstaticanalyzersettings.h"
#include "clangstaticanalyzerutils.h" #include "clangstaticanalyzerutils.h"
#include <analyzerbase/analyzerconstants.h>
#include <analyzerbase/analyzermanager.h> #include <analyzerbase/analyzermanager.h>
#include <analyzerbase/analyzerutils.h>
#include <clangcodemodel/clangutils.h> #include <clangcodemodel/clangutils.h>
@@ -53,14 +53,6 @@ static Q_LOGGING_CATEGORY(LOG, "qtc.clangstaticanalyzer.runcontrol")
namespace ClangStaticAnalyzer { namespace ClangStaticAnalyzer {
namespace Internal { namespace Internal {
static void logToIssuesPane(Task::TaskType type, const QString &message)
{
TaskHub::addTask(type, message, Analyzer::Constants::ANALYZERTASK_ID);
if (type == Task::Error)
TaskHub::requestPopup();
}
ClangStaticAnalyzerRunControl::ClangStaticAnalyzerRunControl( ClangStaticAnalyzerRunControl::ClangStaticAnalyzerRunControl(
const Analyzer::AnalyzerStartParameters &startParams, const Analyzer::AnalyzerStartParameters &startParams,
ProjectExplorer::RunConfiguration *runConfiguration, ProjectExplorer::RunConfiguration *runConfiguration,
@@ -204,7 +196,7 @@ bool ClangStaticAnalyzerRunControl::startEngine()
const QString errorMessage = tr("Clang Static Analyzer: Invalid executable \"%1\", stop.") const QString errorMessage = tr("Clang Static Analyzer: Invalid executable \"%1\", stop.")
.arg(executable); .arg(executable);
appendMessage(errorMessage + QLatin1Char('\n'), Utils::ErrorMessageFormat); appendMessage(errorMessage + QLatin1Char('\n'), Utils::ErrorMessageFormat);
logToIssuesPane(Task::Error, errorMessage); AnalyzerUtils::logToIssuesPane(Task::Error, errorMessage);
emit finished(); emit finished();
return false; return false;
} }
@@ -217,7 +209,7 @@ bool ClangStaticAnalyzerRunControl::startEngine()
const QString errorMessage const QString errorMessage
= tr("Clang Static Analyzer: Failed to create temporary dir, stop."); = tr("Clang Static Analyzer: Failed to create temporary dir, stop.");
appendMessage(errorMessage + QLatin1Char('\n'), Utils::ErrorMessageFormat); appendMessage(errorMessage + QLatin1Char('\n'), Utils::ErrorMessageFormat);
logToIssuesPane(Task::Error, errorMessage); AnalyzerUtils::logToIssuesPane(Task::Error, errorMessage);
emit finished(); emit finished();
return false; return false;
} }
@@ -287,8 +279,8 @@ void ClangStaticAnalyzerRunControl::analyzeNextFile()
+ QLatin1Char('\n'), + QLatin1Char('\n'),
Utils::NormalMessageFormat); Utils::NormalMessageFormat);
if (m_filesAnalyzed == 0 && m_filesNotAnalyzed != 0) { if (m_filesAnalyzed == 0 && m_filesNotAnalyzed != 0) {
logToIssuesPane(Task::Error, AnalyzerUtils::logToIssuesPane(Task::Error,
tr("Clang Static Analyzer: Failed to analyze any files.")); tr("Clang Static Analyzer: Failed to analyze any files."));
} }
m_progress.reportFinished(); m_progress.reportFinished();
emit finished(); emit finished();
@@ -353,8 +345,8 @@ void ClangStaticAnalyzerRunControl::onRunnerFinishedWithFailure(const QString &e
+ QLatin1Char('\n') + QLatin1Char('\n')
, Utils::StdErrFormat); , Utils::StdErrFormat);
appendMessage(errorDetails, Utils::StdErrFormat); appendMessage(errorDetails, Utils::StdErrFormat);
logToIssuesPane(Task::Warning, errorMessage); AnalyzerUtils::logToIssuesPane(Task::Warning, errorMessage);
logToIssuesPane(Task::Warning, errorDetails); AnalyzerUtils::logToIssuesPane(Task::Warning, errorDetails);
handleFinished(); handleFinished();
} }