ProjectExplorer: Use RAII pattern for parsing start/stop signalling

Change-Id: I13de537140f265db3e3d0ab1cd924d6897cd90c8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Tobias Hunger
2019-08-06 14:46:37 +02:00
parent 8868989d5c
commit 09530d6dcc
18 changed files with 143 additions and 69 deletions

View File

@@ -112,7 +112,6 @@ Project::RestoreResult AutotoolsProject::fromMap(const QVariantMap &map, QString
void AutotoolsProject::loadProjectTree()
{
emitParsingStarted();
if (m_makefileParserThread) {
// The thread is still busy parsing a previus configuration.
// Wait until the thread has been finished and delete it.
@@ -125,7 +124,8 @@ void AutotoolsProject::loadProjectTree()
}
// Parse the makefile asynchronously in a thread
m_makefileParserThread = new MakefileParserThread(projectFilePath().toString());
m_makefileParserThread = new MakefileParserThread(projectFilePath().toString(),
guardParsingRun());
connect(m_makefileParserThread, &MakefileParserThread::started,
this, &AutotoolsProject::makefileParsingStarted);
@@ -212,8 +212,6 @@ void AutotoolsProject::makefileParsingFinished()
m_makefileParserThread->deleteLater();
m_makefileParserThread = nullptr;
emitParsingFinished(true);
}
void AutotoolsProject::onFileChanged(const QString &file)