Nabi issue 37433, 37407 and 37327 fix
authorchitta ranjan <chitta.rs@samsung.com>
Sat, 4 May 2013 13:22:20 +0000 (22:22 +0900)
committerchitta ranjan <chitta.rs@samsung.com>
Mon, 6 May 2013 06:13:05 +0000 (15:13 +0900)
Change-Id: I669539a10aadbce5f9d21fc9a248de229e59b9d4
Signed-off-by: chitta ranjan <chitta.rs@samsung.com>
inc/IvImageNameEditorForm.h
src/IvImageCropForm.cpp
src/IvImageNameEditorForm.cpp

index d139b59..40a5689 100644 (file)
 #define _IV_IMAGE_NAME_EDITOR_FORM_H_
 
 #include <FUi.h>
+#include <IvFileUpdateEventListener.h>
 
 class ImageViewerPresentationModel;
 
 class ImageNameEditorForm
-       : public Tizen::Ui::Controls::Form
+       : public IFileUpdateEventListener
+       , public Tizen::Ui::Controls::Form
        , public Tizen::Ui::Controls::IFormBackEventListener
        , public Tizen::Ui::IActionEventListener
        , public Tizen::Ui::IOrientationEventListener
@@ -60,6 +62,8 @@ public:
        virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,
                        const Tizen::Ui::Scenes::SceneId& nextSceneId);
 
+       virtual void OnFormFileEventOccuered(const int index, const unsigned long eventId);
+
 private:
        int __currentIndex;
        int __modalMsgBoxResult;
index 7aeebe9..3f8549d 100644 (file)
@@ -395,19 +395,24 @@ ImageCropForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
                                                                destFilePath.Insert(count, destFilePath.GetLength() - index - 1);
                                                        }
                                                }
-                                                r = pCropBuffer->EncodeToFile(destFilePath, IMG_FORMAT_JPG, true, 100);
+                                               r = pCropBuffer->EncodeToFile(destFilePath, IMG_FORMAT_JPG, true, 100);
                                                ContentManager::ScanFile(destFilePath);
                                                Contact* pContact = null;
                                                AddressbookManager* pAddressbookManager = AddressbookManager::GetInstance();
                                                Addressbook* pAddressbook = null;
 
                                                pAddressbook = pAddressbookManager->GetAddressbookN(DEFAULT_ADDRESSBOOK_ID);
-                                               pContact = pAddressbook->GetContactN(__contentId);
-                                               pContact->SetThumbnail(destFilePath);
-                                               pAddressbook->UpdateContact(*pContact);
-
-                                               delete pContact;
-                                               delete pAddressbook;
+                                               if (pAddressbook != null)
+                                               {
+                                                       pContact = pAddressbook->GetContactN(__contentId);
+                                                       if (pContact != null)
+                                                       {
+                                                               pContact->SetThumbnail(destFilePath);
+                                                               pAddressbook->UpdateContact(*pContact);
+                                                               delete pContact;
+                                                       }
+                                                       delete pAddressbook;
+                                               }
                                                delete pCropBuffer;
 
                                                ArrayList* pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
index 8d7f33b..7895821 100644 (file)
@@ -113,7 +113,7 @@ ImageNameEditorForm::OnInitializing(void)
        __pNameEditField->SetText(__nameEditFieldText);
        __nameEditFieldTempText = __nameEditFieldText;
        __pNameEditField->AddActionEventListener(*this);
-
+       __pPresentationModel->AddFileUpdateListener(this);
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 
        return E_SUCCESS;
@@ -155,7 +155,6 @@ ImageNameEditorForm::OnActionPerformed(const Control& source, int actionId)
        {
        case IDA_BUTTON_EDITFIELD_SAVE:
                inputString = __nameEditFieldText;
-               inputString.Trim();
 
                if (__nameEditFieldPreText == inputString)
                {
@@ -427,3 +426,10 @@ ImageNameEditorForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
        pSceneManager->GoBackward(BackwardSceneTransition());
 
 }
+
+void
+ImageNameEditorForm::OnFormFileEventOccuered(const int index, const unsigned long eventId)
+{
+       SceneManager* pSceneManager = SceneManager::GetInstance();
+       pSceneManager->GoBackward(BackwardSceneTransition());
+}