diff options
author | Christian Kamm <christian.d.kamm@nokia.com> | 2011-11-23 12:09:16 +0100 |
---|---|---|
committer | Christian Kamm <christian.d.kamm@nokia.com> | 2011-11-23 12:16:02 +0100 |
commit | 7bafb8adfa0b9f6fd6801b99e5e4e4afee9464b3 (patch) | |
tree | 8a5b22b2c6959fd617ae5f23d34d34fd30e0ec34 /src/plugins/texteditor | |
parent | 3029af276992d2a1b3018dd671703811e05210fa (diff) | |
download | qt-creator-7bafb8adfa0b9f6fd6801b99e5e4e4afee9464b3.tar.gz |
Completion: Fix completion not triggering sometimes.
The problem was that an automatically triggered 'idle' completion result
could come in while we were waiting for actual 'triggered' completion
and then the real completion result would be discarded.
To avoid that:
* Only accept proposals from the currently running completion.
* Increase the idle completion timeout to 400ms so it doesn't get
triggered during regular typing.
Change-Id: Ibb2fa8907a2b67a94e092dfdc5a48fb50be06b65
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
Diffstat (limited to 'src/plugins/texteditor')
-rw-r--r-- | src/plugins/texteditor/codeassist/codeassistant.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/texteditor/codeassist/codeassistant.cpp b/src/plugins/texteditor/codeassist/codeassistant.cpp index df8e4a4430..5b5a3c9bb6 100644 --- a/src/plugins/texteditor/codeassist/codeassistant.cpp +++ b/src/plugins/texteditor/codeassist/codeassistant.cpp @@ -147,7 +147,7 @@ CodeAssistantPrivate::CodeAssistantPrivate(CodeAssistant *assistant) , m_settings(TextEditorSettings::instance()->completionSettings()) { m_automaticProposalTimer.setSingleShot(true); - m_automaticProposalTimer.setInterval(250); + m_automaticProposalTimer.setInterval(400); connect(&m_automaticProposalTimer, SIGNAL(timeout()), this, SLOT(automaticProposalTimeout())); connect(TextEditorSettings::instance(), @@ -278,7 +278,7 @@ void CodeAssistantPrivate::proposalComputed() { // Since the request runner is a different thread, there's still a gap in which the queued // signal could be processed after an invalidation of the current request. - if (!m_requestRunner) + if (m_requestRunner != sender()) return; IAssistProposal *newProposal = m_requestRunner->proposal(); |