From: Jihoon Kim Date: Fri, 9 Jun 2017 06:13:31 +0000 (+0900) Subject: Reduce the duplicated code to launch app control X-Git-Tag: accepted/tizen/unified/20170613.194647~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c6ae8ddafc2afd0c7c2c9de57384362bd8466a81;p=platform%2Fcore%2Fuifw%2Fisf.git Reduce the duplicated code to launch app control Change-Id: Ia4349ec3151b6f7b58fc8714d808215a9a231a83 Signed-off-by: Jihoon Kim --- diff --git a/ism/extras/efl_panel/isf_panel_efl.cpp b/ism/extras/efl_panel/isf_panel_efl.cpp index 42de097..b82b302 100644 --- a/ism/extras/efl_panel/isf_panel_efl.cpp +++ b/ism/extras/efl_panel/isf_panel_efl.cpp @@ -284,6 +284,7 @@ static void create_notification (NotificationData *noti_d static void show_ime_selector_notification (void); #endif static void set_language_and_locale (void); +static void app_control_launch (const char *app_id); ///////////////////////////////////////////////////////////////////////////// // Declaration of internal variables. @@ -5569,7 +5570,6 @@ static void slot_show_helper_ise_list (void) { // Launch IME List application; e.g., org.tizen.inputmethod-setting-list int ret; - app_control_h app_control; char *app_id = NULL; #ifdef HAVE_PKGMGR_INFO pkgmgrinfo_appinfo_filter_h handle; @@ -5592,39 +5592,7 @@ static void slot_show_helper_ise_list (void) #endif if (app_id) { - ret = app_control_create (&app_control); - if (ret != APP_CONTROL_ERROR_NONE) { - LOGW ("app_control_create returned %d\n", ret); - free(app_id); - return; - } - - ret = app_control_set_operation (app_control, APP_CONTROL_OPERATION_DEFAULT); - if (ret != APP_CONTROL_ERROR_NONE) { - LOGW ("app_control_set_operation returned %d\n", ret); - app_control_destroy(app_control); - free(app_id); - return; - } - - ret = app_control_set_app_id (app_control, app_id); - if (ret != APP_CONTROL_ERROR_NONE) { - LOGW ("app_control_set_app_id returned %d\n", ret); - app_control_destroy(app_control); - free(app_id); - return; - } - - ret = app_control_send_launch_request (app_control, NULL, NULL); - if (ret != APP_CONTROL_ERROR_NONE) { - LOGW ("app_control_send_launch_request returned %d, app_id=%s\n", ret, app_id); - app_control_destroy(app_control); - free(app_id); - return; - } - - app_control_destroy (app_control); - SECURE_LOGD ("Launch %s\n", app_id); + app_control_launch (app_id); free(app_id); } else { @@ -5639,7 +5607,6 @@ static void slot_show_helper_ise_selector (void) { // Launch IME Selector application; e.g., org.tizen.inputmethod-setting-selector int ret; - app_control_h app_control; char *app_id = NULL; #ifdef HAVE_PKGMGR_INFO pkgmgrinfo_appinfo_filter_h handle; @@ -5662,39 +5629,7 @@ static void slot_show_helper_ise_selector (void) #endif if (app_id) { - ret = app_control_create (&app_control); - if (ret != APP_CONTROL_ERROR_NONE) { - LOGW ("app_control_create returned %d\n", ret); - free(app_id); - return; - } - - ret = app_control_set_operation (app_control, APP_CONTROL_OPERATION_DEFAULT); - if (ret != APP_CONTROL_ERROR_NONE) { - LOGW ("app_control_set_operation returned %d\n", ret); - app_control_destroy(app_control); - free(app_id); - return; - } - - ret = app_control_set_app_id (app_control, app_id); - if (ret != APP_CONTROL_ERROR_NONE) { - LOGW ("app_control_set_app_id returned %d\n", ret); - app_control_destroy(app_control); - free(app_id); - return; - } - - ret = app_control_send_launch_request(app_control, NULL, NULL); - if (ret != APP_CONTROL_ERROR_NONE) { - LOGW ("app_control_send_launch_request returned %d, app_id=%s\n", ret, app_id); - app_control_destroy(app_control); - free(app_id); - return; - } - - app_control_destroy(app_control); - SECURE_LOGD ("Launch %s\n", app_id); + app_control_launch (app_id); free(app_id); } else {