Qbs: Rewire handling of parsingStateChanged slot

Change-Id: Ieba22469249ba86b28d098e59fe7e953033243c9
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
Tobias Hunger
2014-04-08 14:59:14 +02:00
parent 25e88a161d
commit 279756d062
2 changed files with 16 additions and 8 deletions

View File

@@ -192,6 +192,9 @@ bool QbsProjectManagerPlugin::initialize(const QStringList &arguments, QString *
connect(Core::EditorManager::instance(), SIGNAL(currentEditorChanged(Core::IEditor*)),
this, SLOT(updateBuildActions()));
connect(SessionManager::instance(), SIGNAL(projectAdded(ProjectExplorer::Project*)),
this, SLOT(projectWasAdded(ProjectExplorer::Project*)));
// Run initial setup routines
updateContextActions(0, 0);
updateReparseQbsAction();
@@ -203,15 +206,22 @@ bool QbsProjectManagerPlugin::initialize(const QStringList &arguments, QString *
void QbsProjectManagerPlugin::extensionsInitialized()
{ }
void QbsProjectManagerPlugin::projectWasAdded(Project *project)
{
QbsProject *qbsProject = qobject_cast<QbsProject *>(project);
if (!qbsProject)
return;
connect(qbsProject, SIGNAL(projectParsingStarted()), this, SLOT(parsingStateChanged()));
connect(qbsProject, SIGNAL(projectParsingDone(bool)), this, SLOT(parsingStateChanged()));
}
void QbsProjectManagerPlugin::updateContextActions(ProjectExplorer::Node *node, ProjectExplorer::Project *project)
{
if (m_selectedProject) {
disconnect(m_selectedProject, SIGNAL(activeTargetChanged(ProjectExplorer::Target*)),
this, SLOT(activeTargetChanged()));
disconnect(m_selectedProject, SIGNAL(projectParsingStarted()),
this, SLOT(parsingStateChanged()));
disconnect(m_selectedProject, SIGNAL(projectParsingDone(bool)),
this, SLOT(parsingStateChanged()));
}
m_selectedNode = node;
@@ -219,10 +229,6 @@ void QbsProjectManagerPlugin::updateContextActions(ProjectExplorer::Node *node,
if (m_selectedProject) {
connect(m_selectedProject, SIGNAL(activeTargetChanged(ProjectExplorer::Target*)),
this, SLOT(activeTargetChanged()));
connect(m_selectedProject, SIGNAL(projectParsingStarted()),
this, SLOT(parsingStateChanged()));
connect(m_selectedProject, SIGNAL(projectParsingDone(bool)),
this, SLOT(parsingStateChanged()));
}
activeTargetChanged();