summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/analyzerbase/analyzersettings.cpp9
-rw-r--r--src/plugins/analyzerbase/analyzersettings.h6
-rw-r--r--src/plugins/debugger/debuggerrunconfigurationaspect.cpp4
-rw-r--r--src/plugins/debugger/debuggerrunconfigurationaspect.h2
-rw-r--r--src/plugins/projectexplorer/environmentaspect.cpp14
-rw-r--r--src/plugins/projectexplorer/environmentaspect.h2
-rw-r--r--src/plugins/projectexplorer/runconfiguration.cpp2
-rw-r--r--src/plugins/projectexplorer/runconfiguration.h2
-rw-r--r--src/plugins/valgrind/valgrindsettings.cpp28
-rw-r--r--src/plugins/valgrind/valgrindsettings.h8
10 files changed, 36 insertions, 41 deletions
diff --git a/src/plugins/analyzerbase/analyzersettings.cpp b/src/plugins/analyzerbase/analyzersettings.cpp
index d9cdd0163b..6aeedf2a6a 100644
--- a/src/plugins/analyzerbase/analyzersettings.cpp
+++ b/src/plugins/analyzerbase/analyzersettings.cpp
@@ -71,11 +71,10 @@ void AnalyzerRunConfigurationAspect::fromMap(const QVariantMap &map)
m_useGlobalSettings = map.value(QLatin1String(useGlobalC), true).toBool();
}
-QVariantMap AnalyzerRunConfigurationAspect::toMap() const
+void AnalyzerRunConfigurationAspect::toMap(QVariantMap &map) const
{
- QVariantMap map = m_customConfiguration->toMap();
+ m_customConfiguration->toMap(map);
map.insert(QLatin1String(useGlobalC), m_useGlobalSettings);
- return map;
}
AnalyzerRunConfigurationAspect *AnalyzerRunConfigurationAspect::clone(
@@ -97,7 +96,9 @@ void AnalyzerRunConfigurationAspect::resetCustomToGlobalSettings()
{
AbstractAnalyzerSubConfig *global = globalSubConfig();
QTC_ASSERT(global, return);
- m_customConfiguration->fromMap(global->toMap());
+ QVariantMap map;
+ global->toMap(map);
+ m_customConfiguration->fromMap(map);
}
ProjectExplorer::RunConfigWidget *AnalyzerRunConfigurationAspect::createConfigurationWidget()
diff --git a/src/plugins/analyzerbase/analyzersettings.h b/src/plugins/analyzerbase/analyzersettings.h
index 7b046a63e8..51bfebd143 100644
--- a/src/plugins/analyzerbase/analyzersettings.h
+++ b/src/plugins/analyzerbase/analyzersettings.h
@@ -53,7 +53,7 @@ public:
AbstractAnalyzerSubConfig() {}
/// convert current configuration into map for storage
- virtual QVariantMap toMap() const = 0;
+ virtual void toMap(QVariantMap &map) const = 0;
/// read configuration from @p map
virtual void fromMap(const QVariantMap &map) = 0;
@@ -84,7 +84,6 @@ public:
~AnalyzerRunConfigurationAspect();
- virtual QVariantMap toMap() const;
AnalyzerRunConfigurationAspect *clone(ProjectExplorer::RunConfiguration *parent) const;
bool isUsingGlobalSettings() const { return m_useGlobalSettings; }
@@ -97,7 +96,8 @@ public:
ProjectExplorer::RunConfigWidget *createConfigurationWidget();
protected:
- virtual void fromMap(const QVariantMap &map);
+ void fromMap(const QVariantMap &map);
+ void toMap(QVariantMap &map) const;
private:
bool m_useGlobalSettings;
diff --git a/src/plugins/debugger/debuggerrunconfigurationaspect.cpp b/src/plugins/debugger/debuggerrunconfigurationaspect.cpp
index 8bd6d7100a..78d0f34555 100644
--- a/src/plugins/debugger/debuggerrunconfigurationaspect.cpp
+++ b/src/plugins/debugger/debuggerrunconfigurationaspect.cpp
@@ -277,16 +277,14 @@ bool DebuggerRunConfigurationAspect::isQmlDebuggingSpinboxSuppressed() const
return dev->canAutoDetectPorts();
}
-QVariantMap DebuggerRunConfigurationAspect::toMap() const
+void DebuggerRunConfigurationAspect::toMap(QVariantMap &map) const
{
- QVariantMap map;
map.insert(QLatin1String(USE_CPP_DEBUGGER_KEY), m_useCppDebugger == EnabledLanguage);
map.insert(QLatin1String(USE_CPP_DEBUGGER_AUTO_KEY), m_useCppDebugger == AutoEnabledLanguage);
map.insert(QLatin1String(USE_QML_DEBUGGER_KEY), m_useQmlDebugger == EnabledLanguage);
map.insert(QLatin1String(USE_QML_DEBUGGER_AUTO_KEY), m_useQmlDebugger == AutoEnabledLanguage);
map.insert(QLatin1String(QML_DEBUG_SERVER_PORT_KEY), m_qmlDebugServerPort);
map.insert(QLatin1String(USE_MULTIPROCESS_KEY), m_useMultiProcess);
- return map;
}
void DebuggerRunConfigurationAspect::fromMap(const QVariantMap &map)
diff --git a/src/plugins/debugger/debuggerrunconfigurationaspect.h b/src/plugins/debugger/debuggerrunconfigurationaspect.h
index a5f53fdd46..ed178da89f 100644
--- a/src/plugins/debugger/debuggerrunconfigurationaspect.h
+++ b/src/plugins/debugger/debuggerrunconfigurationaspect.h
@@ -54,8 +54,8 @@ public:
AutoEnabledLanguage
};
- QVariantMap toMap() const;
void fromMap(const QVariantMap &map);
+ void toMap(QVariantMap &map) const;
DebuggerRunConfigurationAspect *clone(ProjectExplorer::RunConfiguration *parent) const;
ProjectExplorer::RunConfigWidget *createConfigurationWidget();
diff --git a/src/plugins/projectexplorer/environmentaspect.cpp b/src/plugins/projectexplorer/environmentaspect.cpp
index ffdcc7fceb..cb3e5b4409 100644
--- a/src/plugins/projectexplorer/environmentaspect.cpp
+++ b/src/plugins/projectexplorer/environmentaspect.cpp
@@ -58,14 +58,6 @@ EnvironmentAspect::EnvironmentAspect(const EnvironmentAspect *other, RunConfigur
m_runConfiguration(parent)
{ }
-QVariantMap EnvironmentAspect::toMap() const
-{
- QVariantMap data;
- data.insert(QLatin1String(BASE_KEY), m_base);
- data.insert(QLatin1String(CHANGES_KEY), Utils::EnvironmentItem::toStringList(m_changes));
- return data;
-}
-
RunConfigWidget *EnvironmentAspect::createConfigurationWidget()
{
return new EnvironmentAspectWidget(this);
@@ -116,4 +108,10 @@ void EnvironmentAspect::fromMap(const QVariantMap &map)
m_changes = Utils::EnvironmentItem::fromStringList(map.value(QLatin1String(CHANGES_KEY)).toStringList());
}
+void EnvironmentAspect::toMap(QVariantMap &data) const
+{
+ data.insert(QLatin1String(BASE_KEY), m_base);
+ data.insert(QLatin1String(CHANGES_KEY), Utils::EnvironmentItem::toStringList(m_changes));
+}
+
} // namespace ProjectExplorer
diff --git a/src/plugins/projectexplorer/environmentaspect.h b/src/plugins/projectexplorer/environmentaspect.h
index ab094537ee..3145490e6d 100644
--- a/src/plugins/projectexplorer/environmentaspect.h
+++ b/src/plugins/projectexplorer/environmentaspect.h
@@ -47,7 +47,6 @@ class PROJECTEXPLORER_EXPORT EnvironmentAspect : public IRunConfigurationAspect
public:
// IRunConfigurationAspect:
- QVariantMap toMap() const;
RunConfigWidget *createConfigurationWidget();
virtual RunConfiguration *runConfiguration() const { return m_runConfiguration; }
@@ -73,6 +72,7 @@ protected:
EnvironmentAspect(const EnvironmentAspect *other, RunConfiguration *parent);
EnvironmentAspect(RunConfiguration *rc);
void fromMap(const QVariantMap &map);
+ void toMap(QVariantMap &map) const;
private:
mutable int m_base;
diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp
index 4a07959841..a466d708d6 100644
--- a/src/plugins/projectexplorer/runconfiguration.cpp
+++ b/src/plugins/projectexplorer/runconfiguration.cpp
@@ -224,7 +224,7 @@ QVariantMap RunConfiguration::toMap() const
QVariantMap map = ProjectConfiguration::toMap();
foreach (IRunConfigurationAspect *aspect, m_aspects)
- map.unite(aspect->toMap());
+ aspect->toMap(map);
return map;
}
diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h
index f7ee9ef87b..6e91335394 100644
--- a/src/plugins/projectexplorer/runconfiguration.h
+++ b/src/plugins/projectexplorer/runconfiguration.h
@@ -78,7 +78,6 @@ class PROJECTEXPLORER_EXPORT IRunConfigurationAspect : public QObject
public:
virtual ~IRunConfigurationAspect() {}
- virtual QVariantMap toMap() const = 0;
virtual IRunConfigurationAspect *clone(RunConfiguration *parent) const = 0;
virtual RunConfigWidget *createConfigurationWidget();
@@ -91,6 +90,7 @@ public:
protected:
friend class RunConfiguration;
virtual void fromMap(const QVariantMap &map) = 0;
+ virtual void toMap(QVariantMap &data) const = 0;
private:
QString m_displayName;
diff --git a/src/plugins/valgrind/valgrindsettings.cpp b/src/plugins/valgrind/valgrindsettings.cpp
index 1e4d563d32..1cf8b7f32c 100644
--- a/src/plugins/valgrind/valgrindsettings.cpp
+++ b/src/plugins/valgrind/valgrindsettings.cpp
@@ -113,10 +113,8 @@ void ValgrindBaseSettings::fromMap(const QVariantMap &map)
emit changed();
}
-QVariantMap ValgrindBaseSettings::toMap() const
+void ValgrindBaseSettings::toMap(QVariantMap &map) const
{
- QVariantMap map;
-
// General
map.insert(QLatin1String(valgrindExeC), m_valgrindExecutable);
@@ -138,7 +136,6 @@ QVariantMap ValgrindBaseSettings::toMap() const
map.insert(QLatin1String(callgrindMinimumCostRatioC), m_minimumInclusiveCostRatio);
map.insert(QLatin1String(callgrindVisualisationMinimumCostRatioC),
m_visualisationMinimumInclusiveCostRatio);
- return map;
}
void ValgrindBaseSettings::setValgrindExecutable(const QString &valgrindExecutable)
@@ -288,13 +285,15 @@ void ValgrindGlobalSettings::fromMap(const QVariantMap &map)
AbstractAnalyzerSubConfig *ValgrindGlobalSettings::clone()
{
ValgrindGlobalSettings *other = new ValgrindGlobalSettings;
- other->fromMap(toMap());
+ QVariantMap data;
+ toMap(data);
+ other->fromMap(data);
return other;
}
-QVariantMap ValgrindGlobalSettings::toMap() const
+void ValgrindGlobalSettings::toMap(QVariantMap &map) const
{
- QVariantMap map = ValgrindBaseSettings::toMap();
+ ValgrindBaseSettings::toMap(map);
// Memcheck
map.insert(QLatin1String(suppressionFilesC), m_suppressionFiles);
@@ -305,8 +304,6 @@ QVariantMap ValgrindGlobalSettings::toMap() const
map.insert(QLatin1String(callgrindCostFormatC), m_costFormat);
map.insert(QLatin1String(callgrindCycleDetectionC), m_detectCycles);
map.insert(QLatin1String(callgrindShortenTemplates), m_shortenTemplates);
-
- return map;
}
//
@@ -400,7 +397,8 @@ void ValgrindGlobalSettings::writeSettings() const
{
QSettings *settings = Core::ICore::settings();
settings->beginGroup(QLatin1String(groupC));
- const QVariantMap map = toMap();
+ QVariantMap map;
+ toMap(map);
for (QVariantMap::ConstIterator it = map.begin(); it != map.end(); ++it)
settings->setValue(it.key(), it.value());
settings->endGroup();
@@ -466,19 +464,19 @@ void ValgrindProjectSettings::fromMap(const QVariantMap &map)
AbstractAnalyzerSubConfig *ValgrindProjectSettings::clone()
{
ValgrindProjectSettings *other = new ValgrindProjectSettings;
- other->fromMap(toMap());
+ QVariantMap data;
+ toMap(data);
+ other->fromMap(data);
return other;
}
-QVariantMap ValgrindProjectSettings::toMap() const
+void ValgrindProjectSettings::toMap(QVariantMap &map) const
{
- QVariantMap map = ValgrindBaseSettings::toMap();
+ ValgrindBaseSettings::toMap(map);
// Memcheck
map.insert(QLatin1String(addedSuppressionFilesC), m_addedSuppressionFiles);
map.insert(QLatin1String(removedSuppressionFilesC), m_disabledGlobalSuppressionFiles);
-
- return map;
}
//
diff --git a/src/plugins/valgrind/valgrindsettings.h b/src/plugins/valgrind/valgrindsettings.h
index 6ca9f54834..1d139173ea 100644
--- a/src/plugins/valgrind/valgrindsettings.h
+++ b/src/plugins/valgrind/valgrindsettings.h
@@ -53,8 +53,8 @@ class ValgrindBaseSettings : public Analyzer::AbstractAnalyzerSubConfig
public:
ValgrindBaseSettings() {}
- virtual QVariantMap toMap() const;
- virtual void fromMap(const QVariantMap &map);
+ void toMap(QVariantMap &map) const;
+ void fromMap(const QVariantMap &map);
signals:
void changed(); // sent when multiple values have changed simulatenously (e.g. fromMap)
@@ -168,7 +168,7 @@ public:
ValgrindGlobalSettings();
QWidget *createConfigWidget(QWidget *parent);
- QVariantMap toMap() const;
+ void toMap(QVariantMap &map) const;
void fromMap(const QVariantMap &map);
virtual AbstractAnalyzerSubConfig *clone();
@@ -228,7 +228,7 @@ public:
ValgrindProjectSettings() {}
QWidget *createConfigWidget(QWidget *parent);
- QVariantMap toMap() const;
+ void toMap(QVariantMap &map) const;
void fromMap(const QVariantMap &map);
virtual AbstractAnalyzerSubConfig *clone();