forked from qt-creator/qt-creator
ProjectExplorer: Keep RunConfiguration in ISettingsAspect
Any SettingsAspect that doesn't refer to the global settings has a specific RunConfiguration it is about. This can be very handy to know when constructing the actual settings. Right now there is no way to find out about it. Drop the clone() and create() methods. They weren't used anywhere and a proper implementation should take care of the runConfiguration member. Change-Id: Ie505a9b19707f8a1b6bf9cae73513cd3c30d0bca Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -95,7 +95,7 @@ public:
|
||||
ValgrindRunConfigurationAspect(RunConfiguration *parent)
|
||||
: IRunConfigurationAspect(parent)
|
||||
{
|
||||
setProjectSettings(new ValgrindProjectSettings());
|
||||
setProjectSettings(new ValgrindProjectSettings(parent));
|
||||
setGlobalSettings(ValgrindPlugin::globalSettings());
|
||||
setId(ANALYZER_VALGRIND_SETTINGS);
|
||||
setDisplayName(QCoreApplication::translate("Valgrind::Internal::ValgrindRunConfigurationAspect",
|
||||
|
||||
@@ -113,6 +113,10 @@ void ValgrindBaseSettings::fromMap(const QVariantMap &map)
|
||||
emit changed();
|
||||
}
|
||||
|
||||
ValgrindBaseSettings::ValgrindBaseSettings(ProjectExplorer::RunConfiguration *runConfiguration) :
|
||||
ProjectExplorer::ISettingsAspect(runConfiguration)
|
||||
{}
|
||||
|
||||
void ValgrindBaseSettings::toMap(QVariantMap &map) const
|
||||
{
|
||||
// General
|
||||
@@ -471,6 +475,11 @@ void ValgrindGlobalSettings::setShortenTemplates(bool on)
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
ValgrindProjectSettings::ValgrindProjectSettings(
|
||||
ProjectExplorer::RunConfiguration *runConfiguration) :
|
||||
ValgrindBaseSettings(runConfiguration)
|
||||
{}
|
||||
|
||||
QWidget *ValgrindProjectSettings::createConfigWidget(QWidget *parent)
|
||||
{
|
||||
return new ValgrindConfigWidget(this, parent, false);
|
||||
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
LeakCheckOnFinishYes
|
||||
};
|
||||
|
||||
ValgrindBaseSettings() {}
|
||||
ValgrindBaseSettings(ProjectExplorer::RunConfiguration *runConfiguration = nullptr);
|
||||
|
||||
void toMap(QVariantMap &map) const;
|
||||
void fromMap(const QVariantMap &map);
|
||||
@@ -186,8 +186,6 @@ public:
|
||||
QWidget *createConfigWidget(QWidget *parent) override;
|
||||
void toMap(QVariantMap &map) const;
|
||||
void fromMap(const QVariantMap &map);
|
||||
ISettingsAspect *create() const { return new ValgrindGlobalSettings; }
|
||||
|
||||
|
||||
/*
|
||||
* Global memcheck settings
|
||||
@@ -241,12 +239,11 @@ class ValgrindProjectSettings : public ValgrindBaseSettings
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ValgrindProjectSettings() {}
|
||||
ValgrindProjectSettings(ProjectExplorer::RunConfiguration *runConfiguration);
|
||||
|
||||
QWidget *createConfigWidget(QWidget *parent) override;
|
||||
void toMap(QVariantMap &map) const;
|
||||
void fromMap(const QVariantMap &map);
|
||||
ISettingsAspect *create() const { return new ValgrindProjectSettings; }
|
||||
|
||||
/**
|
||||
* Per-project memcheck settings, saves a diff to the global suppression files list
|
||||
|
||||
Reference in New Issue
Block a user