Commit 28aa2d54 authored by dt's avatar dt
Browse files

change RunConfiguration::addedRunConfiguration() removedRunConfiguration()

To simply transmit the RunConfiguration

Reviewed-By: Tobias Hunger
parent 28d021a3
...@@ -418,7 +418,7 @@ void Project::addRunConfiguration(RunConfiguration* runConfiguration) ...@@ -418,7 +418,7 @@ void Project::addRunConfiguration(RunConfiguration* runConfiguration)
QTC_ASSERT(runConfiguration && !m_runConfigurations.contains(runConfiguration), return); QTC_ASSERT(runConfiguration && !m_runConfigurations.contains(runConfiguration), return);
m_runConfigurations.push_back(runConfiguration); m_runConfigurations.push_back(runConfiguration);
emit addedRunConfiguration(this, runConfiguration->displayName()); emit addedRunConfiguration(runConfiguration);
} }
void Project::removeRunConfiguration(RunConfiguration* runConfiguration) void Project::removeRunConfiguration(RunConfiguration* runConfiguration)
...@@ -438,7 +438,7 @@ void Project::removeRunConfiguration(RunConfiguration* runConfiguration) ...@@ -438,7 +438,7 @@ void Project::removeRunConfiguration(RunConfiguration* runConfiguration)
} }
m_runConfigurations.removeOne(runConfiguration); m_runConfigurations.removeOne(runConfiguration);
emit removedRunConfiguration(this, runConfiguration->displayName()); emit removedRunConfiguration(runConfiguration);
delete runConfiguration; delete runConfiguration;
} }
......
...@@ -133,8 +133,8 @@ signals: ...@@ -133,8 +133,8 @@ signals:
void activeRunConfigurationChanged(); void activeRunConfigurationChanged();
void runConfigurationsEnabledStateChanged(); void runConfigurationsEnabledStateChanged();
void removedRunConfiguration(ProjectExplorer::Project *p, const QString &name); void removedRunConfiguration(ProjectExplorer::RunConfiguration *rc);
void addedRunConfiguration(ProjectExplorer::Project *p, const QString &name); void addedRunConfiguration(ProjectExplorer::RunConfiguration *rc);
void removedBuildConfiguration(ProjectExplorer::BuildConfiguration *bc); void removedBuildConfiguration(ProjectExplorer::BuildConfiguration *bc);
void addedBuildConfiguration(ProjectExplorer::BuildConfiguration *bc); void addedBuildConfiguration(ProjectExplorer::BuildConfiguration *bc);
......
...@@ -407,15 +407,8 @@ void RunConfigurationComboBox::activeRunConfigurationChanged() ...@@ -407,15 +407,8 @@ void RunConfigurationComboBox::activeRunConfigurationChanged()
m_ignoreChange = false; m_ignoreChange = false;
} }
void RunConfigurationComboBox::addedRunConfiguration(ProjectExplorer::Project *p, const QString &name) void RunConfigurationComboBox::addedRunConfiguration(RunConfiguration *runConfiguration)
{ {
RunConfiguration *runConfiguration = 0;
foreach(RunConfiguration *rc, p->runConfigurations()) {
if (rc->displayName() == name) {
runConfiguration = rc;
break;
}
}
if (runConfiguration) { if (runConfiguration) {
connect(runConfiguration, SIGNAL(displayNameChanged()), connect(runConfiguration, SIGNAL(displayNameChanged()),
this, SLOT(rebuildTree())); this, SLOT(rebuildTree()));
...@@ -423,10 +416,9 @@ void RunConfigurationComboBox::addedRunConfiguration(ProjectExplorer::Project *p ...@@ -423,10 +416,9 @@ void RunConfigurationComboBox::addedRunConfiguration(ProjectExplorer::Project *p
rebuildTree(); rebuildTree();
} }
void RunConfigurationComboBox::removedRunConfiguration(ProjectExplorer::Project *p, const QString &name) void RunConfigurationComboBox::removedRunConfiguration(RunConfiguration *rc)
{ {
Q_UNUSED(p) Q_UNUSED(rc)
Q_UNUSED(name)
rebuildTree(); rebuildTree();
} }
...@@ -448,20 +440,20 @@ void RunConfigurationComboBox::connectToProject(ProjectExplorer::Project *p) ...@@ -448,20 +440,20 @@ void RunConfigurationComboBox::connectToProject(ProjectExplorer::Project *p)
{ {
connect(p, SIGNAL(activeRunConfigurationChanged()), connect(p, SIGNAL(activeRunConfigurationChanged()),
this, SLOT(activeRunConfigurationChanged())); this, SLOT(activeRunConfigurationChanged()));
connect(p, SIGNAL(addedRunConfiguration(ProjectExplorer::Project *, QString)), connect(p, SIGNAL(addedRunConfiguration(ProjectExplorer::RunConfiguration *)),
this, SLOT(addedRunConfiguration(ProjectExplorer::Project *, QString))); this, SLOT(addedRunConfiguration(ProjectExplorer::RunConfiguration *)));
connect(p, SIGNAL(removedRunConfiguration(ProjectExplorer::Project *, QString)), connect(p, SIGNAL(removedRunConfiguration(ProjectExplorer::RunConfiguration *)),
this, SLOT(removedRunConfiguration(ProjectExplorer::Project *, QString))); this, SLOT(removedRunConfiguration(ProjectExplorer::RunConfiguration *)));
} }
void RunConfigurationComboBox::disconnectFromProject(ProjectExplorer::Project *p) void RunConfigurationComboBox::disconnectFromProject(ProjectExplorer::Project *p)
{ {
disconnect(p, SIGNAL(activeRunConfigurationChanged()), disconnect(p, SIGNAL(activeRunConfigurationChanged()),
this, SLOT(activeRunConfigurationChanged())); this, SLOT(activeRunConfigurationChanged()));
disconnect(p, SIGNAL(addedRunConfiguration(ProjectExplorer::Project *, QString)), disconnect(p, SIGNAL(addedRunConfiguration(ProjectExplorer::RunConfiguration *)),
this, SLOT(addedRunConfiguration(ProjectExplorer::Project *, QString))); this, SLOT(addedRunConfiguration(ProjectExplorer::RunConfiguration *)));
disconnect(p, SIGNAL(removedRunConfiguration(ProjectExplorer::Project *, QString)), disconnect(p, SIGNAL(removedRunConfiguration(ProjectExplorer::RunConfiguration *)),
this, SLOT(removedRunConfiguration(ProjectExplorer::Project *, QString))); this, SLOT(removedRunConfiguration(ProjectExplorer::RunConfiguration *)));
} }
void RunConfigurationComboBox::rebuildTree() void RunConfigurationComboBox::rebuildTree()
......
...@@ -50,6 +50,7 @@ namespace ProjectExplorer { ...@@ -50,6 +50,7 @@ namespace ProjectExplorer {
class IPropertiesPanel; class IPropertiesPanel;
class Project; class Project;
class BuildConfiguration; class BuildConfiguration;
class RunConfiguration;
namespace Internal { namespace Internal {
...@@ -130,8 +131,8 @@ public: ...@@ -130,8 +131,8 @@ public:
private slots: private slots:
void activeRunConfigurationChanged(); void activeRunConfigurationChanged();
void activeItemChanged(int); void activeItemChanged(int);
void addedRunConfiguration(ProjectExplorer::Project *p, const QString &); void addedRunConfiguration(ProjectExplorer::RunConfiguration *);
void removedRunConfiguration(ProjectExplorer::Project *p, const QString &); void removedRunConfiguration(ProjectExplorer::RunConfiguration *);
void projectAdded(ProjectExplorer::Project*); void projectAdded(ProjectExplorer::Project*);
void projectRemoved(ProjectExplorer::Project*); void projectRemoved(ProjectExplorer::Project*);
void rebuildTree(); void rebuildTree();
......
...@@ -200,9 +200,9 @@ RunSettingsWidget::RunSettingsWidget(Project *project) ...@@ -200,9 +200,9 @@ RunSettingsWidget::RunSettingsWidget(Project *project)
connect(m_ui->removeToolButton, SIGNAL(clicked(bool)), connect(m_ui->removeToolButton, SIGNAL(clicked(bool)),
this, SLOT(removeRunConfiguration())); this, SLOT(removeRunConfiguration()));
connect(m_project, SIGNAL(removedRunConfiguration(ProjectExplorer::Project *, QString)), connect(m_project, SIGNAL(removedRunConfiguration(ProjectExplorer::RunConfiguration *)),
this, SLOT(initRunConfigurationComboBox())); this, SLOT(initRunConfigurationComboBox()));
connect(m_project, SIGNAL(addedRunConfiguration(ProjectExplorer::Project *, QString)), connect(m_project, SIGNAL(addedRunConfiguration(ProjectExplorer::RunConfiguration *)),
this, SLOT(initRunConfigurationComboBox())); this, SLOT(initRunConfigurationComboBox()));
connect(m_project, SIGNAL(activeRunConfigurationChanged()), connect(m_project, SIGNAL(activeRunConfigurationChanged()),
......
...@@ -589,10 +589,10 @@ RunConfiguration *MaemoRunConfigurationFactory::create(Project *project, ...@@ -589,10 +589,10 @@ RunConfiguration *MaemoRunConfigurationFactory::create(Project *project,
Qt4Project *qt4project = qobject_cast<Qt4Project *>(project); Qt4Project *qt4project = qobject_cast<Qt4Project *>(project);
Q_ASSERT(qt4project); Q_ASSERT(qt4project);
connect(project, SIGNAL(addedRunConfiguration(ProjectExplorer::Project*, connect(project, SIGNAL(addedRunConfiguration(ProjectExplorer::RunConfiguration *)),
QString)), this, SLOT(addedRunConfiguration(ProjectExplorer::Project*))); this, SLOT(addedRunConfiguration(ProjectExplorer::RunConfiguration *)));
connect(project, SIGNAL(removedRunConfiguration(ProjectExplorer::Project*, connect(project, SIGNAL(removedRunConfiguration(RunConfiguration *)),
QString)), this, SLOT(removedRunConfiguration(ProjectExplorer::Project*))); this, SLOT(removedRunConfiguration(ProjectExplorer::RunConfiguration *)));
RunConfiguration *rc = 0; RunConfiguration *rc = 0;
const QLatin1String prefix("MaemoRunConfiguration."); const QLatin1String prefix("MaemoRunConfiguration.");
...@@ -635,17 +635,15 @@ bool hasMaemoRunConfig(ProjectExplorer::Project* project) ...@@ -635,17 +635,15 @@ bool hasMaemoRunConfig(ProjectExplorer::Project* project)
return false; return false;
} }
void MaemoRunConfigurationFactory::addedRunConfiguration( void MaemoRunConfigurationFactory::addedRunConfiguration(ProjectExplorer::RunConfiguration *rc)
ProjectExplorer::Project *project)
{ {
if (hasMaemoRunConfig(project)) if (hasMaemoRunConfig(rc->project()))
MaemoManager::instance()->addQemuSimulatorStarter(project); MaemoManager::instance()->addQemuSimulatorStarter(project);
} }
void MaemoRunConfigurationFactory::removedRunConfiguration( void MaemoRunConfigurationFactory::removedRunConfiguration(ProjectExplorer::RunConfiguration *rc)
ProjectExplorer::Project *project)
{ {
if (!hasMaemoRunConfig(project)) if (!hasMaemoRunConfig(rc->project()))
MaemoManager::instance()->removeQemuSimulatorStarter(project); MaemoManager::instance()->removeQemuSimulatorStarter(project);
} }
......
...@@ -186,8 +186,8 @@ public: ...@@ -186,8 +186,8 @@ public:
ProjectExplorer::RunConfiguration *create(ProjectExplorer::Project *project, const QString &id); ProjectExplorer::RunConfiguration *create(ProjectExplorer::Project *project, const QString &id);
private slots: private slots:
void addedRunConfiguration(ProjectExplorer::Project *project); void addedRunConfiguration(ProjectExplorer::RunConfiguration *rc);
void removedRunConfiguration(ProjectExplorer::Project *project); void removedRunConfiguration(ProjectExplorer::RunConfiguration *rc);
void projectAdded(ProjectExplorer::Project *project); void projectAdded(ProjectExplorer::Project *project);
void projectRemoved(ProjectExplorer::Project *project); void projectRemoved(ProjectExplorer::Project *project);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment