diff options
author | Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com> | 2009-03-26 15:40:53 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com> | 2009-03-26 15:40:53 +0100 |
commit | 0a99fef5a390271d988537dd587ea826631a4475 (patch) | |
tree | 959d481cb7db089e534e26f15c4c00ca76fd2d5d /src/plugins/cpptools/cppcodecompletion.cpp | |
parent | ece7c9afd744f1403ccb25e04fa20a541218bd72 (diff) | |
download | qt-creator-0a99fef5a390271d988537dd587ea826631a4475.tar.gz |
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.
Diffstat (limited to 'src/plugins/cpptools/cppcodecompletion.cpp')
-rw-r--r-- | src/plugins/cpptools/cppcodecompletion.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
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, |