forked from qt-creator/qt-creator
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 <hjk@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user