[TizenRefApp-4857] Email contact name in predictive search list area starts with... 29/55829/2 accepted/tizen/mobile/20160107.030807 submit/tizen/20160106.170435
authorAndriy Kolesnichenko <a.kolesniche@samsung.com>
Tue, 29 Dec 2015 19:31:47 +0000 (21:31 +0200)
committerAndriy Kolesnichenko <a.kolesniche@samsung.com>
Wed, 30 Dec 2015 08:41:51 +0000 (10:41 +0200)
[Implementation] Fix logic of tag insertion, remove unused bool variables

Change-Id: If67e261ff07e12942b886bdf808e76e74bdf05fd
Signed-off-by: Andriy Kolesnichenko <a.kolesniche@samsung.com>
Project-Files/modules/composer/inc/email-composer.h
Project-Files/modules/composer/src/email-composer-predictive-search.c
Project-Files/modules/composer/src/email-composer-recipient-callback.c

index ad9eba9..4fed181 100644 (file)
@@ -215,8 +215,6 @@ struct ug_data {
        /* Related to predictive search */
        char ps_keyword[EMAIL_LIMIT_EMAIL_ADDRESS_LENGTH + 1];
        Eina_Bool ps_is_runnig;
-       Eina_Bool ps_while_destroying_list;
-       Eina_Bool ps_is_item_from_contact_add;
 
        Eina_Hash *ps_hash;
        Eina_List *ps_contacts_list;
index a541a9c..f55b58b 100644 (file)
@@ -208,9 +208,9 @@ static char *__composer_ps_insert_match_tag(char *input, char *matched_word)
        char *string = NULL;
        char *first = NULL, *matched = NULL, *last = NULL;
 
-       char *temp = g_strndup(input, found - input);
+       char *temp = strndup(input, found - input);
        first = elm_entry_utf8_to_markup(temp);
-       matched = elm_entry_utf8_to_markup(matched_word);
+       matched = strndup(found, strlen(matched_word));
        last = elm_entry_utf8_to_markup(input + strlen(matched_word) + (temp ? strlen(temp) : 0));
        g_free(temp);
 
@@ -315,12 +315,7 @@ static void __composer_ps_append_result(EmailComposerUGD *ugd, Eina_List *predic
 
        Eina_List *l = NULL;
        email_contact_list_info_t *item = NULL;
-       ugd->ps_is_item_from_contact_add = EINA_FALSE;
        EINA_LIST_FOREACH(predict_list, l, item) {
-               if (item->contact_origin == EMAIL_SEARCH_CONTACT_ORIGIN_CONTACTS) {
-                       ugd->ps_is_item_from_contact_add = EINA_TRUE;
-               }
-
                elm_genlist_item_append(ugd->ps_genlist, &__ps_itc, item, NULL, ELM_GENLIST_ITEM_NONE, __composer_ps_gl_sel, ugd);
        }
 
index 0cbafdf..9ad4292 100644 (file)
@@ -797,16 +797,6 @@ void _recipient_entry_changed_cb(void *data, Evas_Object *obj, void *event_info)
        /* Because of elm_entry_entry_set(), this callback can be called even though the entry doesn't have the focus. */
        ret_if(ugd->selected_entry != obj);
 
-       /* XXX: check this
-        * While predictive search list is destroying, we set the layouts to the proper position again.
-        * when we call elm_object_part_content_set() to set the layout, mbe changed callback is called.
-        * See __composer_ps_unset_contents()
-        */
-       if (ugd->ps_while_destroying_list) {
-               debug_log("==> while destroying predictive list!!");
-               return;
-       }
-
        const char *entry_str = elm_entry_entry_get(obj);
        retm_if(!entry_str, "entry_str is [NULL]");
        if (elm_entry_is_empty(obj) || strcmp(entry_str, "<br/>") == 0) {