summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunghyun Kim <jh1114.kim@samsung.com>2013-01-16 19:11:39 +0900
committerJunghyun Kim <jh1114.kim@samsung.com>2013-01-16 19:11:39 +0900
commite53e41ab35e6f68cb2ed596a7fb8ce818b823735 (patch)
treee1d651d20e6efb071485f6f3a7d19ad5c0f03f5d
parent7c908690057ce3748b9ca3d41053cb34b9721b79 (diff)
downloadsmartsearch-e53e41ab35e6f68cb2ed596a7fb8ce818b823735.tar.gz
smartsearch-e53e41ab35e6f68cb2ed596a7fb8ce818b823735.tar.bz2
smartsearch-e53e41ab35e6f68cb2ed596a7fb8ce818b823735.zip
sync for private
-rwxr-xr-xsrc/ps_app_interface.cpp10
-rwxr-xr-xsrc/ps_makeupviews.cpp6
-rwxr-xr-xsrc/ps_searcher.cpp215
-rwxr-xr-xsrc/search_bar.cpp4
4 files changed, 154 insertions, 81 deletions
diff --git a/src/ps_app_interface.cpp b/src/ps_app_interface.cpp
index b56e1e0..3c9bc88 100755
--- a/src/ps_app_interface.cpp
+++ b/src/ps_app_interface.cpp
@@ -70,6 +70,12 @@ static void __search_ug_closed_cb(ui_gadget_h ug, void *priv)
ug_destroy(ug);
ad->detail_ug = NULL;
+ elm_genlist_select_mode_set(ad->search_gl, ELM_OBJECT_SELECT_MODE_DEFAULT);
+
+ if (elm_object_scroll_freeze_get(ad->search_gl) > 0) {
+ elm_object_scroll_freeze_pop(ad->search_gl);
+ }
+
SEARCH_FUNC_END;
}
@@ -424,7 +430,7 @@ void search_launch_calendar_view(void *data, void *record_info)
SEARCH_RET_IF(ad == NULL);
SEARCH_RET_IF(cur_category_mem == NULL);
- if (strlen(cur_category_mem->launch_param) < 0) {
+ if (strlen(cur_category_mem->launch_param) <= 0) {
SEARCH_DEBUG_ERROR("Selected item does not have data!");
goto out_func;
} else {
@@ -494,7 +500,7 @@ void search_launch_memo_view(void *data, void *record_info)
SEARCH_RET_IF(ad == NULL);
SEARCH_RET_IF(cur_category_mem == NULL);
- if (strlen(cur_category_mem->launch_param) < 0) {
+ if (strlen(cur_category_mem->launch_param) <= 0) {
SEARCH_DEBUG_ERROR("Selected item does not have data!");
goto out_func;
} else {
diff --git a/src/ps_makeupviews.cpp b/src/ps_makeupviews.cpp
index 29ff2fd..f845f7d 100755
--- a/src/ps_makeupviews.cpp
+++ b/src/ps_makeupviews.cpp
@@ -67,14 +67,14 @@ ecore_exe_pipe_cb(void *data, void *buf, unsigned int size)
int cmd = 0;
- SEARCH_DEBUG_LOG("Pipe Command : %d ret : %d", cmd, pipe_data->search_ret);
-
SEARCH_RET_IF(ad == NULL);
SEARCH_RET_IF(pipe_data == NULL);
result_info = pipe_data->result_list;
cmd = pipe_data->cmd;
+ SEARCH_DEBUG_LOG("Pipe Command : %d ret : %d", cmd, pipe_data->search_ret);
+
switch (cmd) {
case SEARCH_PIPE_CMD_CLEAR_GENLIST:
elm_genlist_clear(ad->search_gl);
@@ -606,7 +606,7 @@ static int __search_gl_set_phone_search_result(struct search_content_object *obj
{
SEARCH_FUNC_START;
- int sel_cnt = SEARCH_CATEGORY_LIST_MORE_CNT + 1;
+ int sel_cnt = SEARCH_CATEGORY_LIST_MORE_CNT;
int func_ret = SEARCH_RET_SEARCH_NONE;
struct appdata *ad = (struct appdata *)data;
diff --git a/src/ps_searcher.cpp b/src/ps_searcher.cpp
index 1b8abed..c6ad4c0 100755
--- a/src/ps_searcher.cpp
+++ b/src/ps_searcher.cpp
@@ -172,6 +172,8 @@ int search_sql_contact_search_result_by_api(struct search_content_object *obj,
contacts_list_h list;
unsigned int count = 0;
+ int total_cnt = -1;
+
int loop_cnt = 0;
SEARCH_RETV_IF(ad == NULL, SEARCH_RET_SEARCH_FAIL);
@@ -187,7 +189,9 @@ int search_sql_contact_search_result_by_api(struct search_content_object *obj,
contacts_filter_add_str(filter, _contacts_person_number.number,
CONTACTS_MATCH_CONTAINS, keyword);
contacts_query_set_filter(query, filter);
+ contacts_query_set_sort(query, _contacts_person_number.display_name, true);
+ contacts_db_get_count_with_query(query, &total_cnt);
ret = contacts_db_get_records_with_query(query, offset, limit, &list);
contacts_filter_destroy(filter);
contacts_query_destroy(query);
@@ -195,6 +199,9 @@ int search_sql_contact_search_result_by_api(struct search_content_object *obj,
SEARCH_RETV_IF_WITH_ERRORV(ret != CONTACTS_ERROR_NONE, SEARCH_RET_SEARCH_FAIL, ret);
contacts_list_get_count(list, &count);
+ SEARCH_DEBUG_LOG("CONTACT COUNT: %d", count);
+ SEARCH_DEBUG_LOG("TOTAL COUNT: %d", total_cnt);
+
if (count > 0) {
/* Set group title */
if (offset == 0) {
@@ -216,12 +223,6 @@ int search_sql_contact_search_result_by_api(struct search_content_object *obj,
bool is_word_in_str = false;
char contact_id_str[MAX_LENGTH_PER_ID] = {0,};
- loop_cnt++;
-
- if (loop_cnt == limit) {
- break;
- }
-
sel_mem_info = (struct search_item_sel *)calloc(1, sizeof(struct search_item_sel));
if (!sel_mem_info) {
@@ -275,6 +276,12 @@ int search_sql_contact_search_result_by_api(struct search_content_object *obj,
obj, itc_style, sel_mem_info,
obj->gl_result_grp);
result_info->itemlist = g_list_append(result_info->itemlist, (void*)gen_item);
+
+ loop_cnt++;
+
+ if (loop_cnt == limit) {
+ break;
+ }
}while (contacts_list_next(list) == CONTACTS_ERROR_NONE);
} else {
SEARCH_DEBUG_WARNING("No matched contacts data", ret);
@@ -284,10 +291,12 @@ int search_sql_contact_search_result_by_api(struct search_content_object *obj,
contacts_list_destroy(list, true);
/* Set more title to genlist (under 'search all') */
- if (loop_cnt == limit) {
+ int curr_cnt = offset + loop_cnt;
+
+ if (total_cnt > curr_cnt) {
struct search_item_more_sel *sel_mem_more = NULL;
- obj->mr_info.next_point = offset + limit - 1;
+ obj->mr_info.next_point = offset + limit;
sel_mem_more =
(struct search_item_more_sel *)calloc(1,
@@ -321,8 +330,10 @@ int search_sql_calendar_search_result_by_api(struct search_content_object *obj,
int loop_cnt = 0;
int count = -1;
+ int total_cnt = -1;
int ret = 0;
int search_ret = SEARCH_RET_SEARCH_NONE;
+ int curr_cnt = 0;
SEARCH_RETV_IF(ad == NULL, SEARCH_RET_SEARCH_FAIL);
@@ -359,6 +370,18 @@ int search_sql_calendar_search_result_by_api(struct search_content_object *obj,
goto out_func;
}
+ ret = calendar_query_set_sort(query, _calendar_event.summary, true);
+ if (ret != CALENDAR_ERROR_NONE) {
+ SEARCH_DEBUG_WARNING("calendar_query_set_sort : %d", ret);
+ goto out_func;
+ }
+
+ ret = calendar_db_get_count_with_query(query, &total_cnt);
+ if (ret != CALENDAR_ERROR_NONE) {
+ SEARCH_DEBUG_WARNING("calendar_db_get_count_with_query : %d", ret);
+ goto out_func;
+ }
+
ret = calendar_db_get_records_with_query(query, offset, limit, &list);
if (ret != CALENDAR_ERROR_NONE) {
SEARCH_DEBUG_WARNING("calendar_db_get_records_with_query : %d", ret);
@@ -367,6 +390,9 @@ int search_sql_calendar_search_result_by_api(struct search_content_object *obj,
calendar_list_get_count(list, &count);
+ SEARCH_DEBUG_LOG("CALENDAR COUNT : %d", count);
+ SEARCH_DEBUG_LOG("TOTAL COUNT : %d", total_cnt);
+
if (count > 0) {
/* Set group title */
if (offset == 0) {
@@ -378,12 +404,6 @@ int search_sql_calendar_search_result_by_api(struct search_content_object *obj,
}
do {
- loop_cnt++;
-
- if (loop_cnt == limit) {
- break;
- }
-
int main_id = -1;
char *summary = NULL;
bool is_word_in_str = false;
@@ -433,6 +453,11 @@ int search_sql_calendar_search_result_by_api(struct search_content_object *obj,
sel_mem_info, obj->gl_result_grp);
result_info->itemlist = g_list_append(result_info->itemlist, (void*)gen_item);
+ loop_cnt++;
+
+ if (loop_cnt == limit) {
+ break;
+ }
} while (calendar_list_next(list) == CALENDAR_ERROR_NONE);
} else {
SEARCH_DEBUG_WARNING("No Matched calendar data: %d", count);
@@ -441,9 +466,11 @@ int search_sql_calendar_search_result_by_api(struct search_content_object *obj,
goto out_func;
}
+ curr_cnt = offset + loop_cnt;
+
/* Set more title to genlist (under 'search all') */
- if (loop_cnt == limit) {
- obj->mr_info.next_point = offset + limit - 1;
+ if (total_cnt > curr_cnt) {
+ obj->mr_info.next_point = offset + limit;
sel_mem_more =
(struct search_item_more_sel *)calloc(1,
@@ -614,6 +641,8 @@ int search_sql_email_search_result_by_api(struct search_content_object *obj,
int filter_list_count = 5;
int sorting_rule_list_count = 1;
int mail_count = 0;
+ int total_mail_cnt = -1;
+ int unseen_mail_cnt = -1;
struct search_genlist_item_info *gen_item = NULL;
struct search_item_sel *sel_mem_info = NULL;
@@ -657,16 +686,25 @@ int search_sql_email_search_result_by_api(struct search_content_object *obj,
sorting_rule_list[0].target_attribute = EMAIL_MAIL_ATTRIBUTE_SUBJECT;
sorting_rule_list[0].sort_order = EMAIL_SORT_ORDER_ASCEND;
+ ret = email_count_mail(filter_list, filter_list_count, &total_mail_cnt, &unseen_mail_cnt);
+ if (ret != EMAIL_ERROR_NONE) {
+ SEARCH_DEBUG_WARNING("Fail to call email_count_mail");
+ goto out_func;
+ }
+
ret = email_get_mail_list_ex(filter_list, filter_list_count, sorting_rule_list, sorting_rule_list_count,
offset, limit, &mail_list, &mail_count);
if (ret != EMAIL_ERROR_NONE) {
- SEARCH_DEBUG_WARNING("no email search result");
+ SEARCH_DEBUG_WARNING("Fail to call email_get_mail_list_ex");
goto out_func;
}
+ SEARCH_DEBUG_LOG("EMAIL TOTAL COUNT : %d UNSEEN : %d", total_mail_cnt, unseen_mail_cnt);
+ SEARCH_DEBUG_LOG("EMAIL COUNT : %d", mail_count);
+
if(mail_list == NULL) {
SEARCH_DEBUG_WARNING("mail_list is null");
search_ret = SEARCH_RET_SEARCH_NONE;
@@ -693,9 +731,6 @@ int search_sql_email_search_result_by_api(struct search_content_object *obj,
char email_id_str[MAX_LENGTH_PER_ID] = {0,};
char email_path_str[MAX_LENGTH_PER_PATH] = {0,};
- if(i == limit -1)
- break;
-
sel_mem_info = (struct search_item_sel*)calloc(1, sizeof(struct search_item_sel));
if (!sel_mem_info) {
@@ -735,8 +770,8 @@ int search_sql_email_search_result_by_api(struct search_content_object *obj,
}
/* Set more title to genlist (under 'search all') */
- if (mail_count == limit) {
- obj->mr_info.next_point = offset + mail_count - 1;
+ if (i < total_mail_cnt) {
+ obj->mr_info.next_point = offset + i;
sel_mem_more =
(struct search_item_more_sel *)calloc(1,
@@ -966,7 +1001,8 @@ static int __search_sql_media_search_result_by_api(struct search_content_object
filter_h filter,
media_info_cb func_cb,
void *data,
- struct search_genlist_info *result_info)
+ struct search_genlist_info *result_info,
+ int total_cnt)
{
SEARCH_FUNC_START;
@@ -976,6 +1012,7 @@ static int __search_sql_media_search_result_by_api(struct search_content_object
int result_cnt = 0;
int ret = 0;
int func_ret = SEARCH_RET_SEARCH_SUCCESS;
+ int curr_cnt = 0;
struct search_item_more_sel *sel_mem_more = NULL;
@@ -1001,9 +1038,11 @@ static int __search_sql_media_search_result_by_api(struct search_content_object
goto out_func;
}
+ curr_cnt = offset + result_cnt;
+
/* Set more title to genlist (under 'search all') */
- if (result_cnt == limit) {
- obj->mr_info.next_point = offset + result_cnt - 1;
+ if (total_cnt > curr_cnt) {
+ obj->mr_info.next_point = offset + result_cnt;
sel_mem_more =
(struct search_item_more_sel *)calloc(1,
@@ -1037,6 +1076,8 @@ int search_sql_image_search_result_by_api(struct search_content_object *obj,
int ret = SEARCH_RET_SEARCH_SUCCESS;
int len = 0;
+ int total_cnt = -1;
+
char *search_query = NULL;
char *escape_added_keyword = NULL;
@@ -1051,9 +1092,6 @@ int search_sql_image_search_result_by_api(struct search_content_object *obj,
snprintf(search_query, len, image_query, escape_added_keyword, "%");
- SEARCH_DEBUG_WARNING("keyword :%s", keyword);
- SEARCH_DEBUG_WARNING("search_query :%s", escape_added_keyword);
-
filter_h filter;
ret = media_filter_create(&filter);
@@ -1063,23 +1101,26 @@ int search_sql_image_search_result_by_api(struct search_content_object *obj,
goto out_func;
}
- ret = media_filter_set_offset(filter, offset, limit);
+ ret = media_filter_set_condition(filter, search_query, MEDIA_CONTENT_COLLATE_DEFAULT);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
- SEARCH_DEBUG_WARNING("media_filter_set_offset failed : %d\n", ret);
+ SEARCH_DEBUG_WARNING("media_filter_set_condition failed : %d\n", ret);
ret = SEARCH_RET_SEARCH_FAIL;
goto out_func;
}
- ret = media_filter_set_condition(filter, search_query, MEDIA_CONTENT_COLLATE_DEFAULT);
+ ret = media_filter_set_order(filter, MEDIA_CONTENT_ORDER_ASC, MEDIA_DISPLAY_NAME, MEDIA_CONTENT_COLLATE_DEFAULT);
if(ret != MEDIA_CONTENT_ERROR_NONE) {
- SEARCH_DEBUG_WARNING("media_filter_set_condition failed : %d\n", ret);
+ SEARCH_DEBUG_WARNING("media_filter_set_order failed : %d\n", ret);
ret = SEARCH_RET_SEARCH_FAIL;
goto out_func;
}
- ret = media_filter_set_order(filter, MEDIA_CONTENT_ORDER_ASC, MEDIA_DISPLAY_NAME, MEDIA_CONTENT_COLLATE_DEFAULT);
+ media_info_get_media_count_from_db(filter, &total_cnt);
+ SEARCH_DEBUG_LOG("Matched Image Total Cnt : %d", total_cnt);
+
+ ret = media_filter_set_offset(filter, offset, limit);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
- SEARCH_DEBUG_WARNING("media_filter_set_order failed : %d\n", ret);
+ SEARCH_DEBUG_WARNING("media_filter_set_offset failed : %d\n", ret);
ret = SEARCH_RET_SEARCH_FAIL;
goto out_func;
}
@@ -1092,7 +1133,8 @@ int search_sql_image_search_result_by_api(struct search_content_object *obj,
filter,
__search_media_info_cb,
data,
- result_info);
+ result_info,
+ total_cnt);
out_func:
SEARCH_FREE(search_query);
@@ -1113,6 +1155,7 @@ int search_sql_video_search_result_by_api(struct search_content_object *obj,
int len = 0;
char *search_query = NULL;
char *escape_added_keyword = NULL;
+ int total_cnt = -1;
const char *video_query = "(MEDIA_TYPE=1 and (MEDIA_DISPLAY_NAME LIKE \"%%%s%%\" ESCAPE (\"%s\")))";
@@ -1155,6 +1198,16 @@ int search_sql_video_search_result_by_api(struct search_content_object *obj,
goto out_func;
}
+ media_info_get_media_count_from_db(filter, &total_cnt);
+ SEARCH_DEBUG_LOG("Matched Video Total cnt : %d", total_cnt);
+
+ ret = media_filter_set_offset(filter, offset, limit);
+ if (ret != MEDIA_CONTENT_ERROR_NONE) {
+ SEARCH_DEBUG_WARNING("media_filter_set_offset failed : %d\n", ret);
+ ret = SEARCH_RET_SEARCH_FAIL;
+ goto out_func;
+ }
+
ret = __search_sql_media_search_result_by_api(obj,
offset,
limit,
@@ -1162,7 +1215,8 @@ int search_sql_video_search_result_by_api(struct search_content_object *obj,
filter,
__search_media_info_cb,
data,
- result_info);
+ result_info,
+ total_cnt);
out_func:
@@ -1187,6 +1241,7 @@ int search_sql_music_search_result_by_api(struct search_content_object *obj,
int len = 0;
char *search_query = NULL;
char *escape_added_keyword = NULL;
+ int total_cnt = -1;
const char *music_query = "(MEDIA_TYPE=3 and (MEDIA_TITLE LIKE \"%%%s%%\" or MEDIA_ALBUM LIKE \"%%%s%%\" or MEDIA_ARTIST LIKE \"%%%s%%\" ESCAPE (\"%s\")))";
@@ -1209,23 +1264,28 @@ int search_sql_music_search_result_by_api(struct search_content_object *obj,
goto out_func;
}
- ret = media_filter_set_offset(filter, offset, limit);
+
+
+ ret = media_filter_set_condition(filter, search_query, MEDIA_CONTENT_COLLATE_DEFAULT);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
- SEARCH_DEBUG_WARNING("media_filter_set_offset failed : %d\n", ret);
+ SEARCH_DEBUG_WARNING("media_filter_set_condition failed : %d\n", ret);
ret = SEARCH_RET_SEARCH_FAIL;
goto out_func;
}
- ret = media_filter_set_condition(filter, search_query, MEDIA_CONTENT_COLLATE_DEFAULT);
+ ret = media_filter_set_order(filter, MEDIA_CONTENT_ORDER_ASC, MEDIA_TITLE, MEDIA_CONTENT_COLLATE_DEFAULT);
if(ret != MEDIA_CONTENT_ERROR_NONE) {
- SEARCH_DEBUG_WARNING("media_filter_set_condition failed : %d\n", ret);
+ SEARCH_DEBUG_WARNING("media_filter_set_order failed : %d\n", ret);
ret = SEARCH_RET_SEARCH_FAIL;
goto out_func;
}
- ret = media_filter_set_order(filter, MEDIA_CONTENT_ORDER_ASC, MEDIA_TITLE, MEDIA_CONTENT_COLLATE_DEFAULT);
+ media_info_get_media_count_from_db(filter, &total_cnt);
+ SEARCH_DEBUG_LOG("Matched Music Total cnt : %d", total_cnt);
+
+ ret = media_filter_set_offset(filter, offset, limit);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
- SEARCH_DEBUG_WARNING("media_filter_set_order failed : %d\n", ret);
+ SEARCH_DEBUG_WARNING("media_filter_set_offset failed : %d\n", ret);
ret = SEARCH_RET_SEARCH_FAIL;
goto out_func;
}
@@ -1237,7 +1297,8 @@ int search_sql_music_search_result_by_api(struct search_content_object *obj,
filter,
__search_sql_music_info_cb,
data,
- result_info);
+ result_info,
+ total_cnt);
out_func:
@@ -1304,22 +1365,21 @@ ail_cb_ret_e __search_sql_menu_search_result_cb(
if(strcmp(package, "org.tizen.smartsearch") == 0) {
SEARCH_DEBUG_LOG("'smartsearch' does not appended");
obj->mr_info.loop_cnt++;
+ obj->mr_info.next_point++;
SEARCH_FREE(sel_mem_info);
return AIL_CB_RET_CONTINUE;
}
sel_mem_info->launch_path = strdup(package);
- SEARCH_DEBUG_LOG("package : %s", package);
} else {
- SEARCH_DEBUG_LOG("package : null");
+ SEARCH_DEBUG_WARNING("package : null");
}
ail_appinfo_get_str(appinfo, AIL_PROP_NAME_STR, &name);
if ((name) && (strlen(name) > 0)) {
sel_mem_info->text1 = strdup(search_markup_keyword(name, keyword, &is_word_in_str));
- SEARCH_DEBUG_LOG("name : %s", name);
} else {
- SEARCH_DEBUG_LOG("name : null");
+ SEARCH_DEBUG_WARNING("name : null");
}
if(obj->mr_info.next_point == 0) {
@@ -1718,7 +1778,7 @@ int search_sql_browser_search_result_by_api(struct search_content_object *obj,
if (bookmark_cnt > browser_result[0].next_point )
bookmark_ret = favorites_bookmark_foreach(__search_sql_browser_bookmark_result_cb,
&scd_browser);
- if (history_cnt > browser_result[1].next_point )
+ if (history_cnt > browser_result[1].next_point && g_list_length(result_info->itemlist) < SEARCH_CATEGORY_LIST_MORE_CNT)
history_ret = favorites_history_foreach(__search_sql_browser_history_result_cb,
&scd_history);
@@ -1779,6 +1839,8 @@ int search_sql_msg_search_result_by_api(struct search_content_object *obj,
bool is_word_in_title = false;
msg_error_t err = MSG_SUCCESS;
+
+ msg_struct_list_s total_msgList;
msg_struct_list_s msgList;
msg_struct_t search_s = NULL;
msg_struct_list_s *addr_list = NULL;
@@ -1803,6 +1865,12 @@ int search_sql_msg_search_result_by_api(struct search_content_object *obj,
goto out_func;
}
+ err = msg_search_message(ad->msg_handle, search_s, 0, 0, &total_msgList);
+ if (err != MSG_SUCCESS && err != MSG_ERR_DB_NORECORD) {
+ SEARCH_DEBUG_WARNING("msg_search_message is failed : %d", err);
+ goto out_func;
+ }
+
err = msg_search_message(ad->msg_handle, search_s, offset, limit, &msgList);
if (err != MSG_SUCCESS && err != MSG_ERR_DB_NORECORD) {
@@ -1810,6 +1878,9 @@ int search_sql_msg_search_result_by_api(struct search_content_object *obj,
goto out_func;
}
+ SEARCH_DEBUG_LOG("Matched Total Message : %d", total_msgList.nCount);
+ SEARCH_DEBUG_LOG("Message Count : %d", msgList.nCount);
+
if (msgList.nCount <= 0) {
SEARCH_DEBUG_WARNING("no msg search result");
ret = SEARCH_RET_SEARCH_NONE;
@@ -1825,19 +1896,9 @@ int search_sql_msg_search_result_by_api(struct search_content_object *obj,
NULL);
}
- /* Set search result to genlist */
-
- if(msgList.nCount < limit) {
- loop_cnt = msgList.nCount;
- is_more_btn = false;
- } else {
- loop_cnt = limit-1;
- is_more_btn = true;
- }
-
/********** START : set search result to sel_mem_info buf ************/
- for (i = 0; i < loop_cnt; i++) {
+ for (i = 0; i < msgList.nCount; i++) {
const char *text_1line = NULL;
const char *markup_keyword = NULL;
char *img_path = NULL;
@@ -1852,6 +1913,15 @@ int search_sql_msg_search_result_by_api(struct search_content_object *obj,
char msg_text[MAX_MSG_TEXT_LEN] = {0,};
char msg_id_str[MAX_LENGTH_PER_PATH] = {0,};
+ err = msg_get_int_value(msgList.msg_struct_info[i], MSG_MESSAGE_TYPE_INT, &msg_type);
+ if (err != MSG_SUCCESS) {
+ SEARCH_DEBUG_WARNING("Fail to make search struct : MSG_MESSAGE_TYPE_INT %d", err);
+ goto out_func;
+ }
+
+ SEARCH_DEBUG_LOG("mms : %d", msg_type);
+
+
sel_mem_info = (struct search_item_sel *)calloc(1,sizeof(struct search_item_sel));
if (!sel_mem_info) {
SEARCH_DEBUG_WARNING("[%d] Fail to make a genlist select info item!", i);
@@ -1869,16 +1939,8 @@ int search_sql_msg_search_result_by_api(struct search_content_object *obj,
snprintf(msg_id_str, MAX_LENGTH_PER_ID - 1, "%d", message_id);
sel_mem_info->launch_param= strdup(msg_id_str);
- err = msg_get_int_value(msgList.msg_struct_info[i], MSG_MESSAGE_TYPE_INT, &msg_type);
- if (err != MSG_SUCCESS) {
- SEARCH_DEBUG_WARNING("Fail to make search struct : MSG_MESSAGE_TYPE_INT %d", err);
- goto out_func;
- }
-
- SEARCH_DEBUG_LOG("mms : %d", msg_type);
-
/* Set 1st line string */
- if (msg_type == MSG_TYPE_MMS) {
+ if (msg_type == MSG_TYPE_MMS || msg_type == MSG_TYPE_MMS_JAVA || msg_type == MSG_TYPE_MMS_NOTI) {
/* MMS case */
err = msg_get_str_value(msgList.msg_struct_info[i], MSG_MESSAGE_SUBJECT_STR,
subject, MAX_SUBJECT_LEN);
@@ -1910,12 +1972,12 @@ int search_sql_msg_search_result_by_api(struct search_content_object *obj,
&is_word_in_title);
}
- SEARCH_DEBUG_LOG("1st string : %s", text_1line);
-
if ((text_1line) && (strlen(text_1line) > 0 )) {
sel_mem_info->text1 = strdup(markup_keyword);
+ } else {
+ sel_mem_info->text1 = strdup("Unknown");
}
- } else {
+ } else if(msg_type == MSG_TYPE_SMS) {
/* SMS Case */
err = msg_get_str_value(msgList.msg_struct_info[i],
MSG_MESSAGE_SMS_DATA_STR,
@@ -1988,12 +2050,12 @@ int search_sql_msg_search_result_by_api(struct search_content_object *obj,
/* Set text_2line */
markup_keyword = search_markup_keyword(str_number, keyword, &is_word_in_str);
- if (j == 0) {
if (strlen(str_name) > 0) {
sel_mem_info->text2 = strdup(str_name);
- }
+ } else if(strlen(str_number) > 0) {
+ sel_mem_info->text2 = strdup(markup_keyword);
} else {
- sel_mem_info->text2 = strdup(markup_keyword);
+ sel_mem_info->text2 = strdup("Unknown");
}
/* Check Whether Thumbnail Image exist or not */
@@ -2055,10 +2117,11 @@ int search_sql_msg_search_result_by_api(struct search_content_object *obj,
}
msg_release_list_struct(&msgList);
+ msg_release_list_struct(&total_msgList);
/* Set more title to genlist (under 'search all') */
- if (is_more_btn) {
- obj->mr_info.next_point = offset + limit - 1;
+ if (total_msgList.nCount > offset + i) {
+ obj->mr_info.next_point = offset + i;
sel_mem_more = (struct search_item_more_sel *)
calloc(1,sizeof(struct search_item_more_sel));
diff --git a/src/search_bar.cpp b/src/search_bar.cpp
index 203ae62..1ced446 100755
--- a/src/search_bar.cpp
+++ b/src/search_bar.cpp
@@ -556,6 +556,10 @@ Evas_Object *search_create_search_entry(Evas_Object *parent, void *data)
elm_entry_cnp_mode_set(entry, ELM_CNP_MODE_PLAINTEXT);
elm_entry_input_panel_layout_set(entry, ELM_INPUT_PANEL_LAYOUT_NORMAL);
+ elm_entry_prediction_allow_set(entry, EINA_FALSE);
+ elm_entry_autocapital_type_set(entry, ELM_AUTOCAPITAL_TYPE_NONE);
+ elm_entry_input_panel_return_key_type_set(entry, ELM_INPUT_PANEL_RETURN_KEY_TYPE_SEARCH);
+
Ecore_IMF_Context *imf_context = (Ecore_IMF_Context *)elm_entry_imf_context_get(entry);
ecore_imf_context_input_panel_event_callback_add(imf_context,
ECORE_IMF_INPUT_PANEL_STATE_EVENT,