AutotoolsPM: Make MakefileParser cancelable

Change-Id: Iccd3c54c401433b82f567cfef281a0043af2efff
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2024-07-15 13:28:18 +02:00
parent d65bed648f
commit 1d3de2b5be
3 changed files with 15 additions and 33 deletions

View File

@@ -5,12 +5,10 @@
#include <projectexplorer/projectmacro.h>
#include <QFuture>
#include <QObject>
#include <QStringList>
#include <QTextStream>
#include <QObject>
#include <QVector>
#include <atomic>
QT_BEGIN_NAMESPACE
class QDir;
@@ -71,22 +69,10 @@ public:
* the makefile could not be opened.
*/
bool parse();
bool parse(const QFuture<void> &future);
MakefileParserOutputData outputData() const { return m_outputData; }
/**
* Cancels the parsing. Calling this function only makes sense, if the
* parser runs in a different thread than the caller of this function.
* The function is thread-safe.
*/
void cancel();
/**
* @return True, if the parser has been cancelled by MakefileParser::cancel().
* The function is thread-safe.
*/
bool isCanceled() const;
signals:
/**
* Is emitted periodically during parsing the Makefile.am files
@@ -224,7 +210,7 @@ private:
bool m_success = false; ///< Return value for MakefileParser::parse().
bool m_subDirsEmpty = false;///< States if last subdirs var was empty
std::atomic_bool m_cancel = false; ///< True, if the parsing should be cancelled.
QFuture<void> m_future; ///< For periodic checking of cancelled state.
QString m_makefile; ///< Filename of the makefile
MakefileParserOutputData m_outputData;