Fixed prevent issue
[apps/osp/Gallery.git] / src / GlAlbumListPresentationModel.cpp
index feca505..477d0a3 100644 (file)
@@ -1,7 +1,7 @@
 //
 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
 //
-// Licensed under the Flora License, Version 1.0 (the License);
+// Licensed under the Flora License, Version 1.1 (the License);
 // you may not use this file except in compliance with the License.
 // You may obtain a copy of the License at
 //
 #include "GlAlbumListPresentationModel.h"
 #include "GlAlbumRenameEventListener.h"
 #include "GlContentUpdateEventListener.h"
+#include "GlFileListPresentationModel.h"
 #include "GlGalleryApp.h"
 #include "GlThumbnailEvent.h"
 #include "GlThumbnailEventArg.h"
 #include "GlThumbnailProvider.h"
+#include "GlTimerScanDirListener.h"
 
 using namespace Tizen::App;
 using namespace Tizen::Base;
@@ -67,7 +69,7 @@ static const int GAP = 10;
 static const int HEIGHT_OFFSET = 5;
 static const int Y_POS_CANVAS = 260;
 static const int FOLDER_NAME_WIDTH = 165;
-static const int FOLDER_NAME_HEIGHT = 38 ;
+static const int FOLDER_NAME_HEIGHT = 38;
 
 
 static const int ALPHA_BG = 110;
@@ -78,7 +80,7 @@ static const String RESERVED_MEDIA_PATH = Environment::GetMediaPath();
 static const String RESERVED_CAMERA_PATH = Environment::GetMediaPath() + L"Camera";
 static const String RESERVED_CAMERA_PATH_EXT = Environment::GetExternalStoragePath() + L"Camera";
 static const String RESERVED_DOWNLOAD_PATH = Environment::GetMediaPath() + L"Downloads";
-static const String CONTENT_INFO_ORDER = L"ContentFileName";
+static const String DATE_TIME = L"DateTime";
 
 static const int FORMAT_BUFFER_SIZE = 256;
 
@@ -99,6 +101,8 @@ AlbumListPresentationModel::AlbumListPresentationModel(void)
        , __appControlMediaType(APPCONTROL_MEDIA_TYPE_IMAGE)
        , __appControlSelectionMode(APPCONTROL_SELECTION_MODE_SINGLE)
        , __updateProgressStatus(false)
+       , __pTimerScanListener(null)
+       , __scanCount(0)
 {
        AppLogDebug("ENTER");
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
@@ -107,6 +111,8 @@ AlbumListPresentationModel::AlbumListPresentationModel(void)
 AlbumListPresentationModel::~AlbumListPresentationModel(void)
 {
        AppLogDebug("ENTER");
+       DeviceManager::RemoveDeviceEventListener(DEVICE_TYPE_STORAGE_CARD, *this);
+       delete __pFolderBackgroundBitmap;
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 }
 
@@ -138,9 +144,6 @@ AlbumListPresentationModel::Construct(void)
        __pThumbnailEvent = new (std::nothrow) ThumbnailEvent();
        __pThumbnailEvent->AddListener(*pThumbnailEventListener, true);
 
-       __pContentManager = new (std::nothrow) ContentManager();
-       __pContentManager->Construct();
-
        DeviceManager::AddDeviceEventListener(DEVICE_TYPE_STORAGE_CARD, *this);
 
        __pThumbnailProvider = ThumbnailProvider::GetInstance();
@@ -173,11 +176,6 @@ AlbumListPresentationModel::Construct(void)
                        {
                                __appControlSelectionMode = APPCONTROL_SELECTION_MODE_MULTIPLE;
                        }
-
-                       if (pApp->GetMimeType().StartsWith(APPCONTROL_DATA_VIDEO, 0) == true)
-                       {
-                               __appControlMediaType = APPCONTROL_MEDIA_TYPE_VIDEO;
-                       }
                }
        }
        else if (operationId.CompareTo(APPCONTROL_OPERATION_ID_CONFIGURE) == 0)
