#include "GlAlbumListPresentationModel.h"
#include "GlAlbumRenameEventListener.h"
#include "GlContentUpdateEventListener.h"
+#include "GlFileListPresentationModel.h"
#include "GlGalleryApp.h"
#include "GlThumbnailEvent.h"
#include "GlThumbnailEventArg.h"
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;
AlbumListPresentationModel::~AlbumListPresentationModel(void)
{
AppLogDebug("ENTER");
+ DeviceManager::RemoveDeviceEventListener(DEVICE_TYPE_STORAGE_CARD, *this);
+ delete __pFolderBackgroundBitmap;
+ delete __pContentManager;
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
else
{
__pAlbumListener = pAlbumListener;
- if (orgPath.Contains(Tizen::System::Environment::GetMediaPath()))
- {
- r = ContentManager::ScanDirectory(Tizen::System::Environment::GetMediaPath(), true, this, __reqId);
- }
- else if (orgPath.Contains(Tizen::System::Environment::GetExternalStoragePath()))
- {
- r = ContentManager::ScanDirectory(Tizen::System::Environment::GetExternalStoragePath(), 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)
+bool AlbumListPresentationModel::OnContentScanCompleted (const Tizen::Base::String &scanPath)\r
{
- AppLogDebug("ENTER");
- if (__pAlbumListener && __reqId == reqId)
+ AppLogDebug("ENTER");\r
+ if (__pAlbumListener && (scanPath == __renameNewPath))\r
{
InitializeAlbumInfoList(CONTENT_TYPE_ALL);
__pAlbumListener->OnAlbumRenameComplete();
+ __renameNewPath = L"";
+ AppLogDebug("EXIT");
+ return true;
}
AppLogDebug("EXIT");
+ return false;
}
void
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);
IAppControlResponseListener* pListener)
{
AppLogDebug("ENTER");
+ FileListPresentationModel::GetInstance()->ClearProviderId();
AppControl* pAc = AppManager::FindAppControlN(providerId, operationId);
if (pAc == null)
{
{
AppLogDebug("ENTER");
String directoryName;
- int lastIndex = -1 ;
+ int lastIndex = -1;
directoryPath.LastIndexOf(DIRECTORY_SEPARATOR, directoryPath.GetLength() - 1, lastIndex);
directoryPath.SubString(lastIndex + 1, directoryName);
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;
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);
pAllAlbumInfo->AppendDirectory(*pDirPath);
pAllAlbumInfo->AppendContentIdList(*pContentIdList);
+
+ pContentIdList->RemoveAll(true);
delete pContentIdList;
}
}
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
{
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
}
delete pEnum;
}
- delete pContentInfoList;
+
+ if (pContentInfoList != NULL)
+ {
+ pContentInfoList->RemoveAll(true);
+ delete pContentInfoList;
+ }
+
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
return pContentIdList;
}
}
+ delete pThumbnailInfo;
+
if (__pPresentationModelListener->GetCount() > 0)
{
IEnumerator* pEnum = __pPresentationModelListener->GetEnumeratorN();
AlbumListPresentationModel::OnDeviceStateChanged(DeviceType deviceType, const Tizen::Base::String& state)
{
AppLogDebug("ENTER");
- if (deviceType == DEVICE_TYPE_STORAGE_CARD && state == DEVICE_STORAGE_CARD_UNMOUNTED)
- {
- IFormContentUpdateEventListener* pInterface = null;
- IEnumerator* pEventEnum = __pContentEventListener->GetEnumeratorN();
- while (pEventEnum->MoveNext() == E_SUCCESS)
- {
- pInterface = static_cast<IFormContentUpdateEventListener*>(pEventEnum->GetCurrent());
- pInterface->OnContentUpdated();
- }
- delete pEventEnum;
- }
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}