Change directory for app2sd
authorDuyoung Jang <duyoung.jang@samsung.com>
Fri, 25 Jan 2013 09:47:38 +0000 (18:47 +0900)
committerDuyoung Jang <duyoung.jang@samsung.com>
Fri, 25 Jan 2013 09:47:38 +0000 (18:47 +0900)
Change-Id: If3797ff34ea5357b7ec84df91122b8cecfffc77a
Signed-off-by: Duyoung Jang <duyoung.jang@samsung.com>
inc/InstallerDefs.h
src/Manager/InstallerManager.cpp

index 4f7dae8..9320f83 100755 (executable)
@@ -21,7 +21,7 @@
 #ifndef _INSTALLER_DEFS_H_
 #define _INSTALLER_DEFS_H_
 
-#define OSP_INSTALLER_VERSION "osp-installer version = 20130124.2"
+#define OSP_INSTALLER_VERSION "osp-installer version = 20130125.1"
 
 #define DIR_BIN                                L"/bin"
 #define DIR_INFO                       L"/info"
index 6b2d3db..7ecc530 100755 (executable)
@@ -594,9 +594,9 @@ InstallerManager::RequestMove(const PackageId& packageId, int moveType)
                DirEntry entry = pDirEnum->GetCurrentDirEntry();
 
                String entryName = entry.GetName();
-               String rootDirectory = rootPath;
-               rootDirectory += L"/";
-               rootDirectory += entryName;
+               //String rootDirectory = rootPath;
+               //rootDirectory += L"/";
+               //rootDirectory += entryName;
 
                if (entryName == L"." || entryName == L"..")
                {
@@ -609,15 +609,15 @@ InstallerManager::RequestMove(const PackageId& packageId, int moveType)
                pDirDetails = (app2ext_dir_details*) calloc(1, sizeof(app2ext_dir_details));
                TryCatch(pDirDetails, errorType = INSTALLER_ERROR_INTERNAL_STATE, "pDirDetails is null");
 
-               length = rootDirectory.GetLength();
+               length = entryName.GetLength();
                pDirDetails->name = (char*) calloc(1, (sizeof(char) * length) + 1);
-               snprintf(pDirDetails->name, length + 1, "%ls", rootDirectory.GetPointer());
+               snprintf(pDirDetails->name, length + 1, "%ls", entryName.GetPointer());
 
                String bin(L"bin");
                String res(L"res");
                String icons(L"icons");
 
-               if (rootDirectory.Contains(bin) || rootDirectory.Contains(res) || rootDirectory.Contains(icons))
+               if (entryName.Contains(bin) || entryName.Contains(res) || entryName.Contains(icons))
                {
                        pDirDetails->type = APP2EXT_DIR_RO;
                }
@@ -821,6 +821,14 @@ InstallerManager::ReqeustByTest(void)
                {
                        errorType = RequestRecursiveDirectory(path, errorType);
                }
+               else if (readBuf[0] == '>')
+               {
+                       errorType = RequestMove(path, PM_MOVE_TO_SDCARD);
+               }
+               else if (readBuf[0] == '<')
+               {
+                       errorType = RequestMove(path, PM_MOVE_TO_INTERNAL);
+               }
        }
 
 CATCH: