diff --git a/src/plugins/valgrind/callgrindtool.cpp b/src/plugins/valgrind/callgrindtool.cpp index 9e5d6e2026a..bbc7bacb156 100644 --- a/src/plugins/valgrind/callgrindtool.cpp +++ b/src/plugins/valgrind/callgrindtool.cpp @@ -95,6 +95,7 @@ using namespace Analyzer; using namespace Core; using namespace Valgrind::Callgrind; +using namespace ProjectExplorer; namespace Valgrind { namespace Internal { @@ -499,7 +500,7 @@ static QToolButton *createToolButton(QAction *action) } CallgrindTool::CallgrindTool(QObject *parent) - : ValgrindTool(parent) + : IAnalyzerTool(parent) { d = new CallgrindToolPrivate(this); setObjectName(QLatin1String("CallgrindTool")); @@ -518,9 +519,14 @@ Core::Id CallgrindTool::id() const return Core::Id("Callgrind"); } -ProjectExplorer::RunMode CallgrindTool::runMode() const +RunMode CallgrindTool::runMode() const { - return ProjectExplorer::CallgrindRunMode; + return CallgrindRunMode; +} + +bool CallgrindTool::canRun(RunConfiguration *, RunMode mode) const +{ + return mode == CallgrindRunMode; } QString CallgrindTool::displayName() const @@ -564,13 +570,13 @@ void CallgrindTool::extensionsInitialized() } IAnalyzerEngine *CallgrindTool::createEngine(const AnalyzerStartParameters &sp, - ProjectExplorer::RunConfiguration *runConfiguration) + RunConfiguration *runConfiguration) { return d->createEngine(sp, runConfiguration); } IAnalyzerEngine *CallgrindToolPrivate::createEngine(const AnalyzerStartParameters &sp, - ProjectExplorer::RunConfiguration *runConfiguration) + RunConfiguration *runConfiguration) { CallgrindEngine *engine = new CallgrindEngine(sp, runConfiguration); diff --git a/src/plugins/valgrind/callgrindtool.h b/src/plugins/valgrind/callgrindtool.h index 9c8c2cefc29..b913bbb3c94 100644 --- a/src/plugins/valgrind/callgrindtool.h +++ b/src/plugins/valgrind/callgrindtool.h @@ -30,14 +30,14 @@ #ifndef CALLGRINDTOOL_H #define CALLGRINDTOOL_H -#include "valgrindtool.h" +#include namespace Valgrind { namespace Internal { class CallgrindToolPrivate; -class CallgrindTool : public ValgrindTool +class CallgrindTool : public Analyzer::IAnalyzerTool { Q_OBJECT @@ -50,6 +50,7 @@ public: QString displayName() const; QString description() const; ToolMode toolMode() const; + bool canRun(ProjectExplorer::RunConfiguration *, ProjectExplorer::RunMode mode) const; void extensionsInitialized(); diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index b93fc75f06e..a3366787200 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -179,7 +179,7 @@ static void initKindFilterAction(QAction *action, const QList &kinds) } MemcheckTool::MemcheckTool(QObject *parent) - : ValgrindTool(parent) + : IAnalyzerTool(parent) { m_settings = 0; m_errorModel = 0; @@ -286,6 +286,11 @@ RunMode MemcheckTool::runMode() const return MemcheckRunMode; } +bool MemcheckTool::canRun(RunConfiguration *, RunMode mode) const +{ + return mode == MemcheckRunMode; +} + QString MemcheckTool::displayName() const { return tr("Valgrind Memory Analyzer"); diff --git a/src/plugins/valgrind/memchecktool.h b/src/plugins/valgrind/memchecktool.h index 26c632c8f24..3603e77ef6e 100644 --- a/src/plugins/valgrind/memchecktool.h +++ b/src/plugins/valgrind/memchecktool.h @@ -31,18 +31,13 @@ #ifndef MEMCHECKTOOL_H #define MEMCHECKTOOL_H -#include "valgrindtool.h" +#include #include -#include QT_BEGIN_NAMESPACE -class QItemSelection; -class QTreeView; class QModelIndex; class QAction; -class QSpinBox; -class QCheckBox; class QMenu; QT_END_NAMESPACE @@ -82,7 +77,7 @@ private: bool m_filterExternalIssues; }; -class MemcheckTool : public ValgrindTool +class MemcheckTool : public Analyzer::IAnalyzerTool { Q_OBJECT @@ -93,6 +88,7 @@ public: ProjectExplorer::RunMode runMode() const; QString displayName() const; QString description() const; + bool canRun(ProjectExplorer::RunConfiguration *, ProjectExplorer::RunMode mode) const; // Create the valgrind settings (for all valgrind tools) Analyzer::AbstractAnalyzerSubConfig *createGlobalSettings(); diff --git a/src/plugins/valgrind/valgrind.pro b/src/plugins/valgrind/valgrind.pro index 8d504b2ff50..597a88970dc 100644 --- a/src/plugins/valgrind/valgrind.pro +++ b/src/plugins/valgrind/valgrind.pro @@ -29,7 +29,6 @@ HEADERS += \ memcheckengine.h \ memcheckerrorview.h \ suppressiondialog.h \ - valgrindtool.h \ valgrindruncontrolfactory.h SOURCES += \ @@ -53,7 +52,6 @@ SOURCES += \ memcheckengine.cpp \ memcheckerrorview.cpp \ suppressiondialog.cpp \ - valgrindtool.cpp \ valgrindruncontrolfactory.cpp FORMS += \ diff --git a/src/plugins/valgrind/valgrind.qbs b/src/plugins/valgrind/valgrind.qbs index 0f6d1a9a89b..6c71bf70267 100644 --- a/src/plugins/valgrind/valgrind.qbs +++ b/src/plugins/valgrind/valgrind.qbs @@ -54,8 +54,6 @@ QtcPlugin { "valgrindrunner.h", "valgrindsettings.cpp", "valgrindsettings.h", - "valgrindtool.cpp", - "valgrindtool.h", "workarounds.cpp", "workarounds.h", "callgrind/callgrindabstractmodel.h", diff --git a/src/plugins/valgrind/valgrindtool.cpp b/src/plugins/valgrind/valgrindtool.cpp deleted file mode 100644 index 8b58b863b37..00000000000 --- a/src/plugins/valgrind/valgrindtool.cpp +++ /dev/null @@ -1,48 +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 "valgrindtool.h" - -using namespace ProjectExplorer; - -namespace Valgrind { -namespace Internal { - -ValgrindTool::ValgrindTool(QObject *parent) : - Analyzer::IAnalyzerTool(parent) -{ -} - -bool ValgrindTool::canRun(RunConfiguration *, RunMode mode) const -{ - return mode == runMode(); -} - -} // namespace Internal -} // namespace Valgrind diff --git a/src/plugins/valgrind/valgrindtool.h b/src/plugins/valgrind/valgrindtool.h deleted file mode 100644 index fc1d280757c..00000000000 --- a/src/plugins/valgrind/valgrindtool.h +++ /dev/null @@ -1,51 +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 VALGRINDTOOL_H -#define VALGRINDTOOL_H - -#include - -namespace Valgrind { -namespace Internal { - -class ValgrindTool : public Analyzer::IAnalyzerTool -{ - Q_OBJECT -public: - explicit ValgrindTool(QObject *parent); - - bool canRun(ProjectExplorer::RunConfiguration *runConfiguration, - ProjectExplorer::RunMode mode) const; -}; - -} // namespace Internal -} // namespace Valgrind - -#endif // VALGRINDTOOL_H