Apply Tizen coding rule 48/70848/3 accepted/tizen/common/20160606.141815 accepted/tizen/ivi/20160602.230626 accepted/tizen/mobile/20160602.230559 accepted/tizen/tv/20160602.230615 submit/tizen/20160602.021703 submit/tizen_common/20160606.122615
authorSeonah Moon <seonah1.moon@samsung.com>
Mon, 23 May 2016 04:57:17 +0000 (13:57 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Thu, 2 Jun 2016 04:48:59 +0000 (13:48 +0900)
Change-Id: Ie777394054d9d0346c1eb53159d6161fce4536ab
Signed-off-by: Seonah Moon <seonah1.moon@samsung.com>
packaging/ug-setting-mobileap-efl.spec
src/mh_common_utility.c
src/mh_connected_client.c
src/mh_device_rename.c
src/mh_func_onoff.c
src/mh_main_ug.c
src/mh_popup.c
src/mh_view_main.c
src/mh_view_wifi_setup.c

index 8397126..cf2afb8 100755 (executable)
@@ -3,7 +3,7 @@
 
 Name:          ug-setting-mobileap-efl
 Summary:       Tethering UI Gadget Library
-Version:       1.0.137
+Version:       1.0.138
 Release:       1
 Group:         App/Network
 License:       Flora-1.1
index 141630f..b94a65a 100644 (file)
@@ -79,19 +79,19 @@ void _device_name_changed_cb(keynode_t *key, void *data)
                return;
        }
        dev_name = vconf_keynode_get_str(key);
-       if (ad->setup.name_item != NULL) {
+       if (ad->setup.name_item != NULL)
                elm_genlist_item_update(ad->setup.name_item);
-       }
-       if (ad->main.help_item != NULL) {
+
+       if (ad->main.help_item != NULL)
                elm_genlist_item_update(ad->main.help_item);
-       }
+
        if (ad->rename_popup) {
                elm_entry_entry_set(ad->rename_entry, dev_name);
                elm_entry_cursor_end_set(ad->rename_entry);
        }
-       if (ad->main.hotspot_mode & VCONFKEY_MOBILE_HOTSPOT_MODE_WIFI) {
+       if (ad->main.hotspot_mode & VCONFKEY_MOBILE_HOTSPOT_MODE_WIFI)
                _update_wifi_item(ad, MH_STATE_PROCESS);
-       }
+
        return;
 }
 
