Fixed issue 39329
authorHimanshu Talwar <himanshu.t@samsung.com>
Wed, 22 May 2013 11:54:32 +0000 (17:24 +0530)
committerHimanshu Talwar <himanshu.t@samsung.com>
Wed, 22 May 2013 13:22:25 +0000 (18:52 +0530)
Change-Id: I593d33673fa791028373d156469935bd7e933b4e
Signed-off-by: Himanshu Talwar <himanshu.t@samsung.com>
src/GlFileListPresentationModel.cpp

index dd61657..1e337a9 100644 (file)
@@ -986,49 +986,19 @@ FileListPresentationModel::MoveToContentFile(const ContentId& contentId, const S
                File::Remove(destPath);
        }
 
-       if (pContentInfo->GetContentType() == CONTENT_TYPE_IMAGE)
-       {
-               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));
-                                       }
-                               }
-                       }
-               }
-       }
-       else if (pContentInfo->GetContentType() == CONTENT_TYPE_VIDEO)
+       r = File::Copy(filePath, destPath, false);
+
+       if ( r == E_SUCCESS )
        {
-               r = File::Copy(filePath, destPath, false);
-               if (r == E_SUCCESS)
+               ContentManager::ScanFile(destPath);
+
+               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()));