forked from qt-creator/qt-creator
QtSupport: Use setup pattern for QtOutputFormatter
Change-Id: Ic570a6503bedc4685d3d7f6222f1edab33fb6bad Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include <projectexplorer/deployablefile.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/runconfigurationaspects.h>
|
||||
#include <projectexplorer/runcontrol.h>
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
#include <remotelinux/remotelinuxenvironmentaspect.h>
|
||||
|
@@ -8,6 +8,8 @@
|
||||
#include "qttestparser.h"
|
||||
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
|
||||
#include <projectexplorer/runcontrol.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
@@ -218,13 +220,22 @@ void QtOutputLineParser::updateProjectFileList()
|
||||
|
||||
// QtOutputFormatterFactory
|
||||
|
||||
QtOutputFormatterFactory::QtOutputFormatterFactory()
|
||||
class QtOutputFormatterFactory final : public OutputFormatterFactory
|
||||
{
|
||||
setFormatterCreator([](Target *t) -> QList<OutputLineParser *> {
|
||||
if (QtKitAspect::qtVersion(t ? t->kit() : nullptr))
|
||||
return {new QtTestParser, new QtOutputLineParser(t)};
|
||||
return {};
|
||||
});
|
||||
public:
|
||||
QtOutputFormatterFactory()
|
||||
{
|
||||
setFormatterCreator([](Target *t) -> QList<OutputLineParser *> {
|
||||
if (QtKitAspect::qtVersion(t ? t->kit() : nullptr))
|
||||
return {new QtTestParser, new QtOutputLineParser(t)};
|
||||
return {};
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
void setupQtOutputFormatter()
|
||||
{
|
||||
static QtOutputFormatterFactory theQtOutputFormatterFactory;
|
||||
}
|
||||
|
||||
} // QtSupport::Internal
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <projectexplorer/runcontrol.h>
|
||||
#include <QObject>
|
||||
|
||||
// "file" or "qrc", colon, optional '//', '/' and further characters
|
||||
#define QT_QML_URL_REGEXP "(?:file|qrc):(?://)?/.+?"
|
||||
@@ -14,11 +14,7 @@
|
||||
|
||||
namespace QtSupport::Internal {
|
||||
|
||||
class QtOutputFormatterFactory : public ProjectExplorer::OutputFormatterFactory
|
||||
{
|
||||
public:
|
||||
QtOutputFormatterFactory();
|
||||
};
|
||||
void setupQtOutputFormatter();
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
QObject *createQtOutputFormatterTest();
|
||||
|
@@ -48,8 +48,6 @@ namespace QtSupport::Internal {
|
||||
class QtSupportPluginPrivate
|
||||
{
|
||||
public:
|
||||
QtOutputFormatterFactory qtOutputFormatterFactory;
|
||||
|
||||
UicGeneratorFactory uicGeneratorFactory;
|
||||
QScxmlcGeneratorFactory qscxmlcGeneratorFactory;
|
||||
|
||||
@@ -110,6 +108,7 @@ void QtSupportPlugin::initialize()
|
||||
setupEmbeddedLinuxQtVersion();
|
||||
setupGettingStartedWelcomePage();
|
||||
setupQtSettingsPage();
|
||||
setupQtOutputFormatter();
|
||||
|
||||
theProcessRunner() = processRunnerCallback;
|
||||
|
||||
|
Reference in New Issue
Block a user