summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppsourceprocessor.cpp
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2020-11-30 17:02:33 +0100
committerJarek Kobus <jaroslaw.kobus@qt.io>2020-12-01 13:08:33 +0000
commitb281d6f00af6a3ceb590ac4cd58fc297bae882c9 (patch)
tree4a4b11aabb33a1a46a3b4f208347e8da83e87d51 /src/plugins/cpptools/cppsourceprocessor.cpp
parentf30565873a067b29ccb62cf1b728b183afd4bf36 (diff)
downloadqt-creator-b281d6f00af6a3ceb590ac4cd58fc297bae882c9.tar.gz
Don't call CppTypeHierarchyWidget::perform() twice
In case a Type Hierarchy widget isn't visible, the CppIncludeHierarchyWidget::perform() is called twice when requested from "Open Type Hierarchy" context menu. The instances of CppIncludeHierarchyWidget class are created only when Type Hierarchy item is selected form the combobox, and are destroyed when different item is selected. A call to: NavigationWidget::activateSubWidget(Constants::TYPE_HIERARCHY_ID, Side::Left) may be ignored (in case Type Hierarchy widget was visible) or may recreate the widget and invoke CppTypeHierarchyWidget::perform() for the first time (in case when Type Hierarchy wasn't visible). Just after this we emit typeHierarchyRequested(), which in turn invokes perform() one more time unconditionally. In order to fix it, we emit the signal typeHierarchyRequested() first (which will invoke perform() only when the Type Hierarchy widget was visible), and later call activateSubWidget(), which invoke perform only when we are recreating a widget. This shorten the freeze time for calculating big hierarchies, like for ExtensionSystem::IPlugin, by 50%. We do the same for CppIncludeHierarchyWidget. Change-Id: If58fba4ba1dc32999d106fc2faa712e05442caf3 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/cpptools/cppsourceprocessor.cpp')
0 files changed, 0 insertions, 0 deletions