Analyzer: Cleanup settings handling

More flexible, less over-engineered this way.

Change-Id: I3e224a6be85d3a187056d79fd506e8cf6a32c8a9
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
hjk
2013-08-08 17:37:37 +02:00
parent 2d4afd0494
commit 5fa7b60b97
32 changed files with 282 additions and 632 deletions

View File

@@ -213,12 +213,6 @@ public:
};
static ValgrindGlobalSettings *globalSettings()
{
return AnalyzerGlobalSettings::instance()->subConfig<ValgrindGlobalSettings>();
}
CallgrindToolPrivate::CallgrindToolPrivate(CallgrindTool *parent)
: q(parent)
, m_dataModel(new DataModel(this))
@@ -399,7 +393,7 @@ void CallgrindToolPrivate::updateCostFormat()
m_calleesView->setCostFormat(format);
m_callersView->setCostFormat(format);
}
if (ValgrindGlobalSettings *settings = globalSettings())
if (ValgrindGlobalSettings *settings = ValgrindPlugin::globalSettings())
settings->setCostFormat(format);
}
@@ -583,8 +577,9 @@ AnalyzerRunControl *CallgrindToolPrivate::createRunControl(const AnalyzerStartPa
// apply project settings
if (runConfiguration) {
if (const AnalyzerRunConfigurationAspect *analyzerSettings = runConfiguration->extraAspect<AnalyzerRunConfigurationAspect>()) {
if (const ValgrindProjectSettings *settings = analyzerSettings->subConfig<ValgrindProjectSettings>()) {
if (AnalyzerRunConfigurationAspect *analyzerAspect
= runConfiguration->extraAspect<AnalyzerRunConfigurationAspect>(ANALYZER_VALGRIND_SETTINGS)) {
if (const ValgrindBaseSettings *settings = qobject_cast<ValgrindBaseSettings *>(analyzerAspect->currentConfig())) {
m_visualisation->setMinimumInclusiveCostRatio(settings->visualisationMinimumInclusiveCostRatio() / 100.0);
m_proxyModel->setMinimumInclusiveCostRatio(settings->minimumInclusiveCostRatio() / 100.0);
m_dataModel->setVerboseToolTipsEnabled(settings->enableEventToolTips());
@@ -785,7 +780,7 @@ QWidget *CallgrindToolPrivate::createWidgets()
}
ValgrindGlobalSettings *settings = globalSettings();
ValgrindGlobalSettings *settings = ValgrindPlugin::globalSettings();
// cycle detection
//action = new QAction(QLatin1String("Cycle Detection"), this); ///FIXME: icon