98 */ |
98 */ |
99 CpEapUserPasswordUi::~CpEapUserPasswordUi() |
99 CpEapUserPasswordUi::~CpEapUserPasswordUi() |
100 { |
100 { |
101 qDebug("CpEapUserPasswordUi::~CpEapUserPasswordUi"); |
101 qDebug("CpEapUserPasswordUi::~CpEapUserPasswordUi"); |
102 |
102 |
103 delete mValidatorUsername; |
103 // mValidatorUsername, mValidatorPassword |
104 delete mValidatorPassword; |
|
105 |
|
106 // mConfigIf: scoped pointer deleted automatically |
104 // mConfigIf: scoped pointer deleted automatically |
107 } |
105 } |
108 |
106 |
109 /*! |
107 /*! |
110 * Initializes the password-username ui and initializes objects based on configuration |
108 * Initializes the password-username ui and initializes objects based on configuration |
195 (mForm->itemByIndex(modelIndex)); |
193 (mForm->itemByIndex(modelIndex)); |
196 HbDataFormModelItem *modelItem = mModel->itemFromIndex(modelIndex); |
194 HbDataFormModelItem *modelItem = mModel->itemFromIndex(modelIndex); |
197 |
195 |
198 if (modelItem == mUsername) { |
196 if (modelItem == mUsername) { |
199 // When username lineEdit is activated (shown) first time, validator is added |
197 // When username lineEdit is activated (shown) first time, validator is added |
200 if (NULL == mValidatorUsername) { |
198 mValidatorUsername.reset(mConfigIf->validatorEap(mPluginInfo.pluginHandle().type(), |
201 mValidatorUsername = mConfigIf->validatorEap(mPluginInfo.pluginHandle().type(), |
199 EapQtConfig::Username)); |
202 EapQtConfig::Username); |
|
203 } |
|
204 HbLineEdit *usernameEdit = qobject_cast<HbLineEdit *> (viewItem->dataItemContentWidget()); |
200 HbLineEdit *usernameEdit = qobject_cast<HbLineEdit *> (viewItem->dataItemContentWidget()); |
205 mValidatorUsername->updateEditor(usernameEdit); |
201 mValidatorUsername->updateEditor(usernameEdit); |
206 } |
202 } |
207 else if (modelItem == mPassword) { |
203 else if (modelItem == mPassword) { |
208 // When password lineEdit is activated (shown) first time, validator is added |
204 // When password lineEdit is activated (shown) first time, validator is added |
209 if (NULL == mValidatorPassword){ |
205 mValidatorPassword.reset(mConfigIf->validatorEap(mPluginInfo.pluginHandle().type(), |
210 mValidatorPassword = mConfigIf->validatorEap(mPluginInfo.pluginHandle().type(), |
206 EapQtConfig::Password)); |
211 EapQtConfig::Password); |
|
212 } |
|
213 mPasswordEdit = qobject_cast<HbLineEdit *> (viewItem->dataItemContentWidget()); |
207 mPasswordEdit = qobject_cast<HbLineEdit *> (viewItem->dataItemContentWidget()); |
214 mValidatorPassword->updateEditor(mPasswordEdit); |
208 mValidatorPassword->updateEditor(mPasswordEdit); |
215 // Install event filter to clear dummy password, when password is started to edit. |
209 // Install event filter to clear dummy password, when password is started to edit. |
216 mPasswordEdit->installEventFilter(this); |
210 mPasswordEdit->installEventFilter(this); |
217 } |
211 } |