forked from qt-creator/qt-creator
ProjectExplorer/Analyzer: Merge RunConfigurationAspects
The Analyzer implementation is now simple and still generic enough to serve as general base. Change-Id: I050a21919bf128929b77a64da1f46d157691d849 Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
@@ -11,7 +11,6 @@ SOURCES += \
|
||||
analyzerplugin.cpp \
|
||||
analyzerruncontrol.cpp \
|
||||
analyzermanager.cpp \
|
||||
analyzersettings.cpp \
|
||||
analyzerrunconfigwidget.cpp \
|
||||
analyzerutils.cpp \
|
||||
startremotedialog.cpp
|
||||
@@ -23,7 +22,6 @@ HEADERS += \
|
||||
analyzerplugin.h \
|
||||
analyzerruncontrol.h \
|
||||
analyzermanager.h \
|
||||
analyzersettings.h \
|
||||
analyzerstartparameters.h \
|
||||
analyzerrunconfigwidget.h \
|
||||
analyzerutils.h \
|
||||
|
||||
@@ -24,8 +24,6 @@ QtcPlugin {
|
||||
"analyzerrunconfigwidget.h",
|
||||
"analyzerruncontrol.cpp",
|
||||
"analyzerruncontrol.h",
|
||||
"analyzersettings.cpp",
|
||||
"analyzersettings.h",
|
||||
"analyzerstartparameters.h",
|
||||
"analyzerutils.cpp",
|
||||
"analyzerutils.h",
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
|
||||
#include "analyzerplugin.h"
|
||||
#include "ianalyzertool.h"
|
||||
#include "analyzersettings.h"
|
||||
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/findplaceholder.h>
|
||||
|
||||
@@ -41,9 +41,8 @@
|
||||
#include <QPushButton>
|
||||
|
||||
namespace Analyzer {
|
||||
namespace Internal {
|
||||
|
||||
AnalyzerRunConfigWidget::AnalyzerRunConfigWidget(AnalyzerRunConfigurationAspect *aspect)
|
||||
AnalyzerRunConfigWidget::AnalyzerRunConfigWidget(ProjectExplorer::IRunConfigurationAspect *aspect)
|
||||
{
|
||||
m_aspect = aspect;
|
||||
m_config = aspect->projectSettings();
|
||||
@@ -106,8 +105,7 @@ void AnalyzerRunConfigWidget::chooseSettings(int setting)
|
||||
void AnalyzerRunConfigWidget::restoreGlobal()
|
||||
{
|
||||
QTC_ASSERT(m_aspect, return);
|
||||
m_aspect->resetCustomToGlobalSettings();
|
||||
m_aspect->resetProjectToGlobalSettings();
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Analyzer
|
||||
|
||||
@@ -28,10 +28,12 @@
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef ANALYZER_INTERNAL_ANALYZERRUNCONFIGWIDGET_H
|
||||
#define ANALYZER_INTERNAL_ANALYZERRUNCONFIGWIDGET_H
|
||||
#ifndef ANALYZERRUNCONFIGWIDGET_H
|
||||
#define ANALYZERRUNCONFIGWIDGET_H
|
||||
|
||||
#include "analyzersettings.h"
|
||||
#include "analyzerbase_global.h"
|
||||
|
||||
#include <projectexplorer/runconfiguration.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QComboBox;
|
||||
@@ -41,14 +43,13 @@ QT_END_NAMESPACE
|
||||
namespace Utils { class DetailsWidget; }
|
||||
|
||||
namespace Analyzer {
|
||||
namespace Internal {
|
||||
|
||||
class AnalyzerRunConfigWidget : public ProjectExplorer::RunConfigWidget
|
||||
class ANALYZER_EXPORT AnalyzerRunConfigWidget : public ProjectExplorer::RunConfigWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
AnalyzerRunConfigWidget(AnalyzerRunConfigurationAspect *aspect);
|
||||
AnalyzerRunConfigWidget(ProjectExplorer::IRunConfigurationAspect *aspect);
|
||||
|
||||
QString displayName() const;
|
||||
|
||||
@@ -58,14 +59,13 @@ private slots:
|
||||
|
||||
private:
|
||||
QWidget *m_configWidget;
|
||||
AnalyzerRunConfigurationAspect *m_aspect;
|
||||
ISettingsAspect *m_config;
|
||||
ProjectExplorer::IRunConfigurationAspect *m_aspect;
|
||||
ProjectExplorer::ISettingsAspect *m_config;
|
||||
QComboBox *m_settingsCombo;
|
||||
QPushButton *m_restoreButton;
|
||||
Utils::DetailsWidget *m_details;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Analyzer
|
||||
|
||||
#endif // ANALYZER_INTERNAL_ANALYZERRUNCONFIGWIDGET_H
|
||||
#endif // ANALYZERRUNCONFIGWIDGET_H
|
||||
|
||||
@@ -1,117 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
** Author: Milian Wolff, KDAB (milian.wolff@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 "analyzersettings.h"
|
||||
|
||||
#include "analyzermanager.h"
|
||||
#include "analyzerrunconfigwidget.h"
|
||||
#include "ianalyzertool.h"
|
||||
#include "analyzerplugin.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QSettings>
|
||||
|
||||
using namespace Analyzer::Internal;
|
||||
|
||||
static const char useGlobalC[] = "Analyzer.Project.UseGlobal";
|
||||
|
||||
namespace Analyzer {
|
||||
|
||||
ISettingsAspect *ISettingsAspect::clone() const
|
||||
{
|
||||
ISettingsAspect *other = create();
|
||||
QVariantMap data;
|
||||
toMap(data);
|
||||
other->fromMap(data);
|
||||
return other;
|
||||
}
|
||||
|
||||
AnalyzerRunConfigurationAspect::AnalyzerRunConfigurationAspect(ISettingsAspect *projectSettings,
|
||||
ISettingsAspect *globalSettings)
|
||||
{
|
||||
m_useGlobalSettings = true;
|
||||
m_projectSettings = projectSettings;
|
||||
m_globalSettings = globalSettings;
|
||||
}
|
||||
|
||||
ISettingsAspect *AnalyzerRunConfigurationAspect::currentSettings() const
|
||||
{
|
||||
return m_useGlobalSettings ? m_globalSettings : m_projectSettings;
|
||||
}
|
||||
|
||||
AnalyzerRunConfigurationAspect::~AnalyzerRunConfigurationAspect()
|
||||
{
|
||||
delete m_projectSettings;
|
||||
}
|
||||
|
||||
void AnalyzerRunConfigurationAspect::fromMap(const QVariantMap &map)
|
||||
{
|
||||
m_projectSettings->fromMap(map);
|
||||
m_useGlobalSettings = map.value(QLatin1String(useGlobalC), true).toBool();
|
||||
}
|
||||
|
||||
void AnalyzerRunConfigurationAspect::toMap(QVariantMap &map) const
|
||||
{
|
||||
m_projectSettings->toMap(map);
|
||||
map.insert(QLatin1String(useGlobalC), m_useGlobalSettings);
|
||||
}
|
||||
|
||||
AnalyzerRunConfigurationAspect *AnalyzerRunConfigurationAspect::clone(
|
||||
ProjectExplorer::RunConfiguration *parent) const
|
||||
{
|
||||
Q_UNUSED(parent)
|
||||
AnalyzerRunConfigurationAspect *other
|
||||
= new AnalyzerRunConfigurationAspect(m_projectSettings->clone(), m_globalSettings);
|
||||
other->m_useGlobalSettings = m_useGlobalSettings;
|
||||
return other;
|
||||
}
|
||||
|
||||
void AnalyzerRunConfigurationAspect::setUsingGlobalSettings(bool value)
|
||||
{
|
||||
m_useGlobalSettings = value;
|
||||
}
|
||||
|
||||
void AnalyzerRunConfigurationAspect::resetCustomToGlobalSettings()
|
||||
{
|
||||
ISettingsAspect *global = globalSettings();
|
||||
QTC_ASSERT(global, return);
|
||||
QVariantMap map;
|
||||
global->toMap(map);
|
||||
m_projectSettings->fromMap(map);
|
||||
}
|
||||
|
||||
ProjectExplorer::RunConfigWidget *AnalyzerRunConfigurationAspect::createConfigurationWidget()
|
||||
{
|
||||
return new AnalyzerRunConfigWidget(this);
|
||||
}
|
||||
|
||||
} // namespace Analyzer
|
||||
@@ -1,107 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
** Author: Milian Wolff, KDAB (milian.wolff@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 ANALYZER_INTERNAL_ANALYZERSETTINGS_H
|
||||
#define ANALYZER_INTERNAL_ANALYZERSETTINGS_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include "analyzerbase_global.h"
|
||||
|
||||
#include <projectexplorer/runconfiguration.h>
|
||||
|
||||
namespace Analyzer {
|
||||
|
||||
/**
|
||||
* Subclass this to add configuration to your analyzer tool.
|
||||
*
|
||||
* If global and project-specific settings differ for your tool,
|
||||
* create one subclass for each.
|
||||
*/
|
||||
class ANALYZER_EXPORT ISettingsAspect : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ISettingsAspect() {}
|
||||
|
||||
/// Converts current object into map for storage.
|
||||
virtual void toMap(QVariantMap &map) const = 0;
|
||||
/// Read object state from @p map.
|
||||
virtual void fromMap(const QVariantMap &map) = 0;
|
||||
|
||||
/// Create a configuration widget for this settings aspect.
|
||||
virtual QWidget *createConfigWidget(QWidget *parent) = 0;
|
||||
/// "Virtual default constructor"
|
||||
virtual ISettingsAspect *create() const = 0;
|
||||
/// "Virtual copy constructor"
|
||||
ISettingsAspect *clone() const;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Settings associated with a single project/run configuration
|
||||
*
|
||||
*/
|
||||
class ANALYZER_EXPORT AnalyzerRunConfigurationAspect
|
||||
: public ProjectExplorer::IRunConfigurationAspect
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
AnalyzerRunConfigurationAspect(ISettingsAspect *projectSettings,
|
||||
ISettingsAspect *globalSettings);
|
||||
|
||||
~AnalyzerRunConfigurationAspect();
|
||||
|
||||
AnalyzerRunConfigurationAspect *clone(ProjectExplorer::RunConfiguration *parent) const;
|
||||
|
||||
bool isUsingGlobalSettings() const { return m_useGlobalSettings; }
|
||||
void setUsingGlobalSettings(bool value);
|
||||
void resetCustomToGlobalSettings();
|
||||
|
||||
ISettingsAspect *projectSettings() const { return m_projectSettings; }
|
||||
ISettingsAspect *globalSettings() const { return m_globalSettings; }
|
||||
ISettingsAspect *currentSettings() const;
|
||||
ProjectExplorer::RunConfigWidget *createConfigurationWidget();
|
||||
|
||||
protected:
|
||||
void fromMap(const QVariantMap &map);
|
||||
void toMap(QVariantMap &map) const;
|
||||
|
||||
private:
|
||||
bool m_useGlobalSettings;
|
||||
ISettingsAspect *m_projectSettings;
|
||||
ISettingsAspect *m_globalSettings;
|
||||
};
|
||||
|
||||
} // namespace Analyzer
|
||||
|
||||
#endif // ANALYZER_INTERNAL_ANALYZERSETTINGS_H
|
||||
@@ -204,14 +204,14 @@ void DebuggerMainWindowPrivate::updateUiForRunConfiguration(RunConfiguration *rc
|
||||
{
|
||||
if (m_previousRunConfiguration)
|
||||
disconnect(m_previousRunConfiguration->extraAspect<Debugger::DebuggerRunConfigurationAspect>(),
|
||||
SIGNAL(debuggersChanged()),
|
||||
SIGNAL(requestRunActionsUpdate()),
|
||||
this, SLOT(updateUiForCurrentRunConfiguration()));
|
||||
m_previousRunConfiguration = rc;
|
||||
updateUiForCurrentRunConfiguration();
|
||||
if (!rc)
|
||||
return;
|
||||
connect(m_previousRunConfiguration->extraAspect<Debugger::DebuggerRunConfigurationAspect>(),
|
||||
SIGNAL(debuggersChanged()),
|
||||
SIGNAL(requestRunActionsUpdate()),
|
||||
SLOT(updateUiForCurrentRunConfiguration()));
|
||||
}
|
||||
|
||||
|
||||
@@ -194,48 +194,32 @@ void DebuggerRunConfigWidget::useMultiProcessToggled(bool on)
|
||||
|
||||
DebuggerRunConfigurationAspect::DebuggerRunConfigurationAspect(
|
||||
ProjectExplorer::RunConfiguration *rc) :
|
||||
m_runConfiguration(rc),
|
||||
IRunConfigurationAspect(rc),
|
||||
m_useCppDebugger(AutoEnabledLanguage),
|
||||
m_useQmlDebugger(AutoEnabledLanguage),
|
||||
m_qmlDebugServerPort(Constants::QML_DEFAULT_DEBUG_SERVER_PORT),
|
||||
m_useMultiProcess(false)
|
||||
{
|
||||
ctor();
|
||||
}
|
||||
|
||||
DebuggerRunConfigurationAspect::DebuggerRunConfigurationAspect(
|
||||
ProjectExplorer::RunConfiguration *runConfiguration,
|
||||
const DebuggerRunConfigurationAspect *other)
|
||||
: m_runConfiguration(runConfiguration),
|
||||
m_useCppDebugger(other->m_useCppDebugger),
|
||||
m_useQmlDebugger(other->m_useQmlDebugger),
|
||||
m_qmlDebugServerPort(other->m_qmlDebugServerPort),
|
||||
m_useMultiProcess(other->m_useMultiProcess)
|
||||
{
|
||||
ctor();
|
||||
}
|
||||
|
||||
ProjectExplorer::RunConfiguration *DebuggerRunConfigurationAspect::runConfiguration()
|
||||
{
|
||||
return m_runConfiguration;
|
||||
setId("DebuggerAspect");
|
||||
setDisplayName(tr("Debugger settings"));
|
||||
}
|
||||
|
||||
void DebuggerRunConfigurationAspect::setUseQmlDebugger(bool value)
|
||||
{
|
||||
m_useQmlDebugger = value ? EnabledLanguage : DisabledLanguage;
|
||||
emit debuggersChanged();
|
||||
emit requestRunActionsUpdate();
|
||||
}
|
||||
|
||||
void DebuggerRunConfigurationAspect::setUseCppDebugger(bool value)
|
||||
{
|
||||
m_useCppDebugger = value ? EnabledLanguage : DisabledLanguage;
|
||||
emit debuggersChanged();
|
||||
emit requestRunActionsUpdate();
|
||||
}
|
||||
|
||||
bool DebuggerRunConfigurationAspect::useCppDebugger() const
|
||||
{
|
||||
if (m_useCppDebugger == DebuggerRunConfigurationAspect::AutoEnabledLanguage)
|
||||
return m_runConfiguration->target()->project()->projectLanguages().contains(
|
||||
return runConfiguration()->target()->project()->projectLanguages().contains(
|
||||
ProjectExplorer::Constants::LANG_CXX);
|
||||
return m_useCppDebugger == DebuggerRunConfigurationAspect::EnabledLanguage;
|
||||
}
|
||||
@@ -243,7 +227,7 @@ bool DebuggerRunConfigurationAspect::useCppDebugger() const
|
||||
bool DebuggerRunConfigurationAspect::useQmlDebugger() const
|
||||
{
|
||||
if (m_useQmlDebugger == DebuggerRunConfigurationAspect::AutoEnabledLanguage)
|
||||
return m_runConfiguration->target()->project()->projectLanguages().contains(
|
||||
return runConfiguration()->target()->project()->projectLanguages().contains(
|
||||
ProjectExplorer::Constants::LANG_QMLJS);
|
||||
return m_useQmlDebugger == DebuggerRunConfigurationAspect::EnabledLanguage;
|
||||
}
|
||||
@@ -270,7 +254,7 @@ void DebuggerRunConfigurationAspect::setUseMultiProcess(bool value)
|
||||
|
||||
bool DebuggerRunConfigurationAspect::isQmlDebuggingSpinboxSuppressed() const
|
||||
{
|
||||
ProjectExplorer::Kit *k = m_runConfiguration->target()->kit();
|
||||
ProjectExplorer::Kit *k = runConfiguration()->target()->kit();
|
||||
ProjectExplorer::IDevice::ConstPtr dev = ProjectExplorer::DeviceKitInformation::device(k);
|
||||
if (dev.isNull())
|
||||
return false;
|
||||
@@ -304,10 +288,10 @@ void DebuggerRunConfigurationAspect::fromMap(const QVariantMap &map)
|
||||
m_useMultiProcess = map.value(QLatin1String(USE_MULTIPROCESS_KEY), false).toBool();
|
||||
}
|
||||
|
||||
DebuggerRunConfigurationAspect *DebuggerRunConfigurationAspect::clone(
|
||||
ProjectExplorer::RunConfiguration *parent) const
|
||||
DebuggerRunConfigurationAspect *DebuggerRunConfigurationAspect::create
|
||||
(ProjectExplorer::RunConfiguration *runConfiguration) const
|
||||
{
|
||||
return new DebuggerRunConfigurationAspect(parent, this);
|
||||
return new DebuggerRunConfigurationAspect(runConfiguration);
|
||||
}
|
||||
|
||||
ProjectExplorer::RunConfigWidget *DebuggerRunConfigurationAspect::createConfigurationWidget()
|
||||
@@ -315,15 +299,6 @@ ProjectExplorer::RunConfigWidget *DebuggerRunConfigurationAspect::createConfigur
|
||||
return new Internal::DebuggerRunConfigWidget(this);
|
||||
}
|
||||
|
||||
void DebuggerRunConfigurationAspect::ctor()
|
||||
{
|
||||
setId("DebuggerAspect");
|
||||
setDisplayName(tr("Debugger settings"));
|
||||
|
||||
connect(this, SIGNAL(debuggersChanged()),
|
||||
m_runConfiguration, SIGNAL(requestRunActionsUpdate()));
|
||||
}
|
||||
|
||||
} // namespace Debugger
|
||||
|
||||
|
||||
|
||||
@@ -45,8 +45,7 @@ class DEBUGGER_EXPORT DebuggerRunConfigurationAspect
|
||||
|
||||
public:
|
||||
DebuggerRunConfigurationAspect(ProjectExplorer::RunConfiguration *runConfiguration);
|
||||
DebuggerRunConfigurationAspect(ProjectExplorer::RunConfiguration *runConfiguration,
|
||||
const DebuggerRunConfigurationAspect *other);
|
||||
DebuggerRunConfigurationAspect *create(ProjectExplorer::RunConfiguration *runConfiguration) const;
|
||||
|
||||
enum DebuggerLanguageStatus {
|
||||
DisabledLanguage = 0,
|
||||
@@ -57,7 +56,6 @@ public:
|
||||
void fromMap(const QVariantMap &map);
|
||||
void toMap(QVariantMap &map) const;
|
||||
|
||||
DebuggerRunConfigurationAspect *clone(ProjectExplorer::RunConfiguration *parent) const;
|
||||
ProjectExplorer::RunConfigWidget *createConfigurationWidget();
|
||||
|
||||
bool useCppDebugger() const;
|
||||
@@ -69,15 +67,8 @@ public:
|
||||
bool useMultiProcess() const;
|
||||
void setUseMultiProcess(bool on);
|
||||
bool isQmlDebuggingSpinboxSuppressed() const;
|
||||
ProjectExplorer::RunConfiguration *runConfiguration();
|
||||
|
||||
signals:
|
||||
void debuggersChanged();
|
||||
|
||||
private:
|
||||
void ctor();
|
||||
|
||||
ProjectExplorer::RunConfiguration *m_runConfiguration;
|
||||
DebuggerLanguageStatus m_useCppDebugger;
|
||||
DebuggerLanguageStatus m_useQmlDebugger;
|
||||
uint m_qmlDebugServerPort;
|
||||
|
||||
@@ -43,21 +43,13 @@ namespace ProjectExplorer {
|
||||
// EnvironmentAspect:
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
EnvironmentAspect::EnvironmentAspect(RunConfiguration *rc) :
|
||||
m_base(-1),
|
||||
m_runConfiguration(rc)
|
||||
EnvironmentAspect::EnvironmentAspect(RunConfiguration *runConfig)
|
||||
: IRunConfigurationAspect(runConfig), m_base(-1)
|
||||
{
|
||||
QTC_CHECK(m_runConfiguration);
|
||||
setDisplayName(tr("Run Environment"));
|
||||
setId("EnvironmentAspect");
|
||||
}
|
||||
|
||||
EnvironmentAspect::EnvironmentAspect(const EnvironmentAspect *other, RunConfiguration *parent) :
|
||||
m_base(other->m_base),
|
||||
m_changes(other->m_changes),
|
||||
m_runConfiguration(parent)
|
||||
{ }
|
||||
|
||||
RunConfigWidget *EnvironmentAspect::createConfigurationWidget()
|
||||
{
|
||||
return new EnvironmentAspectWidget(this);
|
||||
|
||||
@@ -49,8 +49,6 @@ public:
|
||||
// IRunConfigurationAspect:
|
||||
RunConfigWidget *createConfigurationWidget();
|
||||
|
||||
virtual RunConfiguration *runConfiguration() const { return m_runConfiguration; }
|
||||
|
||||
virtual QList<int> possibleBaseEnvironments() const = 0;
|
||||
virtual QString baseEnvironmentDisplayName(int base) const = 0;
|
||||
|
||||
@@ -69,15 +67,13 @@ signals:
|
||||
void environmentChanged();
|
||||
|
||||
protected:
|
||||
EnvironmentAspect(const EnvironmentAspect *other, RunConfiguration *parent);
|
||||
EnvironmentAspect(RunConfiguration *rc);
|
||||
explicit EnvironmentAspect(RunConfiguration *rc);
|
||||
void fromMap(const QVariantMap &map);
|
||||
void toMap(QVariantMap &map) const;
|
||||
|
||||
private:
|
||||
mutable int m_base;
|
||||
QList<Utils::EnvironmentItem> m_changes;
|
||||
RunConfiguration *m_runConfiguration;
|
||||
};
|
||||
|
||||
} // namespace ProjectExplorer
|
||||
|
||||
@@ -88,22 +88,16 @@ void LocalEnvironmentAspect::buildEnvironmentHasChanged()
|
||||
emit environmentChanged();
|
||||
}
|
||||
|
||||
LocalEnvironmentAspect::LocalEnvironmentAspect(RunConfiguration *rc) :
|
||||
EnvironmentAspect(rc)
|
||||
LocalEnvironmentAspect::LocalEnvironmentAspect(RunConfiguration *parent) :
|
||||
EnvironmentAspect(parent)
|
||||
{
|
||||
connect(rc->target(), SIGNAL(environmentChanged()),
|
||||
connect(parent->target(), SIGNAL(environmentChanged()),
|
||||
this, SLOT(buildEnvironmentHasChanged()));
|
||||
}
|
||||
|
||||
LocalEnvironmentAspect::LocalEnvironmentAspect(const LocalEnvironmentAspect *other,
|
||||
ProjectExplorer::RunConfiguration *parent) :
|
||||
EnvironmentAspect(other, parent)
|
||||
{ }
|
||||
|
||||
LocalEnvironmentAspect *LocalEnvironmentAspect::clone(RunConfiguration *parent) const
|
||||
LocalEnvironmentAspect *LocalEnvironmentAspect::create(RunConfiguration *parent) const
|
||||
{
|
||||
Q_UNUSED(parent);
|
||||
return new LocalEnvironmentAspect(this, parent);
|
||||
return new LocalEnvironmentAspect(parent);
|
||||
}
|
||||
|
||||
} // namespace ProjectExplorer
|
||||
|
||||
@@ -39,9 +39,8 @@ class PROJECTEXPLORER_EXPORT LocalEnvironmentAspect : public EnvironmentAspect
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
LocalEnvironmentAspect(RunConfiguration *rc);
|
||||
|
||||
LocalEnvironmentAspect *clone(RunConfiguration *parent) const;
|
||||
LocalEnvironmentAspect(RunConfiguration *parent);
|
||||
LocalEnvironmentAspect *create(RunConfiguration *parent) const;
|
||||
|
||||
QList<int> possibleBaseEnvironments() const;
|
||||
QString baseEnvironmentDisplayName(int base) const;
|
||||
@@ -56,8 +55,6 @@ private:
|
||||
SystemEnvironmentBase,
|
||||
BuildEnvironmentBase
|
||||
};
|
||||
|
||||
LocalEnvironmentAspect(const LocalEnvironmentAspect *other, RunConfiguration *parent);
|
||||
};
|
||||
|
||||
} // namespace ProjectExplorer
|
||||
|
||||
@@ -103,15 +103,99 @@ bool ProcessHandle::equals(const ProcessHandle &rhs) const
|
||||
return m_pid == rhs.m_pid;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// ISettingsAspect
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
|
||||
ISettingsAspect *ISettingsAspect::clone() const
|
||||
{
|
||||
ISettingsAspect *other = create();
|
||||
QVariantMap data;
|
||||
toMap(data);
|
||||
other->fromMap(data);
|
||||
return other;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// IRunConfigurationAspect
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
|
||||
IRunConfigurationAspect::IRunConfigurationAspect(RunConfiguration *parent)
|
||||
{
|
||||
m_runConfiguration = parent;
|
||||
m_projectSettings = 0;
|
||||
m_globalSettings = 0;
|
||||
m_useGlobalSettings = false;
|
||||
connect(this, SIGNAL(requestRunActionsUpdate()), parent, SIGNAL(requestRunActionsUpdate()));
|
||||
}
|
||||
|
||||
IRunConfigurationAspect::~IRunConfigurationAspect()
|
||||
{
|
||||
delete m_projectSettings;
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Returns the widget used to configure this run configuration. Ownership is transferred to the caller
|
||||
*/
|
||||
|
||||
RunConfigWidget *IRunConfigurationAspect::createConfigurationWidget()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void IRunConfigurationAspect::setProjectSettings(ISettingsAspect *settings)
|
||||
{
|
||||
m_projectSettings = settings;
|
||||
}
|
||||
|
||||
void IRunConfigurationAspect::setGlobalSettings(ISettingsAspect *settings)
|
||||
{
|
||||
m_globalSettings = settings;
|
||||
}
|
||||
|
||||
void IRunConfigurationAspect::setUsingGlobalSettings(bool value)
|
||||
{
|
||||
m_useGlobalSettings = value;
|
||||
}
|
||||
|
||||
ISettingsAspect *IRunConfigurationAspect::currentSettings() const
|
||||
{
|
||||
return m_useGlobalSettings ? m_globalSettings : m_projectSettings;
|
||||
}
|
||||
|
||||
void IRunConfigurationAspect::fromMap(const QVariantMap &map)
|
||||
{
|
||||
m_projectSettings->fromMap(map);
|
||||
m_useGlobalSettings = map.value(m_id.toString() + QLatin1String(".UseGlobalSettings"), true).toBool();
|
||||
}
|
||||
|
||||
void IRunConfigurationAspect::toMap(QVariantMap &map) const
|
||||
{
|
||||
m_projectSettings->toMap(map);
|
||||
map.insert(m_id.toString() + QLatin1String(".UseGlobalSettings"), m_useGlobalSettings);
|
||||
}
|
||||
|
||||
IRunConfigurationAspect *IRunConfigurationAspect::clone(RunConfiguration *parent) const
|
||||
{
|
||||
IRunConfigurationAspect *other = create(parent);
|
||||
other->m_projectSettings = m_projectSettings->clone();
|
||||
other->m_globalSettings = m_globalSettings;
|
||||
other->m_useGlobalSettings = m_useGlobalSettings;
|
||||
return other;
|
||||
}
|
||||
|
||||
void IRunConfigurationAspect::resetProjectToGlobalSettings()
|
||||
{
|
||||
QTC_ASSERT(m_globalSettings, return);
|
||||
QVariantMap map;
|
||||
m_globalSettings->toMap(map);
|
||||
m_projectSettings->fromMap(map);
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\class ProjectExplorer::RunConfiguration
|
||||
@@ -272,6 +356,14 @@ QList<IRunConfigurationAspect *> RunConfiguration::extraAspects() const
|
||||
QTC_ASSERT(m_aspectsInitialized, return QList<IRunConfigurationAspect *>());
|
||||
return m_aspects;
|
||||
}
|
||||
IRunConfigurationAspect *RunConfiguration::extraAspect(Core::Id id) const
|
||||
{
|
||||
QTC_ASSERT(m_aspectsInitialized, return 0);
|
||||
foreach (IRunConfigurationAspect *aspect, m_aspects)
|
||||
if (aspect->id() == id)
|
||||
return aspect;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Utils::OutputFormatter *RunConfiguration::createOutputFormatter() const
|
||||
{
|
||||
|
||||
@@ -47,6 +47,7 @@ namespace Utils { class OutputFormatter; }
|
||||
namespace ProjectExplorer {
|
||||
class Abi;
|
||||
class BuildConfiguration;
|
||||
class IRunConfigurationAspect;
|
||||
class RunConfiguration;
|
||||
class RunConfigWidget;
|
||||
class RunControl;
|
||||
@@ -72,29 +73,85 @@ private:
|
||||
inline bool operator==(const ProcessHandle &p1, const ProcessHandle &p2) { return p1.equals(p2); }
|
||||
inline bool operator!=(const ProcessHandle &p1, const ProcessHandle &p2) { return !p1.equals(p2); }
|
||||
|
||||
/**
|
||||
* An interface for a hunk of global or per-project
|
||||
* configuration data.
|
||||
*
|
||||
*/
|
||||
|
||||
class PROJECTEXPLORER_EXPORT ISettingsAspect : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ISettingsAspect() {}
|
||||
|
||||
/// Create a configuration widget for this settings aspect.
|
||||
virtual QWidget *createConfigWidget(QWidget *parent) = 0;
|
||||
/// "Virtual default constructor"
|
||||
virtual ISettingsAspect *create() const = 0;
|
||||
/// "Virtual copy constructor"
|
||||
ISettingsAspect *clone() const;
|
||||
|
||||
protected:
|
||||
///
|
||||
friend class IRunConfigurationAspect;
|
||||
/// Converts current object into map for storage.
|
||||
virtual void toMap(QVariantMap &map) const = 0;
|
||||
/// Read object state from @p map.
|
||||
virtual void fromMap(const QVariantMap &map) = 0;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* An interface to facilitate switching between hunks of
|
||||
* global and per-project configuration data.
|
||||
*
|
||||
*/
|
||||
|
||||
class PROJECTEXPLORER_EXPORT IRunConfigurationAspect : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
virtual ~IRunConfigurationAspect() {}
|
||||
virtual IRunConfigurationAspect *clone(RunConfiguration *parent) const = 0;
|
||||
explicit IRunConfigurationAspect(RunConfiguration *parent);
|
||||
~IRunConfigurationAspect();
|
||||
|
||||
virtual IRunConfigurationAspect *create(RunConfiguration *parent) const = 0;
|
||||
virtual IRunConfigurationAspect *clone(RunConfiguration *parent) const;
|
||||
virtual RunConfigWidget *createConfigurationWidget();
|
||||
|
||||
QString displayName() const { return m_displayName; }
|
||||
void setDisplayName(const QString &displayName) { m_displayName = displayName; }
|
||||
|
||||
void setId(Core::Id id) { m_id = id; }
|
||||
void setDisplayName(const QString &displayName) { m_displayName = displayName; }
|
||||
void setProjectSettings(ISettingsAspect *settings);
|
||||
void setGlobalSettings(ISettingsAspect *settings);
|
||||
|
||||
QString displayName() const { return m_displayName; }
|
||||
Core::Id id() const { return m_id; }
|
||||
bool isUsingGlobalSettings() const { return m_useGlobalSettings; }
|
||||
void setUsingGlobalSettings(bool value);
|
||||
void resetProjectToGlobalSettings();
|
||||
|
||||
ISettingsAspect *projectSettings() const { return m_projectSettings; }
|
||||
ISettingsAspect *globalSettings() const { return m_globalSettings; }
|
||||
ISettingsAspect *currentSettings() const;
|
||||
RunConfiguration *runConfiguration() const { return m_runConfiguration; }
|
||||
|
||||
signals:
|
||||
void requestRunActionsUpdate();
|
||||
|
||||
protected:
|
||||
friend class RunConfiguration;
|
||||
virtual void fromMap(const QVariantMap &map) = 0;
|
||||
virtual void toMap(QVariantMap &data) const = 0;
|
||||
virtual void fromMap(const QVariantMap &map);
|
||||
virtual void toMap(QVariantMap &data) const;
|
||||
|
||||
private:
|
||||
QString m_displayName;
|
||||
Core::Id m_id;
|
||||
QString m_displayName;
|
||||
bool m_useGlobalSettings;
|
||||
RunConfiguration *m_runConfiguration;
|
||||
ISettingsAspect *m_projectSettings; // Owned if present.
|
||||
ISettingsAspect *m_globalSettings; // Not owned.
|
||||
};
|
||||
|
||||
// Documentation inside.
|
||||
@@ -120,6 +177,7 @@ public:
|
||||
QVariantMap toMap() const;
|
||||
|
||||
QList<IRunConfigurationAspect *> extraAspects() const;
|
||||
IRunConfigurationAspect *extraAspect(Core::Id id) const;
|
||||
|
||||
template <typename T> T *extraAspect() const
|
||||
{
|
||||
@@ -130,15 +188,6 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
template <typename T> T *extraAspect(Core::Id id) const
|
||||
{
|
||||
QTC_ASSERT(m_aspectsInitialized, return 0);
|
||||
foreach (IRunConfigurationAspect *aspect, m_aspects)
|
||||
if (aspect->id() == id)
|
||||
return qobject_cast<T *>(aspect);
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual ProjectExplorer::Abi abi() const;
|
||||
|
||||
void addExtraAspects();
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
#include <analyzerbase/analyzermanager.h>
|
||||
#include <analyzerbase/analyzerstartparameters.h>
|
||||
#include <analyzerbase/analyzerruncontrol.h>
|
||||
#include <analyzerbase/analyzersettings.h>
|
||||
|
||||
#include <debugger/debuggerrunconfigurationaspect.h>
|
||||
|
||||
|
||||
@@ -58,14 +58,9 @@ QmlProjectEnvironmentAspect::QmlProjectEnvironmentAspect(ProjectExplorer::RunCon
|
||||
ProjectExplorer::EnvironmentAspect(rc)
|
||||
{ }
|
||||
|
||||
QmlProjectEnvironmentAspect *QmlProjectEnvironmentAspect::clone(ProjectExplorer::RunConfiguration *parent) const
|
||||
QmlProjectEnvironmentAspect *QmlProjectEnvironmentAspect::create(ProjectExplorer::RunConfiguration *parent) const
|
||||
{
|
||||
return new QmlProjectEnvironmentAspect(this, parent);
|
||||
return new QmlProjectEnvironmentAspect(parent);
|
||||
}
|
||||
|
||||
QmlProjectEnvironmentAspect::QmlProjectEnvironmentAspect(const QmlProjectManager::QmlProjectEnvironmentAspect *other,
|
||||
ProjectExplorer::RunConfiguration *parent) :
|
||||
ProjectExplorer::EnvironmentAspect(other, parent)
|
||||
{ }
|
||||
|
||||
} // namespace QmlProjectManager
|
||||
|
||||
@@ -42,7 +42,7 @@ class QmlProjectEnvironmentAspect : public ProjectExplorer::EnvironmentAspect
|
||||
|
||||
public:
|
||||
QmlProjectEnvironmentAspect(ProjectExplorer::RunConfiguration *rc);
|
||||
QmlProjectEnvironmentAspect *clone(ProjectExplorer::RunConfiguration *parent) const;
|
||||
QmlProjectEnvironmentAspect *create(ProjectExplorer::RunConfiguration *parent) const;
|
||||
|
||||
QList<int> possibleBaseEnvironments() const;
|
||||
QString baseEnvironmentDisplayName(int base) const;
|
||||
@@ -52,8 +52,6 @@ private:
|
||||
enum BaseEnvironmentBase {
|
||||
SystemEnvironmentBase = 0
|
||||
};
|
||||
|
||||
QmlProjectEnvironmentAspect(const QmlProjectEnvironmentAspect *other, ProjectExplorer::RunConfiguration *parent);
|
||||
};
|
||||
|
||||
} // namespace QmlProjectManager
|
||||
|
||||
@@ -41,9 +41,9 @@ RemoteLinuxEnvironmentAspect::RemoteLinuxEnvironmentAspect(ProjectExplorer::RunC
|
||||
ProjectExplorer::EnvironmentAspect(rc)
|
||||
{ }
|
||||
|
||||
RemoteLinuxEnvironmentAspect *RemoteLinuxEnvironmentAspect::clone(ProjectExplorer::RunConfiguration *parent) const
|
||||
RemoteLinuxEnvironmentAspect *RemoteLinuxEnvironmentAspect::create(ProjectExplorer::RunConfiguration *parent) const
|
||||
{
|
||||
return new RemoteLinuxEnvironmentAspect(this, parent);
|
||||
return new RemoteLinuxEnvironmentAspect(parent);
|
||||
}
|
||||
|
||||
ProjectExplorer::RunConfigWidget *RemoteLinuxEnvironmentAspect::createConfigurationWidget()
|
||||
@@ -101,10 +101,5 @@ QString RemoteLinuxEnvironmentAspect::userEnvironmentChangesAsString() const
|
||||
return env.mid(0, env.size() - 1);
|
||||
}
|
||||
|
||||
RemoteLinuxEnvironmentAspect::RemoteLinuxEnvironmentAspect(const RemoteLinuxEnvironmentAspect *other,
|
||||
ProjectExplorer::RunConfiguration *parent) :
|
||||
ProjectExplorer::EnvironmentAspect(other, parent)
|
||||
{ }
|
||||
|
||||
} // namespace RemoteLinux
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ class REMOTELINUX_EXPORT RemoteLinuxEnvironmentAspect : public ProjectExplorer::
|
||||
|
||||
public:
|
||||
RemoteLinuxEnvironmentAspect(ProjectExplorer::RunConfiguration *rc);
|
||||
RemoteLinuxEnvironmentAspect *clone(ProjectExplorer::RunConfiguration *parent) const;
|
||||
RemoteLinuxEnvironmentAspect *create(ProjectExplorer::RunConfiguration *parent) const;
|
||||
ProjectExplorer::RunConfigWidget *createConfigurationWidget();
|
||||
|
||||
QList<int> possibleBaseEnvironments() const;
|
||||
@@ -66,8 +66,6 @@ private:
|
||||
RemoteBaseEnvironment = 1
|
||||
};
|
||||
|
||||
RemoteLinuxEnvironmentAspect(const RemoteLinuxEnvironmentAspect *other, ProjectExplorer::RunConfiguration *parent);
|
||||
|
||||
Utils::Environment m_remoteEnvironment;
|
||||
};
|
||||
|
||||
|
||||
@@ -47,7 +47,6 @@
|
||||
#include <valgrind/valgrindsettings.h>
|
||||
|
||||
#include <analyzerbase/analyzermanager.h>
|
||||
#include <analyzerbase/analyzersettings.h>
|
||||
#include <analyzerbase/analyzerutils.h>
|
||||
#include <analyzerbase/analyzerconstants.h>
|
||||
|
||||
@@ -546,8 +545,7 @@ AnalyzerRunControl *CallgrindToolPrivate::createRunControl(const AnalyzerStartPa
|
||||
|
||||
// apply project settings
|
||||
if (runConfiguration) {
|
||||
if (AnalyzerRunConfigurationAspect *analyzerAspect
|
||||
= runConfiguration->extraAspect<AnalyzerRunConfigurationAspect>(ANALYZER_VALGRIND_SETTINGS)) {
|
||||
if (IRunConfigurationAspect *analyzerAspect = runConfiguration->extraAspect(ANALYZER_VALGRIND_SETTINGS)) {
|
||||
if (const ValgrindBaseSettings *settings = qobject_cast<ValgrindBaseSettings *>(analyzerAspect->currentSettings())) {
|
||||
m_visualisation->setMinimumInclusiveCostRatio(settings->visualisationMinimumInclusiveCostRatio() / 100.0);
|
||||
m_proxyModel->setMinimumInclusiveCostRatio(settings->minimumInclusiveCostRatio() / 100.0);
|
||||
|
||||
@@ -32,8 +32,6 @@
|
||||
|
||||
#include "valgrindsettings.h"
|
||||
|
||||
#include <analyzerbase/analyzersettings.h>
|
||||
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <projectexplorer/taskhub.h>
|
||||
|
||||
|
||||
@@ -231,8 +231,8 @@ void MemcheckTool::maybeActiveRunConfigurationChanged()
|
||||
if (Project *project = pe->startupProject())
|
||||
if (Target *target = project->activeTarget())
|
||||
if (RunConfiguration *rc = target->activeRunConfiguration())
|
||||
if (AnalyzerRunConfigurationAspect *aspect = rc->extraAspect<AnalyzerRunConfigurationAspect>(ANALYZER_VALGRIND_SETTINGS))
|
||||
settings = qobject_cast<ValgrindBaseSettings *>(aspect->projectSettings());
|
||||
if (IRunConfigurationAspect *aspect = rc->extraAspect(ANALYZER_VALGRIND_SETTINGS))
|
||||
settings = qobject_cast<ValgrindBaseSettings *>(aspect->currentSettings());
|
||||
|
||||
if (!settings) // fallback to global settings
|
||||
settings = ValgrindPlugin::globalSettings();
|
||||
|
||||
@@ -64,8 +64,8 @@ ValgrindRunControl::ValgrindRunControl(const AnalyzerStartParameters &sp,
|
||||
m_isStopping(false)
|
||||
{
|
||||
if (runConfiguration)
|
||||
if (AnalyzerRunConfigurationAspect *aspect = runConfiguration->extraAspect<AnalyzerRunConfigurationAspect>(ANALYZER_VALGRIND_SETTINGS))
|
||||
m_settings = qobject_cast<ValgrindBaseSettings *>(aspect->projectSettings());
|
||||
if (IRunConfigurationAspect *aspect = runConfiguration->extraAspect(ANALYZER_VALGRIND_SETTINGS))
|
||||
m_settings = qobject_cast<ValgrindBaseSettings *>(aspect->currentSettings());
|
||||
|
||||
if (!m_settings)
|
||||
m_settings = ValgrindPlugin::globalSettings();
|
||||
|
||||
@@ -34,9 +34,9 @@
|
||||
#include "memchecktool.h"
|
||||
#include "valgrindruncontrolfactory.h"
|
||||
#include "valgrindsettings.h"
|
||||
#include "valgrindconfigwidget.h"
|
||||
|
||||
#include <analyzerbase/analyzermanager.h>
|
||||
#include <analyzerbase/analyzersettings.h>
|
||||
|
||||
#include <coreplugin/dialogs/ioptionspage.h>
|
||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||
@@ -73,7 +73,7 @@ public:
|
||||
}
|
||||
|
||||
QWidget *createPage(QWidget *parent) {
|
||||
return theGlobalSettings->createConfigWidget(parent);
|
||||
return new ValgrindConfigWidget(theGlobalSettings, parent, true);
|
||||
}
|
||||
|
||||
void apply() {
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#include <analyzerbase/analyzermanager.h>
|
||||
#include <analyzerbase/analyzerstartparameters.h>
|
||||
#include <analyzerbase/analyzerruncontrol.h>
|
||||
#include <analyzerbase/analyzersettings.h>
|
||||
#include <analyzerbase/analyzerrunconfigwidget.h>
|
||||
|
||||
#include <remotelinux/remotelinuxrunconfiguration.h>
|
||||
|
||||
@@ -108,14 +108,34 @@ RunControl *ValgrindRunControlFactory::create(RunConfiguration *runConfiguration
|
||||
return AnalyzerManager::createRunControl(sp, runConfiguration);
|
||||
}
|
||||
|
||||
|
||||
class ValgrindRunConfigurationAspect : public IRunConfigurationAspect
|
||||
{
|
||||
public:
|
||||
ValgrindRunConfigurationAspect(RunConfiguration *parent)
|
||||
: IRunConfigurationAspect(parent)
|
||||
{
|
||||
setProjectSettings(new ValgrindProjectSettings());
|
||||
setGlobalSettings(ValgrindPlugin::globalSettings());
|
||||
setId(ANALYZER_VALGRIND_SETTINGS);
|
||||
setDisplayName(tr("Valgrind Settings"));
|
||||
}
|
||||
|
||||
IRunConfigurationAspect *create(RunConfiguration *parent) const
|
||||
{
|
||||
return new ValgrindRunConfigurationAspect(parent);
|
||||
}
|
||||
|
||||
RunConfigWidget *createConfigurationWidget()
|
||||
{
|
||||
return new Analyzer::AnalyzerRunConfigWidget(this);
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
IRunConfigurationAspect *ValgrindRunControlFactory::createRunConfigurationAspect(RunConfiguration *rc)
|
||||
{
|
||||
Q_UNUSED(rc);
|
||||
IRunConfigurationAspect *aspect
|
||||
= new AnalyzerRunConfigurationAspect(new ValgrindProjectSettings(), ValgrindPlugin::globalSettings());
|
||||
aspect->setId(ANALYZER_VALGRIND_SETTINGS);
|
||||
aspect->setDisplayName(tr("Valgrind Settings"));
|
||||
return aspect;
|
||||
return new ValgrindRunConfigurationAspect(rc);
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
#ifndef ANALYZER_INTERNAL_VALGRINDSETTINGS_H
|
||||
#define ANALYZER_INTERNAL_VALGRINDSETTINGS_H
|
||||
|
||||
#include <analyzerbase/analyzersettings.h>
|
||||
#include "callgrindcostdelegate.h"
|
||||
#include <projectexplorer/runconfiguration.h>
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
@@ -46,7 +46,7 @@ const char ANALYZER_VALGRIND_SETTINGS[] = "Analyzer.Valgrind.Settings";
|
||||
/**
|
||||
* Valgrind settings shared for global and per-project.
|
||||
*/
|
||||
class ValgrindBaseSettings : public Analyzer::ISettingsAspect
|
||||
class ValgrindBaseSettings : public ProjectExplorer::ISettingsAspect
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
Reference in New Issue
Block a user