diff options
author | hjk <hjk121@nokiamail.com> | 2013-08-12 17:05:52 +0200 |
---|---|---|
committer | hjk <hjk121@nokiamail.com> | 2013-08-13 13:18:42 +0200 |
commit | cd460a363804f51ea560b5b4c94ad66df13c5674 (patch) | |
tree | c7bd2a9cda84b14d68ee689231bcfa0f156f72cb /src/plugins/valgrind/valgrindsettings.cpp | |
parent | e3ae9e80b5ee2fa2445be37bdf1753695c9c0c4d (diff) | |
download | qt-creator-cd460a363804f51ea560b5b4c94ad66df13c5674.tar.gz |
RunConfigurationAspect: Streamline data serialization
Change-Id: I6f49dd9eeff53eafc51bd5238ca655437df12111
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
Diffstat (limited to 'src/plugins/valgrind/valgrindsettings.cpp')
-rw-r--r-- | src/plugins/valgrind/valgrindsettings.cpp | 28 |
1 files changed, 13 insertions, 15 deletions
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; } // |