@@ -313,22 +311,79 @@ AlbumListPresentationModel::RenameAlbum(const String& orgPath, const String& new
        else
        {
                __pAlbumListener = pAlbumListener;
-               r = ContentManager::ScanDirectory(Tizen::System::Environment::GetMediaPath(), true, this, __reqId);
+               __renameNewPath = newPath;\r
+               r = ContentManager::ScanDirectory(newPath, true, NULL, __reqId);\r
+               AppLogDebug("Content scan failed (%s)", GetErrorMessage(r));
+               r = ContentManager::ScanDirectory(orgPath, true, NULL, __reqId);\r
                AppLogDebug("Content scan failed (%s)", GetErrorMessage(r));
        }
        AppLogDebug("EXIT");
        return r;
 }
 
-void AlbumListPresentationModel::OnContentScanCompleted (RequestId reqId, const Tizen::Base::String &scanPath, result r)
+void
+AlbumListPresentationModel::ShowAnimation(void)
 {
-       AppLogDebug("ENTER");
-       if (__pAlbumListener && __reqId == reqId)
+       IFormContentUpdateEventListener* pInterface = null;
+       IEnumerator* pEventEnum = __pContentEventListener->GetEnumeratorN();
+       while (pEventEnum->MoveNext() == E_SUCCESS)
+       {
+               pInterface = static_cast<IFormContentUpdateEventListener*>(pEventEnum->GetCurrent());
+               pInterface->ShowAnimation();
+       }
+       delete pEventEnum;
+}
+
+void
+AlbumListPresentationModel::StopAnimation(void)
+{
+       IFormContentUpdateEventListener* pInterface = null;
+       IEnumerator* pEventEnum = __pContentEventListener->GetEnumeratorN();
+       while (pEventEnum->MoveNext() == E_SUCCESS)
+       {
+               pInterface = static_cast<IFormContentUpdateEventListener*>(pEventEnum->GetCurrent());
+               pInterface->StopAnimation();
+       }
+       delete pEventEnum;
+}
+
+void
+AlbumListPresentationModel::AddTimerScanListener(ITimerScanDirListener* pListener, int scanCount)
+{
+       __pTimerScanListener = pListener;
+       __scanCount = scanCount;
+}
+
+void
+AlbumListPresentationModel::RemoveTimerScanListener(void)
+{
+       __pTimerScanListener = null;
+       __scanCount = 0;
+}
+
+bool
+AlbumListPresentationModel::OnContentScanCompleted (const Tizen::Base::String &scanPath)\r
+{
+       AppLogDebug("ENTER");\r
+       if (__pTimerScanListener)
+       {
+               __scanCount--;
+               if ( __scanCount == 0 )
+               {
+                       __pTimerScanListener->OnTimerScanDirComplete();
+               }
+               return false;
+       }
+       if (__pAlbumListener && ( scanPath == __renameNewPath))\r
        {
                InitializeAlbumInfoList(CONTENT_TYPE_ALL);
                __pAlbumListener->OnAlbumRenameComplete();
+               __renameNewPath = L"";
+               AppLogDebug("EXIT");
+               return true;
        }
        AppLogDebug("EXIT");
+       return false;
 }
 
 void
