Fixed prevent issues
[apps/osp/Gallery.git] / src / GlFileListPresentationModel.cpp
index 32f37fd..5fde925 100644 (file)
@@ -1010,6 +1010,12 @@ FileListPresentationModel::MoveToContentFile(const ContentId& contentId, const S
        return r;
 }
 
+void
+FileListPresentationModel::ClearProviderId(void)
+{
+       __providerId.Clear();
+}
+
 result
 FileListPresentationModel::StartAppControl(const String& providerId, const String& operationId,
                const String* pUriData, const Tizen::Base::String* pMimeType, const HashMap* pDataList,
@@ -1017,7 +1023,8 @@ FileListPresentationModel::StartAppControl(const String& providerId, const Strin
 {
        AppLogDebug("ENTER");
        AppControl* pAc = AppManager::FindAppControlN(providerId, operationId);
-       __providerId.Clear();
+
+       ClearProviderId();
        __providerId.Append(providerId);
 
        if (pAc == null)
@@ -1581,36 +1588,37 @@ FileListPresentationModel::RotateImage(int index, RotateMode rotateMode)
        if (r == E_SUCCESS)
        {
                imageFormat = img.GetImageFormat(filePath);
-       }
 
-       r = rotateBuffer.Construct(filePath);
-       if (r == E_SUCCESS)
-       {
-               if (rotateMode == ROTATE_MODE_RIGHT)
+               r = rotateBuffer.Construct(filePath);
+               if (r == E_SUCCESS)
                {
-                       pRotatedBuffer = rotateBuffer.RotateN(IMAGE_ROTATION_90);
+                       if (rotateMode == ROTATE_MODE_RIGHT)
+                       {
+                               pRotatedBuffer = rotateBuffer.RotateN(IMAGE_ROTATION_90);
+                       }
+                       else
+                       {
+                               pRotatedBuffer = rotateBuffer.RotateN(IMAGE_ROTATION_270);
+                       }
                }
-               else
+
+               if (pRotatedBuffer != null)
                {
-                       pRotatedBuffer = rotateBuffer.RotateN(IMAGE_ROTATION_270);
+                       r = pRotatedBuffer->EncodeToFile(filePath, imageFormat, true, 100);
+                       delete pRotatedBuffer;
+                       ContentManager::ScanFile(filePath);
                }
        }
 
-       if (pRotatedBuffer != null)
-       {
-               r = pRotatedBuffer->EncodeToFile(filePath, imageFormat, true, 100);
-               delete pRotatedBuffer;
-               ContentManager::ScanFile(filePath);
-       }
        return r;
 }
 
 void
 FileListPresentationModel::ClearImageCache(void)
 {
-       AppLogDebug("FileListPresentationModel::ClearImageCache ++");
+       AppLogDebug("ENTER");
 
-       if(__pIconListViewCache != null && __providerId.Equals(APPCONTROL_PROVIDER_ID_IMAGE, false) == true)
+       if(__pIconListViewCache != null)
        {
                bool clearThumbnailReq = true;
                while(__pIconListViewCache->GetCount() != 0)
@@ -1624,7 +1632,7 @@ FileListPresentationModel::ClearImageCache(void)
                        __pIconListViewCache->RemoveAt(0, true);
                }
        }
-       AppLogDebug("FileListPresentationModel::ClearImageCache --");
+       AppLogDebug("EXIT");
 }
 
 void