remove bool return value from IRunConfigurationAspect::fromMap

Change-Id: I9f909b2209eaf5e81b1475d87219ae63e2741075
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
hjk
2012-02-22 12:36:39 +01:00
committed by hjk
parent b1b431f21f
commit c5879f843d
6 changed files with 22 additions and 35 deletions

View File

@@ -67,18 +67,15 @@ QVariantMap AnalyzerSettings::defaults() const
return map;
}
bool AnalyzerSettings::fromMap(const QVariantMap &map)
void AnalyzerSettings::fromMap(const QVariantMap &map)
{
return fromMap(map, &m_subConfigs);
fromMap(map, &m_subConfigs);
}
bool AnalyzerSettings::fromMap(const QVariantMap &map, QList<AbstractAnalyzerSubConfig *> *subConfigs)
void AnalyzerSettings::fromMap(const QVariantMap &map, QList<AbstractAnalyzerSubConfig *> *subConfigs)
{
bool ret = true;
foreach (AbstractAnalyzerSubConfig *config, *subConfigs) {
ret = ret && config->fromMap(map);
}
return ret;
foreach (AbstractAnalyzerSubConfig *config, *subConfigs)
config->fromMap(map);
}
QVariantMap AnalyzerSettings::toMap() const
@@ -180,12 +177,10 @@ QString AnalyzerProjectSettings::displayName() const
return tr("Analyzer Settings");
}
bool AnalyzerProjectSettings::fromMap(const QVariantMap &map)
void AnalyzerProjectSettings::fromMap(const QVariantMap &map)
{
if (!AnalyzerSettings::fromMap(map, &m_customConfigurations))
return false;
AnalyzerSettings::fromMap(map, &m_customConfigurations);
m_useGlobalSettings = map.value(QLatin1String(useGlobalC), true).toBool();
return true;
}
QVariantMap AnalyzerProjectSettings::toMap() const

View File

@@ -74,7 +74,7 @@ public:
/// convert current configuration into map for storage
virtual QVariantMap toMap() const = 0;
/// read configuration from @p map
virtual bool fromMap(const QVariantMap &map) = 0;
virtual void fromMap(const QVariantMap &map) = 0;
/// unique ID for this configuration
virtual QString id() const = 0;
@@ -113,10 +113,10 @@ public:
virtual QVariantMap toMap() const;
protected:
virtual bool fromMap(const QVariantMap &map);
virtual void fromMap(const QVariantMap &map);
QVariantMap toMap(const QList<AbstractAnalyzerSubConfig *> &subConfigs) const;
bool fromMap(const QVariantMap &map, QList<AbstractAnalyzerSubConfig *> *subConfigs);
void fromMap(const QVariantMap &map, QList<AbstractAnalyzerSubConfig *> *subConfigs);
AnalyzerSettings(QObject *parent);
QList<AbstractAnalyzerSubConfig *> m_subConfigs;
@@ -179,7 +179,7 @@ public:
QList<AbstractAnalyzerSubConfig *> customSubConfigs() const { return m_customConfigurations; }
protected:
virtual bool fromMap(const QVariantMap &map);
virtual void fromMap(const QVariantMap &map);
private:
bool m_useGlobalSettings;

View File

@@ -277,7 +277,7 @@ QVariantMap DebuggerProjectSettings::toMap() const
return map;
}
bool DebuggerProjectSettings::fromMap(const QVariantMap &map)
void DebuggerProjectSettings::fromMap(const QVariantMap &map)
{
m_useCppDebugger = map.value(QLatin1String(USE_CPP_DEBUGGER_KEY), true).toBool();
if (map.value(QLatin1String(USE_QML_DEBUGGER_AUTO_KEY), false).toBool()) {
@@ -286,7 +286,6 @@ bool DebuggerProjectSettings::fromMap(const QVariantMap &map)
bool useQml = map.value(QLatin1String(USE_QML_DEBUGGER_KEY), false).toBool();
m_useQmlDebugger = useQml ? EnableQmlDebugger : DisableQmlDebugger;
}
return true;
}
@@ -391,12 +390,10 @@ ProjectExplorer::Abi RunConfiguration::abi() const
bool RunConfiguration::fromMap(const QVariantMap &map)
{
if (!m_debuggerAspect->fromMap(map))
return false;
m_debuggerAspect->fromMap(map);
foreach (IRunConfigurationAspect *aspect, m_aspects)
if (!aspect->fromMap(map))
return false;
aspect->fromMap(map);
return ProjectConfiguration::fromMap(map);
}