@@ -382,16 +437,25 @@ AlbumListPresentationModel::DrawFontImage(Canvas& canvas, AlbumInfo* pAlbumInfo,
 
        String strFolderName = pAlbumInfo->GetAlbumName();
 
+       if (strFolderName == ALL_ALBUMS_REAL_NAME)
+       {
+               strFolderName = ResourceManager::GetString(L"IDS_MEDIABR_BODY_ALL_ALBUMS");
+       }
+
+       String strDirectory = pAlbumInfo->GetDirectory(0);
+       AppLog("The directory path is  %ls" , strDirectory.GetPointer());
+
        Rectangle rectCanvas(ICON_CAP + FOLDER_CAP, Y_POS_CANVAS, CANVAS_WIDTH, CANVAS_HEIGHT);
        Color bgColor(COLOR_CANVAS_BG);
        bgColor.SetAlpha(ALPHA_BG);
        canvas.FillRectangle(bgColor, rectCanvas);
 
-       if (strFolderName == ResourceManager::GetString(L"IDS_COM_BODY_DOWNLOADS"))
+
+       if (strDirectory == RESERVED_DOWNLOAD_PATH)
        {
                pBitmap = ResourceManager::GetBitmapN(IDB_ALBUM_ICON_DOWNLOAD);
        }
-       else if (strFolderName == ResourceManager::GetString(L"IDS_MEDIABR_BODY_CAMERA_ROLL_ABB"))
+       else if (strDirectory == RESERVED_CAMERA_PATH ||  strDirectory == RESERVED_CAMERA_PATH_EXT)
        {
                pBitmap = ResourceManager::GetBitmapN(IDB_ALBUM_ICON_CAMERA);
        }
@@ -438,12 +502,14 @@ AlbumListPresentationModel::DrawFontImage(Canvas& canvas, AlbumInfo* pAlbumInfo,
        enTextCount.SetTextAbbreviationEnabled(true);
        enTextCount.Add(textElementCount);
 
-       pointText = Point(CANVAS_MARGIN_LEFT + CANVAS_IMAGE_FOLDER_WIDTH + GAP + FOLDER_NAME_WIDTH , rectCanvas.y + HEIGHT_OFFSET);
+       pointText = Point(CANVAS_MARGIN_LEFT + CANVAS_IMAGE_FOLDER_WIDTH + GAP + FOLDER_NAME_WIDTH,
+                       rectCanvas.y + HEIGHT_OFFSET);
        canvas.SetFont(ftCnt);
        canvas.SetForegroundColor(Color::GetColor(COLOR_ID_WHITE));
        canvas.DrawText(pointText, enTextCount);
 
-       pointText = Point(CANVAS_MARGIN_LEFT + CANVAS_IMAGE_FOLDER_WIDTH + GAP , rectCanvas.y + GAP + HEIGHT_OFFSET);
+       pointText = Point(CANVAS_MARGIN_LEFT + CANVAS_IMAGE_FOLDER_WIDTH + GAP,
+                       rectCanvas.y + GAP + HEIGHT_OFFSET);
        canvas.SetForegroundColor(Color::GetColor(COLOR_ID_WHITE));
        canvas.DrawText(pointText, enText);
 
@@ -451,7 +517,7 @@ AlbumListPresentationModel::DrawFontImage(Canvas& canvas, AlbumInfo* pAlbumInfo,
 }
 
 Bitmap*
-AlbumListPresentationModel::CreateMergeBitmapN(int index)
+AlbumListPresentationModel::CreateMergeBitmapN(const int index)
 {
        AppLogDebug("ENTER index(%d)", index);
 
@@ -504,6 +570,7 @@ AlbumListPresentationModel::StartAppControl(const String& providerId, const Stri
                IAppControlResponseListener* pListener)
 {
        AppLogDebug("ENTER");
+       FileListPresentationModel::GetInstance()->ClearProviderId();
        AppControl* pAc = AppManager::FindAppControlN(providerId, operationId);
        if (pAc == null)
        {
@@ -527,11 +594,11 @@ AlbumListPresentationModel::StartAppControl(const String& providerId, const Stri
 }
 
 String
-AlbumListPresentationModel::GetDirectoryName(String& directoryPath)
+AlbumListPresentationModel::GetDirectoryName(String& directoryPath) const
 {
        AppLogDebug("ENTER");
        String directoryName;
-       int lastIndex = -1 ;
+       int lastIndex = -1;
 
        directoryPath.LastIndexOf(DIRECTORY_SEPARATOR, directoryPath.GetLength() - 1, lastIndex);
        directoryPath.SubString(lastIndex + 1, directoryName);
@@ -541,7 +608,7 @@ AlbumListPresentationModel::GetDirectoryName(String& directoryPath)
 }
 
 int
-AlbumListPresentationModel::GetFolderCount(void)
+AlbumListPresentationModel::GetFolderCount(void) const
 {
        AppLogDebug("ENTER");
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
@@ -561,15 +628,6 @@ AlbumListPresentationModel::InitializeAlbumInfoList(const ContentType& contentTy
 
        if (__pAlbumInfoList != null)
        {
-               AlbumInfo* info = null;
-               for (int i = 0; i < __pAlbumInfoList->GetCount(); ++i)
-               {
-                       info = static_cast<AlbumInfo*>(__pAlbumInfoList->GetAt(i));
-                       if (info->GetAlbumName().IsEmpty() == false)
-                       {
-                               AppLog("Print AlbumName(%d)(%ls)", i, info->GetAlbumName().GetPointer());
-                       }
-               }
                delete __pAlbumInfoList;
        }
        __pAlbumInfoList = new (std::nothrow) ArrayList(SingleObjectDeleter);
@@ -578,7 +636,7 @@ AlbumListPresentationModel::InitializeAlbumInfoList(const ContentType& contentTy
 
        if (contentType == CONTENT_TYPE_ALL)
        {
-               IListT< ContentType >* pListT = new (std::nothrow) ArrayListT<ContentType>();
+               IListT<ContentType>* pListT = new (std::nothrow) ArrayListT<ContentType>();
                TryReturnVoid(pListT != null, "Unable to Create ArrayListT");
                pListT->Add(CONTENT_TYPE_IMAGE);
                pListT->Add(CONTENT_TYPE_VIDEO);
@@ -617,7 +675,7 @@ AlbumListPresentationModel::InitializeAlbumInfoList(const ContentType& contentTy
 
        result r = pAllAlbumInfo->Construct();
        TryCatch(IsFailed(r) == E_SUCCESS,,"new pNoNameAlbumInfo is %s",GetErrorMessage(r));
-       pAllAlbumInfo->SetAlbumName(ResourceManager::GetString(L"IDS_MEDIABR_BODY_ALL_ALBUMS"));
+       pAllAlbumInfo->SetAlbumName(ALL_ALBUMS_REAL_NAME);
 
        r = pCameraAlbumInfo->Construct();
        TryCatch(IsFailed(r) == E_SUCCESS,,"new pNoNameAlbumInfo is %s",GetErrorMessage(r));
@@ -637,11 +695,14 @@ AlbumListPresentationModel::InitializeAlbumInfoList(const ContentType& contentTy
                while (pEnum->MoveNext() == E_SUCCESS)
                {
                        pDirPath = static_cast<String*>(pEnum->GetCurrent());
+                       String mediaPath = RESERVED_MEDIA_PATH;
+                       int length = mediaPath.GetLength();
+                       mediaPath.Remove(length-1,1);
+
                        if (pDirPath == null)
                        {
                                continue;
                        }
-
                        if ((*pDirPath == RESERVED_CAMERA_PATH) ||(*pDirPath == RESERVED_CAMERA_PATH_EXT))
                        {
                                IList* pContentIdList = GetContentIdListInDirectoryN(*pDirPath, contentType);
@@ -667,10 +728,12 @@ AlbumListPresentationModel::InitializeAlbumInfoList(const ContentType& contentTy
 
                                        pAllAlbumInfo->AppendDirectory(*pDirPath);
                                        pAllAlbumInfo->AppendContentIdList(*pContentIdList);
+
+                                       pContentIdList->RemoveAll(true);
                                        delete pContentIdList;
                                }
                        }
-                       else if (*pDirPath == RESERVED_MEDIA_PATH)
+                       else if (*pDirPath == mediaPath)
                        {
                                IList* pContentIdList = GetContentIdListInDirectoryN(*pDirPath, contentType);
 
@@ -681,6 +744,8 @@ AlbumListPresentationModel::InitializeAlbumInfoList(const ContentType& contentTy
 
                                        pAllAlbumInfo->AppendDirectory(*pDirPath);
                                        pAllAlbumInfo->AppendContentIdList(*pContentIdList);
+
+                                       pContentIdList->RemoveAll(true);
                                        delete pContentIdList;
                                }
                        }
@@ -702,18 +767,27 @@ AlbumListPresentationModel::InitializeAlbumInfoList(const ContentType& contentTy
 
                                                pAllAlbumInfo->AppendDirectory(*pDirPath);
                                                pAllAlbumInfo->AppendContentIdList(*pContentIdList);
+
+                                               pSubDirList->RemoveAll(true);
                                                delete pSubDirList;
                                        }
-                                       delete pContentIdList;
+
+                                       if (pContentIdList != NULL)
+                                       {
+                                               pContentIdList->RemoveAll(true);
+                                               delete pContentIdList;
+                                       }
                                }
                                if (pAlbumInfo != null && pAlbumInfo->GetContentIdCount() > 0)
                                {
                                        __pAlbumInfoList->Add(pAlbumInfo);
+                                       AppLog("Adding album");
                                }
                                else
                                {
                                        delete pAlbumInfo;
                                }
+                               pAlbumInfo = null;
                        }
                }
 
@@ -766,32 +840,23 @@ AlbumListPresentationModel::InitializeAlbumInfoList(const ContentType& contentTy
 
        if (pContentDirectoryPathList != null)
        {
+               pContentDirectoryPathList->RemoveAll(true);
                delete pContentDirectoryPathList;
        }
+       ClearThumbnailRequests(false);
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
        return;
 
 CATCH:
-       if (pContentDirectoryPathList != null)
-       {
-               delete pContentDirectoryPathList;
-       }
-       if (pAllAlbumInfo != null)
-       {
-               delete pAllAlbumInfo;
-       }
-       if (pCameraAlbumInfo != null)
-       {
-               delete pCameraAlbumInfo;
-       }
-       if (pDownloadAlbumInfo != null)
-       {
-               delete pDownloadAlbumInfo;
-       }
-       if (pNoNameAlbumInfo != null)
-       {
-               delete pNoNameAlbumInfo;
-       }
+if (pContentDirectoryPathList != null)
+{
+       pContentDirectoryPathList->RemoveAll(true);
+       delete pContentDirectoryPathList;
+}
+       delete pAllAlbumInfo;
+       delete pCameraAlbumInfo;
+       delete pDownloadAlbumInfo;
+       delete pNoNameAlbumInfo;
 }
 
 String
@@ -831,7 +896,7 @@ AlbumListPresentationModel::GetContentIdListInDirectoryN(const String& directory
        const String contentDirectoryPath = directoryPath;
        if (contentType == CONTENT_TYPE_ALL)
        {
-               IListT< ContentType >* pListT = new (std::nothrow) ArrayListT<ContentType>();
+               IListT<ContentType>* pListT = new (std::nothrow) ArrayListT<ContentType>();
                pListT->Add(CONTENT_TYPE_IMAGE);
                pListT->Add(CONTENT_TYPE_VIDEO);
                result r = directory.Construct(*pListT);
@@ -854,8 +919,10 @@ AlbumListPresentationModel::GetContentIdListInDirectoryN(const String& directory
 
        int pageNo = 1;
        int countPerPage = directory.GetContentDirectoryItemCount(contentDirectoryPath);
+
        IList* pContentInfoList = directory.GetContentDirectoryItemListN(contentDirectoryPath, pageNo, countPerPage,
-                       CONTENT_INFO_ORDER, SORT_ORDER_ASCENDING);
+                       DATE_TIME, SORT_ORDER_DESCENDING);
+
        IList* pContentIdList = new (std::nothrow) ArrayList(SingleObjectDeleter);
 
        if ((pContentInfoList != null) && (pContentInfoList->GetCount() > 0))
@@ -870,25 +937,25 @@ AlbumListPresentationModel::GetContentIdListInDirectoryN(const String& directory
                }
                delete pEnum;
        }
-       delete pContentInfoList;
+
+       if (pContentInfoList != NULL)
+       {
+               pContentInfoList->RemoveAll(true);
+               delete pContentInfoList;
+       }
+
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 
        return pContentIdList;
 }
 
 result
-AlbumListPresentationModel::DeleteContentFile(const ContentId& contentId)
+AlbumListPresentationModel::DeleteContentFile(const String& filePath)
 {
        AppLogDebug("ENTER");
        result r = E_SUCCESS;
-       ContentManager contentManager;
-       r = contentManager.Construct();
-       if (r == E_SUCCESS)
-       {
-               r = contentManager.DeleteContent(contentId);
-       }
-       AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
-
+       r = File::Remove(filePath);
+       AppLogDebug("Exit");
        return r;
 }
 
@@ -917,7 +984,7 @@ AlbumListPresentationModel::GetAppControlSelectionMode(void) const
 }
 
 IList*
-AlbumListPresentationModel::GetAlbumInfoList(void)
+AlbumListPresentationModel::GetAlbumInfoList(void) const
 {
        AppLogDebug("ENTER");
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
@@ -931,7 +998,7 @@ IList* AlbumListPresentationModel::GetContentIdListAtIndexN(const IList& indexLi
        ContentDirectory directory;
        IList* pContentIdList = new (std::nothrow) ArrayList(SingleObjectDeleter);
 
-       IListT< ContentType >* pListT = new (std::nothrow) ArrayListT<ContentType>();
+       IListT<ContentType>* pListT = new (std::nothrow) ArrayListT<ContentType>();
        TryReturn(pListT != null,null, "Unable to Create ArrayListT");
        pListT->Add(CONTENT_TYPE_IMAGE);
        pListT->Add(CONTENT_TYPE_VIDEO);
@@ -946,11 +1013,11 @@ IList* AlbumListPresentationModel::GetContentIdListAtIndexN(const IList& indexLi
                return null;
        }
 
-       IList* pContentDirectoryPathList = directory.GetContentDirectoryPathListN(SORT_ORDER_ASCENDING);
-       String* pDirPath = null;
-       if ((pContentDirectoryPathList != null) && (pContentDirectoryPathList->GetCount() > 0))
+       if (static_cast<const Integer*>(indexList.GetAt(0))->ToInt() == 0) //if all-album is selected, get all files for delete
        {
-               if (static_cast<const Integer*>(indexList.GetAt(0))->ToInt() == 0) //if all-album is selected, get all files for delete
+               IList* pContentDirectoryPathList = directory.GetContentDirectoryPathListN(SORT_ORDER_ASCENDING);
+               String* pDirPath = null;
+               if ((pContentDirectoryPathList != null) && (pContentDirectoryPathList->GetCount() > 0))
                {
                        int loopCount = pContentDirectoryPathList->GetCount();
                        for (int i = 0; i < loopCount; ++i)
@@ -959,18 +1026,26 @@ IList* AlbumListPresentationModel::GetContentIdListAtIndexN(const IList& indexLi
                                pContentIdList->AddItems(*(GetContentIdListInDirectoryN(*pDirPath, CONTENT_TYPE_ALL)));
                        }
                }
-               else //get all files in directories which are checked for deletion
+       }
+       else
+       {
+               if(__pAlbumInfoList != null)
                {
                        int loopCount = indexList.GetCount();
+                       AlbumInfo* pInfo = null;
                        for (int i = 0; i < loopCount; ++i)
                        {
-                               const Integer* pIndex = static_cast<const Integer*>(indexList.GetAt(i));
-                               pDirPath = static_cast<String*>(pContentDirectoryPathList->GetAt(pIndex->ToInt() - 1)); //index 0 is all-album which is not counted as a directory. hence delete 1 index
-                               if (pDirPath == null)
+                               int index  = static_cast<const Integer*>(indexList.GetAt(i))->ToInt();
+                               pInfo = static_cast<AlbumInfo*>(__pAlbumInfoList->GetAt(index));
+
+                               if(pInfo != null)
                                {
-                                       continue;
+                                       IList* pList = pInfo->GetContentIdListN();
+                                       if(pList != null)
+                                       {
+                                               pContentIdList->AddItems(*pList);
+                                       }
                                }
-                               pContentIdList->AddItems(*(GetContentIdListInDirectoryN(*pDirPath, CONTENT_TYPE_ALL)));
                        }
                }
        }
@@ -1027,6 +1102,8 @@ AlbumListPresentationModel::OnThumbnailReceivedN(IEventArg& eventArg)
                        }
                }
 
+               delete pThumbnailInfo;
+
                if (__pPresentationModelListener->GetCount() > 0)
                {
                        IEnumerator* pEnum = __pPresentationModelListener->GetEnumeratorN();
@@ -1038,8 +1115,8 @@ AlbumListPresentationModel::OnThumbnailReceivedN(IEventArg& eventArg)
                                int loopCount = pUpdateFolderIndex->GetCount();
                                for (int k = 0; k < loopCount; ++k)
                                {
-                                       Integer *index = (Integer*)pUpdateFolderIndex->GetAt(k);
-                                       int folderIndex = index->ToInt();
+                                       Integer *pIndex = (Integer*)pUpdateFolderIndex->GetAt(k);
+                                       int folderIndex = pIndex->ToInt();
                                        pListener->OnThumbnailDecoded(folderIndex);
                                }
                        }
@@ -1133,7 +1210,7 @@ AlbumListPresentationModel::OnDeviceStateChanged(DeviceType deviceType, const Ti
 }
 
 void
-AlbumListPresentationModel::SetUpdateProgressStatus(bool status)
+AlbumListPresentationModel::SetUpdateProgressStatus(const bool status)
 {
        AppLogDebug("ENTER status = %d",status);
        __updateProgressStatus = status;
@@ -1141,13 +1218,13 @@ AlbumListPresentationModel::SetUpdateProgressStatus(bool status)
 }
 
 result
-AlbumListPresentationModel::RotateImage(int index, RotateMode rotateMode)
+AlbumListPresentationModel::RotateImage(const ContentId&, RotateMode rotateMode)
 {
        return E_SUCCESS;
 }
 
 void
-AlbumListPresentationModel::RequestThumbnail(const int folderIndex, int pathIndex)
+AlbumListPresentationModel::RequestThumbnail(const int folderIndex, const int pathIndex)
 {
        AppLogDebug("ENTER : folderIndex(%d), pathIndex(%d)", folderIndex, pathIndex);
 
@@ -1163,28 +1240,7 @@ AlbumListPresentationModel::RequestThumbnail(const int folderIndex, int pathInde
 }
 
 void
-AlbumListPresentationModel::CancelThumbnailRequest(const int folderIndex)
-{
-       AppLogDebug("ENTER : folderIndex(%d)", folderIndex);
-       if (__pAlbumInfoList != null)
-       {
-               AlbumInfo* pAlbumInfo = static_cast<AlbumInfo*>(__pAlbumInfoList->GetAt(folderIndex));
-               if (pAlbumInfo != null)
-               {
-                       /*
-                       for (int i = 0; i < loopCount ; ++i)
-                       {
-                               contentId = pAlbumInfo->GetContentId(i);
-                               __pThumbnailProvider->CancelThumbnailRequest(contentId, __pThumbnailEvent);
-                       }
-                        */
-               }
-       }
-       AppLogDebug("EXIT");
-}
-
-void
-AlbumListPresentationModel::ClearThumbnailRequests(bool appTerminating)
+AlbumListPresentationModel::ClearThumbnailRequests(const bool appTerminating)
 {
        AppLogDebug("ENTER");
        if (__pThumbnailProvider != null)