Manage the executable name separately from the display name. 2.1b_release accepted/tizen_2.1/20130425.034743 submit/tizen_2.1/20130424.232455
authorBum-Sung Cho <bs0111.cho@samsung.com>
Mon, 22 Apr 2013 12:42:10 +0000 (21:42 +0900)
committerBum-Sung Cho <bs0111.cho@samsung.com>
Mon, 22 Apr 2013 12:42:10 +0000 (21:42 +0900)
Change-Id: I2ce7159f1f20dacf9adcc6a01a22cf5c9a12b151
Signed-off-by: Bum-Sung Cho <bs0111.cho@samsung.com>
src/app/FApp_ImeEntry.cpp

index 95b5312..6b4bd1b 100644 (file)
@@ -57,6 +57,7 @@ static char** __pArgv = NULL;
 static char __appId[_MAX_BUFFER_SIZE];
 static char __uuid[_MAX_BUFFER_SIZE];
 static char __name[_MAX_BUFFER_SIZE];
+static char __exeName[_MAX_BUFFER_SIZE];
 static char __language[_MAX_LANGUAGE_BUFFER_SIZE];
 
 #ifdef __cplusplus
@@ -393,6 +394,7 @@ scim_helper_module_set_path_info(const char* path)
        memset(__appId, '\0', _MAX_BUFFER_SIZE);
        memset(__uuid, '\0', _MAX_BUFFER_SIZE);
        memset(__name, '\0', _MAX_BUFFER_SIZE);
+       memset(__exeName, '\0', _MAX_BUFFER_SIZE);
        memset(__language, '\0', _MAX_LANGUAGE_BUFFER_SIZE);
 
        char symbolicLinkPath[_MAX_BUFFER_SIZE];
@@ -414,6 +416,12 @@ scim_helper_module_set_path_info(const char* path)
 
        // initialize ime info
        InitImeInfo(__uuid, __name, __language);
+
+       // parse executable name
+       const char* pPath = strrchr(symbolicLinkPath, '/');
+       const char* pExtension = strstr(symbolicLinkPath, ".exe");
+       strncpy(__exeName, pPath + 1, pExtension - pPath - 1);
+       LOG(LOG_DEBUG, _LOG_TAG_IME, "%s {%d) > The executable name is %s.", __func__, __LINE__, __exeName);
 }
 
 bool _OSP_EXPORT_
@@ -466,7 +474,7 @@ scim_helper_module_run_helper(const scim::String& uuid, const scim::ConfigPointe
        char binaryPath[_MAX_BUFFER_SIZE];
        memset(binaryPath, '\0', _MAX_BUFFER_SIZE);
 
-       snprintf(binaryPath, _MAX_BUFFER_SIZE - 1, "/opt/apps/%s/bin/%s", __appId, __name);
+       snprintf(binaryPath, _MAX_BUFFER_SIZE - 1, "/opt/apps/%s/bin/%s", __appId, __exeName);
        LOG(LOG_DEBUG, _LOG_TAG_IME, "%s {%d) > The binary path is %s.", __func__, __LINE__, binaryPath);
 
        // set __pArgv
@@ -488,7 +496,7 @@ scim_helper_module_run_helper(const scim::String& uuid, const scim::ConfigPointe
                char packageName[_MAX_PACKAGE_NAME];
                memset(packageName, '\0', _MAX_PACKAGE_NAME);
 
-               GetPackageNameFromAppIdAppExecutableName(__appId, __name, packageName, _MAX_PACKAGE_NAME);
+               GetPackageNameFromAppIdAppExecutableName(__appId, __exeName, packageName, _MAX_PACKAGE_NAME);
                AdjustPrivilege(packageName);
        }
 
@@ -503,7 +511,7 @@ scim_helper_module_run_helper(const scim::String& uuid, const scim::ConfigPointe
                return;
        }
 
-       InitAppInfo(__appId, __name, __argc, __pArgv, fd);
+       InitAppInfo(__appId, __exeName, __argc, __pArgv, fd);
 
        //
        OspMain(__argc, __pArgv);