//
// 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
//
FileListPresentationModel::~FileListPresentationModel(void)
{
AppLogDebug("ENTER");
+ DeviceManager::RemoveDeviceEventListener(DEVICE_TYPE_STORAGE_CARD, *this);
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
if (__pIconListViewCache != null)
{
+ __pIconListViewCache->RemoveAll(true);
delete __pIconListViewCache;
+ __pIconListViewCache = null;
}
__pIconListViewCache = new (std::nothrow) ArrayList(SingleObjectDeleter);
__pIconListViewCache->Construct(SIZE_ICON_LIST_CACHE);
if (__pIconListViewCache != null)
{
+ __pIconListViewCache->RemoveAll(true);
delete __pIconListViewCache;
__pIconListViewCache = null;
}
}
}
+ delete pEnum;
+
if (isMatch == false)
{
if (SIZE_ICON_LIST_CACHE <= __pIconListViewCache->GetCount())
File::Remove(destPath);
}
- if (pContentInfo->GetContentType() == CONTENT_TYPE_IMAGE)
+ r = File::Copy(filePath, destPath, false);
+
+ if ( r == E_STORAGE_FULL)
{
- r = File::Copy(filePath, destPath, false);
- if (r == E_SUCCESS)
- {
- if (r == E_SUCCESS)
- {
- ImageContentInfo contentInfo;
- r = contentInfo.Construct(&destPath);
- if (r == E_SUCCESS)
- {
- __pContentManager->CreateContent(contentInfo);
- r = GetLastResult();
- TryCatch(!IsFailed(r),,"CreateContent::the value is %s", GetErrorMessage(r));
- if (!isCopyOperation)
- {
- r = __pContentManager->DeleteContent(contentId);
- TryCatch(!IsFailed(r),,"DeleteContent::the value is %s", GetErrorMessage(r));
- }
- }
- }
- }
+ File::Remove(destPath);
}
- else if (pContentInfo->GetContentType() == CONTENT_TYPE_VIDEO)
+ ContentManager::ScanFile(destPath);
+
+ if ( r == E_SUCCESS )
{
- r = File::Copy(filePath, destPath, false);
- if (r == E_SUCCESS)
+ if ( isCopyOperation == false)
{
- VideoContentInfo contentInfo;
- r = contentInfo.Construct(&destPath);
- {
- __pContentManager->CreateContent(contentInfo);
- r = GetLastResult();
- TryCatch(!IsFailed(r),,"CreateContent::the value is %s", GetErrorMessage(r));
- if (!isCopyOperation)
- {
- r = __pContentManager->DeleteContent(contentId);
- TryCatch(!IsFailed(r),,"DeleteContent::the value is %s", GetErrorMessage(r));
- }
- }
+ File::Remove(filePath); // if Move Op remove original file
+ ContentManager::ScanFile(filePath);
}
}
- CATCH:
+
delete pContentInfo;
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
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,
{
AppLogDebug("ENTER");
AppControl* pAc = AppManager::FindAppControlN(providerId, operationId);
- __providerId.Clear();
+
+ ClearProviderId();
__providerId.Append(providerId);
if (pAc == null)
ImageFormat imageFormat;
Image img;
String filePath = GetContentFilePath(index);
- r = img.Construct();
+ ContentType contentType = ContentManagerUtil::CheckContentType(filePath);
+ if (contentType == CONTENT_TYPE_VIDEO)
+ {
+ return r;
+ }
+ r = img.Construct();
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)
__pIconListViewCache->RemoveAt(0, true);
}
}
- AppLogDebug("FileListPresentationModel::ClearImageCache --");
+ AppLogDebug("EXIT");
}
void