}
}
+static char *_strcasestr(char *str1, char *str2)
+{
+ int len1 = 0, len2 = 0;
+
+ retv_if(!str1, NULL);
+ retv_if(!str2, NULL);
+
+ len1 = strlen(str1);
+ retv_if(!len1, NULL);
+
+ len2 = strlen(str2);
+ retv_if(!len2, NULL);
+
+ while (*str1) {
+ if (!strncasecmp(str1, str2, len2))
+ return str1;
+ str1++;
+ }
+
+ return NULL;
+}
+
+
static void _update_searchlist(Evas_Object *searchlist, const char *str, main_view_s *main_view_info)
{
Evas_Object *predict_item = NULL;
for (; i < CITY_SYDNEY; i++) {
int matched = 0;
- if (city_info[i].name && str && strstr(city_info[i].name, str))
+ if (city_info[i].name && str && _strcasestr(city_info[i].name, str))
matched = 1;
- else if (city_info[i].nation && str && strstr(city_info[i].nation, str))
+ else if (city_info[i].nation && str && _strcasestr(city_info[i].nation, str))
matched = 1;
if (matched) {
prev_t = cur_t;
elm_object_signal_emit(obj, "momentic,state,page,back", "");
- if (1 == cur_page) {
+ switch (cur_page) {
+ Eina_List *list = NULL;
+ Evas_Object *item = NULL;
+ Evas_Object *tmp = NULL;
+ Evas_Object *box = NULL;
+
+ case 0:
+ _D("Page 0 [Initial page] -> Out : elm_win_lower()");
+
+ elm_win_lower(main_view_info->moment_info->win);
+ break;
+ case 1:
+ _D("Page 1 [Entry page] -> Page 0 [Initial page] : Initial city list");
+
item_reset_color_index();
scroller_clear_item(main_view_info->city_list);
_append_here_to_city_list(main_view_info->city_list, main_view_info);
elm_object_focus_set(main_view_info->searchbar, EINA_FALSE);
cur_page = 0;
- } else if (2 == cur_page) {
- Eina_List *list = NULL;
- Evas_Object *item = NULL;
- Evas_Object *tmp = NULL;
- Evas_Object *box = elm_object_content_get(main_view_info->city_list);
+ break;
+ case 2:
+ _D("Page 2 [Best time page] -> Page 1 [Entry page] : Remove the best item");
+ box = elm_object_content_get(main_view_info->city_list);
ret_if(!box);
list = elm_box_children_get(box);
EINA_LIST_FREE(list, item) {
elm_object_signal_emit(item, "momentic,item,state,default", "");
+ unset_time_range(item);
tmp = item;
}
+
scroller_remove_item(main_view_info->city_list, tmp);
item_destroy_best_time(tmp);
cur_page = 1;
- } else if (0 == cur_page) {
- elm_win_lower(main_view_info->moment_info->win);
- } else if (4 == cur_page) {
+ break;
+ case 4:
+ _D("Page 3 [Best time page] -> Page 0[Initial page]");
+
scroller_clear_item(main_view_info->city_list);
_append_here_to_city_list(main_view_info->city_list, main_view_info);
elm_object_signal_emit(main_view_info->main_view, "load", "");
elm_object_signal_emit(main_view_info->main_view, "momentic,state,add_description,show", "");
+ cur_page = 0;
+ break;
+ default:
+ _E("cannot reach here");
+ break;
}
}