From c57160eda676b7cefd9375191054a0df0c8d4408 Mon Sep 17 00:00:00 2001 From: Aurindam Jana Date: Fri, 19 Jul 2013 16:08:54 +0200 Subject: Analyzer: Separate out run control factories Separating out the run control factories is the initial step towards separation of run control from QML profiler engine. The goal is to to make the engine agnostic of the run control. Change-Id: Ic8279755f0188ab53253a62322fcccf1c17b6aaf Reviewed-by: Christian Kandeler Reviewed-by: Christiaan Janssen --- src/plugins/analyzerbase/analyzerbase.pro | 6 +- src/plugins/analyzerbase/analyzerbase.qbs | 2 - src/plugins/analyzerbase/analyzerplugin.cpp | 3 - .../analyzerbase/analyzerruncontrolfactory.cpp | 84 -------------------- .../analyzerbase/analyzerruncontrolfactory.h | 57 -------------- src/plugins/qmlprofiler/qmlprofiler.pro | 6 +- src/plugins/qmlprofiler/qmlprofiler.qbs | 2 + src/plugins/qmlprofiler/qmlprofilerplugin.cpp | 3 + .../qmlprofiler/qmlprofilerruncontrolfactory.cpp | 91 ++++++++++++++++++++++ .../qmlprofiler/qmlprofilerruncontrolfactory.h | 58 ++++++++++++++ src/plugins/valgrind/valgrind.pro | 6 +- src/plugins/valgrind/valgrind.qbs | 2 + src/plugins/valgrind/valgrindplugin.cpp | 3 + src/plugins/valgrind/valgrindruncontrolfactory.cpp | 86 ++++++++++++++++++++ src/plugins/valgrind/valgrindruncontrolfactory.h | 58 ++++++++++++++ 15 files changed, 313 insertions(+), 154 deletions(-) delete mode 100644 src/plugins/analyzerbase/analyzerruncontrolfactory.cpp delete mode 100644 src/plugins/analyzerbase/analyzerruncontrolfactory.h create mode 100644 src/plugins/qmlprofiler/qmlprofilerruncontrolfactory.cpp create mode 100644 src/plugins/qmlprofiler/qmlprofilerruncontrolfactory.h create mode 100644 src/plugins/valgrind/valgrindruncontrolfactory.cpp create mode 100644 src/plugins/valgrind/valgrindruncontrolfactory.h (limited to 'src/plugins') diff --git a/src/plugins/analyzerbase/analyzerbase.pro b/src/plugins/analyzerbase/analyzerbase.pro index f003999510..d768b6e5a6 100644 --- a/src/plugins/analyzerbase/analyzerbase.pro +++ b/src/plugins/analyzerbase/analyzerbase.pro @@ -16,8 +16,7 @@ SOURCES += \ analyzeroptionspage.cpp \ analyzerrunconfigwidget.cpp \ analyzerutils.cpp \ - startremotedialog.cpp \ - analyzerruncontrolfactory.cpp + startremotedialog.cpp HEADERS += \ ianalyzerengine.h \ @@ -32,8 +31,7 @@ HEADERS += \ analyzeroptionspage.h \ analyzerrunconfigwidget.h \ analyzerutils.h \ - startremotedialog.h \ - analyzerruncontrolfactory.h + startremotedialog.h RESOURCES += \ analyzerbase.qrc diff --git a/src/plugins/analyzerbase/analyzerbase.qbs b/src/plugins/analyzerbase/analyzerbase.qbs index 7a42610f1b..44658b96ab 100644 --- a/src/plugins/analyzerbase/analyzerbase.qbs +++ b/src/plugins/analyzerbase/analyzerbase.qbs @@ -26,8 +26,6 @@ QtcPlugin { "analyzerrunconfigwidget.h", "analyzerruncontrol.cpp", "analyzerruncontrol.h", - "analyzerruncontrolfactory.cpp", - "analyzerruncontrolfactory.h", "analyzersettings.cpp", "analyzersettings.h", "analyzerstartparameters.h", diff --git a/src/plugins/analyzerbase/analyzerplugin.cpp b/src/plugins/analyzerbase/analyzerplugin.cpp index 079c1f1af3..ba8b86e0cc 100644 --- a/src/plugins/analyzerbase/analyzerplugin.cpp +++ b/src/plugins/analyzerbase/analyzerplugin.cpp @@ -30,7 +30,6 @@ #include "analyzerplugin.h" #include "analyzermanager.h" -#include "analyzerruncontrolfactory.h" #include #include @@ -65,8 +64,6 @@ bool AnalyzerPlugin::initialize(const QStringList &arguments, QString *errorStri (void) new AnalyzerManager(this); - addAutoReleasedObject(new AnalyzerRunControlFactory()); - // Task integration. //: Category under which Analyzer tasks are listed in Issues view ProjectExplorer::ProjectExplorerPlugin::instance()->taskHub() diff --git a/src/plugins/analyzerbase/analyzerruncontrolfactory.cpp b/src/plugins/analyzerbase/analyzerruncontrolfactory.cpp deleted file mode 100644 index 9367ccacc7..0000000000 --- a/src/plugins/analyzerbase/analyzerruncontrolfactory.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/************************************************************************** -** -** Copyright (C) 2013 Kläralvdalens Datakonsult AB, a KDAB Group company. -** Contact: Kläralvdalens Datakonsult AB (info@kdab.com) -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "analyzerruncontrolfactory.h" -#include "analyzersettings.h" -#include "analyzerruncontrol.h" -#include "analyzermanager.h" -#include "ianalyzertool.h" -#include "analyzerstartparameters.h" - -#include - -#include - -using namespace ProjectExplorer; - -namespace Analyzer { -namespace Internal { - -AnalyzerRunControlFactory::AnalyzerRunControlFactory(QObject *parent) : - IRunControlFactory(parent) -{ -} - -bool AnalyzerRunControlFactory::canRun(RunConfiguration *runConfiguration, RunMode mode) const -{ - IAnalyzerTool *tool = AnalyzerManager::toolFromRunMode(mode); - if (tool) - return tool->canRun(runConfiguration, mode); - return false; -} - -RunControl *AnalyzerRunControlFactory::create(RunConfiguration *runConfiguration, RunMode mode, QString *errorMessage) -{ - IAnalyzerTool *tool = AnalyzerManager::toolFromRunMode(mode); - if (!tool) { - if (errorMessage) - *errorMessage = tr("No analyzer tool selected"); // never happens - return 0; - } - - QTC_ASSERT(canRun(runConfiguration, mode), return 0); - - AnalyzerStartParameters sp = tool->createStartParameters(runConfiguration, mode); - sp.toolId = tool->id(); - - AnalyzerRunControl *rc = new AnalyzerRunControl(tool, sp, runConfiguration); - return rc; -} - -IRunConfigurationAspect *AnalyzerRunControlFactory::createRunConfigurationAspect(RunConfiguration *rc) -{ - Q_UNUSED(rc); - return new AnalyzerRunConfigurationAspect; -} - -} // namespace Internal -} // namespace Analyzer diff --git a/src/plugins/analyzerbase/analyzerruncontrolfactory.h b/src/plugins/analyzerbase/analyzerruncontrolfactory.h deleted file mode 100644 index 1a041c222d..0000000000 --- a/src/plugins/analyzerbase/analyzerruncontrolfactory.h +++ /dev/null @@ -1,57 +0,0 @@ -/************************************************************************** -** -** Copyright (C) 2013 Kläralvdalens Datakonsult AB, a KDAB Group company. -** Contact: Kläralvdalens Datakonsult AB (info@kdab.com) -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef ANALYZERRUNCONTROLFACTORY_H -#define ANALYZERRUNCONTROLFACTORY_H - -#include - -namespace Analyzer { -namespace Internal { - -class AnalyzerRunControlFactory : public ProjectExplorer::IRunControlFactory -{ - Q_OBJECT -public: - typedef ProjectExplorer::RunConfiguration RunConfiguration; - - explicit AnalyzerRunControlFactory(QObject *parent = 0); - - // IRunControlFactory implementation - bool canRun(RunConfiguration *runConfiguration, ProjectExplorer::RunMode mode) const; - ProjectExplorer::RunControl *create(RunConfiguration *runConfiguration, - ProjectExplorer::RunMode mode, - QString *errorMessage); - ProjectExplorer::IRunConfigurationAspect *createRunConfigurationAspect(ProjectExplorer::RunConfiguration *rc); -}; - -} // namespace Internal -} // namespace Analyzer - -#endif // ANALYZERRUNCONTROLFACTORY_H diff --git a/src/plugins/qmlprofiler/qmlprofiler.pro b/src/plugins/qmlprofiler/qmlprofiler.pro index c2f6f05818..d644e47527 100644 --- a/src/plugins/qmlprofiler/qmlprofiler.pro +++ b/src/plugins/qmlprofiler/qmlprofiler.pro @@ -20,7 +20,8 @@ SOURCES += \ qmlprofilerdatamodel.cpp \ qmlprofilerclientmanager.cpp \ qmlprofilerviewmanager.cpp \ - qmlprofilerstatewidget.cpp + qmlprofilerstatewidget.cpp \ + qmlprofilerruncontrolfactory.cpp HEADERS += \ qmlprofilerconstants.h \ @@ -40,7 +41,8 @@ HEADERS += \ qmlprofilerdatamodel.h \ qmlprofilerclientmanager.h \ qmlprofilerviewmanager.h \ - qmlprofilerstatewidget.h + qmlprofilerstatewidget.h \ + qmlprofilerruncontrolfactory.h RESOURCES += \ qml/qmlprofiler.qrc diff --git a/src/plugins/qmlprofiler/qmlprofiler.qbs b/src/plugins/qmlprofiler/qmlprofiler.qbs index cb136bf4d8..4550ec894f 100644 --- a/src/plugins/qmlprofiler/qmlprofiler.qbs +++ b/src/plugins/qmlprofiler/qmlprofiler.qbs @@ -42,6 +42,8 @@ QtcPlugin { "qmlprofilereventview.h", "qmlprofilerplugin.cpp", "qmlprofilerplugin.h", + "qmlprofilerruncontrolfactory.cpp", + "qmlprofilerruncontrolfactory.h", "qmlprofilerstatemanager.cpp", "qmlprofilerstatemanager.h", "qmlprofilerstatewidget.cpp", diff --git a/src/plugins/qmlprofiler/qmlprofilerplugin.cpp b/src/plugins/qmlprofiler/qmlprofilerplugin.cpp index 4d49ff1d8a..70e016cf09 100644 --- a/src/plugins/qmlprofiler/qmlprofilerplugin.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerplugin.cpp @@ -28,6 +28,7 @@ ****************************************************************************/ #include "qmlprofilerplugin.h" +#include "qmlprofilerruncontrolfactory.h" #include "qmlprofilertool.h" @@ -50,6 +51,8 @@ bool QmlProfilerPlugin::initialize(const QStringList &arguments, QString *errorS modes.append(StartMode(StartRemote)); AnalyzerManager::addTool(new QmlProfilerTool(this), modes); + addAutoReleasedObject(new QmlProfilerRunControlFactory()); + return true; } diff --git a/src/plugins/qmlprofiler/qmlprofilerruncontrolfactory.cpp b/src/plugins/qmlprofiler/qmlprofilerruncontrolfactory.cpp new file mode 100644 index 0000000000..453a37f559 --- /dev/null +++ b/src/plugins/qmlprofiler/qmlprofilerruncontrolfactory.cpp @@ -0,0 +1,91 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +#include "qmlprofilerruncontrolfactory.h" +#include "localqmlprofilerrunner.h" +#include "qmlprofilerengine.h" + +#include +#include +#include +#include +#include + +#include +#include + +#include + +using namespace Analyzer; +using namespace ProjectExplorer; + +namespace QmlProfiler { +namespace Internal { + +QmlProfilerRunControlFactory::QmlProfilerRunControlFactory(QObject *parent) : + IRunControlFactory(parent) +{ +} + +bool QmlProfilerRunControlFactory::canRun(RunConfiguration *runConfiguration, RunMode mode) const +{ + if (mode != QmlProfilerRunMode) + return false; + IAnalyzerTool *tool = AnalyzerManager::toolFromRunMode(mode); + if (tool) + return tool->canRun(runConfiguration, mode); + return false; +} + +RunControl *QmlProfilerRunControlFactory::create(RunConfiguration *runConfiguration, RunMode mode, QString *errorMessage) +{ + IAnalyzerTool *tool = AnalyzerManager::toolFromRunMode(mode); + if (!tool) { + if (errorMessage) + *errorMessage = tr("No analyzer tool selected"); // never happens + return 0; + } + + QTC_ASSERT(canRun(runConfiguration, mode), return 0); + + AnalyzerStartParameters sp = tool->createStartParameters(runConfiguration, mode); + sp.toolId = tool->id(); + + AnalyzerRunControl *rc = new AnalyzerRunControl(tool, sp, runConfiguration); + return rc; +} + +IRunConfigurationAspect *QmlProfilerRunControlFactory::createRunConfigurationAspect(RunConfiguration *rc) +{ + Q_UNUSED(rc); + return new AnalyzerRunConfigurationAspect; +} + +} // namespace Internal +} // namespace QmlProfiler diff --git a/src/plugins/qmlprofiler/qmlprofilerruncontrolfactory.h b/src/plugins/qmlprofiler/qmlprofilerruncontrolfactory.h new file mode 100644 index 0000000000..a7f6d9ffe3 --- /dev/null +++ b/src/plugins/qmlprofiler/qmlprofilerruncontrolfactory.h @@ -0,0 +1,58 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +#ifndef QMLPROFILERRUNCONTROLFACTORY_H +#define QMLPROFILERRUNCONTROLFACTORY_H + +#include + +namespace QmlProfiler { +namespace Internal { + +class QmlProfilerRunControlFactory : public ProjectExplorer::IRunControlFactory +{ + Q_OBJECT +public: + typedef ProjectExplorer::RunConfiguration RunConfiguration; + + explicit QmlProfilerRunControlFactory(QObject *parent = 0); + + // IRunControlFactory implementation + bool canRun(RunConfiguration *runConfiguration, ProjectExplorer::RunMode mode) const; + + ProjectExplorer::RunControl *create(RunConfiguration *runConfiguration, + ProjectExplorer::RunMode mode, + QString *errorMessage); + ProjectExplorer::IRunConfigurationAspect *createRunConfigurationAspect(ProjectExplorer::RunConfiguration *rc); +}; + +} // namespace Internal +} // namespace QmlProfiler + +#endif // QMLPROFILERRUNCONTROLFACTORY_H diff --git a/src/plugins/valgrind/valgrind.pro b/src/plugins/valgrind/valgrind.pro index e3ebcb1e99..8d504b2ff5 100644 --- a/src/plugins/valgrind/valgrind.pro +++ b/src/plugins/valgrind/valgrind.pro @@ -29,7 +29,8 @@ HEADERS += \ memcheckengine.h \ memcheckerrorview.h \ suppressiondialog.h \ - valgrindtool.h + valgrindtool.h \ + valgrindruncontrolfactory.h SOURCES += \ valgrindplugin.cpp \ @@ -52,7 +53,8 @@ SOURCES += \ memcheckengine.cpp \ memcheckerrorview.cpp \ suppressiondialog.cpp \ - valgrindtool.cpp + valgrindtool.cpp \ + valgrindruncontrolfactory.cpp FORMS += \ valgrindconfigwidget.ui diff --git a/src/plugins/valgrind/valgrind.qbs b/src/plugins/valgrind/valgrind.qbs index aeb1ce262a..0f6d1a9a89 100644 --- a/src/plugins/valgrind/valgrind.qbs +++ b/src/plugins/valgrind/valgrind.qbs @@ -48,6 +48,8 @@ QtcPlugin { "valgrindplugin.h", "valgrindprocess.cpp", "valgrindprocess.h", + "valgrindruncontrolfactory.cpp", + "valgrindruncontrolfactory.h", "valgrindrunner.cpp", "valgrindrunner.h", "valgrindsettings.cpp", diff --git a/src/plugins/valgrind/valgrindplugin.cpp b/src/plugins/valgrind/valgrindplugin.cpp index 005d0a4c4f..88a0232b4d 100644 --- a/src/plugins/valgrind/valgrindplugin.cpp +++ b/src/plugins/valgrind/valgrindplugin.cpp @@ -32,6 +32,7 @@ #include "callgrindtool.h" #include "memchecktool.h" +#include "valgrindruncontrolfactory.h" #include #include @@ -99,6 +100,8 @@ bool ValgrindPlugin::initialize(const QStringList &, QString *) AnalyzerManager::addTool(new MemcheckTool(this), modes); AnalyzerManager::addTool(new CallgrindTool(this), modes); + addAutoReleasedObject(new ValgrindRunControlFactory()); + return true; } diff --git a/src/plugins/valgrind/valgrindruncontrolfactory.cpp b/src/plugins/valgrind/valgrindruncontrolfactory.cpp new file mode 100644 index 0000000000..4fbbb40ea0 --- /dev/null +++ b/src/plugins/valgrind/valgrindruncontrolfactory.cpp @@ -0,0 +1,86 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +#include "valgrindruncontrolfactory.h" + +#include +#include +#include +#include +#include + +#include + +using namespace Analyzer; +using namespace ProjectExplorer; + +namespace Valgrind { +namespace Internal { + +ValgrindRunControlFactory::ValgrindRunControlFactory(QObject *parent) : + IRunControlFactory(parent) +{ +} + +bool ValgrindRunControlFactory::canRun(RunConfiguration *runConfiguration, RunMode mode) const +{ + if (mode != CallgrindRunMode && mode != MemcheckRunMode) + return false; + IAnalyzerTool *tool = AnalyzerManager::toolFromRunMode(mode); + if (tool) + return tool->canRun(runConfiguration, mode); + return false; +} + +RunControl *ValgrindRunControlFactory::create(RunConfiguration *runConfiguration, RunMode mode, QString *errorMessage) +{ + IAnalyzerTool *tool = AnalyzerManager::toolFromRunMode(mode); + if (!tool) { + if (errorMessage) + *errorMessage = tr("No analyzer tool selected"); // never happens + return 0; + } + + QTC_ASSERT(canRun(runConfiguration, mode), return 0); + + AnalyzerStartParameters sp = tool->createStartParameters(runConfiguration, mode); + sp.toolId = tool->id(); + + AnalyzerRunControl *rc = new AnalyzerRunControl(tool, sp, runConfiguration); + return rc; +} + +IRunConfigurationAspect *ValgrindRunControlFactory::createRunConfigurationAspect(RunConfiguration *rc) +{ + Q_UNUSED(rc); + return new AnalyzerRunConfigurationAspect; +} + +} // namespace Internal +} // namespace Valgrind diff --git a/src/plugins/valgrind/valgrindruncontrolfactory.h b/src/plugins/valgrind/valgrindruncontrolfactory.h new file mode 100644 index 0000000000..74cd0d79a4 --- /dev/null +++ b/src/plugins/valgrind/valgrindruncontrolfactory.h @@ -0,0 +1,58 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +#ifndef VALGRINDRUNCONTROLFACTORY_H +#define VALGRINDRUNCONTROLFACTORY_H + +#include + +namespace Valgrind { +namespace Internal { + +class ValgrindRunControlFactory : public ProjectExplorer::IRunControlFactory +{ + Q_OBJECT +public: + typedef ProjectExplorer::RunConfiguration RunConfiguration; + + explicit ValgrindRunControlFactory(QObject *parent = 0); + + // IRunControlFactory implementation + bool canRun(RunConfiguration *runConfiguration, ProjectExplorer::RunMode mode) const; + + ProjectExplorer::RunControl *create(RunConfiguration *runConfiguration, + ProjectExplorer::RunMode mode, + QString *errorMessage); + ProjectExplorer::IRunConfigurationAspect *createRunConfigurationAspect(ProjectExplorer::RunConfiguration *rc); +}; + +} // namespace Internal +} // namespace Valgrind + +#endif // VALGRINDRUNCONTROLFACTORY_H -- cgit v1.2.1