src/hbplugins/inputmethods/touchinput/virtual12key.cpp
changeset 30 80e4d18b72f5
parent 23 e6ad4ef83b23
--- a/src/hbplugins/inputmethods/touchinput/virtual12key.cpp	Fri Sep 17 08:32:10 2010 +0300
+++ b/src/hbplugins/inputmethods/touchinput/virtual12key.cpp	Mon Oct 04 00:38:12 2010 +0300
@@ -305,8 +305,10 @@
     // Close candidate popup if open
     closeCandidatePopup();
 
-    QObject::disconnect(mCurrentKeypad,SIGNAL(aboutToActivateCustomAction(HbAction*)),
-        this,SLOT(aboutToActivateCustomAction(HbAction*)));
+    if (mCurrentKeypad) {
+        QObject::disconnect(mCurrentKeypad,SIGNAL(aboutToActivateCustomAction(HbAction*)),
+            this,SLOT(aboutToActivateCustomAction(HbAction*)));
+    }
     QObject::connect(keypadToOpen,SIGNAL(aboutToActivateCustomAction(HbAction*)),
         this,SLOT(aboutToActivateCustomAction(HbAction*)));
 
@@ -473,7 +475,13 @@
             }
         }
     }
+    // need to make sure that the prediction mode handler has the input state's language set 
+    // it is the global input language by default
 
+    if(mPredictionModeHandler && newState.language().language() != HbInputSettingProxy::instance()->globalInputLanguage().language()) {
+        HbInputLanguage inputStateLang = newState.language();
+        mPredictionModeHandler->setLanguage(inputStateLang);
+    }
     HbInputModeHandler *previousModeHandler = mActiveModeHandler;
     if (newState.inputMode() == HbInputModeDefault && usePrediction()) {
         mActiveModeHandler = mPredictionModeHandler;