Fixed: Coding rule issues.
[apps/native/ug-wifi-direct.git] / ug-wifidirect / src / wfd_ug_rename_popup.c
index ffa6c97..24bd87d 100755 (executable)
@@ -32,11 +32,11 @@ static char special_char[30] = "'!@$%^&*()-_=+[];:,<.>/?";
 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;
@@ -54,8 +54,8 @@ static void _rename_popop_entry_changed_cb(void *data, Evas_Object *obj, void *e
        WFD_RET_IF(ugd == NULL || obj == NULL, "Incorrect parameter(NULL)\n");
        WFD_RET_IF(ugd->rename_button == NULL, "ugd->rename_button(NULL)\n");
 
-       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);
@@ -113,9 +113,8 @@ int _check_device_name(const char *device_name)
        int j = 0;
        bool is_unavailable_char_found = true;
 
-       if ((device_name == NULL) || (strlen(device_name) == 0)) {
+       if ((device_name == NULL) || (strlen(device_name) == 0))
                return -1;
-       }
 
        for (i = 0; i < strlen(device_name); i++) {
                if ((device_name[i] >= '0' && device_name[i] <= '9') ||
@@ -154,9 +153,9 @@ static void _rename_popup_ok_cb(void *data, Evas_Object *obj, void *event_info)
        DBG(LOG_INFO, "New device name:[%s]\n", device_name_str);
        _check_device_name(device_name_str);
 
-       if (0 != vconf_set_str(VCONFKEY_SETAPPL_DEVICE_NAME_STR, device_name_str)) {
-               DBG(LOG_ERROR, "Set vconf[%s] failed\n",VCONFKEY_SETAPPL_DEVICE_NAME_STR);
-       }
+       if (0 != vconf_set_str(VCONFKEY_SETAPPL_DEVICE_NAME_STR, device_name_str))
+               DBG(LOG_ERROR, "Set vconf[%s] failed\n", VCONFKEY_SETAPPL_DEVICE_NAME_STR);
+
 #ifdef WFD_ON_OFF_GENLIST
        wfd_ug_view_refresh_glitem(ugd->item_wifi_onoff);
 #endif
@@ -195,9 +194,8 @@ static void __device_name_maxlength_reached_cb(void *data, Evas_Object *obj,
 
        int ret = notification_status_message_post(
                        D_("IDS_COM_POP_MAXIMUM_NUMBER_OF_CHARACTERS_REACHED"));
-       if (ret != NOTIFICATION_ERROR_NONE) {
+       if (ret != NOTIFICATION_ERROR_NONE)
                DBG(LOG_ERROR, "notification_status_message_post() ERROR [%d]", ret);
-       }
 
        __FUNC_EXIT__;
 }
@@ -231,9 +229,8 @@ static void _rename_entry_keydown_cb(void *data, Evas *e, Evas_Object *obj, void
                Ecore_IMF_Context *imf_context;
 
                imf_context = (Ecore_IMF_Context*)elm_entry_imf_context_get(entry);
-               if (imf_context) {
+               if (imf_context)
                        ecore_imf_context_input_panel_hide(imf_context);
-               }
 
                elm_object_focus_set(entry, EINA_FALSE);
        }
@@ -244,10 +241,9 @@ static char *__wfd_main_rename_desc_label_get(void *data, Evas_Object *obj,
 {
        __FUNC_ENTER__;
 
-       DBG(LOG_INFO,"Part = %s", part);
-       if (obj == NULL || part == NULL) {
+       DBG(LOG_INFO, "Part = %s", part);
+       if (obj == NULL || part == NULL)
                return NULL;
-       }
 
        if (!strcmp("elm.text.multiline", part)) {
                char buf[WFD_GLOBALIZATION_STR_LENGTH] = {0, };
@@ -368,7 +364,7 @@ void _gl_rename_device_sel(void *data, Evas_Object *obj, void *event_info)
 
        /* Entry genlist item */
        ugd->rename_entry_itc = elm_genlist_item_class_new();
-       if(ugd->rename_entry_itc != NULL) {
+       if (ugd->rename_entry_itc != NULL) {
                ugd->rename_entry_itc->item_style = "entry";
                ugd->rename_entry_itc->func.text_get = NULL;
                ugd->rename_entry_itc->func.content_get = __wfd_main_rename_entry_icon_get;
@@ -380,7 +376,7 @@ void _gl_rename_device_sel(void *data, Evas_Object *obj, void *event_info)
        }
 
        ugd->rename_desc_itc = elm_genlist_item_class_new();
-       if(ugd->rename_desc_itc != NULL) {
+       if (ugd->rename_desc_itc != NULL) {
                ugd->rename_desc_itc->item_style = WFD_GENLIST_MULTILINE_TEXT_STYLE;
                ugd->rename_desc_itc->func.text_get = __wfd_main_rename_desc_label_get;
                ugd->rename_desc_itc->func.content_get = NULL;
@@ -389,7 +385,7 @@ void _gl_rename_device_sel(void *data, Evas_Object *obj, void *event_info)
 
                git = elm_genlist_item_append(genlist, ugd->rename_desc_itc, NULL, NULL,
                                ELM_GENLIST_ITEM_NONE, NULL, NULL);
-               if(git != NULL)
+               if (git != NULL)
                        elm_genlist_item_select_mode_set(git,
                                                 ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
        }