Rename Changes
authorravi.n2 <ravi.n2@samsung.com>
Tue, 23 Apr 2013 12:52:22 +0000 (18:22 +0530)
committerravi.n2 <ravi.n2@samsung.com>
Tue, 23 Apr 2013 12:52:22 +0000 (18:22 +0530)
Change-Id: If0ff95e60efe96fb2713e2ecfcc94fac145d5cd0

src/MfCreateFolderForm.cpp

index bc0ff3e..b3dbb68 100644 (file)
@@ -788,21 +788,18 @@ CreateFolderForm::OnTextValueChanged(const Tizen::Ui::Control& source)
                        tempLength = ID_FILE_NAME_LENGTH_MAX;
                }
 
-               textToCheck =  __pEditFieldFolderName->GetText().GetLength() - __textLength;
-               r = currentText.SubString(__pEditFieldFolderName->GetCursorPosition() - textToCheck,currentInput);
-               for(int i = 0 ; i < currentInput.GetLength() ; i++)
+               currentInput = __pEditFieldFolderName->GetText();
+
+               if(currentInput.Contains(specialCharacters[0]))
                {
-                       if(specialCharacters.Contains(currentInput[i]))
-                       {
-                               String invalidCharacterString;
-                               AppResource::GetInstance()->GetString(L"IDS_COM_POP_INVALID_CHARACTERS", invalidCharacterString);
-                               messageBox.Construct(L"", invalidCharacterString, MSGBOX_STYLE_NONE, ID_MESSAGE_BOX_TIMEOUT_ONE_SECOND);
-                               messageBox.ShowAndWait(modalResult);
-                               currentText.Remove(__pEditFieldFolderName->GetCursorPosition()-textToCheck,textToCheck);
-                               __pEditFieldFolderName->SetText(currentText);
-                               __pEditFieldFolderName->SetFocus();
-                               break;
-                       }
+                       String invalidCharacterString;
+                       AppResource::GetInstance()->GetString(L"IDS_COM_POP_INVALID_CHARACTERS", invalidCharacterString);
+                       messageBox.Construct(L"", invalidCharacterString, MSGBOX_STYLE_NONE, ID_MESSAGE_BOX_TIMEOUT_ONE_SECOND);
+                       messageBox.ShowAndWait(modalResult);
+                       r = currentInput.Replace("/","");
+                       __pEditFieldFolderName->SetText(currentInput);
+                       __pEditFieldFolderName->SetFocus();
+                       AppLogDebug("result is %s",GetErrorMessage(r));
                }
 
                inputLength = byteCount;
@@ -839,9 +836,6 @@ CreateFolderForm::OnTextValueChanged(const Tizen::Ui::Control& source)
                        __pEditFieldFolderName->ShowKeypad();
                        return;
                }
-
-               r = utf8.GetByteCount(__pEditFieldFolderName->GetText(), byteCount);
-               __textLength = byteCount;
        }
        return;
 }