summaryrefslogtreecommitdiff
path: root/src/ps_makeupviews.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ps_makeupviews.cpp')
-rwxr-xr-xsrc/ps_makeupviews.cpp45
1 files changed, 30 insertions, 15 deletions
diff --git a/src/ps_makeupviews.cpp b/src/ps_makeupviews.cpp
index dd8dac3..a7bc7b0 100755
--- a/src/ps_makeupviews.cpp
+++ b/src/ps_makeupviews.cpp
@@ -329,12 +329,14 @@ static int __search_gl_set_phone_search_result(int type, int offset, char *keywo
case SEARCH_TYPE_PHONE_MSG:
{
+ if (ad->msg_handle != NULL) {
func_ret =
search_sql_msg_search_result_by_api(type,
offset,
sel_cnt,
data);
}
+ }
break;
case SEARCH_TYPE_PHONE_EMAIL:
@@ -348,30 +350,36 @@ static int __search_gl_set_phone_search_result(int type, int offset, char *keywo
break;
case SEARCH_TYPE_PHONE_IMAGES:
{
+ if (ad->media_handle != NULL ) {
func_ret =
search_sql_image_search_result_by_api(type,
offset,
sel_cnt,
data);
}
+ }
break;
case SEARCH_TYPE_PHONE_MUSIC:
{
+ if (ad->media_handle != NULL ) {
func_ret =
search_sql_music_search_result_by_api(type,
offset,
sel_cnt,
data);
}
+ }
break;
case SEARCH_TYPE_PHONE_VIDEO:
{
+ if (ad->media_handle != NULL ) {
func_ret =
search_sql_video_search_result_by_api(type,
offset,
sel_cnt,
data);
}
+ }
break;
case SEARCH_TYPE_PHONE_CALENDAR:
@@ -426,17 +434,19 @@ void search_gl_result_more_item_append_cb(void *data, Evas_Object * obj,
struct search_item_sel *sel_mem_info = NULL;
struct search_item_sel *sel_mem_more = NULL;
- char search_keyword[MAX_SEARCH_WORD_SIZE * 2 + 5] = { 0, };
+ char* escape_added_keyword = NULL;
+ SEARCH_MALLOC(escape_added_keyword, strlen(ad->search_word)*2+5, char);
+ memset(escape_added_keyword, 0x0, strlen(ad->search_word)*2+5);
int rc = 0, i = 0;
int type = sel_mem->type;
int offset = ad->cate_info[type].next_point;
- search_sql_make_keyword_bind_value(ad->search_word, search_keyword, SEARCH_SQL_BIND_TYPE_DUPLEX);
-
+ search_sql_make_keyword_bind_value(ad->search_word, escape_added_keyword, SEARCH_SQL_BIND_TYPE_DUPLEX);
+
elm_object_item_del(it);
- __search_gl_set_phone_search_result(type, offset, search_keyword, ad);
+ __search_gl_set_phone_search_result(type, offset, escape_added_keyword, ad);
SEARCH_FUNC_END;
}
@@ -478,33 +488,36 @@ Eina_Bool search_set_result_list(void *data)
SEARCH_FUNC_START;
struct appdata *ad = (struct appdata *)data;
- const char *text;
+ char *text;
int ret = 0;
bool is_input_keyword = false;
- char search_keyword[MAX_SEARCH_WORD_SIZE * 2 + 5] = { 0, };
+ char* escape_added_keyword = NULL;
int bind_type = 0;
- char* search_word = ad->search_word;
- int search_ret = 0;
+ int search_ret = SEARCH_RET_SEARCH_NONE;
SEARCH_ASSERT_IF(!ad);
text = elm_entry_markup_to_utf8(elm_object_text_get(ad->search_entry));
- memset(search_word, '\0', MAX_SEARCH_WORD_SIZE);
+ SEARCH_FREE(ad->not_markup_search_word);
+ SEARCH_FREE(ad->search_word);
if((text) && (strlen(text) > 0)) {
- g_strlcpy(search_word, text, MAX_SEARCH_WORD_SIZE);
+ ad->not_markup_search_word = strdup(elm_object_text_get(ad->search_entry));
+ ad->search_word = text;
+
+ SEARCH_MALLOC(escape_added_keyword, strlen(ad->search_word)*2+5, char);
+ memset(escape_added_keyword, 0x0, strlen(ad->search_word)*2+5);
bind_type = SEARCH_SQL_BIND_TYPE_DUPLEX;
- search_sql_make_keyword_bind_value(search_word, search_keyword, bind_type);
-
+ search_sql_make_keyword_bind_value(ad->search_word, escape_added_keyword, bind_type);
is_input_keyword = true;
- }
- elm_genlist_clear(ad->search_gl);
+ elm_genlist_clear(ad->search_gl);
- search_ret = __search_set_phone_result_list(ad, is_input_keyword, search_keyword);
+ search_ret = __search_set_phone_result_list(ad, is_input_keyword, ad->search_word);
+ }
if(search_ret == SEARCH_RET_SEARCH_SUCCESS) {
search_layout_set_search_list(ad);
@@ -512,6 +525,8 @@ Eina_Bool search_set_result_list(void *data)
search_layout_set_search_no_result(ad);
}
+ SEARCH_FREE(escape_added_keyword);
+
SEARCH_FUNC_END;
return EINA_FALSE;