From 43f69abea1a048cb372a68734a8b36f0a3e38142 Mon Sep 17 00:00:00 2001
From: hjk <qtc-committer@nokia.com>
Date: Thu, 23 Feb 2012 14:41:28 +0100
Subject: [PATCH] Rename {Analyzer,Debugger}ProjectSettings to
 *RunConfigurationAspect

Change-Id: I5913ddaaab1a80b1557f0bcf7ebcc15e0e4b74eb
Reviewed-by: hjk <qthjk@ovi.com>
---
 .../analyzerbase/analyzerrunconfigwidget.cpp  | 22 +++++------
 .../analyzerbase/analyzerrunconfigwidget.h    |  2 +-
 .../analyzerruncontrolfactory.cpp             |  6 +--
 src/plugins/analyzerbase/analyzersettings.cpp | 14 +++----
 src/plugins/analyzerbase/analyzersettings.h   |  6 +--
 src/plugins/debugger/debuggerrunner.cpp       | 22 +++++------
 .../projectexplorer/runconfiguration.cpp      | 38 +++++++++----------
 .../projectexplorer/runconfiguration.h        | 12 +++---
 src/plugins/valgrind/callgrindtool.cpp        |  2 +-
 src/plugins/valgrind/memchecktool.cpp         |  2 +-
 src/plugins/valgrind/valgrindengine.cpp       |  2 +-
 11 files changed, 62 insertions(+), 66 deletions(-)

diff --git a/src/plugins/analyzerbase/analyzerrunconfigwidget.cpp b/src/plugins/analyzerbase/analyzerrunconfigwidget.cpp
index 16b57210564..d4afaf47d47 100644
--- a/src/plugins/analyzerbase/analyzerrunconfigwidget.cpp
+++ b/src/plugins/analyzerbase/analyzerrunconfigwidget.cpp
@@ -98,17 +98,17 @@ void AnalyzerRunConfigWidget::setRunConfiguration(ProjectExplorer::RunConfigurat
 {
     QTC_ASSERT(rc, return);
 
-    m_settings = rc->extraAspect<AnalyzerProjectSettings>();
-    QTC_ASSERT(m_settings, return);
+    m_aspect = rc->extraAspect<AnalyzerRunConfigurationAspect>();
+    QTC_ASSERT(m_aspect, return);
 
     // add config widget for each sub config
-    foreach (AbstractAnalyzerSubConfig *config, m_settings->customSubConfigs()) {
+    foreach (AbstractAnalyzerSubConfig *config, m_aspect->customSubConfigs()) {
         QWidget *widget = new AnalyzerToolDetailWidget(config);
         m_subConfigWidget->layout()->addWidget(widget);
     }
-    setDetailEnabled(!m_settings->isUsingGlobalSettings());
-    m_settingsCombo->setCurrentIndex(m_settings->isUsingGlobalSettings() ? 0 : 1);
-    m_restoreButton->setEnabled(!m_settings->isUsingGlobalSettings());
+    setDetailEnabled(!m_aspect->isUsingGlobalSettings());
+    m_settingsCombo->setCurrentIndex(m_aspect->isUsingGlobalSettings() ? 0 : 1);
+    m_restoreButton->setEnabled(!m_aspect->isUsingGlobalSettings());
 }
 
 void AnalyzerRunConfigWidget::setDetailEnabled(bool value)
@@ -120,16 +120,16 @@ void AnalyzerRunConfigWidget::setDetailEnabled(bool value)
 
 void AnalyzerRunConfigWidget::chooseSettings(int setting)
 {
-    QTC_ASSERT(m_settings, return);
+    QTC_ASSERT(m_aspect, return);
     setDetailEnabled(setting != 0);
-    m_settings->setUsingGlobalSettings(setting == 0);
-    m_restoreButton->setEnabled(!m_settings->isUsingGlobalSettings());
+    m_aspect->setUsingGlobalSettings(setting == 0);
+    m_restoreButton->setEnabled(!m_aspect->isUsingGlobalSettings());
 }
 
 void AnalyzerRunConfigWidget::restoreGlobal()
 {
-    QTC_ASSERT(m_settings, return);
-    m_settings->resetCustomToGlobalSettings();
+    QTC_ASSERT(m_aspect, return);
+    m_aspect->resetCustomToGlobalSettings();
 }
 
 } // namespace Internal
diff --git a/src/plugins/analyzerbase/analyzerrunconfigwidget.h b/src/plugins/analyzerbase/analyzerrunconfigwidget.h
index da7c9129e26..87f20e49bb0 100644
--- a/src/plugins/analyzerbase/analyzerrunconfigwidget.h
+++ b/src/plugins/analyzerbase/analyzerrunconfigwidget.h
@@ -85,7 +85,7 @@ private slots:
 
 private:
     QWidget *m_subConfigWidget;
-    AnalyzerProjectSettings *m_settings;
+    AnalyzerRunConfigurationAspect *m_aspect;
     QComboBox *m_settingsCombo;
     QPushButton *m_restoreButton;
 };
