aboutsummaryrefslogtreecommitdiffstats
path: root/src/virtualkeyboard/hunspellinputmethod.cpp
diff options
context:
space:
mode:
authorJarkko Koivikko <jarkko.koivikko@code-q.fi>2015-03-21 23:46:28 +0200
committerJarkko Koivikko <jarkko.koivikko@code-q.fi>2015-06-17 12:35:21 +0300
commita6333e2fedb2798f62c7cee16a3634707b6b52d5 (patch)
tree08fb3aea13324f2d8f49e7ff5faddc434ca0f80e /src/virtualkeyboard/hunspellinputmethod.cpp
parenta37875713058609b90bcaab7fd4217b6c1aa0c2a (diff)
Remove manual call to HunspellInputMethod::reset()
The reset() function should not be called directly from the input method because it is a virtual function and may cause side effects in the derived class. This change moves the reset() function to private class and uses that function instead. This change does not introduce any new behavior, nor it should break any existing ones. It fixes a particular issue that presents itself after introduction of the LipiInputMethod, which uses HunspellInputMethod as its base class. Change-Id: I38b56150a677f6c8fcf10a9b7b556acc3f7f4a92 Reviewed-by: Gatis Paeglis <gatis.paeglis@theqtcompany.com>
Diffstat (limited to 'src/virtualkeyboard/hunspellinputmethod.cpp')
-rw-r--r--src/virtualkeyboard/hunspellinputmethod.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/virtualkeyboard/hunspellinputmethod.cpp b/src/virtualkeyboard/hunspellinputmethod.cpp
index 8080afd7..cc701df6 100644
--- a/src/virtualkeyboard/hunspellinputmethod.cpp
+++ b/src/virtualkeyboard/hunspellinputmethod.cpp
@@ -193,12 +193,7 @@ void HunspellInputMethod::selectionListItemSelected(DeclarativeSelectionListMode
void HunspellInputMethod::reset()
{
Q_D(HunspellInputMethod);
- if (d->clearSuggestions()) {
- emit selectionListChanged(DeclarativeSelectionListModel::WordCandidateList);
- emit selectionListActiveItemChanged(DeclarativeSelectionListModel::WordCandidateList, d->activeWordIndex);
- }
- d->word.clear();
- d->autoSpaceAllowed = false;
+ d->reset();
}
void HunspellInputMethod::update()
@@ -208,7 +203,7 @@ void HunspellInputMethod::update()
return;
if (!d->word.isEmpty()) {
QString finalWord = d->hasSuggestions() ? d->wordCandidates.at(d->activeWordIndex) : d->word;
- reset();
+ d->reset();
inputContext()->commit(finalWord);
}
d->autoSpaceAllowed = false;