From 442bdbded2b2268efcb3be1a969d432533023366 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Tue, 7 Jul 2015 15:02:14 +0200 Subject: CppTools: Avoid unnecessary blocking of main thread Among others, BaseEditorDocumentParser::projectPart() was a blocking operation in case the parser was running. This led to noticeable GUI freezes for the ClangCodeModel since the function was called from the main thread. Rework *EditorDocumentParser to clearly separate the configuration data (input) from the actual object state. Querying/setting configuration or (last) state does not block anymore. update() is supposed to get the necessary configuration and the last state at the beginning and to set the new state at end. Change-Id: Ib4b534fa6ff373c3059826726b3f10ece95acc21 Reviewed-by: Erik Verbruggen --- src/plugins/cpptools/cppsourceprocessor_test.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/plugins/cpptools/cppsourceprocessor_test.cpp') diff --git a/src/plugins/cpptools/cppsourceprocessor_test.cpp b/src/plugins/cpptools/cppsourceprocessor_test.cpp index 378d1ae413..518eece226 100644 --- a/src/plugins/cpptools/cppsourceprocessor_test.cpp +++ b/src/plugins/cpptools/cppsourceprocessor_test.cpp @@ -137,6 +137,7 @@ void CppToolsPlugin::test_cppsourceprocessor_includes_cyclic() const QString filePath = editor->document()->filePath().toString(); auto *processor = BaseEditorDocumentProcessor::get(filePath); QVERIFY(processor); + QVERIFY(TestCase::waitForProcessedEditorDocument(filePath)); Snapshot snapshot = processor->snapshot(); QCOMPARE(snapshot.size(), 3); // Configuration file included -- cgit v1.2.1