diff --git a/src/plugins/analyzerbase/analyzerruncontrolfactory.cpp b/src/plugins/analyzerbase/analyzerruncontrolfactory.cpp
index e887f4008e2..87392ae802f 100644
--- a/src/plugins/analyzerbase/analyzerruncontrolfactory.cpp
+++ b/src/plugins/analyzerbase/analyzerruncontrolfactory.cpp
@@ -86,15 +86,11 @@ RunControl *AnalyzerRunControlFactory::create(RunConfiguration *runConfiguration
 
 IRunConfigurationAspect *AnalyzerRunControlFactory::createRunConfigurationAspect()
 {
-    return new AnalyzerProjectSettings;
+    return new AnalyzerRunConfigurationAspect;
 }
 
 RunConfigWidget *AnalyzerRunControlFactory::createConfigurationWidget(RunConfiguration *runConfiguration)
 {
-    AnalyzerProjectSettings *settings = runConfiguration->extraAspect<AnalyzerProjectSettings>();
-    if (!settings)
-        return 0;
-
     AnalyzerRunConfigWidget *ret = new AnalyzerRunConfigWidget;
     ret->setRunConfiguration(runConfiguration);
     return ret;
diff --git a/src/plugins/analyzerbase/analyzersettings.cpp b/src/plugins/analyzerbase/analyzersettings.cpp
index 325c0d4f65f..f3e955e6704 100644
--- a/src/plugins/analyzerbase/analyzersettings.cpp
+++ b/src/plugins/analyzerbase/analyzersettings.cpp
@@ -152,7 +152,7 @@ void AnalyzerGlobalSettings::registerTool(IAnalyzerTool *tool)
 }
 
 
-AnalyzerProjectSettings::AnalyzerProjectSettings(QObject *parent)
+AnalyzerRunConfigurationAspect::AnalyzerRunConfigurationAspect(QObject *parent)
     : AnalyzerSettings(parent), m_useGlobalSettings(true)
 {
     QList<IAnalyzerTool*> tools = AnalyzerManager::tools();
@@ -167,30 +167,30 @@ AnalyzerProjectSettings::AnalyzerProjectSettings(QObject *parent)
     resetCustomToGlobalSettings();
 }
 
-AnalyzerProjectSettings::~AnalyzerProjectSettings()
+AnalyzerRunConfigurationAspect::~AnalyzerRunConfigurationAspect()
 {
     qDeleteAll(m_customConfigurations);
 }
 
-QString AnalyzerProjectSettings::displayName() const
+QString AnalyzerRunConfigurationAspect::displayName() const
 {
     return tr("Analyzer Settings");
 }
 
-void AnalyzerProjectSettings::fromMap(const QVariantMap &map)
+void AnalyzerRunConfigurationAspect::fromMap(const QVariantMap &map)
 {
     AnalyzerSettings::fromMap(map, &m_customConfigurations);
     m_useGlobalSettings = map.value(QLatin1String(useGlobalC), true).toBool();
 }
 
-QVariantMap AnalyzerProjectSettings::toMap() const
+QVariantMap AnalyzerRunConfigurationAspect::toMap() const
 {
     QVariantMap map = AnalyzerSettings::toMap(m_customConfigurations);
     map.insert(QLatin1String(useGlobalC), m_useGlobalSettings);
     return map;
 }
 
-void AnalyzerProjectSettings::setUsingGlobalSettings(bool value)
+void AnalyzerRunConfigurationAspect::setUsingGlobalSettings(bool value)
 {
     if (value == m_useGlobalSettings)
         return;
@@ -202,7 +202,7 @@ void AnalyzerProjectSettings::setUsingGlobalSettings(bool value)
     }
 }
 
