Change-Id: I3120c073dd95bfdc23eae2f2224883dfb9217bb2
Signed-off-by: Seokpil Park <seokpil.park@samsung.com>
TARGET_LINK_LIBRARIES(${this_target} ${pkgs_LDFLAGS})
TARGET_LINK_LIBRARIES(${this_target} "-losp-locations")
TARGET_LINK_LIBRARIES(${this_target} ${pkgs_LDFLAGS})
TARGET_LINK_LIBRARIES(${this_target} "-losp-locations")
-TARGET_LINK_LIBRARIES(${this_target} "-lexif" )
+TARGET_LINK_LIBRARIES(${this_target} "-lexif")
TARGET_LINK_LIBRARIES(${this_target} "-lcapi-web-url-download")
TARGET_LINK_LIBRARIES(${this_target} "-lpthread")
TARGET_LINK_LIBRARIES(${this_target} "-lcapi-web-url-download")
TARGET_LINK_LIBRARIES(${this_target} "-lpthread")
- SysAssertf(__pAudioContentInfoImpl == null,
+ SysAssertf(__pAudioContentInfoImpl == null || __pAudioContentInfoImpl->IsReconstructable(),
"Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
_AudioContentInfoImpl* pAudioContentInfoImpl = new (std::nothrow) _AudioContentInfoImpl();
"Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
_AudioContentInfoImpl* pAudioContentInfoImpl = new (std::nothrow) _AudioContentInfoImpl();
_ContentInfoHelper::SetContentInfoImpl(this, pAudioContentInfoImpl);
_ContentInfoHelper::SetContentInfoImpl(this, pAudioContentInfoImpl);
+ delete __pAudioContentInfoImpl;
__pAudioContentInfoImpl = pAudioContentInfoImpl;
__pAudioContentInfoImpl = pAudioContentInfoImpl;
+ if (r == E_FILE_NOT_FOUND)
+ {
+ __pAudioContentInfoImpl->SetReconstructable(true);
+ }
+ else
+ {
+ __pAudioContentInfoImpl->SetReconstructable(false);
+ }
+
- SysAssertf(__pAudioContentInfoImpl == null,
+ SysAssertf(__pAudioContentInfoImpl == null || __pAudioContentInfoImpl->IsReconstructable(),
"Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
_AudioContentInfoImpl* pAudioContentInfoImpl = new (std::nothrow) _AudioContentInfoImpl();
SysTryReturnResult(NID_CNT, pAudioContentInfoImpl != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Construct failed.");
r = pAudioContentInfoImpl->Construct(pContentPath);
"Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
_AudioContentInfoImpl* pAudioContentInfoImpl = new (std::nothrow) _AudioContentInfoImpl();
SysTryReturnResult(NID_CNT, pAudioContentInfoImpl != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Construct failed.");
r = pAudioContentInfoImpl->Construct(pContentPath);
- SysTryCatch(NID_CNT, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryCatch(NID_CNT, r == E_SUCCESS || r == E_FILE_NOT_FOUND, , r, "[%s] Propagating.", GetErrorMessage(r));
_ContentInfoHelper::SetContentInfoImpl(this, pAudioContentInfoImpl);
_ContentInfoHelper::SetContentInfoImpl(this, pAudioContentInfoImpl);
+ delete __pAudioContentInfoImpl;
__pAudioContentInfoImpl = pAudioContentInfoImpl;
__pAudioContentInfoImpl = pAudioContentInfoImpl;
+ if (r == E_FILE_NOT_FOUND)
+ {
+ __pAudioContentInfoImpl->SetReconstructable(true);
+ }
+ else
+ {
+ __pAudioContentInfoImpl->SetReconstructable(false);
+ }
+
- SysAssertf(__pImageContentInfoImpl == null,
+ SysAssertf(__pImageContentInfoImpl == null || __pImageContentInfoImpl->IsReconstructable(),
"Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
_ImageContentInfoImpl* pImageContentInfoImpl = new (std::nothrow) _ImageContentInfoImpl();
"Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
_ImageContentInfoImpl* pImageContentInfoImpl = new (std::nothrow) _ImageContentInfoImpl();
_ContentInfoHelper::SetContentInfoImpl(this, pImageContentInfoImpl);
_ContentInfoHelper::SetContentInfoImpl(this, pImageContentInfoImpl);
+ delete __pImageContentInfoImpl;
__pImageContentInfoImpl = pImageContentInfoImpl;
__pImageContentInfoImpl = pImageContentInfoImpl;
+ if (r == E_FILE_NOT_FOUND)
+ {
+ __pImageContentInfoImpl->SetReconstructable(true);
+ }
+ else
+ {
+ __pImageContentInfoImpl->SetReconstructable(false);
+ }
+
- SysAssertf(__pImageContentInfoImpl == null,
+ SysAssertf(__pImageContentInfoImpl == null || __pImageContentInfoImpl->IsReconstructable(),
"Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
_ImageContentInfoImpl* pImageContentInfoImpl = new (std::nothrow) _ImageContentInfoImpl();
SysTryReturnResult(NID_CNT, pImageContentInfoImpl != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Construct failed.");
r = pImageContentInfoImpl->Construct(pContentPath);
"Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
_ImageContentInfoImpl* pImageContentInfoImpl = new (std::nothrow) _ImageContentInfoImpl();
SysTryReturnResult(NID_CNT, pImageContentInfoImpl != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Construct failed.");
r = pImageContentInfoImpl->Construct(pContentPath);
- SysTryCatch(NID_CNT, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryCatch(NID_CNT, r == E_SUCCESS || r == E_FILE_NOT_FOUND, , r, "[%s] Propagating.", GetErrorMessage(r));
_ContentInfoHelper::SetContentInfoImpl(this, pImageContentInfoImpl);
_ContentInfoHelper::SetContentInfoImpl(this, pImageContentInfoImpl);
+ delete __pImageContentInfoImpl;
__pImageContentInfoImpl = pImageContentInfoImpl;
__pImageContentInfoImpl = pImageContentInfoImpl;
+ if (r == E_FILE_NOT_FOUND)
+ {
+ __pImageContentInfoImpl->SetReconstructable(true);
+ }
+ else
+ {
+ __pImageContentInfoImpl->SetReconstructable(false);
+ }
+
- SysAssertf(__pOtherContentInfoImpl == null,
+ SysAssertf(__pOtherContentInfoImpl == null || __pOtherContentInfoImpl->IsReconstructable(),
"Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
_OtherContentInfoImpl* pOtherContentInfoImpl = new (std::nothrow) _OtherContentInfoImpl();
"Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
_OtherContentInfoImpl* pOtherContentInfoImpl = new (std::nothrow) _OtherContentInfoImpl();
_ContentInfoHelper::SetContentInfoImpl(this, pOtherContentInfoImpl);
_ContentInfoHelper::SetContentInfoImpl(this, pOtherContentInfoImpl);
+ delete __pOtherContentInfoImpl;
__pOtherContentInfoImpl = pOtherContentInfoImpl;
__pOtherContentInfoImpl = pOtherContentInfoImpl;
+ if (r == E_FILE_NOT_FOUND)
+ {
+ __pOtherContentInfoImpl->SetReconstructable(true);
+ }
+ else
+ {
+ __pOtherContentInfoImpl->SetReconstructable(false);
+ }
+
- SysAssertf(__pOtherContentInfoImpl == null,
+ SysAssertf(__pOtherContentInfoImpl == null || __pOtherContentInfoImpl->IsReconstructable(),
"Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
_OtherContentInfoImpl* pOtherContentInfoImpl = new (std::nothrow) _OtherContentInfoImpl();
SysTryReturnResult(NID_CNT, pOtherContentInfoImpl != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Construct failed.");
r = pOtherContentInfoImpl->Construct(pContentPath);
"Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
_OtherContentInfoImpl* pOtherContentInfoImpl = new (std::nothrow) _OtherContentInfoImpl();
SysTryReturnResult(NID_CNT, pOtherContentInfoImpl != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Construct failed.");
r = pOtherContentInfoImpl->Construct(pContentPath);
- SysTryCatch(NID_CNT, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryCatch(NID_CNT, r == E_SUCCESS || r == E_FILE_NOT_FOUND, , r, "[%s] Propagating.", GetErrorMessage(r));
_ContentInfoHelper::SetContentInfoImpl(this, pOtherContentInfoImpl);
_ContentInfoHelper::SetContentInfoImpl(this, pOtherContentInfoImpl);
+ delete __pOtherContentInfoImpl;
__pOtherContentInfoImpl = pOtherContentInfoImpl;
__pOtherContentInfoImpl = pOtherContentInfoImpl;
+ if (r == E_FILE_NOT_FOUND)
+ {
+ __pOtherContentInfoImpl->SetReconstructable(true);
+ }
+ else
+ {
+ __pOtherContentInfoImpl->SetReconstructable(false);
+ }
+
result
VideoContentInfo::Construct(const String& contentPath, const String& thumbnailPath, bool setGps)
{
result
VideoContentInfo::Construct(const String& contentPath, const String& thumbnailPath, bool setGps)
{
- SysAssertf(__pVideoContentInfoImpl == null,
+ SysAssertf(__pVideoContentInfoImpl == null || __pVideoContentInfoImpl->IsReconstructable(),
"Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
result r = E_SUCCESS;
"Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
result r = E_SUCCESS;
_ContentInfoHelper::SetContentInfoImpl(this, pVideoContentInfoImpl);
_ContentInfoHelper::SetContentInfoImpl(this, pVideoContentInfoImpl);
+ delete __pVideoContentInfoImpl;
__pVideoContentInfoImpl = pVideoContentInfoImpl;
__pVideoContentInfoImpl = pVideoContentInfoImpl;
+ if (r == E_FILE_NOT_FOUND)
+ {
+ __pVideoContentInfoImpl->SetReconstructable(true);
+ }
+ else
+ {
+ __pVideoContentInfoImpl->SetReconstructable(false);
+ }
+
result
VideoContentInfo::Construct(const String* pContentPath)
{
result
VideoContentInfo::Construct(const String* pContentPath)
{
- SysAssertf(__pVideoContentInfoImpl == null,
+ SysAssertf(__pVideoContentInfoImpl == null || __pVideoContentInfoImpl->IsReconstructable(),
"Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
result r = E_SUCCESS;
"Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
result r = E_SUCCESS;
SysTryReturnResult(NID_CNT, pVideoContentInfoImpl != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Construct failed.");
r = pVideoContentInfoImpl->Construct(pContentPath);
SysTryReturnResult(NID_CNT, pVideoContentInfoImpl != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Construct failed.");
r = pVideoContentInfoImpl->Construct(pContentPath);
- SysTryCatch(NID_CNT, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryCatch(NID_CNT, r == E_SUCCESS || r == E_FILE_NOT_FOUND, , r, "[%s] Propagating.", GetErrorMessage(r));
_ContentInfoHelper::SetContentInfoImpl(this, pVideoContentInfoImpl);
_ContentInfoHelper::SetContentInfoImpl(this, pVideoContentInfoImpl);
+ delete __pVideoContentInfoImpl;
__pVideoContentInfoImpl = pVideoContentInfoImpl;
__pVideoContentInfoImpl = pVideoContentInfoImpl;
+ if (r == E_FILE_NOT_FOUND)
+ {
+ __pVideoContentInfoImpl->SetReconstructable(true);
+ }
+ else
+ {
+ __pVideoContentInfoImpl->SetReconstructable(false);
+ }
+
+ // It is processed by normal case when the content exist in DB but the actual file doesn't exist.
+ r = E_SUCCESS;
+ break;
+
case E_IO:
r = E_SYSTEM;
break;
case E_IO:
r = E_SYSTEM;
break;
, __provider(L"")
, __rating(L"")
, __mediaFormat(L"")
, __provider(L"")
, __rating(L"")
, __mediaFormat(L"")
+ , __isConstructed(false)
+bool
+_ContentInfoImpl::IsReconstructable(void) const
+{
+ return __isConstructed;
+}
+
+void
+_ContentInfoImpl::SetReconstructable(bool isConstructed)
+{
+ __isConstructed = isConstructed;
+}
+
switch (res)
{
case E_FILE_NOT_FOUND:
switch (res)
{
case E_FILE_NOT_FOUND:
+ // It is processed by normal case when the content exist in DB but the actual file doesn't exist.
+ r = E_SUCCESS;
+ break;
+
case E_IO:
r = E_SYSTEM;
break;
case E_IO:
r = E_SYSTEM;
break;
- case E_INVALID_ARG:
- // Fall through
+ // It is processed by normal case when the content exist in DB but the actual file doesn't exist.
+ r = E_SUCCESS;
+ break;
+
+ case E_INVALID_ARG:
// Fall through
case E_IO:
r = E_SYSTEM;
// Fall through
case E_IO:
r = E_SYSTEM;
result GetCompatContentPath(const Tizen::Base::String& contentPath, Tizen::Base::String& changedPath) const;
result GetCompatContentPath(const Tizen::Base::String& contentPath, Tizen::Base::String& changedPath) const;
+ bool IsReconstructable(void) const;
+
+ void SetReconstructable(bool isConstructed);
+
static _ContentInfoImpl* GetInstance(ContentInfo& contentInfo);
static const _ContentInfoImpl* GetInstance(const ContentInfo& contentInfo);
static _ContentInfoImpl* GetInstance(ContentInfo& contentInfo);
static const _ContentInfoImpl* GetInstance(const ContentInfo& contentInfo);
Tizen::Base::String __rating;
Tizen::Base::String __mediaFormat;
Tizen::Locations::Coordinates __coordinates;
Tizen::Base::String __rating;
Tizen::Base::String __mediaFormat;
Tizen::Locations::Coordinates __coordinates;