Commit 52d07a9b authored by dt's avatar dt
Browse files

BuildConfigurations know their project, these signals can be simpler

parent b5099480
......@@ -85,7 +85,7 @@ void Project::addBuildConfiguration(BuildConfiguration *configuration)
// add it
m_buildConfigurationValues.push_back(configuration);
emit addedBuildConfiguration(this, configuration);
emit addedBuildConfiguration(configuration);
}
void Project::removeBuildConfiguration(BuildConfiguration *configuration)
......@@ -96,7 +96,7 @@ void Project::removeBuildConfiguration(BuildConfiguration *configuration)
m_buildConfigurationValues.removeOne(configuration);
emit removedBuildConfiguration(this, configuration);
emit removedBuildConfiguration(configuration);
delete configuration;
}
......
......@@ -127,9 +127,7 @@ signals:
void fileListChanged();
// TODO clean up signal names
// might be better to also have
// a aboutToRemoveRunConfiguration
// and a removedBuildConfiguration
// might be better to also have aboutToRemove signals
// a runconfiguration display name changed is missing
void activeBuildConfigurationChanged();
void activeRunConfigurationChanged();
......@@ -138,8 +136,8 @@ signals:
void removedRunConfiguration(ProjectExplorer::Project *p, const QString &name);
void addedRunConfiguration(ProjectExplorer::Project *p, const QString &name);
void removedBuildConfiguration(ProjectExplorer::Project *p, ProjectExplorer::BuildConfiguration *bc);
void addedBuildConfiguration(ProjectExplorer::Project *p, ProjectExplorer::BuildConfiguration *bc);
void removedBuildConfiguration(ProjectExplorer::BuildConfiguration *bc);
void addedBuildConfiguration(ProjectExplorer::BuildConfiguration *bc);
protected:
/* This method is called when the project .user file is saved. Simply call
......
......@@ -836,7 +836,6 @@ void ProjectExplorerPlugin::unloadProject()
QList<Core::IFile*> filesToSave;
filesToSave << fi;
// FIXME: What we want here is to check whether we need to safe any of the pro/pri files in this project
// check the number of modified files
int readonlycount = 0;
......
......@@ -518,10 +518,10 @@ BuildConfigurationComboBox::BuildConfigurationComboBox(Project *p, QWidget *pare
// this, SLOT(nameChanged(ProjectExplorer::BuildConfiguration *)));
connect(p, SIGNAL(activeBuildConfigurationChanged()),
this, SLOT(activeConfigurationChanged()));
connect(p, SIGNAL(addedBuildConfiguration(ProjectExplorer::Project*,ProjectExplorer::BuildConfiguration*)),
this, SLOT(addedBuildConfiguration(ProjectExplorer::Project*,ProjectExplorer::BuildConfiguration*)));
connect(p, SIGNAL(removedBuildConfiguration(ProjectExplorer::Project*,ProjectExplorer::BuildConfiguration*)),
this, SLOT(removedBuildConfiguration(ProjectExplorer::Project*,ProjectExplorer::BuildConfiguration*)));
connect(p, SIGNAL(addedBuildConfiguration(ProjectExplorer::BuildConfiguration*)),
this, SLOT(addedBuildConfiguration(ProjectExplorer::BuildConfiguration*)));
connect(p, SIGNAL(removedBuildConfiguration(ProjectExplorer::BuildConfiguration*)),
this, SLOT(removedBuildConfiguration(ProjectExplorer::BuildConfiguration*)));
connect(m_comboBox, SIGNAL(activated(int)),
this, SLOT(changedIndex(int)));
}
......@@ -560,10 +560,8 @@ void BuildConfigurationComboBox::activeConfigurationChanged()
ignoreIndexChange = false;
}
void BuildConfigurationComboBox::addedBuildConfiguration(ProjectExplorer::Project *project,
ProjectExplorer::BuildConfiguration *bc)
void BuildConfigurationComboBox::addedBuildConfiguration(BuildConfiguration *bc)
{
Q_UNUSED(project);
ignoreIndexChange = true;
m_comboBox->addItem(bc->displayName(), QVariant::fromValue(bc));
......@@ -572,10 +570,8 @@ void BuildConfigurationComboBox::addedBuildConfiguration(ProjectExplorer::Projec
ignoreIndexChange = false;
}
void BuildConfigurationComboBox::removedBuildConfiguration(ProjectExplorer::Project *project,
BuildConfiguration * bc)
void BuildConfigurationComboBox::removedBuildConfiguration(BuildConfiguration * bc)
{
Q_UNUSED(project);
ignoreIndexChange = true;
const int index(buildConfigurationToIndex(bc));
if (index == -1)
......
......@@ -97,10 +97,8 @@ public:
private slots:
void nameChanged(BuildConfiguration *bc);
void activeConfigurationChanged();
void addedBuildConfiguration(ProjectExplorer::Project *project,
ProjectExplorer::BuildConfiguration *bc);
void removedBuildConfiguration(ProjectExplorer::Project *project,
ProjectExplorer::BuildConfiguration *bc);
void addedBuildConfiguration(ProjectExplorer::BuildConfiguration *bc);
void removedBuildConfiguration(ProjectExplorer::BuildConfiguration *bc);
void changedIndex(int newIndex);
private:
int buildConfigurationToIndex(BuildConfiguration *bc);
......
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