-void AnalyzerProjectSettings::resetCustomToGlobalSettings()
+void AnalyzerRunConfigurationAspect::resetCustomToGlobalSettings()
 {
     AnalyzerGlobalSettings *gs = AnalyzerGlobalSettings::instance();
     AnalyzerSettings::fromMap(gs->toMap(), &m_customConfigurations);
diff --git a/src/plugins/analyzerbase/analyzersettings.h b/src/plugins/analyzerbase/analyzersettings.h
index 3a3788946d3..5b581cddce1 100644
--- a/src/plugins/analyzerbase/analyzersettings.h
+++ b/src/plugins/analyzerbase/analyzersettings.h
@@ -160,14 +160,14 @@ private:
  * rc->extraAspect<AnalyzerProjectSettings>()->subConfig<YourProjectConfig>()->...
  * @endcode
  */
-class ANALYZER_EXPORT AnalyzerProjectSettings
+class ANALYZER_EXPORT AnalyzerRunConfigurationAspect
     : public AnalyzerSettings, public ProjectExplorer::IRunConfigurationAspect
 {
     Q_OBJECT
 
 public:
-    AnalyzerProjectSettings(QObject *parent = 0);
-    ~AnalyzerProjectSettings();
+    AnalyzerRunConfigurationAspect(QObject *parent = 0);
+    ~AnalyzerRunConfigurationAspect();
 
     QString displayName() const;
     virtual QVariantMap toMap() const;
diff --git a/src/plugins/debugger/debuggerrunner.cpp b/src/plugins/debugger/debuggerrunner.cpp
index 42e08f5297d..2069d9d7ca3 100644
--- a/src/plugins/debugger/debuggerrunner.cpp
+++ b/src/plugins/debugger/debuggerrunner.cpp
@@ -172,7 +172,7 @@ private slots:
     void qmlDebugServerPortChanged(int port);
 
 public:
-    DebuggerProjectSettings *m_settings; // not owned
+    DebuggerRunConfigurationAspect *m_aspect; // not owned
 
     QCheckBox *m_useCppDebugger;
     QCheckBox *m_useQmlDebugger;
@@ -183,7 +183,7 @@ public:
 
 DebuggerRunConfigWidget::DebuggerRunConfigWidget(RunConfiguration *runConfiguration)
 {
-    m_settings = runConfiguration->debuggerAspect();
+    m_aspect = runConfiguration->debuggerAspect();
 
     m_useCppDebugger = new QCheckBox(tr("Enable C++"), this);
     m_useQmlDebugger = new QCheckBox(tr("Enable QML"), this);
@@ -199,9 +199,9 @@ DebuggerRunConfigWidget::DebuggerRunConfigWidget(RunConfiguration *runConfigurat
         "qthelp://com.nokia.qtcreator/doc/creator-debugging-qml.html"
         "\">What are the prerequisites?</a>"));
 
-    useCppDebuggerToggled(m_settings->useCppDebugger());
-    useQmlDebuggerToggled(m_settings->useQmlDebugger());
-    m_debugServerPort->setValue(m_settings->qmlDebugServerPort());
+    useCppDebuggerToggled(m_aspect->useCppDebugger());
+    useQmlDebuggerToggled(m_aspect->useQmlDebugger());
+    m_debugServerPort->setValue(m_aspect->qmlDebugServerPort());
 
     connect(m_qmlDebuggerInfoLabel, SIGNAL(linkActivated(QString)),
             Core::HelpManager::instance(), SLOT(handleHelpRequest(QString)));
@@ -212,7 +212,7 @@ DebuggerRunConfigWidget::DebuggerRunConfigWidget(RunConfiguration *runConfigurat
     connect(m_debugServerPort, SIGNAL(valueChanged(int)),
             SLOT(qmlDebugServerPortChanged(int)));
 
-    if (m_settings->areQmlDebuggingOptionsSuppressed()) {
+    if (m_aspect->areQmlDebuggingOptionsSuppressed()) {
         m_debugServerPortLabel->hide();
         m_debugServerPort->hide();
         m_useQmlDebugger->hide();
@@ -235,12 +235,12 @@ DebuggerRunConfigWidget::DebuggerRunConfigWidget(RunConfiguration *runConfigurat
 
 void DebuggerRunConfigWidget::qmlDebugServerPortChanged(int port)
 {
-    m_settings->m_qmlDebugServerPort = port;
+    m_aspect->m_qmlDebugServerPort = port;
 }
 
 void DebuggerRunConfigWidget::useCppDebuggerToggled(bool toggled)
 {
-    m_settings->m_useCppDebugger = toggled;
+    m_aspect->m_useCppDebugger = toggled;
     if (!toggled && !m_useQmlDebugger->isChecked())
         m_useQmlDebugger->setChecked(true);
 }
@@ -250,9 +250,9 @@ void DebuggerRunConfigWidget::useQmlDebuggerToggled(bool toggled)
     m_debugServerPort->setEnabled(toggled);
     m_debugServerPortLabel->setEnabled(toggled);
 
-    m_settings->m_useQmlDebugger = toggled
-            ? DebuggerProjectSettings::EnableQmlDebugger
-            : DebuggerProjectSettings::DisableQmlDebugger;
+    m_aspect->m_useQmlDebugger = toggled
+            ? DebuggerRunConfigurationAspect::EnableQmlDebugger
+            : DebuggerRunConfigurationAspect::DisableQmlDebugger;
     if (!toggled && !m_useCppDebugger->isChecked())
         m_useCppDebugger->setChecked(true);
 }
diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp
index 7044d8099ae..32ed93f71e2 100644
--- a/src/plugins/projectexplorer/runconfiguration.cpp
+++ b/src/plugins/projectexplorer/runconfiguration.cpp
@@ -195,10 +195,10 @@ bool ProcessHandle::equals(const ProcessHandle &rhs) const
 }
 
 /*!
-    \class ProjectExplorer::DebuggerProjectSettings
+    \class ProjectExplorer::DebuggerRunConfigurationAspect
 */
 
-DebuggerProjectSettings::DebuggerProjectSettings(RunConfiguration *rc) :
+DebuggerRunConfigurationAspect::DebuggerRunConfigurationAspect(RunConfiguration *rc) :
     m_runConfiguration(rc),
     m_useCppDebugger(true),
     m_useQmlDebugger(AutoEnableQmlDebugger),
@@ -206,31 +206,31 @@ DebuggerProjectSettings::DebuggerProjectSettings(RunConfiguration *rc) :
     m_suppressQmlDebuggingOptions(false)
 {}
 
-DebuggerProjectSettings::DebuggerProjectSettings(DebuggerProjectSettings *other) :
+DebuggerRunConfigurationAspect::DebuggerRunConfigurationAspect(DebuggerRunConfigurationAspect *other) :
     m_runConfiguration(other->m_runConfiguration),
     m_useCppDebugger(other->m_useCppDebugger),
     m_useQmlDebugger(other->m_useQmlDebugger),
     m_qmlDebugServerPort(other->m_qmlDebugServerPort)
 {}
 
-RunConfiguration *DebuggerProjectSettings::runConfiguration()
+RunConfiguration *DebuggerRunConfigurationAspect::runConfiguration()
 {
     return m_runConfiguration;
 }
 
-void DebuggerProjectSettings::setUseQmlDebugger(bool value)
+void DebuggerRunConfigurationAspect::setUseQmlDebugger(bool value)
 {
     m_useQmlDebugger = value ? EnableQmlDebugger : DisableQmlDebugger;
     emit debuggersChanged();
 }
 
-void DebuggerProjectSettings::setUseCppDebugger(bool value)
+void DebuggerRunConfigurationAspect::setUseCppDebugger(bool value)
 {
     m_useCppDebugger = value;
     emit debuggersChanged();
 }
 
-bool DebuggerProjectSettings::useCppDebugger() const
+bool DebuggerRunConfigurationAspect::useCppDebugger() const
 {
     return m_useCppDebugger;
 }
@@ -242,39 +242,39 @@ static bool isQtQuickAppProject(Project *project)
     return project->files(Project::ExcludeGeneratedFiles).contains(filePath);
 }
 
-bool DebuggerProjectSettings::useQmlDebugger() const
+bool DebuggerRunConfigurationAspect::useQmlDebugger() const
 {
-    if (m_useQmlDebugger == DebuggerProjectSettings::AutoEnableQmlDebugger)
+    if (m_useQmlDebugger == DebuggerRunConfigurationAspect::AutoEnableQmlDebugger)
         return isQtQuickAppProject(m_runConfiguration->target()->project());
-    return m_useQmlDebugger == DebuggerProjectSettings::EnableQmlDebugger;
+    return m_useQmlDebugger == DebuggerRunConfigurationAspect::EnableQmlDebugger;
 }
 
-uint DebuggerProjectSettings::qmlDebugServerPort() const
+uint DebuggerRunConfigurationAspect::qmlDebugServerPort() const
 {
     return m_qmlDebugServerPort;
 }
 
-void DebuggerProjectSettings::setQmllDebugServerPort(uint port)
+void DebuggerRunConfigurationAspect::setQmllDebugServerPort(uint port)
 {
     m_qmlDebugServerPort = port;
 }
 
-void DebuggerProjectSettings::suppressQmlDebuggingOptions()
+void DebuggerRunConfigurationAspect::suppressQmlDebuggingOptions()
 {
     m_suppressQmlDebuggingOptions = true;
 }
 
-bool DebuggerProjectSettings::areQmlDebuggingOptionsSuppressed() const
+bool DebuggerRunConfigurationAspect::areQmlDebuggingOptionsSuppressed() const
 {
     return m_suppressQmlDebuggingOptions;
 }
 
-QString DebuggerProjectSettings::displayName() const
+QString DebuggerRunConfigurationAspect::displayName() const
 {
     return tr("Debugger settings");
 }
 
-QVariantMap DebuggerProjectSettings::toMap() const
+QVariantMap DebuggerRunConfigurationAspect::toMap() const
 {
     QVariantMap map;
     map.insert(QLatin1String(USE_CPP_DEBUGGER_KEY), m_useCppDebugger);
@@ -284,7 +284,7 @@ QVariantMap DebuggerProjectSettings::toMap() const
     return map;
 }
 
-void DebuggerProjectSettings::fromMap(const QVariantMap &map)
+void DebuggerRunConfigurationAspect::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()) {
@@ -312,7 +312,7 @@ void DebuggerProjectSettings::fromMap(const QVariantMap &map)
 
 RunConfiguration::RunConfiguration(Target *target, const QString &id) :
     ProjectConfiguration(target, id),
-    m_debuggerAspect(new DebuggerProjectSettings(this))
+    m_debuggerAspect(new DebuggerRunConfigurationAspect(this))
 {
     Q_ASSERT(target);
     addExtraAspects();
@@ -320,7 +320,7 @@ RunConfiguration::RunConfiguration(Target *target, const QString &id) :
 
 RunConfiguration::RunConfiguration(Target *target, RunConfiguration *source) :
     ProjectConfiguration(target, source),
-    m_debuggerAspect(new DebuggerProjectSettings(source->debuggerAspect()))
+    m_debuggerAspect(new DebuggerRunConfigurationAspect(source->debuggerAspect()))
 {
     Q_ASSERT(target);
     addExtraAspects();
diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h
index 708af8e85bd..a0aaebac145 100644
--- a/src/plugins/projectexplorer/runconfiguration.h
+++ b/src/plugins/projectexplorer/runconfiguration.h
@@ -50,7 +50,7 @@ namespace Utils { class OutputFormatter; }
 namespace ProjectExplorer {
 class Abi;
 class BuildConfiguration;
-class DebuggerProjectSettings;
+class DebuggerRunConfigurationAspect;
 class RunConfiguration;
 class RunControl;
 class Target;
@@ -86,14 +86,14 @@ protected:
     virtual void fromMap(const QVariantMap &map) = 0;
 };
 
-class PROJECTEXPLORER_EXPORT DebuggerProjectSettings
+class PROJECTEXPLORER_EXPORT DebuggerRunConfigurationAspect
     : public QObject, public ProjectExplorer::IRunConfigurationAspect
 {
     Q_OBJECT
 
 public:
-    DebuggerProjectSettings(RunConfiguration *runConfiguration);
-    DebuggerProjectSettings(DebuggerProjectSettings *other);
+    DebuggerRunConfigurationAspect(RunConfiguration *runConfiguration);
+    DebuggerRunConfigurationAspect(DebuggerRunConfigurationAspect *other);
 
     enum QmlDebuggerStatus {
         DisableQmlDebugger = 0,
@@ -147,7 +147,7 @@ public:
     virtual bool fromMap(const QVariantMap &map);
     virtual QVariantMap toMap() const;
 
-    DebuggerProjectSettings *debuggerAspect() const { return m_debuggerAspect; }
+    DebuggerRunConfigurationAspect *debuggerAspect() const { return m_debuggerAspect; }
 
     QList<IRunConfigurationAspect *> extraAspects() const;
     template <typename T> T *extraAspect() const
@@ -178,7 +178,7 @@ private:
     void addExtraAspects();
 
     QList<IRunConfigurationAspect *> m_aspects;
-    DebuggerProjectSettings *m_debuggerAspect;
+    DebuggerRunConfigurationAspect *m_debuggerAspect;
 };
 
 class PROJECTEXPLORER_EXPORT IRunConfigurationFactory : public QObject
diff --git a/src/plugins/valgrind/callgrindtool.cpp b/src/plugins/valgrind/callgrindtool.cpp
index db4a86b6c64..e430a23b5a6 100644
--- a/src/plugins/valgrind/callgrindtool.cpp
+++ b/src/plugins/valgrind/callgrindtool.cpp
@@ -601,7 +601,7 @@ IAnalyzerEngine *CallgrindToolPrivate::createEngine(const AnalyzerStartParameter
 
     // apply project settings
     if (runConfiguration) {
-        if (const AnalyzerProjectSettings *analyzerSettings = runConfiguration->extraAspect<AnalyzerProjectSettings>()) {
+        if (const AnalyzerRunConfigurationAspect *analyzerSettings = runConfiguration->extraAspect<AnalyzerRunConfigurationAspect>()) {
             if (const ValgrindProjectSettings *settings = analyzerSettings->subConfig<ValgrindProjectSettings>()) {
                 m_visualisation->setMinimumInclusiveCostRatio(settings->visualisationMinimumInclusiveCostRatio() / 100.0);
                 m_proxyModel->setMinimumInclusiveCostRatio(settings->minimumInclusiveCostRatio() / 100.0);
diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp
index e93b10353d0..8609909f65f 100644
--- a/src/plugins/valgrind/memchecktool.cpp
+++ b/src/plugins/valgrind/memchecktool.cpp
@@ -236,7 +236,7 @@ void MemcheckTool::maybeActiveRunConfigurationChanged()
     if (ProjectExplorer::Project *project = pe->startupProject()) {
         if (ProjectExplorer::Target *target = project->activeTarget()) {
             if (ProjectExplorer::RunConfiguration *rc = target->activeRunConfiguration()) {
-                settings = rc->extraAspect<AnalyzerProjectSettings>();
+                settings = rc->extraAspect<AnalyzerRunConfigurationAspect>();
             }
         }
     }
diff --git a/src/plugins/valgrind/valgrindengine.cpp b/src/plugins/valgrind/valgrindengine.cpp
index ce62cec6f33..c07420fd717 100644
--- a/src/plugins/valgrind/valgrindengine.cpp
+++ b/src/plugins/valgrind/valgrindengine.cpp
@@ -63,7 +63,7 @@ ValgrindEngine::ValgrindEngine(IAnalyzerTool *tool, const AnalyzerStartParameter
       m_isStopping(false)
 {
     if (runConfiguration)
-        m_settings = runConfiguration->extraAspect<AnalyzerProjectSettings>();
+        m_settings = runConfiguration->extraAspect<AnalyzerRunConfigurationAspect>();
 
     if  (!m_settings)
         m_settings = AnalyzerGlobalSettings::instance();
-- 
GitLab