summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSegwon <segwon.han@samsung.com>2017-01-06 16:06:03 +0900
committerSegwon <segwon.han@samsung.com>2017-01-06 16:49:30 +0900
commitb134d94c32179f378831dbd90b205a510763d18c (patch)
tree1d7c5b10666a55269138643639eeff8f768d4fc9
parent63d60a213b8dc67c17d99bb20a6cece235dcec70 (diff)
downloadd2d-conv-setting-b134d94c32179f378831dbd90b205a510763d18c.tar.gz
d2d-conv-setting-b134d94c32179f378831dbd90b205a510763d18c.tar.bz2
d2d-conv-setting-b134d94c32179f378831dbd90b205a510763d18c.zip
Block device duplicate detection.
Signed-off-by: Segwon <segwon.han@samsung.com> Change-Id: I394ed43819dd712ac0cb6f2658fd8b1bafe030ce
-rw-r--r--src/ui/setting_item_device_list.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/ui/setting_item_device_list.c b/src/ui/setting_item_device_list.c
index ce8f5bc..535f260 100644
--- a/src/ui/setting_item_device_list.c
+++ b/src/ui/setting_item_device_list.c
@@ -76,7 +76,7 @@ static void popup_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
}
set_acl_device_list();
- evas_object_del(popup);
+ evas_object_del(popup);
}
static void show_device_list_selected_popup(char *title_name, char *content, char *left_button_name, char *center_button_name, char *right_button_name)
@@ -220,7 +220,7 @@ static Evas_Object* create_image(Evas_Object *parent, Evas_Coord w, Evas_Coord h
elm_image_file_set(img, "usr/apps/org.tizen.d2d-conv-setting/res/images/device_type_icon_multimedia.png", NULL);
}
- evas_object_size_hint_min_set(img, ELM_SCALE_SIZE(w), ELM_SCALE_SIZE(h));
+ evas_object_size_hint_min_set(img, ELM_SCALE_SIZE(w), ELM_SCALE_SIZE(h));
return img;
}
@@ -272,7 +272,14 @@ static void discovery_foreach_cb(conv_device_h device_h, int result, void *data)
conv_device_get_property_string(device_h, CONV_DEVICE_NAME, &device_name);
conv_device_get_property_string(device_h, CONV_DEVICE_TYPE, &device_type);
- int index = ++discovered_devices_index;
+ int index;
+ for (index = 0; index <= discovered_devices_index; index++) {
+ if (!strcmp(discovered_devices_info[index]->mac_address, device_id)) {
+ return;
+ }
+ }
+
+ index = ++discovered_devices_index;
discovered_devices_info[index] = (device_info_s *) calloc(sizeof(device_info_s), 1);
discovered_devices_info[index]->list_type = LIST_TYPE_DISCOVERED;
discovered_devices_info[index]->index = index;
@@ -283,7 +290,7 @@ static void discovery_foreach_cb(conv_device_h device_h, int result, void *data)
elm_genlist_item_append(discovered_list, device_item_builder, discovered_devices_info[index], discovered_device_group, ELM_GENLIST_ITEM_NONE, device_list_select_cb, discovered_devices_info[index]);
elm_genlist_item_fields_update(discovered_device_group, "elm.swallow.end", ELM_GENLIST_ITEM_FIELD_CONTENT);
- break;
+ return;
case CONV_DISCOVERY_RESULT_FINISHED :
conv_destroy(conv_handle);