diff options
author | Inho Lee <inho.lee@qt.io> | 2021-08-23 11:24:14 +0200 |
---|---|---|
committer | Inho Lee <inho.lee@qt.io> | 2021-08-23 13:04:53 +0200 |
commit | 946fd8740c52a55e2405a060d4b71ea291327c0a (patch) | |
tree | 47039cd67533c7544ff85c76103d13d99772ad13 | |
parent | 4079ab86dc9ee0ee38e9cfcdc14dce0207fe40f4 (diff) |
Hunspellinputmethod : commit only if the final word is not empty
Hunspellinputmethod's update always makes commit but sometimes it makes
redundant commit with an empty commitstring. This patch will prevent it.
Change-Id: I049aebc6a7081ebf5128e9ca2860c7e9c31add75
Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi>
-rw-r--r-- | src/plugins/hunspell/hunspellinputmethod/hunspellinputmethod.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/hunspell/hunspellinputmethod/hunspellinputmethod.cpp b/src/plugins/hunspell/hunspellinputmethod/hunspellinputmethod.cpp index fdbc6f59..0b365c08 100644 --- a/src/plugins/hunspell/hunspellinputmethod/hunspellinputmethod.cpp +++ b/src/plugins/hunspell/hunspellinputmethod/hunspellinputmethod.cpp @@ -369,7 +369,8 @@ void HunspellInputMethod::update() finalWord = d->wordCandidates.wordAt(d->wordCandidates.index()); } d->reset(); - inputContext()->commit(finalWord); + if (!finalWord.isEmpty()) + inputContext()->commit(finalWord); d->autoSpaceAllowed = false; } |