diff options
author | Jarek Kobus <jaroslaw.kobus@qt.io> | 2021-02-16 15:48:08 +0100 |
---|---|---|
committer | Jarek Kobus <jaroslaw.kobus@qt.io> | 2021-02-16 16:57:49 +0000 |
commit | d4fe3fdb156373d16da8f8592081a7a6d074c352 (patch) | |
tree | 1acaaeeef58f68128d13493c1faf9d57fc7f2c4d /src/plugins/classview/classviewmanager.cpp | |
parent | c87284356c1e27d7f0324a5201d9281ed7e73522 (diff) |
ClassView: Fix a crash when switching sessions
Move a code that operates on QIcon instances out from non-GUI
thread into GUI thread. Instead of storing the QIcon directly
inside ParserTreeItem, store the path to the project. Set the
real icon when we are back on the main thread side.
Rename some fields to start with m_ prefix.
Task-number: QTCREATORBUG-25317
Task-number: QTCREATORBUG-25312
Change-Id: Iaff89c0995045b70c5378a2ff72c5deb74abf89e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/classview/classviewmanager.cpp')
-rw-r--r-- | src/plugins/classview/classviewmanager.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/classview/classviewmanager.cpp b/src/plugins/classview/classviewmanager.cpp index 53ff9ee142..134e3314f9 100644 --- a/src/plugins/classview/classviewmanager.cpp +++ b/src/plugins/classview/classviewmanager.cpp @@ -198,7 +198,7 @@ bool Manager::hasChildren(QStandardItem *item) const ParserTreeItem::ConstPtr ptr = findItemByRoot(item); if (ptr.isNull()) return false; - return ptr->childCount() != 0; + return ptr->childCount(); } void Manager::initialize() @@ -245,7 +245,7 @@ void Manager::initialize() return; QSharedPointer<QStandardItem> rootItem(new QStandardItem()); - d->m_root->convertTo(rootItem.data()); + d->m_root->fetchMore(rootItem.data()); emit treeDataUpdate(rootItem); }, Qt::QueuedConnection); |