View File

@@ -84,7 +84,7 @@ public:
virtual QString displayName() const = 0;
protected:
friend class RunConfiguration;
virtual bool fromMap(const QVariantMap &map) = 0;
virtual void fromMap(const QVariantMap &map) = 0;
};
class PROJECTEXPLORER_EXPORT DebuggerProjectSettings
@@ -104,7 +104,7 @@ public:
};
QVariantMap toMap() const;
bool fromMap(const QVariantMap &map);
void fromMap(const QVariantMap &map);
QString displayName() const;

View File

@@ -106,7 +106,7 @@ QVariantMap ValgrindBaseSettings::defaults() const
return map;
}
bool ValgrindBaseSettings::fromMap(const QVariantMap &map)
void ValgrindBaseSettings::fromMap(const QVariantMap &map)
{
// General
setIfPresent(map, QLatin1String(valgrindExeC), &m_valgrindExecutable);
@@ -132,7 +132,6 @@ bool ValgrindBaseSettings::fromMap(const QVariantMap &map)
&m_visualisationMinimumInclusiveCostRatio);
emit changed();
return true;
}
QVariantMap ValgrindBaseSettings::toMap() const
@@ -311,7 +310,7 @@ QVariantMap ValgrindGlobalSettings::defaults() const
return map;
}
bool ValgrindGlobalSettings::fromMap(const QVariantMap &map)
void ValgrindGlobalSettings::fromMap(const QVariantMap &map)
{
ValgrindBaseSettings::fromMap(map);
@@ -325,8 +324,6 @@ bool ValgrindGlobalSettings::fromMap(const QVariantMap &map)
if (map.contains(QLatin1String(callgrindCostFormatC)))
m_costFormat = static_cast<CostDelegate::CostFormat>(map.value(QLatin1String(callgrindCostFormatC)).toInt());
setIfPresent(map, QLatin1String(callgrindCycleDetectionC), &m_detectCycles);
return true;
}
QVariantMap ValgrindGlobalSettings::toMap() const
@@ -441,15 +438,13 @@ QVariantMap ValgrindProjectSettings::defaults() const
return map;
}
bool ValgrindProjectSettings::fromMap(const QVariantMap &map)
void ValgrindProjectSettings::fromMap(const QVariantMap &map)
{
ValgrindBaseSettings::fromMap(map);
// Memcheck
setIfPresent(map, addedSuppressionFilesC, &m_addedSuppressionFiles);
setIfPresent(map, removedSuppressionFilesC, &m_disabledGlobalSuppressionFiles);
return true;
}
QVariantMap ValgrindProjectSettings::toMap() const

View File

@@ -57,7 +57,7 @@ public:
virtual QVariantMap toMap() const;
virtual QVariantMap defaults() const;
virtual bool fromMap(const QVariantMap &map);
virtual void fromMap(const QVariantMap &map);
virtual QString id() const;
virtual QString displayName() const;
@@ -176,7 +176,7 @@ public:
QWidget *createConfigWidget(QWidget *parent);
QVariantMap toMap() const;
QVariantMap defaults() const;
bool fromMap(const QVariantMap &map);
void fromMap(const QVariantMap &map);
/*
* Global memcheck settings
@@ -231,7 +231,7 @@ public:
QWidget *createConfigWidget(QWidget *parent);
QVariantMap toMap() const;
QVariantMap defaults() const;
bool fromMap(const QVariantMap &map);
void fromMap(const QVariantMap &map);
/**
* Per-project memcheck settings, saves a diff to the global suppression files list