From 545b0537ae628e1de69d73ab46da1bc2a682f21d Mon Sep 17 00:00:00 2001 From: Antonio Di Monaco Date: Fri, 19 Jul 2019 18:28:43 +0200 Subject: [PATCH] Skip pure virtual functions in "Insert Definition From Declaration" Pure virtual functions do not need a definition. The issue is that, when the codebase is very huge (hundreds of thousands of files), the match method starts exploring the whole codebase, searching for an already present definition that will never be found, so the QuickFix wastes time for nothing and freezes the UI. Change-Id: Ia17740d740afcb40ec4f1b3237d8b9f5c1e3d54c Reviewed-by: hjk Reviewed-by: Nikolai Kosjar --- src/plugins/cppeditor/cppquickfixes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/cppeditor/cppquickfixes.cpp b/src/plugins/cppeditor/cppquickfixes.cpp index f82c3d6b505..0b54398b503 100644 --- a/src/plugins/cppeditor/cppquickfixes.cpp +++ b/src/plugins/cppeditor/cppquickfixes.cpp @@ -2690,7 +2690,7 @@ void InsertDefFromDecl::match(const CppQuickFixInterface &interface, QuickFixOpe if (Symbol *symbol = simpleDecl->symbols->value) { if (Declaration *decl = symbol->asDeclaration()) { if (Function *func = decl->type()->asFunctionType()) { - if (func->isSignal()) + if (func->isSignal() || func->isPureVirtual()) return; // Check if there is already a definition