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/deployablefile.h>
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/runconfigurationaspects.h>
|
#include <projectexplorer/runconfigurationaspects.h>
|
||||||
|
#include <projectexplorer/runcontrol.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
|
|
||||||
#include <remotelinux/remotelinuxenvironmentaspect.h>
|
#include <remotelinux/remotelinuxenvironmentaspect.h>
|
||||||
|
@@ -8,6 +8,8 @@
|
|||||||
#include "qttestparser.h"
|
#include "qttestparser.h"
|
||||||
|
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
|
|
||||||
|
#include <projectexplorer/runcontrol.h>
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
|
|
||||||
@@ -218,7 +220,10 @@ void QtOutputLineParser::updateProjectFileList()
|
|||||||
|
|
||||||
// QtOutputFormatterFactory
|
// QtOutputFormatterFactory
|
||||||
|
|
||||||
QtOutputFormatterFactory::QtOutputFormatterFactory()
|
class QtOutputFormatterFactory final : public OutputFormatterFactory
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
QtOutputFormatterFactory()
|
||||||
{
|
{
|
||||||
setFormatterCreator([](Target *t) -> QList<OutputLineParser *> {
|
setFormatterCreator([](Target *t) -> QList<OutputLineParser *> {
|
||||||
if (QtKitAspect::qtVersion(t ? t->kit() : nullptr))
|
if (QtKitAspect::qtVersion(t ? t->kit() : nullptr))
|
||||||
@@ -226,6 +231,12 @@ QtOutputFormatterFactory::QtOutputFormatterFactory()
|
|||||||
return {};
|
return {};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
void setupQtOutputFormatter()
|
||||||
|
{
|
||||||
|
static QtOutputFormatterFactory theQtOutputFormatterFactory;
|
||||||
|
}
|
||||||
|
|
||||||
} // QtSupport::Internal
|
} // QtSupport::Internal
|
||||||
|
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <projectexplorer/runcontrol.h>
|
#include <QObject>
|
||||||
|
|
||||||
// "file" or "qrc", colon, optional '//', '/' and further characters
|
// "file" or "qrc", colon, optional '//', '/' and further characters
|
||||||
#define QT_QML_URL_REGEXP "(?:file|qrc):(?://)?/.+?"
|
#define QT_QML_URL_REGEXP "(?:file|qrc):(?://)?/.+?"
|
||||||
@@ -14,11 +14,7 @@
|
|||||||
|
|
||||||
namespace QtSupport::Internal {
|
namespace QtSupport::Internal {
|
||||||
|
|
||||||
class QtOutputFormatterFactory : public ProjectExplorer::OutputFormatterFactory
|
void setupQtOutputFormatter();
|
||||||
{
|
|
||||||
public:
|
|
||||||
QtOutputFormatterFactory();
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef WITH_TESTS
|
#ifdef WITH_TESTS
|
||||||
QObject *createQtOutputFormatterTest();
|
QObject *createQtOutputFormatterTest();
|
||||||
|
@@ -48,8 +48,6 @@ namespace QtSupport::Internal {
|
|||||||
class QtSupportPluginPrivate
|
class QtSupportPluginPrivate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QtOutputFormatterFactory qtOutputFormatterFactory;
|
|
||||||
|
|
||||||
UicGeneratorFactory uicGeneratorFactory;
|
UicGeneratorFactory uicGeneratorFactory;
|
||||||
QScxmlcGeneratorFactory qscxmlcGeneratorFactory;
|
QScxmlcGeneratorFactory qscxmlcGeneratorFactory;
|
||||||
|
|
||||||
@@ -110,6 +108,7 @@ void QtSupportPlugin::initialize()
|
|||||||
setupEmbeddedLinuxQtVersion();
|
setupEmbeddedLinuxQtVersion();
|
||||||
setupGettingStartedWelcomePage();
|
setupGettingStartedWelcomePage();
|
||||||
setupQtSettingsPage();
|
setupQtSettingsPage();
|
||||||
|
setupQtOutputFormatter();
|
||||||
|
|
||||||
theProcessRunner() = processRunnerCallback;
|
theProcessRunner() = processRunnerCallback;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user