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

@@ -29,6 +29,7 @@
#include "makefileparser.h"
#include <projectexplorer/project.h>
#include <projectexplorer/projectmacro.h>
#include <QMutex>
@@ -53,7 +54,7 @@ class MakefileParserThread : public QThread
using Macros = ProjectExplorer::Macros;
public:
MakefileParserThread(const QString &makefile);
MakefileParserThread(const QString &makefile, ProjectExplorer::Project::ParseGuard &&guard);
/** @see QThread::run() */
void run() override;
@@ -134,7 +135,6 @@ private:
MakefileParser m_parser; ///< Is not accessible outside the thread
mutable QMutex m_mutex;
bool m_hasError = false; ///< Return value for MakefileParserThread::hasError()
QString m_executable; ///< Return value for MakefileParserThread::executable()
QStringList m_sources; ///< Return value for MakefileParserThread::sources()
QStringList m_makefiles; ///< Return value for MakefileParserThread::makefiles()
@@ -142,6 +142,8 @@ private:
Macros m_macros; ///< Return value for MakefileParserThread::macros()
QStringList m_cflags; ///< Return value for MakefileParserThread::cflags()
QStringList m_cxxflags; ///< Return value for MakefileParserThread::cxxflags()
ProjectExplorer::Project::ParseGuard m_guard;
};
} // namespace Internal