Commit 1fb755bb authored by hjk's avatar hjk

Analyzer: Remove intermediate "ValgrindTool" inheritance level

It's an empty shell nowadays.

Change-Id: I661735eccf035b58cc405905a58bd74e787e6abc
Reviewed-by: default avatarAurindam Jana <aurindam.jana@digia.com>
parent 2ba88d1c
......@@ -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);
......
......@@ -30,14 +30,14 @@
#ifndef CALLGRINDTOOL_H
#define CALLGRINDTOOL_H
#include "valgrindtool.h"
#include <analyzerbase/ianalyzertool.h>
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();
......
......@@ -179,7 +179,7 @@ static void initKindFilterAction(QAction *action, const QList<int> &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");
......
......@@ -31,18 +31,13 @@
#ifndef MEMCHECKTOOL_H
#define MEMCHECKTOOL_H
#include "valgrindtool.h"
#include <analyzerbase/ianalyzertool.h>
#include <QSortFilterProxyModel>
#include <QSharedPointer>
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();
......
......@@ -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 += \
......
......@@ -54,8 +54,6 @@ QtcPlugin {
"valgrindrunner.h",
"valgrindsettings.cpp",
"valgrindsettings.h",
"valgrindtool.cpp",
"valgrindtool.h",
"workarounds.cpp",
"workarounds.h",
"callgrind/callgrindabstractmodel.h",
......
/**************************************************************************
**
** 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
/**************************************************************************
**
** 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 <analyzerbase/ianalyzertool.h>
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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment