Analyzer: Move setIfPresent helper function close to the only user

Change-Id: I8d99fe6438e4d954ad44403ac4a34f7e85a7f021
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
hjk
2013-08-09 15:20:21 +02:00
parent 2890242df5
commit a710f7f8c0
2 changed files with 9 additions and 10 deletions

View File

@@ -39,16 +39,6 @@
namespace Analyzer {
/**
* 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))
return;
*val = map.value(key).template value<T>();
}
/**
* Subclass this to add configuration to your analyzer tool.
*

View File

@@ -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