From: sungmin ha Date: Thu, 19 Jul 2012 12:12:42 +0000 (+0900) Subject: [Title]modified for changed sdcard path X-Git-Tag: TizenStudio_2.0_p2.3~1396^2~91 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e94ff19192c92b3fedd9016efe63c3a8448763db;p=sdk%2Femulator%2Fqemu.git [Title]modified for changed sdcard path [Type]Enhancement [Module]qemu [Priority]Major [Jira#] // Jira Issue Number [Redmine#] // Redmine Isuue Number [Problem] // Problem Description [Cause] // Cause Description [Solution] // Solution Description [TestCase] // Executed the test-target (How to) --- diff --git a/package/pkginfo.manifest b/package/pkginfo.manifest index 7675959..b552d9a 100644 --- a/package/pkginfo.manifest +++ b/package/pkginfo.manifest @@ -1,5 +1,5 @@ Package: emulator-qemu-x86 -Version: 1.3.0 +Version: 1.3.1 OS: ubuntu-32 Build-host-os: ubuntu-32 Maintainer: Yeong-Kyoon Lee @@ -9,7 +9,7 @@ Source: emulator Description: Tizen Emulator Package: emulator-qemu-x86 -Version: 1.3.0 +Version: 1.3.1 OS: ubuntu-64 Build-host-os: ubuntu-64 Maintainer: Yeong-Kyoon Lee @@ -19,7 +19,7 @@ Source: emulator Description: Tizen Emulator Package: emulator-qemu-x86 -Version: 1.3.0 +Version: 1.3.1 OS: windows-32 Build-host-os: windows-32 Maintainer: Yeong-Kyoon Lee diff --git a/tizen/src/guest_server.c b/tizen/src/guest_server.c index 6340706..feabefd 100644 --- a/tizen/src/guest_server.c +++ b/tizen/src/guest_server.c @@ -76,26 +76,39 @@ pthread_t start_guest_server( int server_port ) { } -/* get_tizen_vms_sdcard_path = "/home/{USER}/tizen_vms/sdcard" */ -char* get_tizen_vms_sdcard_path(void) +/* get_emulator_vms_sdcard_path = "/home/{USER}/tizen-sdk-data/emulator-vms/sdcard" */ +char* get_emulator_vms_sdcard_path(void) { - char tizen_vms[] = "/tizen_vms/sdcard/"; + char *emulator_vms_sdcard_path; #ifndef _WIN32 + char emulator_vms[] = "/tizen-sdk-data/emulator-vms/sdcard/"; char *homedir = (char*)g_getenv("HOME"); + + if(!homedir) + homedir = (char*)g_get_home_dir(); + + emulator_vms_sdcard_path = malloc(strlen(homedir) + sizeof emulator_vms + 1); + assert(emulator_vms_sdcard_path != NULL); + strcpy(emulator_vms_sdcard_path, homedir); + strcat(emulator_vms_sdcard_path, emulator_vms); #else - char *homedir = (char*)g_getenv("USERPROFILE"); + char emulator_vms[] = "\\tizen-sdk-data\\emulator-vms\\sdcard\\"; + HKEY hKey; + char strLocalAppDataPath[MAX] = {0}; + DWORD dwBufLen = 1024; + RegOpenKeyEx(HKEY_CURRENT_USER, + "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", + 0, KEY_QUERY_VALUE, &hKey); + + RegQueryValueEx(hKey, "Local AppData", NULL, NULL, (LPBYTE)strLocalAppDataPath, &dwBufLen); + RegCloseKey(hKey); + + emulator_vms_sdcard_path = malloc(strlen(strLocalAppDataPath) + sizeof emulator_vms + 1); + strcpy(emulator_vms_sdcard_path, strLocalAppDataPath); + strcat(emulator_vms_sdcard_path, emulator_vms); #endif - char *tizen_vms_path; - - if(!homedir) - homedir = (char*)g_get_home_dir(); - - tizen_vms_path = malloc(strlen(homedir) + sizeof tizen_vms + 1); - assert(tizen_vms_path != NULL); - strcpy(tizen_vms_path, homedir); - strcat(tizen_vms_path, tizen_vms); - return tizen_vms_path; + return emulator_vms_sdcard_path; } static void* run_guest_server( void* args ) { @@ -184,12 +197,12 @@ static void* run_guest_server( void* args ) { } else if( atoi(ret) == 1 ) { /* mount sdcard */ char sdcard_path[256]; - char* vms_path = get_tizen_vms_sdcard_path(); + char* vms_path = get_emulator_vms_sdcard_path(); memset(sdcard_path, '\0', sizeof(sdcard_path)); strcpy(sdcard_path, vms_path); - /* tizen_vms_sdcard_path + sdcard img name */ + /* emulator_vms_sdcard_path + sdcard img name */ ret = strtok(NULL, token); strcat(sdcard_path, ret); INFO( "%s\n", sdcard_path);