forked from qt-creator/qt-creator
make ProFileOption persist during the scan of an entire project
there is no point in throwing away and re-recreating invariant data over and over ... shaves off ~15% of the load time of Qt 4.6.
This commit is contained in:
@@ -320,7 +320,8 @@ Qt4Project::Qt4Project(Qt4Manager *manager, const QString& fileName) :
|
||||
m_fileInfo(new Qt4ProjectFile(this, fileName, this)),
|
||||
m_isApplication(true),
|
||||
m_projectFiles(new Qt4ProjectFiles),
|
||||
m_lastActiveQt4BuildConfiguration(0)
|
||||
m_lastActiveQt4BuildConfiguration(0),
|
||||
m_proFileOption(0)
|
||||
{
|
||||
m_manager->registerProject(this);
|
||||
|
||||
@@ -855,6 +856,38 @@ void Qt4Project::proFileParseError(const QString &errorMessage)
|
||||
Core::ICore::instance()->messageManager()->printToOutputPane(errorMessage);
|
||||
}
|
||||
|
||||
ProFileReader *Qt4Project::createProFileReader(Qt4ProFileNode *qt4ProFileNode)
|
||||
{
|
||||
if (!m_proFileOption) {
|
||||
m_proFileOption = new ProFileOption;
|
||||
m_proFileOptionRefCnt = 0;
|
||||
|
||||
if (Qt4BuildConfiguration *qt4bc = activeQt4BuildConfiguration()) {
|
||||
QtVersion *version = qt4bc->qtVersion();
|
||||
if (version->isValid())
|
||||
m_proFileOption->properties = version->versionInfo();
|
||||
}
|
||||
}
|
||||
++m_proFileOptionRefCnt;
|
||||
|
||||
ProFileReader *reader = new ProFileReader(m_proFileOption);
|
||||
connect(reader, SIGNAL(errorFound(QString)),
|
||||
this, SLOT(proFileParseError(QString)));
|
||||
|
||||
reader->setOutputDir(qt4ProFileNode->buildDir());
|
||||
|
||||
return reader;
|
||||
}
|
||||
|
||||
void Qt4Project::destroyProFileReader(ProFileReader *reader)
|
||||
{
|
||||
delete reader;
|
||||
if (!--m_proFileOptionRefCnt) {
|
||||
delete m_proFileOption;
|
||||
m_proFileOption = 0;
|
||||
}
|
||||
}
|
||||
|
||||
Qt4ProFileNode *Qt4Project::rootProjectNode() const
|
||||
{
|
||||
return m_rootProjectNode;
|
||||
|
||||
Reference in New Issue
Block a user