forked from qt-creator/qt-creator
QbsPM: Do not delay initial parsing
When a project is opened, delayParsing() is called several times: * activeTargetChanged -> buildConfigurationChanged * environmentChanged * startupProjectChanged -> ... -> buildDirectoryChanged delayParsing starts a 1s timer for aggregating all the relevant changes before starting the actual parse. This makes sense also when the user makes changes (like switching build configurations fast, or editing the build directory). When the project is opened initially, there's no reason to wait before parsing. Change-Id: I4eb0c7d3419465bc01e8f9febc9ee808684adb6e Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
5d6f8547a2
commit
2383a6b452
@@ -637,6 +637,10 @@ void Project::setProjectLanguage(Core::Id id, bool enabled)
|
|||||||
removeProjectLanguage(id);
|
removeProjectLanguage(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Project::projectLoaded()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
Core::Context Project::projectContext() const
|
Core::Context Project::projectContext() const
|
||||||
{
|
{
|
||||||
return d->m_projectContext;
|
return d->m_projectContext;
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ class ProjectPrivate;
|
|||||||
class PROJECTEXPLORER_EXPORT Project : public QObject
|
class PROJECTEXPLORER_EXPORT Project : public QObject
|
||||||
{
|
{
|
||||||
friend class SessionManager; // for setActiveTarget
|
friend class SessionManager; // for setActiveTarget
|
||||||
|
friend class ProjectExplorerPlugin; // for projectLoaded
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -177,6 +178,7 @@ protected:
|
|||||||
void addProjectLanguage(Core::Id id);
|
void addProjectLanguage(Core::Id id);
|
||||||
void removeProjectLanguage(Core::Id id);
|
void removeProjectLanguage(Core::Id id);
|
||||||
void setProjectLanguage(Core::Id id, bool enabled);
|
void setProjectLanguage(Core::Id id, bool enabled);
|
||||||
|
virtual void projectLoaded(); // Called when the project is fully loaded.
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void changeEnvironment();
|
void changeEnvironment();
|
||||||
|
|||||||
@@ -1637,6 +1637,7 @@ ProjectExplorerPlugin::OpenProjectResult ProjectExplorerPlugin::openProject(cons
|
|||||||
return result;
|
return result;
|
||||||
dd->addToRecentProjects(fileName, project->displayName());
|
dd->addToRecentProjects(fileName, project->displayName());
|
||||||
SessionManager::setStartupProject(project);
|
SessionManager::setStartupProject(project);
|
||||||
|
project->projectLoaded();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -152,6 +152,11 @@ QbsRootProjectNode *QbsProject::rootProjectNode() const
|
|||||||
return static_cast<QbsRootProjectNode *>(Project::rootProjectNode());
|
return static_cast<QbsRootProjectNode *>(Project::rootProjectNode());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QbsProject::projectLoaded()
|
||||||
|
{
|
||||||
|
m_parsingDelay.start(0);
|
||||||
|
}
|
||||||
|
|
||||||
static void collectFilesForProject(const qbs::ProjectData &project, QSet<QString> &result)
|
static void collectFilesForProject(const qbs::ProjectData &project, QSet<QString> &result)
|
||||||
{
|
{
|
||||||
result.insert(project.location().filePath());
|
result.insert(project.location().filePath());
|
||||||
|
|||||||
@@ -135,6 +135,7 @@ private:
|
|||||||
void updateApplicationTargets();
|
void updateApplicationTargets();
|
||||||
void updateDeploymentInfo();
|
void updateDeploymentInfo();
|
||||||
void updateBuildTargetData();
|
void updateBuildTargetData();
|
||||||
|
void projectLoaded() override;
|
||||||
|
|
||||||
static bool ensureWriteableQbsFile(const QString &file);
|
static bool ensureWriteableQbsFile(const QString &file);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user