Code cleaning(3) 82/148082/2
authorRadek Kintop <r.kintop@samsung.com>
Wed, 6 Sep 2017 14:08:31 +0000 (16:08 +0200)
committerRadek Kintop <r.kintop@samsung.com>
Wed, 6 Sep 2017 14:09:18 +0000 (14:09 +0000)
Change-Id: I58039ab7909f2933d11b61833f60017a734b67d4
Signed-off-by: Radek Kintop <r.kintop@samsung.com>
setting-common/CMakeLists.txt
setting-common/include/setting-cfg.h
setting-common/include/setting-common-general-func.h
setting-common/src/setting-cfg.c
setting-common/src/setting-common-general-func.c
setting-profile/src/setting-profile-common.c
src/setting-helper.c

index 67c60b9ed91b2986546b221921b3c16462802f4e..f1da308dcf439ac8feedf70469960066b5df9dc5 100755 (executable)
@@ -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
 )
index 4425dd002832e4e2adda372e2403fcb16355abf2..2c94b0947fbd8d936ea8c519ff611bd845d00a59 100644 (file)
@@ -28,7 +28,7 @@
 #define __SETTING_CFG_H__
 
 #include <glib.h>
-#include <setting-common-resource.h>
+#include "setting-common-resource.h"
 #include <app.h>
 #include <app_common.h>
 
@@ -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);
 
index 42c7d2d1c65a1be7ca9ce500bc1497c4cd5f6d9e..131d0bf94b21035ec0f60da6970afa94ac5e9d25 100755 (executable)
@@ -36,7 +36,7 @@
 #undef S_
 #endif
 
-#include <setting-common-data-type.h>
+#include "setting-common-data-type.h"
 #include <regex.h>
 
 #ifndef _EDJ
index 3e4fc0b4acc43a50c49a4475b53e5ed782015902..51982b1337f5b082637cc2c35f4135a04dcc4eea 100755 (executable)
 
 #include "setting-cfg.h"
 #include "setting-debug.h"
-#include <Elementary.h>
 #include <json-glib/json-glib.h>
 #include "setting-common-general-func.h"
 #include "setting-common-data-type.h"
 #include "setting-common-data-slp-setting.h"
 #include <vconf.h>
-#include <ui-gadget-module.h>
 
 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)
index d9475ebb889a38dc423d7208d41489c103fd4fb2..e305adfbbbc5102124b864b4efe40e2f97635193 100755 (executable)
 #include "setting-common-data-slp-setting.h"
 
 #include <glib.h>
-#include <dlfcn.h>
-#include <libxml/xmlmemory.h>
 #include <libxml/parser.h>
 #include <system_info.h>
 
 #include <system_settings.h>
-#include <libxml/xmlmemory.h>
-#include <libxml/parser.h>
-#include <libxml/tree.h>
-
-#include <sys/stat.h>
-#include <sys/mount.h>
 
-#include <limits.h>
-#include <setting-cfg.h>
+#include "setting-cfg.h"
 #include <pkgmgr-info.h>
-#include <player.h>
-#include <bundle.h>
-#include <bundle_internal.h>
 #include <app_control_internal.h>
-#include <pkgmgr-info.h>
-#include <ui-gadget-module.h>
 
 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,
index 4cfc5a9c7364f8aa65ff45d13a54b8dbba8e82e6..d6b2ac26e972078a1deb99bb7b7f5717edb7422b 100755 (executable)
@@ -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))) {
index 8f1dbfe35afcf0e5951dfeee70f07680a9e53d2c..ecb970fe69c4004f65006b54a1ce66b1461a9e68 100755 (executable)
@@ -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 */