src/hbplugins/inputmethods/touchinput/hbinputpredictionqwertyhandler.cpp
changeset 21 4633027730f5
parent 7 923ff622b8b9
child 23 e6ad4ef83b23
equal deleted inserted replaced
7:923ff622b8b9 21:4633027730f5
   131         }
   131         }
   132         break;
   132         break;
   133     case HbInputButton::ButtonKeyCodeSymbol: { // Ctrl/Chr
   133     case HbInputButton::ButtonKeyCodeSymbol: { // Ctrl/Chr
   134     case HbInputButton::ButtonKeyCodeAlphabet:
   134     case HbInputButton::ButtonKeyCodeAlphabet:
   135         mInputMethod->switchSpecialCharacterTable();
   135         mInputMethod->switchSpecialCharacterTable();
   136         q->HbInputPredictionHandler::actionHandler(HbInputModeHandler::HbInputModeActionSetKeypad);
       
   137         }		
   136         }		
   138         break;
   137         break;
   139     case HbInputButton::ButtonKeyCodeSettings:
   138     case HbInputButton::ButtonKeyCodeSettings:
   140         mInputMethod->closeExactWordPopup();
   139         mInputMethod->closeExactWordPopup();
   141 		break;
   140 		break;
   326         //we actually reduce ambiguity in the engine and hence we should have
   325         //we actually reduce ambiguity in the engine and hence we should have
   327         //some word getting predicted as a result to that.
   326         //some word getting predicted as a result to that.
   328         mCanContinuePrediction = true;
   327         mCanContinuePrediction = true;
   329 
   328 
   330         int tailLength =  mInputMethod->focusObject()->preEditString().length() - mEngine->inputLength();
   329         int tailLength =  mInputMethod->focusObject()->preEditString().length() - mEngine->inputLength();
   331         if(tailLength <= 0 && true == mExactPopupLaunched) {
   330         if( true == mExactPopupLaunched ) {
   332             mEngine->deleteKeyPress();
   331             mEngine->deleteKeyPress();
   333             mEngine->updateCandidates(mBestGuessLocation);
   332             mEngine->updateCandidates(mBestGuessLocation);
   334         }
   333         }
   335 
   334 
   336         mBestGuessLocation = 0;
   335         mBestGuessLocation = 0;
   470 }
   469 }
   471 
   470 
   472 void HbInputPredictionQwertyHandlerPrivate::showExactWordPopupIfNeeded()
   471 void HbInputPredictionQwertyHandlerPrivate::showExactWordPopupIfNeeded()
   473 {
   472 {
   474     Q_Q(HbInputPredictionHandler);
   473     Q_Q(HbInputPredictionHandler);
   475     if (mShowTooltip && mCandidates->count() > mPrimaryCandidateIndex && mCandidates->at(0).mid(0, mEngine->inputLength()) \
   474     if (mShowTooltip && mCandidates && mCandidates->count() > mPrimaryCandidateIndex && mPrimaryCandidateIndex != mSecondaryCandidateIndex) {                
   476         != mCandidates->at(mPrimaryCandidateIndex).mid(0, mEngine->inputLength())) {                
       
   477         q->processExactWord(mCandidates->at(mSecondaryCandidateIndex));
   475         q->processExactWord(mCandidates->at(mSecondaryCandidateIndex));
   478     } else {
   476     } else {
   479         QString empty;
   477         QString empty;
   480         q->processExactWord(empty);
   478         q->processExactWord(empty);
   481     }
   479     }