diff -r f7ac710697a9 -r 06ff229162e9 src/hbinput/inputwidgets/hbinputcandidatelist.cpp --- a/src/hbinput/inputwidgets/hbinputcandidatelist.cpp Mon May 03 12:48:33 2010 +0300 +++ b/src/hbinput/inputwidgets/hbinputcandidatelist.cpp Fri May 14 16:09:54 2010 +0300 @@ -72,6 +72,7 @@ int numCandidates; int longestStringWidth; HbFrameItem *mFrameBackground; + bool mCandidateCommitted; }; HbCandidateListPrivate::HbCandidateListPrivate(HbInputMethod* input) @@ -79,7 +80,8 @@ numRows(HbCandListDefaultNumRows), numCandidates(0), longestStringWidth(0), - mFrameBackground(0) + mFrameBackground(0), + mCandidateCommitted(false) { Q_Q(HbCandidateList); @@ -164,7 +166,6 @@ d->setPriority(HbPopupPrivate::VirtualKeyboard + 1); // Should be shown on top of virtual keyboard. d->initFrameIcon(); -#if QT_VERSION >= 0x040600 // Make sure the preview pane never steals focus. setFlag(QGraphicsItem::ItemIsPanel, true); setActive(false); @@ -173,7 +174,6 @@ QGraphicsDropShadowEffect *effect = new QGraphicsDropShadowEffect; effect->setBlurRadius(8); setGraphicsEffect(effect); -#endif setTimeout(NoTimeout); setAttribute(Qt::WA_InputMethodEnabled, false); @@ -242,7 +242,10 @@ || event->key() == Qt::Key_Return || event->key() == Qt::Key_Right || event->key() == Qt::Key_Left) { - d->mInput->candidatePopupClosed(event->key()); + if (!d->mCandidateCommitted) { + emit candidateSelected(event->key(), currentCandidate()); + d->mCandidateCommitted = true; + } hide(); } } @@ -263,8 +266,10 @@ { Q_UNUSED(item); Q_D(HbCandidateList); - - d->mInput->candidatePopupClosed(); + if (!d->mCandidateCommitted) { + emit candidateSelected(0, currentCandidate()); + d->mCandidateCommitted = true; + } hide(); } @@ -293,6 +298,8 @@ */ void HbCandidateList::hideEvent(QHideEvent * event) { + Q_D(HbCandidateList); + d->mCandidateCommitted = false; HbDialog::hideEvent(event); }