@@ -245,9 +245,9 @@ void _handle_mobileap_syspopup_popup_response(keynode_t *key, void *data)
        vconf_key = vconf_keynode_get_int(key);
 
        if (vconf_key) {
-               if (vconf_set_int(VCONF_KEY_MOBILEAP_SYSPOPUP_RESPONSE, 0) < 0) {
+               if (vconf_set_int(VCONF_KEY_MOBILEAP_SYSPOPUP_RESPONSE, 0) < 0)
                        ERR("vconf_set_int is failed\n");
-               }
+
                if (ad->type != TETHERING_TYPE_WIFI) {
                        DBG("no need to handle user response\n");
                        return;
@@ -282,9 +282,9 @@ void _handle_usb_status_change(keynode_t *key, void *data)
        }
 
        vconf_key = vconf_keynode_get_int(key);
-       if (vconf_key == SETTING_USB_NONE_MODE) {
+       if (vconf_key == SETTING_USB_NONE_MODE)
                return;
-       }
+
        if (vconf_key != VCONFKEY_SYSMAN_USB_AVAILABLE) {
                if (ad->type == TETHERING_TYPE_USB && ad->popup) {
                        evas_object_del(ad->popup);
@@ -330,7 +330,7 @@ Eina_Bool _get_no_of_connected_device(mh_appdata_t *ad, int *no, tethering_type_
        tethering_error_e ret;
        int count = 0;
 
-       for (l = ad->client_list; l != NULL; l = g_slist_next(l) ) {
+       for (l = ad->client_list; l != NULL; l = g_slist_next(l)) {
                handle = l->data;
                if (handle == NULL)
                        continue;
@@ -385,7 +385,7 @@ void _release_list_client_handle(mh_appdata_t *ad)
        GSList *l = NULL;
        tethering_client_h handle;
 
-       for (l = ad->client_list; l != NULL; l = g_slist_next(l) ) {
+       for (l = ad->client_list; l != NULL; l = g_slist_next(l)) {
                handle = l->data;
                if (handle == NULL)
                        continue;
@@ -509,9 +509,8 @@ void _get_list_clients_informations(mh_appdata_t *ad)
 
 void _free_genlist_item(Elm_Object_Item **item)
 {
-       if (*item == NULL) {
+       if (*item == NULL)
                return;
-       }
 
        elm_object_item_del(*item);
        *item = NULL;
@@ -519,9 +518,8 @@ void _free_genlist_item(Elm_Object_Item **item)
 
 void _free_genlist_itc(Elm_Genlist_Item_Class **itc)
 {
-       if (*itc == NULL) {
+       if (*itc == NULL)
                return;
-       }
 
        elm_genlist_item_class_free(*itc);
        *itc = NULL;
@@ -531,13 +529,12 @@ int _get_sim_state(void)
 {
        int value = 0;
 
-       if (vconf_get_int(VCONFKEY_TELEPHONY_SIM_SLOT, &value) < 0) {
+       if (vconf_get_int(VCONFKEY_TELEPHONY_SIM_SLOT, &value) < 0)
                ERR("vconf_get_int is failed\n");
-       }
+
        DBG("%s : %d\n", VCONFKEY_TELEPHONY_SIM_SLOT, value);
-       if (value == VCONFKEY_TELEPHONY_SIM_INSERTED) {
+       if (value == VCONFKEY_TELEPHONY_SIM_INSERTED)
                return value;
-       }
 
 #if defined TIZEN_FEATURE_DUALSIM_ENABLE
        if (vconf_get_int(VCONFKEY_TELEPHONY_SIM_SLOT2, &value) < 0) {
index 5faad27..5e45f44 100755 (executable)
@@ -19,9 +19,8 @@ static void __deconstruct_conn_clients_view(mh_appdata_t *ad)
        int i = 0;
 
        no_of_dev = _get_list_clients_count(ad);
-       for (i = 0; i < no_of_dev; i++) {
+       for (i = 0; i < no_of_dev; i++)
                _free_genlist_item(&ad->connected_device.station_items[i]);
-       }
 
        _free_genlist_itc(&client->dev_itc[TETHERING_TYPE_WIFI]);
        _free_genlist_itc(&client->dev_itc[TETHERING_TYPE_BT]);
@@ -53,7 +52,7 @@ static void __update_connected_client_view(mh_appdata_t *ad)
 
        elm_genlist_clear(cli_view->genlist);
 
-       for (l = ad->client_list; l != NULL; l = g_slist_next(l) ) {
+       for (l = ad->client_list; l != NULL; l = g_slist_next(l)) {
                handle = (tethering_client_h *)l->data;
                tethering_client_get_tethering_type(handle, &connection_type);
 
@@ -143,9 +142,8 @@ static char *__gl_get_dev_label(void *data, Evas_Object *obj, const char *part)
 
        if (!strcmp("elm.text", part)) {
                tethering_client_get_name(client, &name);
-               if (NULL == name) {
+               if (NULL == name)
                        return NULL;
-               }
 
                if (!strcmp(name, "UNKNOWN")) {
                        free(name);
@@ -300,7 +298,7 @@ static void __create_genlist(mh_appdata_t *ad)
 
        __set_genlist_itc(ad);
 
-       for (l = ad->client_list; l != NULL; l = g_slist_next(l) ) {
+       for (l = ad->client_list; l != NULL; l = g_slist_next(l)) {
                handle = (tethering_client_h *)l->data;
                tethering_client_get_tethering_type(handle, &connection_type);
 
index 7f172a5..fa20337 100755 (executable)
@@ -27,9 +27,9 @@ static void __rename_popup_keyback_cb(void *data, Evas_Object *obj,
 
        elm_object_focus_set(ad->rename_entry, EINA_FALSE);
 
-       if (ad->rename_popup) {
+       if (ad->rename_popup)
                evas_object_del(ad->rename_popup);
-       }
+
        ad->rename_popup = NULL;
        ad->rename_entry = NULL;
        __set_rotate_cb(NULL, NULL);
@@ -47,9 +47,9 @@ static void __rename_popup_mouseup_cb(void *data,
 
        if (ev->button == 3) {
                elm_object_focus_set(ad->rename_entry, EINA_FALSE);
-               if (ad->rename_popup) {
+               if (ad->rename_popup)
                        evas_object_del(ad->rename_popup);
-               }
+
                ad->rename_popup = NULL;
                ad->rename_entry = NULL;
        }
@@ -60,11 +60,10 @@ static void __rename_popup_mouseup_cb(void *data,
 static bool __is_space_str(const char *str)
 {
        while (str) {
-               if (*str != '\0' && *str != ' ') {
+               if (*str != '\0' && *str != ' ')
                        return FALSE;
-               } else if (*str == '\0') {
+               else if (*str == '\0')
                        return TRUE;
-               }
                str++;
        }
        return TRUE;
@@ -76,8 +75,8 @@ static void __rename_popop_entry_changed_cb(void *data, Evas_Object *obj,
        __MOBILE_AP_FUNC_ENTER__;
        mh_appdata_t *ad = (mh_appdata_t *)data;
 
-       const char *entry_text  = NULL;
-       char *input_str                 = NULL;
+       const char *entry_text = NULL;
+       char *input_str = NULL;
        bool is_space_string = FALSE;
 
        entry_text = elm_entry_entry_get(obj);
@@ -96,9 +95,9 @@ static void __rename_popop_entry_changed_cb(void *data, Evas_Object *obj,
        if (input_str == NULL || (strlen(input_str) == 0)) {
                elm_object_disabled_set(ad->rename_button, TRUE);
                elm_entry_input_panel_return_key_disabled_set(obj, TRUE);
-               if (input_str) {
+               if (input_str)
                        free(input_str);
-               }
+
                return;
        }
 
@@ -114,9 +113,9 @@ static void __rename_popop_entry_changed_cb(void *data, Evas_Object *obj,
                elm_object_disabled_set(ad->rename_button, FALSE);
                elm_entry_input_panel_return_key_disabled_set(ad->rename_entry, FALSE);
        }
-       if (input_str) {
+       if (input_str)
                free(input_str);
-       }
+
        __MOBILE_AP_FUNC_EXIT__;
 }
 
@@ -135,9 +134,8 @@ static void __device_name_maxlength_reached_cb(void *data, Evas_Object *obj,
 
        snprintf(buf, sizeof(buf), STR_PW_MAX_LEN_WARN_MSG, DEVICE_NAME_LENGTH_MAX);
        ret = notification_status_message_post(buf);
-       if (ret != NOTIFICATION_ERROR_NONE) {
+       if (ret != NOTIFICATION_ERROR_NONE)
                ERR("notification_status_message_post() is failed : %d\n", ret);
-       }
 
        __MOBILE_AP_FUNC_EXIT__;
 }
@@ -241,9 +239,8 @@ static void __rename_popup_ok_cb(void *data, Evas_Object *obj,
                ad->rename_entry = NULL;
        }
        if (g_strcmp0(ad->setup.device_name, device_name_str)) {
-               if (vconf_set_str(VCONFKEY_SETAPPL_DEVICE_NAME_STR, device_name_str) != 0) {
-                       DBG("Set vconf[%s] failed\n",VCONFKEY_SETAPPL_DEVICE_NAME_STR);
-               }
+               if (vconf_set_str(VCONFKEY_SETAPPL_DEVICE_NAME_STR, device_name_str) != 0)
+                       DBG("Set vconf[%s] failed\n", VCONFKEY_SETAPPL_DEVICE_NAME_STR);
 
                g_strlcpy(ad->setup.device_name, entry_str,
                                sizeof(ad->setup.device_name));
@@ -305,9 +302,9 @@ void _hadnle_rename_popup_rotation(Eina_Bool is_portrait)
        __MOBILE_AP_FUNC_ENTER__;
 
        __set_portrait_mode(is_portrait);
-       if (rotate_cb) {
+       if (rotate_cb)
                rotate_cb(is_portrait, rotate_cb_data);
-       }
+
        __MOBILE_AP_FUNC_EXIT__;
 }
 
@@ -327,9 +324,8 @@ static Evas_Object *__rename_entry_icon_get(void *data, Evas_Object *obj, const
        }
        mh_appdata_t *ad = (mh_appdata_t*) data;
 
-       if (strcmp(part, "elm.icon.entry")) {
+       if (strcmp(part, "elm.icon.entry"))
                return NULL;
-       }
 
        entry = elm_entry_add(obj);
        elm_entry_single_line_set(entry, EINA_TRUE);
@@ -391,9 +387,9 @@ static Evas_Object *__rename_entry_icon_get(void *data, Evas_Object *obj, const
 static char *__rename_desc_label_get(void *data, Evas_Object *obj,
                                        const char *part)
 {
-       if (!strcmp(part, "elm.text.multiline" )) {
+       if (!strcmp(part, "elm.text.multiline"))
                return g_strdup(STR_RENAME_DEVICE_MSG);
-       }
+
        return NULL;
 }
 
index fcf3163..f8bb989 100644 (file)
@@ -28,23 +28,20 @@ static bool is_wifi_tethering_checkbox_popup_active = false;
 
 void _update_tethering_enabling_item(mh_appdata_t *ad, tethering_type_e type, mh_state_e state)
 {
-       switch(type) {
+       switch (type) {
        case TETHERING_TYPE_WIFI:
                _update_wifi_item(ad, MH_STATE_NONE);
                ad->is_wifi_teth_enabling = false;
                break;
-
        case TETHERING_TYPE_BT:
                _update_bt_item(ad, MH_STATE_NONE);
                ad->is_bt_teth_enabling = false;
                break;
-
        case TETHERING_TYPE_USB:
                _update_usb_item(ad, MH_STATE_NONE);
                ad->is_usb_teth_enabling = false;
                break;
-
-       default :
+       default:
                ERR("invalid type \n");
                break;
        }
@@ -75,18 +72,18 @@ int _get_vconf_usb_state()
 void _update_tethering_item(mh_appdata_t * ad, mh_state_e state)
 {
        ERR("type : %d state : %d\n", ad->type, state);
-       switch(ad->type)        {
-               case TETHERING_TYPE_WIFI:
-                       _update_wifi_item(ad, state);
-                       break;
-               case TETHERING_TYPE_BT:
-                       _update_bt_item(ad, state);
-                       break;
-               case TETHERING_TYPE_USB:
-                       _update_usb_item(ad, state);
-                       break;
-               default:
-                       break;
+       switch (ad->type) {
+       case TETHERING_TYPE_WIFI:
+               _update_wifi_item(ad, state);
+               break;
+       case TETHERING_TYPE_BT:
+               _update_bt_item(ad, state);
+               break;
+       case TETHERING_TYPE_USB:
+               _update_usb_item(ad, state);
+               break;
+       default:
+               break;
        }
 }
 
@@ -98,7 +95,7 @@ gboolean _ps_recheck_timeout_cb(gpointer data)
 
        DBG("Re-Check cellular state (%d)\n", recheck_count);
 
-       if(cellular_state == CONNECTION_CELLULAR_STATE_FLIGHT_MODE) {
+       if (cellular_state == CONNECTION_CELLULAR_STATE_FLIGHT_MODE) {
                _update_tethering_item(ad, MH_STATE_NONE);
                recheck_count = 0;
                return FALSE;
@@ -130,7 +127,7 @@ gboolean _ps_recheck_timeout_cb(gpointer data)
                        return FALSE;
                }
        } else {
-               if(++recheck_count >= PS_RECHECK_COUNT_MAX) {
+               if (++recheck_count >= PS_RECHECK_COUNT_MAX) {
                        DBG("Cellular network is not connected : %d\n", cellular_state);
                        _update_tethering_item(ad, MH_STATE_NONE);
                        _prepare_popup(MH_POPUP_NETWORK_OUT_OF_RANGE, STR_NO_DATA_SERVICE);
@@ -207,7 +204,7 @@ static int __is_preconditions_handled(mh_appdata_t *ad)
 
        /* Check SIM state */
        if (_get_sim_state() != VCONFKEY_TELEPHONY_SIM_INSERTED) {
-               if(ad->type == TETHERING_TYPE_WIFI)
+               if (ad->type == TETHERING_TYPE_WIFI)
                        _prepare_popup(MH_POPUP_NO_SIM, STR_INSERT_SIM_TO_USE_TETH);
                else
                        _prepare_popup(MH_POPUP_NO_SIM, STR_CONN_MOBILE_DATA_TO_USE_TETH);
@@ -227,7 +224,7 @@ static int __is_preconditions_handled(mh_appdata_t *ad)
        } else {
                if (vconf_get_bool(VCONFKEY_3G_ENABLE , &dnet_state) < 0) {
                        ERR("vconf_get_bool is failed\n");
-               } else if(dnet_state == 0) {
+               } else if (dnet_state == 0) {
                        DBG("Data Network is not connected");
                        _prepare_popup(MH_POPUP_MOBILE_DATA_OFF, STR_NO_NET_CONN_MSG);
                        _create_popup(ad);
@@ -235,25 +232,28 @@ static int __is_preconditions_handled(mh_appdata_t *ad)
                }
                if (cellular_state != CONNECTION_CELLULAR_STATE_CONNECTED &&
                        cellular_state != CONNECTION_CELLULAR_STATE_AVAILABLE) {
-                       if(ad->ps_recheck_timer_id > 0) {
+                       if (ad->ps_recheck_timer_id > 0) {
                                g_source_remove(ad->ps_recheck_timer_id);
                                ad->ps_recheck_timer_id = 0;
-                               if (ad->is_wifi_teth_enabling == true && ad->type != TETHERING_TYPE_WIFI) {
-                                       _update_tethering_enabling_item(ad, TETHERING_TYPE_WIFI, MH_STATE_NONE);
-                               }
-                               if (ad->is_bt_teth_enabling == true && ad->type != TETHERING_TYPE_BT) {
-                                       _update_tethering_enabling_item(ad, TETHERING_TYPE_BT, MH_STATE_NONE);
-                               }
-                               if (ad->is_usb_teth_enabling == true && ad->type != TETHERING_TYPE_USB) {
-                                       _update_tethering_enabling_item(ad, TETHERING_TYPE_USB, MH_STATE_NONE);
-                               }
+                               if (ad->is_wifi_teth_enabling == true
+                                               && ad->type != TETHERING_TYPE_WIFI)
+                                       _update_tethering_enabling_item(ad, TETHERING_TYPE_WIFI,
+                                                                                                       MH_STATE_NONE);
+                               if (ad->is_bt_teth_enabling == true
+                                               && ad->type != TETHERING_TYPE_BT)
+                                       _update_tethering_enabling_item(ad, TETHERING_TYPE_BT,
+                                                                                                       MH_STATE_NONE);
+                               if (ad->is_usb_teth_enabling == true
+                                               && ad->type != TETHERING_TYPE_USB)
+                                       _update_tethering_enabling_item(ad, TETHERING_TYPE_USB,
+                                                                                                       MH_STATE_NONE);
                        }
-                       ad->ps_recheck_timer_id = g_timeout_add(PS_RECHECK_INTERVAL, _ps_recheck_timeout_cb, (void*)ad);
+                       ad->ps_recheck_timer_id = g_timeout_add(PS_RECHECK_INTERVAL,
+                                                                               _ps_recheck_timeout_cb, (void*)ad);
                        return 0;
                }
        }
 
-       DBG("Cellular network is connected\n");
        DBG("-\n");
        return 1;
 }
@@ -269,11 +269,11 @@ int _create_wifi_hotspot_on_popup(mh_appdata_t *ad)
        _set_vconf_prev_wifi_state(wifi_state);
        value = _get_checkbox_status(TETHERING_TYPE_WIFI);
        if (0 == value) {
-               if (wifi_state == true || _is_wifi_direct_on() == true) {
+               if (wifi_state == true || _is_wifi_direct_on() == true)
                        fmt = STR_TETH_ON_DESC_1;
-               } else {
+               else
                        fmt = STR_TETH_ON_DESC_2;
-               }
+
                str = g_malloc0(MH_LABEL_LENGTH_MAX);
                if (str == NULL) {
                        ERR("memory allocation is failed\n");
@@ -372,9 +372,8 @@ static void __disable_tethering_by_ind(mh_appdata_t *ad, tethering_disabled_caus
                break;
 
        case TETHERING_DISABLED_BY_OTHERS:
-               if (ad->main.wifi_item && _get_vconf_prev_wifi_state() == true) {
+               if (ad->main.wifi_item && _get_vconf_prev_wifi_state() == true)
                        elm_object_item_disabled_set(ad->main.wifi_item, EINA_TRUE);
-               }
                break;
 
        case TETHERING_DISABLED_BY_LOW_BATTERY:
@@ -418,8 +417,6 @@ void _enabled_cb(tethering_error_e result, tethering_type_e type, bool is_reques
                return;
        }
 
-       if (result != TETHERING_ERROR_NONE) {
-       }
        _update_main_view(ad, type);
 
        return;
@@ -455,9 +452,8 @@ void _disabled_cb(tethering_error_e result, tethering_type_e type, tethering_dis
                return;
        }
 
-       if (ad->main.wifi_item && type == TETHERING_TYPE_WIFI && _get_vconf_prev_wifi_state() == true) {
+       if (ad->main.wifi_item && type == TETHERING_TYPE_WIFI && _get_vconf_prev_wifi_state() == true)
                elm_object_item_disabled_set(ad->main.wifi_item, EINA_TRUE);
-       }
 
        _update_main_view(ad, type);
 
@@ -480,9 +476,8 @@ void _connection_changed_cb(tethering_client_h client, bool is_opened, void *use
                _append_list_client_handle(ad, client);
 
 #ifdef TETHERING_DATA_USAGE_SUPPORT
-               if (ad->is_foreground && _get_list_clients_count(ad) == 1) {
+               if (ad->is_foreground && _get_list_clients_count(ad) == 1)
                        _start_update_data_packet_usage(ad);
-               }
 #endif
        } else {
                tethering_client_get_mac_address(client, &mac_addr);
@@ -510,14 +505,14 @@ void _wifi_state_changed_cb(wifi_device_state_e state, void *user_data)
 
        DBG("+\n");
 
-       mh_appdata_t *ad= (mh_appdata_t *)user_data;
+       mh_appdata_t *ad = (mh_appdata_t *)user_data;
        char *str = NULL;
        char *fmt = NULL;
        if (state == WIFI_DEVICE_STATE_ACTIVATED) {
                if (ad->main.wifi_item && elm_object_item_disabled_get(ad->main.wifi_item))
                        elm_object_item_disabled_set(ad->main.wifi_item, EINA_FALSE);
                _set_vconf_prev_wifi_state(false);
-       } else if (state == WIFI_DEVICE_STATE_DEACTIVATED){
+       } else if (state == WIFI_DEVICE_STATE_DEACTIVATED) {
                _set_vconf_prev_wifi_state(true);
        }
 
@@ -527,11 +522,11 @@ void _wifi_state_changed_cb(wifi_device_state_e state, void *user_data)
                ad->popup_checkbox = NULL;
                evas_object_del(ad->popup);
                ad->popup = NULL;
-               if (state == WIFI_DEVICE_STATE_ACTIVATED) {
+               if (state == WIFI_DEVICE_STATE_ACTIVATED)
                        fmt = STR_TETH_ON_DESC_1;
-               } else {
+               else
                        fmt = STR_TETH_ON_DESC_2;
-               }
+
                str = g_malloc0(MH_LABEL_LENGTH_MAX);
                if (str == NULL) {
                        ERR("memory allocation is failed\n");
@@ -613,9 +608,8 @@ void _passphrase_changed_cb(void *user_data)
                return;
        }
 
-       if (!g_strcmp0(passphrase, ad->setup.wifi_passphrase)) {
+       if (!g_strcmp0(passphrase, ad->setup.wifi_passphrase))
                goto DONE;
-       }
 
        g_strlcpy(ad->setup.wifi_passphrase, passphrase,
                sizeof(ad->setup.wifi_passphrase));
index bc48a7e..741cad4 100755 (executable)
@@ -21,7 +21,9 @@
 #define UG_MODULE_API __attribute__ ((visibility("default")))
 #endif
 
-//#include <setting-cfg.h>
+#if 0
+#include <setting-cfg.h>
+#endif
 
 #include "mobile_hotspot.h"
 #include "mh_view_main.h"
@@ -31,7 +33,9 @@
 #include "mh_string.h"
 #include "mh_view_wifi_setup.h"
 
-//UG_MODULE_API int setting_plugin_search_init(app_control_h app_control, void * priv, char ** domainname);
+#if 0 /* Not support */
+UG_MODULE_API int setting_plugin_search_init(app_control_h app_control, void * priv, char ** domainname);
+#endif
 
 static Evas_Object *create_content(mh_appdata_t *ad)
 {
@@ -230,14 +234,12 @@ static void *on_create(ui_gadget_h ug, enum ug_mode mode,
        elm_object_part_content_set(layout, "elm.swallow.content", content);
        evas_object_show(layout);
        ret = connection_create(&ad->conn_handle);
-       if (ret != CONNECTION_ERROR_NONE) {
+       if (ret != CONNECTION_ERROR_NONE)
                ERR("connection_create() is failed : %d\n", ret);
-       }
 
        ret = wifi_initialize();
-       if (ret != WIFI_ERROR_NONE) {
+       if (ret != WIFI_ERROR_NONE)
                ERR("wifi_initialize() is failed : %d\n", ret);
-       }
 
        __set_callbacks(ad->handle, (void *)ad);
 
@@ -260,15 +262,14 @@ static void on_start(ui_gadget_h ug, app_control_h app_control, void *priv)
 #ifdef TETHERING_DATA_USAGE_SUPPORT
                _start_update_data_packet_usage(ad);
 #endif
-               if (ad->connected_device.navi_it) {
+               if (ad->connected_device.navi_it)
                        _start_update_device_conn_time(ad);
-               }
        }
 
        app_control_get_extra_data(app_control, "viewtype", &viewtype);
 
        if (viewtype != NULL) {
-               if(strcmp(viewtype, "wifisettings") == 0)
+               if (strcmp(viewtype, "wifisettings") == 0)
                        mh_draw_wifi_setup_view(ad);
                g_free(viewtype);
        }
@@ -305,7 +306,7 @@ static void on_resume(ui_gadget_h ug, app_control_h app_control, void *priv)
        ad->is_foreground = true;
 
        if (item && elm_genlist_item_expanded_get(item)) {
-               for (l = ad->client_list; l != NULL; l = g_slist_next(l) ) {
+               for (l = ad->client_list; l != NULL; l = g_slist_next(l)) {
                        item = elm_genlist_item_next_get(item);
                        elm_genlist_item_fields_update(item, "elm.text", ELM_GENLIST_ITEM_FIELD_TEXT);
                }
@@ -315,9 +316,8 @@ static void on_resume(ui_gadget_h ug, app_control_h app_control, void *priv)
 #ifdef TETHERING_DATA_USAGE_SUPPORT
                _start_update_data_packet_usage(ad);
 #endif
-               if (ad->connected_device.navi_it) {
+               if (ad->connected_device.navi_it)
                        _start_update_device_conn_time(ad);
-               }
        }
        DBG("-\n");
 }
@@ -347,24 +347,20 @@ static void on_destroy(ui_gadget_h ug, app_control_h app_control, void *priv)
 #endif
        _stop_update_device_conn_time(ad);
 
-       if (vconf_set_int(VCONF_MOBILE_AP_CONNECT_USB_POPUP_STATUS, 0) < 0) {
+       if (vconf_set_int(VCONF_MOBILE_AP_CONNECT_USB_POPUP_STATUS, 0) < 0)
                ERR("vconf_set_int is failed\n");
-       }
 
        ret = wifi_deinitialize();
-       if (ret != WIFI_ERROR_NONE) {
+       if (ret != WIFI_ERROR_NONE)
                ERR("wifi_deinitialize() is failed : %d\n", ret);
-       }
 
        ret = connection_destroy(ad->conn_handle);
-       if (ret != CONNECTION_ERROR_NONE) {
+       if (ret != CONNECTION_ERROR_NONE)
                ERR("connection_destroy() is failed : %d\n", ret);
-       }
 
        ret = tethering_destroy(ad->handle);
-       if (ret != TETHERING_ERROR_NONE) {
+       if (ret != TETHERING_ERROR_NONE)
                ERR("tethering_destroy() is failed : %d\n", ret);
-       }
 
        if (ad->layout == NULL) {
                ERR("ad->layout is NULL\n");
@@ -378,7 +374,7 @@ static void on_destroy(ui_gadget_h ug, app_control_h app_control, void *priv)
                ad->popup = NULL;
        }
 
-       if(ad->ps_recheck_timer_id > 0) {
+       if (ad->ps_recheck_timer_id > 0) {
                g_source_remove(ad->ps_recheck_timer_id);
                ad->ps_recheck_timer_id = 0;
        }
index b786c86..c74ae96 100755 (executable)
@@ -35,7 +35,7 @@ static void __launch_network_app(void)
        app_control_h app_control;
 
        app_control_create(&app_control);
-       if(ret != APP_CONTROL_ERROR_NONE) {
+       if (ret != APP_CONTROL_ERROR_NONE) {
                ERR("app_control_create failed");
                return;
        }
@@ -44,11 +44,10 @@ static void __launch_network_app(void)
        app_control_set_app_id(app_control, "setting-network-efl");
 
        ret = app_control_send_launch_request(app_control, NULL, NULL);
-       if(ret == APP_CONTROL_ERROR_NONE) {
+       if (ret == APP_CONTROL_ERROR_NONE)
                DBG("Launch network ug successful");
-       } else {
+       else
                ERR("Fail to launch network ug");
-       }
 
        app_control_destroy(app_control);
 }
@@ -80,9 +79,9 @@ static void __handle_popup_resp(void *data, bool response)
        if (response == true) {
                switch (popup_type) {
                case MH_POPUP_WIFI_ON_CHECKBOX:
-                       if(state) {
+                       if (state)
                                _set_checkbox_status(TETHERING_TYPE_WIFI, 1);
-                       }
+
                        ad->is_wifi_teth_enabling = false;
                        ret = tethering_enable(ad->handle, TETHERING_TYPE_WIFI);
                        if (ret != TETHERING_ERROR_NONE) {
@@ -94,9 +93,9 @@ static void __handle_popup_resp(void *data, bool response)
                        break;
 
                case MH_POPUP_BT_ON_CHECKBOX:
-                       if(state) {
+                       if (state)
                                _set_checkbox_status(TETHERING_TYPE_BT, 1);
-                       }
+
                        ad->is_bt_teth_enabling = false;
                        ret = tethering_enable(ad->handle, TETHERING_TYPE_BT);
                        if (ret != TETHERING_ERROR_NONE) {
@@ -106,9 +105,9 @@ static void __handle_popup_resp(void *data, bool response)
                        break;
 
                case MH_POPUP_USB_ON_CHECKBOX:
-                       if(state) {
+                       if (state)
                                _set_checkbox_status(TETHERING_TYPE_USB, 1);
-                       }
+
                        if (_get_vconf_usb_state() != VCONFKEY_SYSMAN_USB_AVAILABLE) {
                                _update_tethering_item(ad, MH_STATE_NONE);
                                break;
@@ -152,7 +151,7 @@ static void __handle_popup_resp(void *data, bool response)
                        break;
 
                case MH_POPUP_USB_ON_CHECKBOX:
-                       _update_tethering_enabling_item(ad,TETHERING_TYPE_USB, MH_STATE_NONE);
+                       _update_tethering_enabling_item(ad, TETHERING_TYPE_USB, MH_STATE_NONE);
                        break;
 
                case MH_POPUP_WIFI_AP_OFF:
@@ -212,9 +211,8 @@ static void __popup_no_btn_mouse_event_cb(void *data, Evas *evas, Evas_Object *o
 
        Evas_Event_Mouse_Up *ev = event_info;
 
-       if (ev->button == 3) {
+       if (ev->button == 3)
                __handle_popup_resp(data, false);
-       }
 }
 
 static void __popup_block_clicked_cb(void *data, Evas_Object *obj, void *event_info)
@@ -297,20 +295,20 @@ static void __language_changed_cb(void *data, Evas_Object *obj, void *event_info
        char *fmt = NULL;
        char str[MH_LABEL_LENGTH_MAX];
 
-       if (ad->type < TETHERING_TYPE_USB || ad->type > TETHERING_TYPE_BT ) {
+       if (ad->type < TETHERING_TYPE_USB || ad->type > TETHERING_TYPE_BT) {
                ERR("Invalid Tethering type\n");
                return;
        }
 
-       switch(ad->type) {
+       switch (ad->type) {
        case TETHERING_TYPE_WIFI:
                wifi_is_activated(&wifi_state);
                _set_vconf_prev_wifi_state(wifi_state);
-               if (wifi_state == true || _is_wifi_direct_on() == true) {
+               if (wifi_state == true || _is_wifi_direct_on() == true)
                        fmt = STR_TETH_ON_DESC_1;
-               } else {
+               else
                        fmt = STR_TETH_ON_DESC_2;
-               }
+
                snprintf(str, MH_LABEL_LENGTH_MAX, fmt, TETHERING_WIFI_MAX_CONNECTED_STA);
                break;
 
@@ -419,7 +417,7 @@ static void __popup_with_checkbox(mh_appdata_t *ad)
                elm_object_focus_next_object_set(yes_button, check, ELM_FOCUS_NEXT);
                if (cancel_button) {
                        elm_object_focus_next_object_set(cancel_button, check, ELM_FOCUS_PREVIOUS);
-                       elm_object_focus_next_object_set(check ,cancel_button, ELM_FOCUS_NEXT);
+                       elm_object_focus_next_object_set(check , cancel_button, ELM_FOCUS_NEXT);
                }
        }
 
@@ -478,7 +476,7 @@ Eina_Bool _create_popup(mh_appdata_t *ad)
                else
                        elm_object_content_set(popup, popup_content);
 
-               cancel_button =_create_button(popup, STR_CANCEL,
+               cancel_button = _create_button(popup, STR_CANCEL,
                                "button1", __popup_no_btn_clicked_cb, ad);
                yes_button = _create_button(popup, STR_TURN_OFF,
                                "button2", __popup_yes_btn_clicked_cb, ad);
index fd7e6b8..6f2af60 100755 (executable)
@@ -42,11 +42,11 @@ void _rotate_adjust_rename_popup(void)
        int change_ang = 0;
 
        change_ang = elm_win_rotation_get(g_ad->win);
-       if (change_ang == 0 || change_ang == 180) {
+       if (change_ang == 0 || change_ang == 180)
                _hadnle_rename_popup_rotation(EINA_TRUE);
-       } else {
+       else
                _hadnle_rename_popup_rotation(EINA_FALSE);
-       }
+
        __MOBILE_AP_FUNC_EXIT__;
 }
 #endif
@@ -105,9 +105,6 @@ Eina_Bool ap_update_data_packet_usage(mh_appdata_t *ad)
                ERR("Invalid param\n");
                return EINA_FALSE;
        }
-       if (ad->main.usage_item == NULL) {
-               return EINA_TRUE;
-       }
 
        if (ad->main.usage_item)
                elm_genlist_item_update(ad->main.usage_item);
@@ -129,9 +126,8 @@ Eina_Bool ap_get_data_statistics(void *data)
        }
 
        /* If previous data is not updated, new data is not required */
-       if (ad->data_statistics.is_updated == false) {
+       if (ad->data_statistics.is_updated == false)
                return ECORE_CALLBACK_RENEW;
-       }
 
        /* Because previous data is updated, new data is required.
           It will be returned asynchronously. */
@@ -175,9 +171,9 @@ void _start_update_device_conn_time(mh_appdata_t *ad)
                return;
        }
 
-       if (ad->update_conn_time_handle) {
+       if (ad->update_conn_time_handle)
                _stop_update_device_conn_time(ad);
-       }
+
        ad->update_conn_time_handle = ecore_timer_add(UPDATE_INTERVAL,
                        ap_update_device_conn_time, (void *)ad);
 
@@ -210,9 +206,8 @@ void _start_update_data_packet_usage(mh_appdata_t *ad)
                return;
        }
 
-       if (ad->update_statistics_handle) {
+       if (ad->update_statistics_handle)
                _stop_update_data_packet_usage(ad);
-       }
 
        ad->data_statistics.is_updated = false;
        tethering_get_data_usage(ad->handle, _data_usage_cb, (void *)ad);
@@ -288,16 +283,16 @@ static void __read_setting(mh_appdata_t *ad)
        free(passphrase);
 
        ret = tethering_wifi_get_ssid_visibility(ad->handle, &visibility);
-       if (ret != TETHERING_ERROR_NONE) {
+       if (ret != TETHERING_ERROR_NONE)
                ERR("tethering_wifi_get_ssid_visibility is failed\n");
-       }
+
        ad->setup.visibility = visibility;
        ad->setup.visibility_new = visibility;
 
        ret = tethering_wifi_get_security_type(ad->handle, &type);
-       if (ret != TETHERING_ERROR_NONE) {
+       if (ret != TETHERING_ERROR_NONE)
                ERR("tethering_wifi_get_security_type is failed\n");
-       }
+
        ad->setup.security_type = type;
        ad->setup.security_type_new = type;
 
@@ -308,9 +303,8 @@ void _update_wifi_item(mh_appdata_t *ad, int wifi_state)
 {
        __MOBILE_AP_FUNC_ENTER__;
 
-       if (ad->main.wifi_state == wifi_state) {
+       if (ad->main.wifi_state == wifi_state)
                return;
-       }
 
        if (ad->main.wifi_state == MH_STATE_PROCESS) {
                ad->main.wifi_state = MH_STATE_NONE;
@@ -335,9 +329,8 @@ void _update_bt_item(mh_appdata_t *ad, int bt_state)
 {
        __MOBILE_AP_FUNC_ENTER__;
 
-       if (ad->main.bt_state == bt_state) {
+       if (ad->main.bt_state == bt_state)
                return;
-       }
 
        if (ad->main.bt_state == MH_STATE_PROCESS) {
                ad->main.bt_state = MH_STATE_NONE;
@@ -359,9 +352,8 @@ void _update_usb_item(mh_appdata_t *ad, int usb_state)
 {
        __MOBILE_AP_FUNC_ENTER__;
 
-       if (ad->main.usb_state == usb_state) {
+       if (ad->main.usb_state == usb_state)
                return;
-       }
 
        if (ad->main.usb_state == MH_STATE_PROCESS) {
                ad->main.usb_state = MH_STATE_NONE;
@@ -407,9 +399,8 @@ void _genlist_update_device_item(mh_appdata_t *ad)
                ad->main.device_item = item;
        }
 
-       if (ad->connected_device.navi_it) {
+       if (ad->connected_device.navi_it)
                _update_conn_clients(ad);
-       }
 
        __MOBILE_AP_FUNC_EXIT__;
        return;
@@ -536,13 +527,11 @@ void _update_main_view(mh_appdata_t *ad, tethering_type_e type)
                        _update_wifi_item(ad, MH_STATE_NONE);
                } else {
                        obj = elm_object_item_part_content_get(ad->main.wifi_item, "elm.swallow.end");
-                       if (obj != NULL) {
+                       if (obj != NULL)
                                elm_check_state_set(obj, wifi_state);
-                       }
 
-                       if (ad->main.wifi_item) {
+                       if (ad->main.wifi_item)
                                elm_genlist_item_update(ad->main.wifi_item);
-                       }
                }
                break;
 
@@ -552,13 +541,11 @@ void _update_main_view(mh_appdata_t *ad, tethering_type_e type)
                        _update_bt_item(ad, MH_STATE_NONE);
                } else {
                        obj = elm_object_item_part_content_get(ad->main.bt_item, "elm.swallow.end");
-                       if (obj != NULL) {
+                       if (obj != NULL)
                                elm_check_state_set(obj, bt_state);
-                       }
 
-                       if (ad->main.bt_item) {
+                       if (ad->main.bt_item)
                                elm_genlist_item_update(ad->main.bt_item);
-                       }
                }
                break;
 
@@ -746,9 +733,8 @@ static void  __back_btn_cb(void *data, Elm_Object_Item *navi_item)
 
 static char *__get_wifi_label(void *data, Evas_Object *obj, const char *part)
 {
-       if (!strcmp("elm.text", part)) {
+       if (!strcmp("elm.text", part))
                return strdup(STR_WIFI_TETH);
-       }
 
        return NULL;
 }
@@ -787,9 +773,8 @@ static Evas_Object *__get_wifi_icon(void *data, Evas_Object *obj,
 
 static char *__get_bt_label(void *data, Evas_Object *obj, const char *part)
 {
-       if (!strcmp("elm.text", part)) {
+       if (!strcmp("elm.text", part))
                return strdup(STR_BLUETOOTH_TETH);
-       }
 
        return NULL;
 }
@@ -828,9 +813,8 @@ static Evas_Object *__get_bt_icon(void *data, Evas_Object *obj, const char *part
 
 static char *__get_usb_label(void *data, Evas_Object *obj, const char *part)
 {
-       if (!strcmp("elm.text", part)) {
+       if (!strcmp("elm.text", part))
                return strdup(STR_USB_TETH);
-       }
 
        return NULL;
 }
@@ -1402,16 +1386,16 @@ static void __ctx_move_more_ctxpopup(Evas_Object *ctx, mh_appdata_t *ad)
        pos = elm_win_rotation_get(ad->win);
 
        switch (pos) {
-               case 0:
-               case 180:
-                       evas_object_move(ctx, w/2, h);
-                       break;
-               case 90:
-                       evas_object_move(ctx, h/2, w);
-                       break;
-               case 270:
-                       evas_object_move(ctx, h/2, w);
-                       break;
+       case 0:
+       case 180:
+               evas_object_move(ctx, w/2, h);
+               break;
+       case 90:
+               evas_object_move(ctx, h/2, w);
+               break;
+       case 270:
+               evas_object_move(ctx, h/2, w);
+               break;
        }
        __MOBILE_AP_FUNC_EXIT__;
 }
@@ -1497,9 +1481,8 @@ static void __create_ctxpopup_more_button(void *data, Evas_Object *obj,
        }
        __MOBILE_AP_FUNC_ENTER__;
 
-       if (ad->setup.navi_it == NULL) {
+       if (ad->setup.navi_it == NULL)
                return;
-       }
 
        elm_naviframe_item_pop_cb_set(ad->setup.navi_it, _setting_back_btn_cb, (void *)ad);
        ctxpopup = elm_ctxpopup_add(ad->naviframe);
index 1e503d8..6469911 100755 (executable)
@@ -134,9 +134,8 @@ static char *__gl_device_name_title_label_get(void *data, Evas_Object *obj, cons
 
        if (!strcmp("elm.text.multiline", part)) {
                device_name_utf = vconf_get_str(VCONFKEY_SETAPPL_DEVICE_NAME_STR);
-               if (device_name_utf == NULL) {
+               if (device_name_utf == NULL)
                        ERR("vconf_get_str failed \n");
-               }
 
                ptr = elm_entry_utf8_to_markup(device_name_utf);
                if (ptr == NULL) {
@@ -169,9 +168,8 @@ static char *__gl_hide_label_get(void *data, Evas_Object *obj, const char *part)
                return NULL;
        }
 
-       if (!strcmp("elm.text", part)) {
+       if (!strcmp("elm.text", part))
                return strdup(STR_HIDE_MY_DEV);
-       }
 
        __MOBILE_AP_FUNC_EXIT__;
        return NULL;
@@ -186,9 +184,8 @@ static char *__gl_security_label_get(void *data, Evas_Object *obj, const char *p
                return NULL;
        }
 
-       if (!strcmp("elm.text", part)) {
+       if (!strcmp("elm.text", part))
                return strdup(STR_SECURITY_TYPE);
-       }
 
        __MOBILE_AP_FUNC_EXIT__;
        return NULL;
@@ -349,9 +346,8 @@ static void __pw_entry_maxlength_reached_cb(void *data, Evas_Object *obj,
                        WIFI_PASSPHRASE_LENGTH_MIN, WIFI_PASSPHRASE_LENGTH_MAX);
 
        ret = notification_status_message_post(buf);
-       if (ret != NOTIFICATION_ERROR_NONE) {
+       if (ret != NOTIFICATION_ERROR_NONE)
                ERR("notification_status_message_post() is failed : %d\n", ret);
-       }
 
        __MOBILE_AP_FUNC_EXIT__;
 }
@@ -809,7 +805,7 @@ static void __save_btn_cb(void *data, Evas_Object *object, void *event_info)
                if (ret == false) {
                        g_strlcpy(st->wifi_passphrase_new, st->wifi_passphrase,
                                        sizeof(st->wifi_passphrase_new));
-                       if(st->pw_item)
+                       if (st->pw_item)
                                elm_genlist_item_update(st->pw_item);
                } else {
                        g_strlcpy(st->wifi_passphrase, st->wifi_passphrase_new,
@@ -869,13 +865,11 @@ Eina_Bool _setting_back_btn_cb(void *data, Elm_Object_Item *navi_item)
        mh_appdata_t *ad = (mh_appdata_t *)data;
        mh_wifi_setting_view_t *st = &ad->setup;
 
-       if (st->visibility != st->visibility_new) {
+       if (st->visibility != st->visibility_new)
                st->visibility_new = st->visibility;
-       }
 
-       if (st->security_type != st->security_type_new) {
+       if (st->security_type != st->security_type_new)
                st->security_type_new = st->security_type;
-       }
 
        if (strcmp(st->wifi_passphrase_new, st->wifi_passphrase)) {
                g_strlcpy(st->wifi_passphrase_new, st->wifi_passphrase,
@@ -907,14 +901,12 @@ static void __gl_realized(void *data, Evas_Object *obj, void *event_info)
        int no_of_sp;
        int i;
 
-       if (item == st->hide_item) {
+       if (item == st->hide_item)
                elm_object_item_signal_emit(item, "elm,state,top", "");
-       } else if (item == st->security_item) {
+       else if (item == st->security_item)
                elm_object_item_signal_emit(item, "elm,state,center", "");
-       } else if (item == st->pw_item) {
+       else if (item == st->pw_item)
                elm_object_item_signal_emit(item, "elm,state,bottom", "");
-       } else if (item == st->name_item) {
-       }
 
        no_of_sp = sizeof(st->sp_item) / sizeof(st->sp_item[0]);
        for (i = 0; i < no_of_sp; i++) {
@@ -982,7 +974,6 @@ Evas_Object *__create_genlist(mh_appdata_t *ad)
        elm_object_style_set(genlist, "dialogue");
        elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
        evas_object_smart_callback_add(genlist, "realized", __gl_realized, ad);
-       //elm_genlist_realization_mode_set(genlist, EINA_TRUE);
 
        __set_genlist_itc(ad);