From: Radek Kintop Date: Wed, 6 Sep 2017 14:08:31 +0000 (+0200) Subject: Code cleaning(3) X-Git-Tag: submit/tizen/20170922.063546~19^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F82%2F148082%2F2;p=profile%2Fmobile%2Fapps%2Fnative%2Fsettings.git Code cleaning(3) Change-Id: I58039ab7909f2933d11b61833f60017a734b67d4 Signed-off-by: Radek Kintop --- diff --git a/setting-common/CMakeLists.txt b/setting-common/CMakeLists.txt index 67c60b9e..f1da308d 100755 --- a/setting-common/CMakeLists.txt +++ b/setting-common/CMakeLists.txt @@ -8,33 +8,17 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include) INCLUDE(FindPkgConfig) pkg_check_modules(pkgs_common_data REQUIRED - alarm-service - appcore-efl - callmgr_client - capi-appfw-app-common capi-appfw-application - capi-media-player capi-media-sound-manager capi-system-info capi-system-system-settings - dbus-1 - deviced - ecore - ecore-imf - edje efl-extension elementary - evas - feedback glib-2.0 json-glib-1.0 libtzplatform-config - libxml-2.0 notification - openssl pkgmgr-info - tapi - ui-gadget-1 vconf capi-base-utils-i18n ) diff --git a/setting-common/include/setting-cfg.h b/setting-common/include/setting-cfg.h index 4425dd00..2c94b094 100644 --- a/setting-common/include/setting-cfg.h +++ b/setting-common/include/setting-cfg.h @@ -28,7 +28,7 @@ #define __SETTING_CFG_H__ #include -#include +#include "setting-common-resource.h" #include #include @@ -67,7 +67,6 @@ typedef enum _cfg_error_type { */ typedef enum _Cfg_Item_Type { Cfg_Item_Node_Error = 0, /** Error - no action */ - Cfg_Item_Ug_Node = 1, /** general UG - don't create Grid */ /** no UG, no app launching, just menu name - create Grid */ Cfg_Item_Ui_Node = 2, Cfg_Item_Title_Node = 3, /** view name - create Grid */ @@ -78,11 +77,6 @@ typedef enum _Cfg_Item_Type { Cfg_Item_AppLauncher_Node = 6, /** view name - 2depth search by app-launcher */ Cfg_Item_AppLauncher_View_Node = 7, - - /*------------------------------------------------------------------- */ - /* (Cfg_Item_Ug_Node_Toggle/10 > 0 ) --> toggle style */ - /** general UG - don't create Grid */ - Cfg_Item_Ug_Node_Toggle = Cfg_Item_Ug_Node + 10, /** no UG, no app launching, just menu name - create Grid */ Cfg_Item_Ui_Node_Toggle = Cfg_Item_Ui_Node + 10, /** view name - 2depth search with toggle button */ @@ -135,10 +129,6 @@ int setting_cfg_get_category_length(void); char *setting_cfg_get_category_name(int category_index); -char *setting_cfg_get_category_display_name(int category_index); - -void setting_cfg_set_category_display_name(int category_index, char *newstring); - int setting_cfg_get_menu_length(int category_index); char *setting_cfg_get_string_field_idx(int category_index, int menu_index, @@ -153,10 +143,6 @@ char *setting_cfg_get_ug_args_idx(int category_index, int menu_index); char *setting_cfg_get_keyname_idx(int category_index, int menu_index); -char *setting_cfg_get_ugpath_idx(int category_index, int menu_index); - -int setting_cfg_get_pos_idx(int category_index, int menu_index); - void setting_cfg_set_pos_idx(int category_index, int menu_index, int pos); int setting_cfg_get_click_times_idx(int category_index, int menu_index); @@ -175,7 +161,6 @@ void setting_cfg_set_last_clicked_idx(int category_index, int menu_index, extern char *get_path_from_args(void *data); extern app_control_h get_svc_from_args(void *data); -extern bool is_ug_installed_by_ug_args(void *data); extern Setting_Cfg_Node_T *get_cfg_node_by_keystr(const char *keystr); diff --git a/setting-common/include/setting-common-general-func.h b/setting-common/include/setting-common-general-func.h index 42c7d2d1..131d0bf9 100755 --- a/setting-common/include/setting-common-general-func.h +++ b/setting-common/include/setting-common-general-func.h @@ -36,7 +36,7 @@ #undef S_ #endif -#include +#include "setting-common-data-type.h" #include #ifndef _EDJ diff --git a/setting-common/src/setting-cfg.c b/setting-common/src/setting-cfg.c index 3e4fc0b4..51982b13 100755 --- a/setting-common/src/setting-cfg.c +++ b/setting-common/src/setting-cfg.c @@ -21,13 +21,11 @@ #include "setting-cfg.h" #include "setting-debug.h" -#include #include #include "setting-common-general-func.h" #include "setting-common-data-type.h" #include "setting-common-data-slp-setting.h" #include -#include JsonParser *parser = NULL; JsonNode *root = NULL; /* category_list */ @@ -60,9 +58,6 @@ int setting_cfg_file_write(JsonNode *node); #define __create_an_item(item_name, icon_path, ug_args, shortcut_appid, \ defaultPos, item_type, is_resetable, ug_exist, uuid, \ click_times, last_clicked) do {\ - if (ug_exist) { \ - if (!is_ug_installed_by_ug_args(ug_args)) break;\ - } \ menu_item = json_node_new(JSON_NODE_OBJECT); \ object = json_object_new(); \ json_node_take_object(menu_item, object); \ @@ -591,20 +586,6 @@ int setting_cfg_create(bool check_ug_exist) false, pitem[i].uuid, pitem[i].click_times, pitem[i].last_clicked); - /*SETTING_TRACE(" add menu - name : %s (%d) - APP ", - * pitem[i].key_name,pitem[i].item_type); */ - - } else if (item_type == Cfg_Item_Ug_Node) { - /* app-control */ - __create_an_item(pitem[i].key_name, pitem[i].icon_path, - pitem[i].ug_args, - pitem[i].shortcut_appid, pitem[i].pos, - pitem[i].item_type, pitem[i].reset_type, - check_ug_exist, pitem[i].uuid, - pitem[i].click_times, - pitem[i].last_clicked); - /*SETTING_TRACE(" add menu - name : %s (%d) - UG ", - * pitem[i].key_name,pitem[i].item_type); */ } } /* write to file */ @@ -688,10 +669,6 @@ int setting_cfg_file_write(JsonNode *node) &error); g_object_unref(generator); - /* ***BEGIN*** DAC black screen SAMSUNG 2010/8/9 add - *add read permission - *chown -R inhouse:inhouse /home/inhouse/setting.cfg - */ if (FALSE == ret) { SETTING_TRACE_ERROR("Error writing file %s!", setting_cfg_get_path()); @@ -944,19 +921,6 @@ char *setting_cfg_get_ug_args_idx(int category_index, int menu_index) "ug_args"); } -EXPORT_PUBLIC -char *setting_cfg_get_ugpath_idx(int category_index, int menu_index) -{ - return setting_cfg_get_string_field_idx(category_index, menu_index, - "ug_path"); -} - -EXPORT_PUBLIC -int setting_cfg_get_pos_idx(int category_index, int menu_index) -{ - return setting_cfg_get_int_field_idx(category_index, menu_index, "pos"); -} - EXPORT_PUBLIC void setting_cfg_set_pos_idx(int category_index, int menu_index, int pos) { @@ -1040,18 +1004,6 @@ void setting_cfg_set_click_times(char *keyname, int click_times) } -EXPORT_PUBLIC -bool is_ug_installed_by_ug_args(void *data) -{ - retv_if(!data, TRUE);/*if passing NULL,drawing it */ - char *ug_args = data; - char *path = get_path_from_args(ug_args); - int is_installed = ug_is_installed(path); - - FREE(path); - return is_installed; -} - /*other relative function*/ EXPORT_PUBLIC char *get_path_from_args(void *data) diff --git a/setting-common/src/setting-common-general-func.c b/setting-common/src/setting-common-general-func.c index d9475ebb..e305adfb 100755 --- a/setting-common/src/setting-common-general-func.c +++ b/setting-common/src/setting-common-general-func.c @@ -23,28 +23,14 @@ #include "setting-common-data-slp-setting.h" #include -#include -#include #include #include #include -#include -#include -#include - -#include -#include -#include -#include +#include "setting-cfg.h" #include -#include -#include -#include #include -#include -#include EXPORT_PUBLIC char *get_application_default_icon(const char *appid) @@ -106,8 +92,6 @@ char *get_brightness_mode_str() return "IDS_ST_BODY_MANUAL"; } -#define MAX_SCREEN_MODE_NUM 4 - EXPORT_PUBLIC char *get_pa_backlight_time_str() { @@ -304,18 +288,14 @@ char *get_pa_display_language_str() char *q = strchr(locale, '.'); if (q) { - /*SETTING_TRACE_DEBUG("find (.) char"); */ *q = '\0'; } - /*SETTING_TRACE_DEBUG("current locale : %s", locale); */ setting_lang_entry *pnode; char *title = NULL; EINA_LIST_FOREACH(list, elist, pnode) { - /*SETTING_TRACE_DEBUG("pnode->locale : %s", - * pnode->locale); */ if (strcmp(pnode->locale, locale) == 0) { title = g_strdup(pnode->title); break; @@ -366,166 +346,6 @@ EXPORT_PUBLIC char *get_pa_date_format_str() return (char *)g_strdup(format_str[value]); } -static inline const char *_check_language_env_value(const char *value) -{ - retv_if(NULL == value, NULL); - - switch (*value) { - case 'a': - if (0 == strcmp(value, "ar")) - return "ar"; - else if (0 == strcmp(value, "az")) - return "az"; - break; - case 'b': - if (0 == strcmp(value, "bg")) - return "bg"; - break; - case 'c': - if (0 == strcmp(value, "ca")) - return "ca"; - else if (0 == strcmp(value, "cs")) - return "cs"; - break; - case 'd': - if (0 == strcmp(value, "da")) - return "da"; - else if (0 == strcmp(value, "de_DE")) - return "de_DE"; - break; - case 'e': - if (0 == strcmp(value, "el_GR")) - return "el_GR"; - else if (0 == strcmp(value, "en")) - return "en"; - else if (0 == strcmp(value, "en_PH")) - return "en_PH"; - else if (0 == strcmp(value, "en_US")) - return "en_US"; - else if (0 == strcmp(value, "es_ES")) - return "es_ES"; - else if (0 == strcmp(value, "es_MX")) - return "es_MX"; - else if (0 == strcmp(value, "et")) - return "et"; - else if (0 == strcmp(value, "eu")) - return "eu"; - break; - case 'f': - if (0 == strcmp(value, "fi")) - return "fi"; - else if (0 == strcmp(value, "fr_CA")) - return "fr_CA"; - else if (0 == strcmp(value, "fr_FR")) - return "fr_FR"; - break; - case 'g': - if (0 == strcmp(value, "ga")) - return "ga"; - else if (0 == strcmp(value, "gl")) - return "gl"; - break; - case 'h': - if (0 == strcmp(value, "hi")) - return "hi"; - else if (0 == strcmp(value, "hr")) - return "hr"; - else if (0 == strcmp(value, "hu")) - return "hu"; - else if (0 == strcmp(value, "hy")) - return "hy"; - break; - case 'i': - if (0 == strcmp(value, "is")) - return "is"; - else if (0 == strcmp(value, "it_IT")) - return "it_IT"; - break; - case 'j': - if (0 == strcmp(value, "ja_JP")) - return "ja_JP"; - break; - case 'k': - if (0 == strcmp(value, "ka")) - return "ka"; - else if (0 == strcmp(value, "kk")) - return "kk"; - else if (0 == strcmp(value, "ko_KR")) - return "ko_KR"; - break; - case 'l': - if (0 == strcmp(value, "lt")) - return "lt"; - else if (0 == strcmp(value, "lv")) - return "lv"; - break; - case 'm': - if (0 == strcmp(value, "mk")) - return "mk"; - break; - case 'n': - if (0 == strcmp(value, "nb")) - return "nb"; - else if (0 == strcmp(value, "nl_NL")) - return "nl_NL"; - break; - /*case 'o': */ - case 'p': - if (0 == strcmp(value, "pl")) - return "pl"; - else if (0 == strcmp(value, "pt_BR")) - return "pt_BR"; - else if (0 == strcmp(value, "pt_PT")) - return "pt_PT"; - break; - /*case 'q': */ - case 'r': - if (0 == strcmp(value, "ro")) - return "ro"; - else if (0 == strcmp(value, "ru_RU")) - return "ru_RU"; - break; - case 's': - if (0 == strcmp(value, "sk")) - return "sk"; - else if (0 == strcmp(value, "sl")) - return "sl"; - else if (0 == strcmp(value, "sr")) - return "sr"; - else if (0 == strcmp(value, "sv")) - return "sv"; - break; - case 't': - if (0 == strcmp(value, "tr_TR")) - return "tr_TR"; - break; - case 'u': - if (0 == strcmp(value, "uk")) - return "uk"; - else if (0 == strcmp(value, "uz")) - return "uz"; - break; - /*case 'v': */ - /*case 'w': */ - /*case 'x': */ - /*case 'y': */ - case 'z': - if (0 == strcmp(value, "zh_CN")) - return "zh_CN"; - else if (0 == strcmp(value, "zh_HK")) - return "zh_HK"; - else if (0 == strcmp(value, "zh_SG")) - return "zh_SG"; - else if (0 == strcmp(value, "zh_TW")) - return "zh_TW"; - break; - default: - break; - } - - return NULL; -} - EXPORT_PUBLIC char *get_pa_select_network() { @@ -1196,7 +1016,6 @@ EXPORT_PUBLIC int app_group_launcher(const char *pkg_name) /*service_set_operation(service, SERVICE_OPERATION_DEFAULT); */ if (path) app_control_set_app_id(service, path); - app_control_set_window(service, elm_win_xwindow_get(ug_get_window())); int launch_ret = app_control_send_launch_request(service, NULL, NULL); SETTING_TRACE("after app_service_create - %s : %d ", pkg_name, diff --git a/setting-profile/src/setting-profile-common.c b/setting-profile/src/setting-profile-common.c index 4cfc5a9c..d6b2ac26 100755 --- a/setting-profile/src/setting-profile-common.c +++ b/setting-profile/src/setting-profile-common.c @@ -174,7 +174,6 @@ int setting_sound_check_file_exist(void *data, const char *file_path) retv_if(data == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER); retv_if(file_path == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER); - /*resolve P130805-7070 */ if (0 == safeStrNCmp(file_path, SETTING_DEFAULT_FOLDER_PATH, safeStrLen(SETTING_DEFAULT_FOLDER_PATH))) { diff --git a/src/setting-helper.c b/src/setting-helper.c index 8f1dbfe3..ecb970fe 100755 --- a/src/setting-helper.c +++ b/src/setting-helper.c @@ -5,7 +5,6 @@ bool is_searchmode_app(Cfg_Item_Type type) bool ret = false; switch (type % 10) { - case Cfg_Item_Ug_Node: /* ug run */ case Cfg_Item_App_Node: /* docomo run */ case Cfg_Item_View_Node: /* n-depth search */ case Cfg_Item_AppLauncher_Node: /* app launch */