From efdaac1040a61cc9073e27d135bb06bbf9960824 Mon Sep 17 00:00:00 2001 From: amtkhdkr Date: Wed, 21 May 2014 16:14:44 +0530 Subject: [PATCH] Use core::stringw functions --- src/states_screens/register_screen.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/states_screens/register_screen.cpp b/src/states_screens/register_screen.cpp index 20a07dc8d..5bc8034fd 100644 --- a/src/states_screens/register_screen.cpp +++ b/src/states_screens/register_screen.cpp @@ -76,8 +76,6 @@ void RegisterScreen::doRegister() core::stringw password_confirm = getWidget("password_confirm") ->getText().trim(); core::stringw email = getWidget("email")->getText().trim(); - std::wstring stdEmail( getWidget("email")->getText().trim().c_str() ); - std::wstring atSign(L"@"); std::wstring dotSign(L"."); core::stringw email_confirm = getWidget("email_confirm") ->getText().trim(); m_info_widget->setErrorColor(); @@ -102,9 +100,9 @@ void RegisterScreen::doRegister() { m_info_widget->setText(_("Email has to be between 4 and 50 characters long!"), false); } - else if (stdEmail.find(atSign)== -1 || stdEmail.find(dotSign)== -1 ||\ - ( stdEmail.find_last_of(dotSign) - stdEmail.find_last_of(atSign) <= 2 ) ||\ - stdEmail.find_last_of(atSign)==0 ) + else if ( email.find(L"@")== -1 || email.find(L".")== -1 || + (email.findLast(L'.') - email.findLast(L'@') <= 2 ) || + email.findLast(L'@')==0 ) { m_info_widget->setText(_("Email is invalid!"), false); }