ClassView: Move the GUI related code out of Parser

Don't create QStandardItem objects inside the non-gui thread,
as it was in case of requestCurrentState() which is always
called in parser's thread. As a result of parsing send a root's
ParserTreeItem::ConstPtr now instead. Store the generated
root inside Manager instead of inside Parser. Remove rootItemLocker
as it's not needed now anymore. Move the implementation of
canFetchMore(), fetchMore() and hasChildren() into Manager class.

Now all the API of Parser class is used only in parser's thread
(with the exception of constructor and destructor).

Task-number: QTCREATORBUG-25317
Change-Id: I2b3c49918bf58266e6bea8acf65c975e19f7d9cb
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Jarek Kobus
2021-02-16 14:01:16 +01:00
parent ab7560bec4
commit a513f25c39
5 changed files with 61 additions and 107 deletions

View File

@@ -30,9 +30,10 @@
#include <QStandardItem>
#include <cplusplus/CppDocument.h>
#include <utils/id.h>
#include "classviewparsertreeitem.h"
namespace ClassView {
namespace Internal {
@@ -59,6 +60,7 @@ signals:
void treeDataUpdate(QSharedPointer<QStandardItem> result);
private:
ParserTreeItem::ConstPtr findItemByRoot(const QStandardItem *item, bool skipRoot = false) const;
void onProjectListChanged();
void resetParser();