From 0a99fef5a390271d988537dd587ea826631a4475 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Thu, 26 Mar 2009 15:40:53 +0100 Subject: Avoid automatically inserting unwanted closing parentheses This is for the case of function overloads where one overload takes no parameters. Solved by keeping track of the duplicate count. Done with Roberto Raggi. --- src/plugins/cpptools/cppcodecompletion.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/plugins/cpptools/cppcodecompletion.cpp') diff --git a/src/plugins/cpptools/cppcodecompletion.cpp b/src/plugins/cpptools/cppcodecompletion.cpp index 35b751104d..1be7e41001 100644 --- a/src/plugins/cpptools/cppcodecompletion.cpp +++ b/src/plugins/cpptools/cppcodecompletion.cpp @@ -1224,8 +1224,9 @@ void CppCodeCompletion::complete(const TextEditor::CompletionItem &item) extraChars += QLatin1Char('('); // If the function takes no arguments, automatically place the closing parenthesis - if (function->argumentCount() == 0 || (function->argumentCount() == 1 && - function->argumentAt(0)->type()->isVoidType())) { + if (item.m_duplicateCount == 0 && (function->argumentCount() == 0 || + (function->argumentCount() == 1 && + function->argumentAt(0)->type()->isVoidType()))) { extraChars += QLatin1Char(')'); // If the function doesn't return anything, automatically place the semicolon, -- cgit v1.2.1