Commit b9813b7c authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Qbs: Make "Reparse Qbs" force a reparsing



... even if Qt Creator thinks all is well.

Change-Id: I40fa61d51c8e18a389bedf7d8afb927bbb88acd5
Reviewed-by: default avatarChristian Kandeler <christian.kandeler@digia.com>
parent 7af5674c
...@@ -112,7 +112,7 @@ QbsProject::QbsProject(QbsManager *manager, const QString &fileName) : ...@@ -112,7 +112,7 @@ QbsProject::QbsProject(QbsManager *manager, const QString &fileName) :
this, SLOT(targetWasAdded(ProjectExplorer::Target*))); this, SLOT(targetWasAdded(ProjectExplorer::Target*)));
connect(this, SIGNAL(environmentChanged()), this, SLOT(delayParsing())); connect(this, SIGNAL(environmentChanged()), this, SLOT(delayParsing()));
connect(&m_parsingDelay, SIGNAL(timeout()), this, SLOT(parseCurrentBuildConfiguration())); connect(&m_parsingDelay, SIGNAL(timeout()), this, SLOT(startParsing()));
updateDocuments(QSet<QString>() << fileName); updateDocuments(QSet<QString>() << fileName);
...@@ -357,6 +357,11 @@ void QbsProject::buildConfigurationChanged(BuildConfiguration *bc) ...@@ -357,6 +357,11 @@ void QbsProject::buildConfigurationChanged(BuildConfiguration *bc)
} }
} }
void QbsProject::startParsing()
{
parseCurrentBuildConfiguration(false);
}
void QbsProject::delayParsing() void QbsProject::delayParsing()
{ {
m_parsingDelay.start(); m_parsingDelay.start();
...@@ -368,10 +373,13 @@ void QbsProject::delayForcedParsing() ...@@ -368,10 +373,13 @@ void QbsProject::delayForcedParsing()
delayParsing(); delayParsing();
} }
void QbsProject::parseCurrentBuildConfiguration() void QbsProject::parseCurrentBuildConfiguration(bool force)
{ {
m_parsingDelay.stop(); m_parsingDelay.stop();
if (!m_forceParsing)
m_forceParsing = force;
if (!activeTarget()) if (!activeTarget())
return; return;
QbsBuildConfiguration *bc = qobject_cast<QbsBuildConfiguration *>(activeTarget()->activeBuildConfiguration()); QbsBuildConfiguration *bc = qobject_cast<QbsBuildConfiguration *>(activeTarget()->activeBuildConfiguration());
......
...@@ -90,6 +90,7 @@ public: ...@@ -90,6 +90,7 @@ public:
QString profileForTarget(const ProjectExplorer::Target *t) const; QString profileForTarget(const ProjectExplorer::Target *t) const;
bool isParsing() const; bool isParsing() const;
bool hasParseResult() const; bool hasParseResult() const;
void parseCurrentBuildConfiguration(bool force);
Utils::FileName defaultBuildDirectory() const; Utils::FileName defaultBuildDirectory() const;
static Utils::FileName defaultBuildDirectory(const QString &path); static Utils::FileName defaultBuildDirectory(const QString &path);
...@@ -101,7 +102,6 @@ public: ...@@ -101,7 +102,6 @@ public:
public slots: public slots:
void invalidate(); void invalidate();
void parseCurrentBuildConfiguration();
void delayParsing(); void delayParsing();
void delayForcedParsing(); void delayForcedParsing();
...@@ -117,6 +117,7 @@ private slots: ...@@ -117,6 +117,7 @@ private slots:
void targetWasAdded(ProjectExplorer::Target *t); void targetWasAdded(ProjectExplorer::Target *t);
void changeActiveTarget(ProjectExplorer::Target *t); void changeActiveTarget(ProjectExplorer::Target *t);
void buildConfigurationChanged(ProjectExplorer::BuildConfiguration *bc); void buildConfigurationChanged(ProjectExplorer::BuildConfiguration *bc);
void startParsing();
private: private:
bool fromMap(const QVariantMap &map); bool fromMap(const QVariantMap &map);
......
...@@ -405,7 +405,7 @@ void QbsProjectManagerPlugin::buildProducts(QbsProject *project, const QStringLi ...@@ -405,7 +405,7 @@ void QbsProjectManagerPlugin::buildProducts(QbsProject *project, const QStringLi
void QbsProjectManagerPlugin::reparseCurrentProject() void QbsProjectManagerPlugin::reparseCurrentProject()
{ {
if (m_currentProject) if (m_currentProject)
m_currentProject->parseCurrentBuildConfiguration(); m_currentProject->parseCurrentBuildConfiguration(true);
} }
} // namespace Internal } // namespace Internal
......
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