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)
QTC_ASSERT(runConfiguration && !m_runConfigurations.contains(runConfiguration), return);
m_runConfigurations.push_back(runConfiguration);
emit addedRunConfiguration(this, runConfiguration->displayName());
emit addedRunConfiguration(runConfiguration);
}
void Project::removeRunConfiguration(RunConfiguration* runConfiguration)
......@@ -438,7 +438,7 @@ void Project::removeRunConfiguration(RunConfiguration* runConfiguration)
}
m_runConfigurations.removeOne(runConfiguration);
emit removedRunConfiguration(this, runConfiguration->displayName());
emit removedRunConfiguration(runConfiguration);
delete runConfiguration;
}
......
......@@ -133,8 +133,8 @@ signals:
void activeRunConfigurationChanged();
void runConfigurationsEnabledStateChanged();
void removedRunConfiguration(ProjectExplorer::Project *p, const QString &name);
void addedRunConfiguration(ProjectExplorer::Project *p, const QString &name);
void removedRunConfiguration(ProjectExplorer::RunConfiguration *rc);
void addedRunConfiguration(ProjectExplorer::RunConfiguration *rc);
void removedBuildConfiguration(ProjectExplorer::BuildConfiguration *bc);
void addedBuildConfiguration(ProjectExplorer::BuildConfiguration *bc);
......
......@@ -407,15 +407,8 @@ void RunConfigurationComboBox::activeRunConfigurationChanged()
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) {
connect(runConfiguration, SIGNAL(displayNameChanged()),
this, SLOT(rebuildTree()));
......@@ -423,10 +416,9 @@ void RunConfigurationComboBox::addedRunConfiguration(ProjectExplorer::Project *p
rebuildTree();
}
void RunConfigurationComboBox::removedRunConfiguration(ProjectExplorer::Project *p, const QString &name)
void RunConfigurationComboBox::removedRunConfiguration(RunConfiguration *rc)
{
Q_UNUSED(p)
Q_UNUSED(name)
Q_UNUSED(rc)
rebuildTree();
}
......@@ -448,20 +440,20 @@ void RunConfigurationComboBox::connectToProject(ProjectExplorer::Project *p)
{
connect(p, SIGNAL(activeRunConfigurationChanged()),
this, SLOT(activeRunConfigurationChanged()));
connect(p, SIGNAL(addedRunConfiguration(ProjectExplorer::Project *, QString)),
this, SLOT(addedRunConfiguration(ProjectExplorer::Project *, QString)));
connect(p, SIGNAL(removedRunConfiguration(ProjectExplorer::Project *, QString)),
this, SLOT(removedRunConfiguration(ProjectExplorer::Project *, QString)));
connect(p, SIGNAL(addedRunConfiguration(ProjectExplorer::RunConfiguration *)),
this, SLOT(addedRunConfiguration(ProjectExplorer::RunConfiguration *)));
connect(p, SIGNAL(removedRunConfiguration(ProjectExplorer::RunConfiguration *)),
this, SLOT(removedRunConfiguration(ProjectExplorer::RunConfiguration *)));
}
void RunConfigurationComboBox::disconnectFromProject(ProjectExplorer::Project *p)
{
disconnect(p, SIGNAL(activeRunConfigurationChanged()),
this, SLOT(activeRunConfigurationChanged()));
disconnect(p, SIGNAL(addedRunConfiguration(ProjectExplorer::Project *, QString)),
this, SLOT(addedRunConfiguration(ProjectExplorer::Project *, QString)));
disconnect(p, SIGNAL(removedRunConfiguration(ProjectExplorer::Project *, QString)),
this, SLOT(removedRunConfiguration(ProjectExplorer::Project *, QString)));
disconnect(p, SIGNAL(addedRunConfiguration(ProjectExplorer::RunConfiguration *)),
this, SLOT(addedRunConfiguration(ProjectExplorer::RunConfiguration *)));
disconnect(p, SIGNAL(removedRunConfiguration(ProjectExplorer::RunConfiguration *)),
this, SLOT(removedRunConfiguration(ProjectExplorer::RunConfiguration *)));
}
void RunConfigurationComboBox::rebuildTree()
......
......@@ -50,6 +50,7 @@ namespace ProjectExplorer {
class IPropertiesPanel;
class Project;
class BuildConfiguration;
class RunConfiguration;
namespace Internal {
......@@ -130,8 +131,8 @@ public:
private slots:
void activeRunConfigurationChanged();
void activeItemChanged(int);
void addedRunConfiguration(ProjectExplorer::Project *p, const QString &);
void removedRunConfiguration(ProjectExplorer::Project *p, const QString &);
void addedRunConfiguration(ProjectExplorer::RunConfiguration *);
void removedRunConfiguration(ProjectExplorer::RunConfiguration *);
void projectAdded(ProjectExplorer::Project*);
void projectRemoved(ProjectExplorer::Project*);
void rebuildTree();
......
......@@ -200,9 +200,9 @@ RunSettingsWidget::RunSettingsWidget(Project *project)
connect(m_ui->removeToolButton, SIGNAL(clicked(bool)),
this, SLOT(removeRunConfiguration()));
connect(m_project, SIGNAL(removedRunConfiguration(ProjectExplorer::Project *, QString)),
connect(m_project, SIGNAL(removedRunConfiguration(ProjectExplorer::RunConfiguration *)),
this, SLOT(initRunConfigurationComboBox()));
connect(m_project, SIGNAL(addedRunConfiguration(ProjectExplorer::Project *, QString)),
connect(m_project, SIGNAL(addedRunConfiguration(ProjectExplorer::RunConfiguration *)),
this, SLOT(initRunConfigurationComboBox()));
connect(m_project, SIGNAL(activeRunConfigurationChanged()),
......
......@@ -589,10 +589,10 @@ RunConfiguration *MaemoRunConfigurationFactory::create(Project *project,
Qt4Project *qt4project = qobject_cast<Qt4Project *>(project);
Q_ASSERT(qt4project);
connect(project, SIGNAL(addedRunConfiguration(ProjectExplorer::Project*,
QString)), this, SLOT(addedRunConfiguration(ProjectExplorer::Project*)));
connect(project, SIGNAL(removedRunConfiguration(ProjectExplorer::Project*,
QString)), this, SLOT(removedRunConfiguration(ProjectExplorer::Project*)));
connect(project, SIGNAL(addedRunConfiguration(ProjectExplorer::RunConfiguration *)),
this, SLOT(addedRunConfiguration(ProjectExplorer::RunConfiguration *)));
connect(project, SIGNAL(removedRunConfiguration(RunConfiguration *)),
this, SLOT(removedRunConfiguration(ProjectExplorer::RunConfiguration *)));
RunConfiguration *rc = 0;
const QLatin1String prefix("MaemoRunConfiguration.");
......@@ -635,17 +635,15 @@ bool hasMaemoRunConfig(ProjectExplorer::Project* project)
return false;
}
void MaemoRunConfigurationFactory::addedRunConfiguration(
ProjectExplorer::Project *project)
void MaemoRunConfigurationFactory::addedRunConfiguration(ProjectExplorer::RunConfiguration *rc)
{
if (hasMaemoRunConfig(project))
if (hasMaemoRunConfig(rc->project()))
MaemoManager::instance()->addQemuSimulatorStarter(project);
}
void MaemoRunConfigurationFactory::removedRunConfiguration(
ProjectExplorer::Project *project)
void MaemoRunConfigurationFactory::removedRunConfiguration(ProjectExplorer::RunConfiguration *rc)
{
if (!hasMaemoRunConfig(project))
if (!hasMaemoRunConfig(rc->project()))
MaemoManager::instance()->removeQemuSimulatorStarter(project);
}
......
......@@ -186,8 +186,8 @@ public:
ProjectExplorer::RunConfiguration *create(ProjectExplorer::Project *project, const QString &id);
private slots:
void addedRunConfiguration(ProjectExplorer::Project *project);
void removedRunConfiguration(ProjectExplorer::Project *project);
void addedRunConfiguration(ProjectExplorer::RunConfiguration *rc);
void removedRunConfiguration(ProjectExplorer::RunConfiguration *rc);
void projectAdded(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