ProjectExplorer: Use a ISettingsAspect::setConfigWidgetCreator() setter

Closer to the usual pattern elsewhere.

Change-Id: Ieaed483bc7f61b63e5bde87a721f43c3e3d737aa
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2019-08-28 08:55:28 +02:00
parent 8b4344f2a2
commit cd3876fd1a
6 changed files with 25 additions and 18 deletions

View File

@@ -82,9 +82,7 @@ template <typename T> void setIfPresent(const QVariantMap &map, const QString &k
*val = map.value(key).template value<T>();
}
ValgrindBaseSettings::ValgrindBaseSettings(const ConfigWidgetCreator &creator)
: ISettingsAspect(creator)
{}
ValgrindBaseSettings::ValgrindBaseSettings() = default;
void ValgrindBaseSettings::fromMap(const QVariantMap &map)
{
@@ -304,9 +302,10 @@ void ValgrindBaseSettings::setVisualisationMinimumInclusiveCostRatio(
static ValgrindGlobalSettings *theGlobalSettings = nullptr;
ValgrindGlobalSettings::ValgrindGlobalSettings()
: ValgrindBaseSettings([this] { return new ValgrindConfigWidget(this, true); })
{
theGlobalSettings = this;
setConfigWidgetCreator([this] { return new ValgrindConfigWidget(this, true); });
readSettings();
}
@@ -494,8 +493,9 @@ void ValgrindGlobalSettings::setShortenTemplates(bool on)
//////////////////////////////////////////////////////////////////
ValgrindProjectSettings::ValgrindProjectSettings()
: ValgrindBaseSettings([this] { return new ValgrindConfigWidget(this, false); })
{}
{
setConfigWidgetCreator([this] { return new ValgrindConfigWidget(this, false); });
}
void ValgrindProjectSettings::fromMap(const QVariantMap &map)
{