fixed NABI_SE-31010
authorchitta ranjan <chitta.rs@samsung.com>
Thu, 4 Apr 2013 12:54:01 +0000 (21:54 +0900)
committerchitta ranjan <chitta.rs@samsung.com>
Thu, 4 Apr 2013 12:54:01 +0000 (21:54 +0900)
Change-Id: If34cc4165661bf487e5f29d4e46a5516164df2bb
Signed-off-by: chitta ranjan <chitta.rs@samsung.com>
inc/IvImageViewerPresentationModel.h
src/IvImageCropForm.cpp
src/IvImageViewerForm.cpp
src/IvImageViewerPresentationModel.cpp

index a37fd82..4af7208 100644 (file)
@@ -60,6 +60,7 @@ public:
        Tizen::Base::String GetFilePathAt(const int index) const;
        Tizen::Base::Collection::ArrayList* GetImageCache() const;
        ImageInfo* GetImageCacheAt(const int index) const;
+       void SetImageCacheAt(const int index, const Tizen::Base::String& filePath);
 
        int GetFileCount(void) const;
        Tizen::Base::String GetType(void) const;
index 4f41b50..f5acc71 100644 (file)
@@ -240,7 +240,10 @@ ImageCropForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
                        ContentManager::ScanFile(destFilePath);
                        delete pCropBuffer;
                }
-               pSceneManager->GoBackward(BackwardSceneTransition());
+               ArrayList* pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
+               pList->Add(new (std::nothrow) String(destFilePath));
+               AppLog("Manish %ls", destFilePath.GetPointer());
+               pSceneManager->GoBackward(BackwardSceneTransition(), pList);
                AppLog("Exit");
        }
        break;
index 8543c1a..e3078b2 100644 (file)
@@ -1432,9 +1432,7 @@ ImageViewerForm::OnActionPerformed(const Control& source, int actionId)
                RotateImage(filePath, rotateMode);
                __pPresentationModel->RequestImage(filePath);
                //Invalidate(true);
-               ContentManager contentManager;
-               contentManager.Construct();
-               contentManager.ScanFile(filePath);
+               ContentManager::ScanFile(filePath);
        }
        break;
        case ACTION_ID_FOOTER_BUTTON_ROTATE_LEFT:
@@ -1446,9 +1444,7 @@ ImageViewerForm::OnActionPerformed(const Control& source, int actionId)
                RotateImage(filePath, rotateMode);
                __pPresentationModel->RequestImage(filePath);
                //Invalidate(true);
-               ContentManager contentManager;
-               contentManager.Construct();
-               contentManager.ScanFile(filePath);
+               ContentManager::ScanFile(filePath);
        }
        break;
        case ACTION_ID_FOOTER_BUTTON_DETAILS:
@@ -1644,6 +1640,22 @@ ImageViewerForm::OnSceneActivatedN(const SceneId& previousSceneId,
                Invalidate(true);
        }
 
+       if (previousSceneId == IDSCN_IMAGE_CROP && pArgs != null)
+       {
+               AppLog("Manish hello");
+               String* pFilePath = null;
+               pFilePath = static_cast<String*>(pArgs->GetAt(0));
+               delete pArgs;
+               AppLog("Manish %ls", pFilePath->GetPointer());
+               String filePath;
+               filePath.Append(*pFilePath);
+               int count = __pPresentationModel->GetFileCount();
+               __pPresentationModel->SetImageCacheAt(count, filePath);
+               __pGallery->UpdateGallery();
+               __pGallery->SetCurrentItemIndex(count);
+               __pPresentationModel->RequestImage(filePath);
+       }
+
        if (__pGallery->GetCurrentItemIndex() < 0)
        {
                SetFooterItemState(false);
index 4d3b6b7..896fa10 100644 (file)
@@ -304,6 +304,21 @@ ImageViewerPresentationModel::GetImageCacheAt(const int index) const
        return static_cast<ImageInfo*>(__pImageCaches->GetAt(index));
 }
 
+void
+ImageViewerPresentationModel::SetImageCacheAt(const int index, const String& filePath)
+{
+       ImageInfo* pImageInfo = null;
+       pImageInfo = new (std::nothrow) ImageInfo();
+       AppLog("Manish %d %ls", index, filePath.GetPointer());
+
+       pImageInfo->Construct(filePath, null);
+       //__pImageCaches->Add(pImageInfo);
+       int count = __pImageCaches->GetCount();
+       AppLog("Manish count %d", count);
+       //__pImageCaches->SetCapacity(++count);
+       __pImageCaches->Add(pImageInfo);
+}
+
 int
 ImageViewerPresentationModel::GetFileCount(void) const
 {