summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim Kibum <kb0929.kim@samsung.com>2012-04-27 13:26:07 +0900
committerKim Kibum <kb0929.kim@samsung.com>2012-04-27 13:26:07 +0900
commitce7d7eaebf6c53435dc706bfbe196a81d2880685 (patch)
tree910f7d18320304f0e9c29dce360015bbd9c94c1e
parent3f013bca015c7ded239970c0e83cdc4591da1197 (diff)
downloadsmartsearch-ce7d7eaebf6c53435dc706bfbe196a81d2880685.tar.gz
smartsearch-ce7d7eaebf6c53435dc706bfbe196a81d2880685.tar.bz2
smartsearch-ce7d7eaebf6c53435dc706bfbe196a81d2880685.zip
Tizen souce update
-rwxr-xr-xdata/images/org.tizen.smartsearch.pngbin10325 -> 24105 bytes
-rwxr-xr-xdata/org.tizen.smartsearch.desktop.in2
-rwxr-xr-xdebian/changelog52
-rwxr-xr-xinclude/common_util.h1
-rwxr-xr-xinclude/smartsearch.h3
-rwxr-xr-xpackaging/org.tizen.smartsearch.spec2
-rwxr-xr-xsrc/common_util.cpp15
-rwxr-xr-xsrc/ps_app_interface.cpp2
-rwxr-xr-xsrc/ps_makeupviews.cpp45
-rwxr-xr-xsrc/ps_searcher.cpp203
-rwxr-xr-xsrc/search_bar.cpp1
-rwxr-xr-xsrc/smartsearch.cpp16
12 files changed, 240 insertions, 102 deletions
diff --git a/data/images/org.tizen.smartsearch.png b/data/images/org.tizen.smartsearch.png
index f2666cb..e843444 100755
--- a/data/images/org.tizen.smartsearch.png
+++ b/data/images/org.tizen.smartsearch.png
Binary files differ
diff --git a/data/org.tizen.smartsearch.desktop.in b/data/org.tizen.smartsearch.desktop.in
index bf7a551..d125e52 100755
--- a/data/org.tizen.smartsearch.desktop.in
+++ b/data/org.tizen.smartsearch.desktop.in
@@ -4,7 +4,7 @@ Exec=${PREFIX}/bin/smartsearch
Icon=${SMARTSEARCH_PKG_NAME}.png
Comment=Search Application
nodisplay=False
-Version=0.3.9
+Version=0.3.15
X-TIZEN-TaskManage=True
X-TIZEN-Multiple=False
X-TIZEN-Service=search_all
diff --git a/debian/changelog b/debian/changelog
index ce99d46..aadeb00 100755
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,55 @@
+smartsearch (0.3.15-1) unstable; urgency=low
+
+ * Fix keyword bug
+ * Fix tag string issue
+ * Update search icon
+ * Git: pkgs/s/smartsearch
+ * Tag: smartsearch_0.3.15-1
+
+ -- Junghyun Kim <jh1114.kim@samsung.com> Sat, 21 Apr 2012 15:54:43 +0900
+
+smartsearch (0.3.14-1) unstable; urgency=low
+
+ * Remove elm_win_active code in app_resume callback
+ * Git: pkgs/s/smartsearch
+ * Tag: smartsearch_0.3.14-1
+
+ -- Junghyun Kim <jh1114.kim@samsung.com> Thu, 19 Apr 2012 18:16:47 +0900
+
+smartsearch (0.3.13-1) unstable; urgency=low
+
+ * Fix Crash
+ * Git: pkgs/s/smartsearch
+ * Tag: smartsearch_0.3.13-1
+
+ -- Junghyun Kim <jh1114.kim@samsung.com> Thu, 19 Apr 2012 15:42:37 +0900
+
+smartsearch (0.3.12-1) unstable; urgency=low
+
+ * Fix N_SE-703, S1-2412, S1-1442
+ * Add cnp mode code
+ * Change keyword save point in code
+ * Git: pkgs/s/smartsearch
+ * Tag: smartsearch_0.3.12-1
+
+ -- Junghyun Kim <jh1114.kim@samsung.com> Thu, 19 Apr 2012 13:33:41 +0900
+
+smartsearch (0.3.11-1) unstable; urgency=low
+
+ * Change Refresh result list concept
+ * Git: pkgs/s/smartsearch
+ * Tag: smartsearch_0.3.11-1
+
+ -- Junghyun Kim <jh1114.kim@samsung.com> Tue, 10 Apr 2012 09:59:37 +0900
+
+smartsearch (0.3.10-1) unstable; urgency=low
+
+ * Change memo search API for search comment field
+ * Git: pkgs/s/smartsearch
+ * Tag: smartsearch_0.3.10-1
+
+ -- Junghyun Kim <jh1114.kim@samsung.com> Mon, 09 Apr 2012 18:00:56 +0900
+
smartsearch (0.3.9-1) unstable; urgency=low
* Fix N_SE-420
diff --git a/include/common_util.h b/include/common_util.h
index 9da518f..fdb0c14 100755
--- a/include/common_util.h
+++ b/include/common_util.h
@@ -30,7 +30,6 @@ void search_util_date_time_format_get_val(const struct tm *tm,
char *format_val);
void search_sql_make_keyword_bind_value(char *src, char *dest, int type);
void search_get_date_string(char *date_string);
-void search_time_format_localtime(char *buf, int len, time_t * time);
const char *search_markup_keyword(const char *string, char *searchword,
bool *result);
char *search_get_main_window_name(void);
diff --git a/include/smartsearch.h b/include/smartsearch.h
index 1d71c60..34e19f0 100755
--- a/include/smartsearch.h
+++ b/include/smartsearch.h
@@ -103,7 +103,8 @@ struct appdata {
search_more_result cate_info[SEARCH_TYPE_PHONE_MAX];
- char search_word[MAX_SEARCH_WORD_SIZE];
+ char *search_word;
+ char *not_markup_search_word;
int back_btn_type;
diff --git a/packaging/org.tizen.smartsearch.spec b/packaging/org.tizen.smartsearch.spec
index 72d3602..7a11f2e 100755
--- a/packaging/org.tizen.smartsearch.spec
+++ b/packaging/org.tizen.smartsearch.spec
@@ -1,6 +1,6 @@
Name: org.tizen.smartsearch
Summary: Smartsearch Application
-Version: 0.3.9
+Version: 0.3.15
Release: 1
Group: main
License: Samsung Proprietary License
diff --git a/src/common_util.cpp b/src/common_util.cpp
index 164832a..71a2ee6 100755
--- a/src/common_util.cpp
+++ b/src/common_util.cpp
@@ -195,21 +195,6 @@ void search_get_date_string(char *date_string)
time_tm->tm_min, time_tm->tm_sec);
}
-void search_time_format_localtime(char *buf, int len, time_t * time)
-{
- struct tm *t = localtime(time);
- if (t != NULL) {
- int hr = 0;
- vconf_get_int(VCONFKEY_SETAPPL_TIME_FORMAT_INT, &hr);
- if (hr == SETTING_TIME_FORMAT_24HOUR) {
- strftime(buf, len, "%d %b %y %H:%M", t); /* 14 May 09 15:37 */
- } else {
- /* SETTING_TIME_FORMAT_24HOUR */
- strftime(buf, len, "%d %b %y %p %I:%M", t); /* 14 May 09 PM 1:37 */
- }
- }
-}
-
#if (!CHECK_VALIDATE_UTF8)
const char *search_markup_keyword(const char *string, char *searchword,
diff --git a/src/ps_app_interface.cpp b/src/ps_app_interface.cpp
index 83bfef0..b22a18a 100755
--- a/src/ps_app_interface.cpp
+++ b/src/ps_app_interface.cpp
@@ -531,8 +531,6 @@ static void __search_launch_popup_error_response_cb(void *data,
evas_object_del(ad->ctxpopup);
ad->ctxpopup = NULL;
- search_set_result_list(ad);
-
SEARCH_FUNC_END;
}
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;
diff --git a/src/ps_searcher.cpp b/src/ps_searcher.cpp
index 3327a40..b95cf4e 100755
--- a/src/ps_searcher.cpp
+++ b/src/ps_searcher.cpp
@@ -208,9 +208,13 @@ static int __search_sql_contact_search_result_cb(CTSvalue * value,
}
if((display_name) && strlen(display_name) > 0) {
+ char* markup_text_1line = elm_entry_utf8_to_markup(display_name);
+
strncpy(sel_mem_info->main_buf,
- search_markup_keyword(display_name, ad->search_word, &is_word_in_str),
+ search_markup_keyword(markup_text_1line, ad->not_markup_search_word, &is_word_in_str),
MAX_LENGTH_PER_LINE - 1);
+
+ SEARCH_FREE(markup_text_1line);
}
/***********************************************************************/
@@ -218,9 +222,12 @@ static int __search_sql_contact_search_result_cb(CTSvalue * value,
number = contacts_svc_value_get_str(value, CTS_LIST_NUM_NUMBER_STR);
if((number) && strlen(number) > 0) {
+ char* markup_text_2line = elm_entry_utf8_to_markup(number);
+
strncpy(sel_mem_info->sub_buf,
- search_markup_keyword(number, ad->search_word, &is_word_in_str),
+ search_markup_keyword(markup_text_2line, ad->not_markup_search_word, &is_word_in_str),
MAX_LENGTH_PER_LINE - 1);
+ SEARCH_FREE(markup_text_2line);
}
/***********************************************************************/
@@ -373,11 +380,15 @@ int search_sql_calendar_search_result_by_api(int type, int offset, int limit,
CAL_VALUE_TXT_SUMMARY);
if ((summary) && (strlen(summary) > 0)) {
+ char* markup_text_1line = elm_entry_utf8_to_markup(summary);
+
strncpy(sel_mem_info->main_buf,
- search_markup_keyword(summary,
- ad->search_word,
- &is_word_in_str),
- MAX_LENGTH_PER_LINE - 1);
+ search_markup_keyword(markup_text_1line,
+ ad->not_markup_search_word,
+ &is_word_in_str),
+ MAX_LENGTH_PER_LINE - 1);
+
+ SEARCH_FREE(markup_text_1line);
}
snprintf(sel_mem_info->main_id,
@@ -483,12 +494,26 @@ static void __search_sql_memo_search_result_cb(memo_data_t * value,
sel_mem_info->type = type;
/********** START : set search result to sel_mem_info buf ************/
+ /* First, We should check comment field. It means drawing memo
+ * If comment field is NULL, then we check content field */
+ if ((value->comment) && (strlen(value->comment) > 0)) {
+ char* markup_text_1line = elm_entry_utf8_to_markup(value->comment);
+
+ strncpy(sel_mem_info->main_buf,
+ search_markup_keyword(markup_text_1line, ad->not_markup_search_word,
+ &is_word_in_str),
+ MAX_LENGTH_PER_LINE - 1);
+
+ SEARCH_FREE(markup_text_1line);
+ } else if ((value->content) && (strlen(value->content) > 0)) {
+ char* markup_text_1line = elm_entry_utf8_to_markup(value->content);
- if ((value->content) && (strlen(value->content) > 0)) {
strncpy(sel_mem_info->main_buf,
- search_markup_keyword(value->content, ad->search_word,
- &is_word_in_str),
- MAX_LENGTH_PER_LINE - 1);
+ search_markup_keyword(markup_text_1line, ad->not_markup_search_word,
+ &is_word_in_str),
+ MAX_LENGTH_PER_LINE - 1);
+
+ SEARCH_FREE(markup_text_1line);
}
snprintf(sel_mem_info->main_id, MAX_LENGTH_PER_ID - 1, "%d", value->id);
@@ -629,21 +654,30 @@ int search_sql_email_search_result_by_api(int type, int offset, int limit,
SEARCH_DEBUG_LOG("subject : %s", mail_list[i].subject);
if((mail_list[i].subject) && (strlen(mail_list[i].subject) > 0)) {
+ char* markup_text_1line = elm_entry_utf8_to_markup(mail_list[i].subject);
+
strncpy(sel_mem_info->main_buf,
- search_markup_keyword(mail_list[i].subject, ad->search_word, &is_word_in_str),
+ search_markup_keyword(markup_text_1line, ad->not_markup_search_word, &is_word_in_str),
MAX_LENGTH_PER_LINE - 1);
+ SEARCH_FREE(markup_text_1line);
}
if((mail_list[i].from) && (strlen(mail_list[i].from) > 0)) {
+ char* markup_text_2line = elm_entry_utf8_to_markup(mail_list[i].from);
+
strncpy(sel_mem_info->sub_buf,
- search_markup_keyword(mail_list[i].from, ad->search_word, &is_word_in_str),
+ search_markup_keyword(markup_text_2line, ad->not_markup_search_word, &is_word_in_str),
MAX_LENGTH_PER_LINE - 1);
+ SEARCH_FREE(markup_text_2line);
}
if(is_word_in_str == false && (mail_list[i].recipients) && (strlen(mail_list[i].recipients) > 0)) {
+ char* markup_text_2line = elm_entry_utf8_to_markup(mail_list[i].recipients);
+
strncpy(sel_mem_info->sub_buf,
- search_markup_keyword(mail_list[i].recipients, ad->search_word, &is_word_in_str),
+ search_markup_keyword(markup_text_2line, ad->not_markup_search_word, &is_word_in_str),
MAX_LENGTH_PER_LINE - 1);
+ SEARCH_FREE(markup_text_2line);
}
elm_genlist_item_append(glist,
@@ -791,11 +825,14 @@ static int __search_sql_media_search_result_by_api(int type, int offset, int lim
sel_mem_info->type = type;
if ((item->display_name) && (strlen(item->display_name) > 0)) {
+ char* markup_text_1line = elm_entry_utf8_to_markup(item->display_name);
+
strncpy(sel_mem_info->main_buf,
- search_markup_keyword(item->display_name,
- ad->search_word,
- &is_word_in_str),
+ search_markup_keyword(markup_text_1line,
+ ad->not_markup_search_word,
+ &is_word_in_str),
MAX_LENGTH_PER_LINE - 1);
+ SEARCH_FREE(markup_text_1line);
}
snprintf(sel_mem_info->main_id, MAX_LENGTH_PER_ID, "%d",
@@ -946,7 +983,6 @@ int search_sql_music_search_result_by_api(int type, int offset, int limit,
if (rc < 0) {
break;
} else {
-
if (loop_cnt == limit -1)
break;
@@ -988,40 +1024,51 @@ int search_sql_music_search_result_by_api(int type, int offset, int limit,
sel_mem_info->type = type;
if ((title) && (strlen(title) > 0)) {
+ char* markup_text_1line = elm_entry_utf8_to_markup(title);
+
strncpy(sel_mem_info->main_buf,
- search_markup_keyword(title, ad->search_word, &is_word_in_str),
+ search_markup_keyword(markup_text_1line, ad->not_markup_search_word, &is_word_in_str),
MAX_LENGTH_PER_LINE - 1);
+ SEARCH_FREE(markup_text_1line);
}
if (is_word_in_str) {
if ((artist) && (strlen(artist) > 0)) {
+ char* markup_text_2line = elm_entry_utf8_to_markup(artist);
+
strncpy(sel_mem_info->sub_buf,
- search_markup_keyword(artist,
- ad->search_word,
+ search_markup_keyword(markup_text_2line,
+ ad->not_markup_search_word,
&is_word_in_str),
MAX_LENGTH_PER_LINE - 1);
+ SEARCH_FREE(markup_text_2line);
}
} else {
- memset(sel_mem_info->sub_buf, '\0',
- MAX_LENGTH_PER_LINE);
-
- if ((artist) && (strlen(artist) > 0)) {
- strncpy(sel_mem_info->sub_buf,
- search_markup_keyword(artist,
- ad->search_word,
- &is_word_in_str),
- MAX_LENGTH_PER_LINE - 1);
- }
+ memset(sel_mem_info->sub_buf, '\0', MAX_LENGTH_PER_LINE);
+
+ if ((artist) && (strlen(artist) > 0)) {
+ char* markup_text_2line = elm_entry_utf8_to_markup(artist);
+
+ strncpy(sel_mem_info->sub_buf,
+ search_markup_keyword(markup_text_2line,
+ ad->not_markup_search_word,
+ &is_word_in_str),
+ MAX_LENGTH_PER_LINE - 1);
+ SEARCH_FREE(markup_text_2line);
+ }
if (is_word_in_str == false && (album) && (strlen(album) > 0)) {
- strncpy(sel_mem_info->sub_buf,
- search_markup_keyword(album,
- ad->search_word,
- &is_word_in_str),
- MAX_LENGTH_PER_LINE - 1);
- }
-
- if (is_word_in_str == false) {
+ char* markup_text_2line = elm_entry_utf8_to_markup(album);
+
+ strncpy(sel_mem_info->sub_buf,
+ search_markup_keyword(markup_text_2line,
+ ad->not_markup_search_word,
+ &is_word_in_str),
+ MAX_LENGTH_PER_LINE - 1);
+ SEARCH_FREE(markup_text_2line);
+ }
+
+ if (is_word_in_str == false) {
SEARCH_DEBUG_LOG("search_result is 0. No match keyword in title,album,artist string");
}
}
@@ -1113,9 +1160,16 @@ ail_cb_ret_e __search_sql_menu_search_result_cb(
ail_appinfo_get_str(appinfo, AIL_PROP_NAME_STR, &name);
if ((name) && (strlen(name) > 0)) {
+ char* markup_text_1line = elm_entry_utf8_to_markup(name);
+
strncpy(sel_mem_info->main_buf,
- search_markup_keyword(name, ad->search_word,&is_word_in_str),
- MAX_LENGTH_PER_LINE - 1);
+ search_markup_keyword(markup_text_1line, ad->not_markup_search_word,&is_word_in_str),
+ MAX_LENGTH_PER_LINE - 1);
+ SEARCH_FREE(markup_text_1line);
+
+ SEARCH_DEBUG_LOG("name : %s", name);
+ } else {
+ SEARCH_DEBUG_LOG("name : null");
}
if(ad->cate_info[type].next_point == 0) {
/* Set group title */
@@ -1278,8 +1332,6 @@ int search_sql_msg_search_result_by_api(int type, int offset, int limit,
bool is_more_btn = false;
bool is_word_in_title = false;
- const char *msg_address = NULL;
- const char *msg_content = NULL;
int address_cnt = 0;
MSG_SEARCH_CONDITION_S searchCon = {0,};
@@ -1334,6 +1386,10 @@ int search_sql_msg_search_result_by_api(int type, int offset, int limit,
/********** START : set search result to sel_mem_info buf ************/
for (i = 0; i < loop_cnt; i++) {
+ const char *text_1line = NULL;
+ const char *text_2line = NULL;
+ const char *msg_address = NULL;
+ const char *markup_keyword = NULL;
sel_mem_info = (struct search_item_sel *)
calloc(1,sizeof(struct search_item_sel));
@@ -1341,40 +1397,67 @@ int search_sql_msg_search_result_by_api(int type, int offset, int limit,
snprintf(sel_mem_info->main_id, MAX_LENGTH_PER_ID - 1, "%d", msg_get_message_id(msgList.msgInfo[i]));
- msg_content = NULL;
-
+ /* Set 1st line string */
if(msg_is_mms(msgList.msgInfo[i])) {
- msg_content = msg_get_subject(msgList.msgInfo[i]);
- }
-
- if((!msg_content) || (strlen(msg_content) == 0)) {
- msg_content = msg_sms_get_message_body(msgList.msgInfo[i]);
+ /* MMS case */
+ char* markup_text_1line = NULL;
+
+ text_1line = msg_get_subject(msgList.msgInfo[i]);
+ markup_text_1line = elm_entry_utf8_to_markup(text_1line);
+
+ markup_keyword = search_markup_keyword(markup_text_1line,
+ ad->not_markup_search_word,
+ &is_word_in_title);
+
+ if (!is_word_in_title) {
+ text_1line = msg_mms_get_text_contents(msgList.msgInfo[i]);
+ markup_text_1line = elm_entry_utf8_to_markup(text_1line);
+ markup_keyword = search_markup_keyword(markup_text_1line,
+ ad->not_markup_search_word,
+ &is_word_in_title);
}
- if ((msg_content) && (strlen(msg_content) > 0)) {
- strncpy(sel_mem_info->main_buf,
- search_markup_keyword(msg_content,
- ad->search_word,
- &is_word_in_title),
- MAX_LENGTH_PER_LINE - 1);
+ if ((text_1line) && (strlen(text_1line) > 0 ))
+ strncpy(sel_mem_info->main_buf, markup_keyword, MAX_LENGTH_PER_LINE - 1);
+
+ SEARCH_FREE(markup_text_1line);
+ } else {
+ /* SMS Case */
+ char* markup_text_1line = NULL;
+
+ text_1line = msg_sms_get_message_body(msgList.msgInfo[i]);
+ markup_text_1line = elm_entry_utf8_to_markup(text_1line);
+ markup_keyword = search_markup_keyword(markup_text_1line,
+ ad->not_markup_search_word,
+ &is_word_in_title);
+
+ if ((text_1line) && (strlen(text_1line) > 0))
+ strncpy(sel_mem_info->main_buf, markup_keyword, MAX_LENGTH_PER_LINE - 1);
+
+ SEARCH_FREE(markup_text_1line);
}
+ /* Set 2nd line string */
address_cnt = msg_get_address_count(msgList.msgInfo[i]);
for(j = 0; j < address_cnt; j++) {
if(msg_get_ith_contact_id(msgList.msgInfo[i],j) > 0) {
- msg_address = msg_get_ith_name(msgList.msgInfo[i],j);
+ text_2line = msg_get_ith_name(msgList.msgInfo[i],j);
} else {
- msg_address = msg_get_ith_address(msgList.msgInfo[i],j);
+ text_2line = msg_get_ith_address(msgList.msgInfo[i],j);
}
- if ((msg_address) && (strlen(msg_address) > 0)) {
+ if ((text_2line) && (strlen(text_2line) > 0)) {
+ char* markup_text_2line = NULL;
+
+ markup_text_2line = elm_entry_utf8_to_markup(text_2line);
strncpy(sel_mem_info->sub_buf,
- search_markup_keyword(msg_address,
- ad->search_word,
+ search_markup_keyword(markup_text_2line,
+ ad->not_markup_search_word,
&is_word_in_str),
MAX_LENGTH_PER_LINE - 1);
+ SEARCH_FREE(markup_text_2line);
}
if ((is_word_in_title) || (is_word_in_str)) {
diff --git a/src/search_bar.cpp b/src/search_bar.cpp
index dfb7bf8..1e0f1ce 100755
--- a/src/search_bar.cpp
+++ b/src/search_bar.cpp
@@ -275,6 +275,7 @@ static void __search_searchbar_create(void *data)
elm_entry_single_line_set(ad->search_entry, EINA_TRUE);
elm_object_part_content_set(ad->search_bar, "elm.swallow.content", ad->search_entry);
elm_object_part_text_set(ad->search_bar, "elm.guidetext", dgettext("sys_string", "IDS_COM_BODY_SEARCH"));
+ elm_entry_cnp_mode_set(ad->search_entry, ELM_CNP_MODE_PLAINTEXT);
evas_object_size_hint_weight_set(ad->search_bar, EVAS_HINT_EXPAND, 0);
evas_object_size_hint_align_set(ad->search_bar, EVAS_HINT_FILL, 0.0);
diff --git a/src/smartsearch.cpp b/src/smartsearch.cpp
index b6e11c8..c9bea6b 100755
--- a/src/smartsearch.cpp
+++ b/src/smartsearch.cpp
@@ -141,12 +141,10 @@ static void __search_back_btn_clicked_cb(void *data, Evas_Object *obj, void *eve
struct appdata *ad = (struct appdata *)data;
- if(ad->back_btn_type == BACK_BTN_TYPE_LOWER) {
- /* change application window as background */
elm_win_lower(ad->win_main);
- } else {
+
+ if(ad->back_btn_type == BACK_BTN_TYPE_CLOSE)
elm_exit();
- }
SEARCH_FUNC_END;
}
@@ -272,6 +270,7 @@ static int __search_init_app_connect(struct appdata *ad)
if (err != MSG_SUCCESS) {
SEARCH_DEBUG_WARNING("msg_open_msg_handle error : %d", err);
+ ad->msg_handle = NULL;
}
}
break;
@@ -286,6 +285,7 @@ static int __search_init_app_connect(struct appdata *ad)
conn_ret = media_svc_connect(&ad->media_handle);
if(conn_ret < 0) {
SEARCH_DEBUG_WARNING("media_svc_connect failed : %d\n", conn_ret);
+ ad->media_handle = NULL;
}
}
break;
@@ -345,6 +345,8 @@ static int __search_deinit_app_disconnect(void *data)
if (err != MSG_SUCCESS) {
SEARCH_DEBUG_WARNING("msg_close_msg_handle error : %d", err);
}
+
+ ad->msg_handle = NULL;
}
break;
case SEARCH_TYPE_PHONE_EMAIL:
@@ -357,6 +359,7 @@ static int __search_deinit_app_disconnect(void *data)
if(conn_ret < 0) {
SEARCH_DEBUG_WARNING("media_svc_disconnect failed : %d\n", conn_ret);
}
+ ad->media_handle = NULL;
}
break;
case SEARCH_TYPE_PHONE_CALENDAR:
@@ -465,6 +468,9 @@ static int __search_app_terminate(void *data)
search_util_date_time_format_deinit();
+ SEARCH_FREE(ad->search_word);
+ SEARCH_FREE(ad->not_markup_search_word);
+
SEARCH_FUNC_END;
return 0;
@@ -486,7 +492,6 @@ static int __search_app_resume(void *data)
struct appdata *ad = (struct appdata *)data;
if (ad->win_main) {
- elm_win_activate(ad->win_main);
elm_object_focus_set(ad->back_btn, EINA_FALSE);
}
SEARCH_FUNC_END;
@@ -553,7 +558,6 @@ static int __search_app_reset(bundle * b, void *data)
if ((keyword) && (strlen(keyword) > 0)) {
elm_object_text_set(ad->search_entry, keyword);
} else {
- memset(ad->search_word, 0x00, MAX_SEARCH_WORD_SIZE);
elm_object_text_set(ad->search_entry, "");
elm_object_signal_emit(ad->search_bar, "cancel,hide", "");