//
// 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"
AlbumListPresentationModel::~AlbumListPresentationModel(void)
{
AppLogDebug("ENTER");
+ DeviceManager::RemoveDeviceEventListener(DEVICE_TYPE_STORAGE_CARD, *this);
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)
+void 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");
}
IAppControlResponseListener* pListener)
{
AppLogDebug("ENTER");
+ FileListPresentationModel::GetInstance()->ClearProviderId();
AppControl* pAc = AppManager::FindAppControlN(providerId, operationId);
if (pAc == null)
{
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;
delete pContentIdList;
}
}
- else if (*pDirPath == RESERVED_MEDIA_PATH)
+ else if (*pDirPath == mediaPath)
{
IList* pContentIdList = GetContentIdListInDirectoryN(*pDirPath, contentType);
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()));
}