Perform parsing asynchronously...

...to avoid blocking the ui thread. Parsing will now performed
in a separate thread, except for small changes where this would
create too much overhead.

Change-Id: I1db441594f1684f969bb86c9423c0fb0bcb1a53a
Reviewed-by: Andre Poenitz <andre.poenitz@theqtcompany.com>
This commit is contained in:
Christian Stenger
2015-02-13 15:44:18 +01:00
parent 223b43e9e0
commit 4caba7a3dd
9 changed files with 166 additions and 71 deletions

View File

@@ -38,6 +38,7 @@ namespace Internal {
struct TestCodeLocationAndType;
class TestInfo;
class UnnamedQuickTestInfo;
class TestCodeParser : public QObject
{
@@ -86,12 +87,13 @@ public slots:
private:
bool postponed(const QStringList &fileList);
void scanForTests(const QStringList &fileList = QStringList());
void clearMaps();
void clearCache();
void removeTestsIfNecessary(const QString &fileName);
void removeTestsIfNecessaryByProFile(const QString &proFile);
void onTaskStarted(Core::Id type);
void onAllTasksFinished(Core::Id type);
void onFinished();
void onPartialParsingFinished();
void updateUnnamedQuickTests(const QString &fileName, const QString &mainFile,
const QMap<QString, TestCodeLocationAndType> &functions);
@@ -99,10 +101,12 @@ private:
const QString &declaringFile, TestTreeItem &testItem);
void updateModelAndQuickDocMap(QmlJS::Document::Ptr document,
const QString &referencingFile, TestTreeItem &testItem);
void removeUnnamedQuickTestsByName(const QString &fileName);
TestTreeModel *m_model;
QMap<QString, TestInfo> m_cppDocMap;
QMap<QString, TestInfo> m_quickDocMap;
QList<UnnamedQuickTestInfo> m_unnamedQuickDocList;
bool m_parserEnabled;
bool m_pendingUpdate;
bool m_fullUpdatePostPoned;