diff options
author | hjk <hjk121@nokiamail.com> | 2013-08-09 15:20:21 +0200 |
---|---|---|
committer | hjk <hjk121@nokiamail.com> | 2013-08-12 13:21:48 +0200 |
commit | a710f7f8c021b746bc1abe7a92acd524e00a3295 (patch) | |
tree | eb4bf24b5756150ebb6574b92632db29d92b0117 /src/plugins/valgrind/valgrindsettings.cpp | |
parent | 2890242df5011a1be4ceab28b5324ed3fbce892d (diff) | |
download | qt-creator-a710f7f8c021b746bc1abe7a92acd524e00a3295.tar.gz |
Analyzer: Move setIfPresent helper function close to the only user
Change-Id: I8d99fe6438e4d954ad44403ac4a34f7e85a7f021
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Diffstat (limited to 'src/plugins/valgrind/valgrindsettings.cpp')
-rw-r--r-- | src/plugins/valgrind/valgrindsettings.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/plugins/valgrind/valgrindsettings.cpp b/src/plugins/valgrind/valgrindsettings.cpp index 5cf6981f3b..089df9c610 100644 --- a/src/plugins/valgrind/valgrindsettings.cpp +++ b/src/plugins/valgrind/valgrindsettings.cpp @@ -76,6 +76,15 @@ namespace Internal { // ////////////////////////////////////////////////////////////////// +/** + * Utility function to set @p val if @p key is present in @p map. + */ +template <typename T> void setIfPresent(const QVariantMap &map, const QString &key, T *val) +{ + if (map.contains(key)) + *val = map.value(key).template value<T>(); +} + void ValgrindBaseSettings::fromMap(const QVariantMap &map) { // General |