Merged with latest common/composer/viewer code
authorSungbok Park <parksb@samsung.com>
Mon, 7 Jan 2013 08:21:59 +0000 (17:21 +0900)
committerSungbok Park <parksb@samsung.com>
Mon, 7 Jan 2013 08:21:59 +0000 (17:21 +0900)
14 files changed:
account/src/email-account-folder.c
account/src/email-account.c
common/src/email-engine.c
composer/src/email-composer-attachment.c
composer/src/email-composer-callback.c
composer/src/email-composer-contents.c
composer/src/email-composer-util.c
composer/src/email-composer.c
mailbox/src/email-mailbox-item.c
mailbox/src/email-mailbox-list.c
mailbox/src/email-mailbox-search.c
mailbox/src/email-mailbox.c
packaging/org.tizen.email.spec
viewer/src/email-viewer.c

index 9ab22f8..d44b488 100755 (executable)
@@ -200,8 +200,8 @@ Evas_Object *create_fullview(EmailAccountUGD *ug_data)
        ug_data->update_button = elm_button_add(ug_data->navi_bar);
        elm_object_style_set(ug_data->update_button, "naviframe/title/default");
        Evas_Object *update_icon = elm_icon_add(ug_data->update_button);
-       elm_icon_file_set(update_icon, CONTROLBAR_ICON_UPDATE, NULL);
-       elm_icon_resizable_set(update_icon, 1, 1);
+       elm_image_file_set(update_icon, CONTROLBAR_ICON_UPDATE, NULL);
+       elm_image_resizable_set(update_icon, 1, 1);
        evas_object_image_smooth_scale_set(update_icon, 0);
        elm_object_content_set(ug_data->update_button, update_icon);
        evas_object_smart_callback_add(ug_data->update_button, "clicked", _update_all_account_cb, ug_data);
@@ -220,8 +220,8 @@ Evas_Object *create_fullview(EmailAccountUGD *ug_data)
        ug_data->update_button = elm_button_add(ug_data->navi_bar);
        elm_object_style_set(ug_data->update_button, "naviframe/title_icon");
        Evas_Object *update_icon = elm_icon_add(ug_data->update_button);
-       elm_icon_file_set(update_icon, CONTROLBAR_ICON_UPDATE, NULL);
-       elm_icon_resizable_set(update_icon, 1, 1);
+       elm_image_file_set(update_icon, CONTROLBAR_ICON_UPDATE, NULL);
+       elm_image_resizable_set(update_icon, 1, 1);
        evas_object_image_smooth_scale_set(update_icon, 0);
        elm_object_content_set(ug_data->update_button, update_icon);
        evas_object_smart_callback_add(ug_data->update_button, "clicked", _update_all_account_cb, ug_data);
@@ -251,13 +251,13 @@ Evas_Object *create_fullview(EmailAccountUGD *ug_data)
        // 2line title text
        elm_object_part_text_set(ug_data->navi_title_ly, "txt_title", _("IDS_EMAIL_HEADER_FOLDERS"));
        if (ug_data->account_id == 0) {
-               elm_icon_file_set(ug_data->sp_icon, NULL, NULL);
+               elm_image_file_set(ug_data->sp_icon, NULL, NULL);
                elm_object_part_text_set(ug_data->navi_title_ly, "txt_sub", _("IDS_EMAIL_HEADER_ALL_ACCOUNTS"));
        }
        else{
                email_account_t *account;
                email_get_account(ug_data->account_id, WITHOUT_OPTION, &account);
-               elm_icon_file_set(ug_data->sp_icon, account->logo_icon_path, NULL);
+               elm_image_file_set(ug_data->sp_icon, account->logo_icon_path, NULL);
 
                elm_object_part_text_set(ug_data->navi_title_ly, "txt_sub", account->account_name);
 
@@ -915,7 +915,7 @@ static Evas_Object *_gl_icon_get_for_subitem(void *data, Evas_Object *obj, const
        if (!strcmp(part, "elm.icon") || !strcmp(part, "elm.icon.1"))
        {
                Evas_Object *icon = elm_icon_add(obj);
-               elm_icon_file_set(icon, FOLDER_ICON_PLUS_FOLDER_LIST, NULL);
+               elm_image_file_set(icon, FOLDER_ICON_PLUS_FOLDER_LIST, NULL);
                evas_object_smart_callback_add(icon, "clicked", _folder_icon_clicked_cb, data);
                evas_object_propagate_events_set(icon, EINA_FALSE);
                evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
@@ -957,7 +957,7 @@ static Evas_Object *_gl_icon_get_for_leafitem(void *data, Evas_Object *obj, cons
        if (!strcmp(part, "elm.icon") || !strcmp(part, "elm.icon.1"))
        {
                Evas_Object *icon = elm_icon_add(obj);
-               elm_icon_file_set(icon, FOLDER_ICON_FOLDER_LIST, NULL);
+               elm_image_file_set(icon, FOLDER_ICON_FOLDER_LIST, NULL);
                evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
 
                return icon;
@@ -1046,7 +1046,7 @@ static Evas_Object *_gl_icon_get(void *data, Evas_Object *obj, const char *part)
        {
                Evas_Object *icon = elm_icon_add(obj);
 
-               elm_icon_file_set(icon, alist->account_info->logo_icon_path, NULL);
+               elm_image_file_set(icon, alist->account_info->logo_icon_path, NULL);
                debug_log("logo_icon_path:%s", alist->account_info->logo_icon_path);
 
                evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
@@ -1226,9 +1226,9 @@ static void _folder_icon_clicked_cb(void *data, Evas_Object *obj, void *event_in
        elm_genlist_item_expanded_set(item_data->it, !expanded);
 
        if (expanded) {
-               elm_icon_file_set(obj, FOLDER_ICON_PLUS_FOLDER_LIST, NULL);
+               elm_image_file_set(obj, FOLDER_ICON_PLUS_FOLDER_LIST, NULL);
        } else {
-               elm_icon_file_set(obj, FOLDER_ICON_MINUS_FOLDER_LIST, NULL);
+               elm_image_file_set(obj, FOLDER_ICON_MINUS_FOLDER_LIST, NULL);
        }
 
 }
index 3842da1..fe49638 100755 (executable)
@@ -644,7 +644,7 @@ static Evas_Object *_gl_icon_get_for_all_emails(void *data, Evas_Object *obj, co
        if (!strcmp(part, "elm.icon"))
        {
                Evas_Object *icon = elm_icon_add(obj);
-               elm_icon_file_set(icon, ACCOUNT_ICON_ALLACCOUNT, NULL);
+               elm_image_file_set(icon, ACCOUNT_ICON_ALLACCOUNT, NULL);
                evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
                return icon;
        }
@@ -688,7 +688,7 @@ static Evas_Object *_gl_icon_get_for_add_account(void *data, Evas_Object *obj, c
        if (!strcmp(part, "elm.icon"))
        {
                Evas_Object *icon = elm_icon_add(obj);
-               elm_icon_file_set(icon, ACCOUNT_ICON_ADDACCOUNT, NULL);
+               elm_image_file_set(icon, ACCOUNT_ICON_ADDACCOUNT, NULL);
                evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
                return icon;
        }
@@ -726,7 +726,7 @@ static Evas_Object *_gl_icon_get(void *data, Evas_Object *obj, const char *part)
        {
                Evas_Object *icon = elm_icon_add(obj);
 
-               elm_icon_file_set(icon, alist->account_info->logo_icon_path, NULL);
+               elm_image_file_set(icon, alist->account_info->logo_icon_path, NULL);
                debug_log("logo_icon_path:%s", alist->account_info->logo_icon_path);
 
                evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
index dd5ac37..b66170a 100755 (executable)
@@ -305,6 +305,7 @@ gboolean email_engine_get_default_account(gint *account_id)
        err = email_get_account_list(&_account, &count);
        if (err != EMAIL_ERROR_NONE) {
                debug_critical("fail to get account list - err(%d)", err);
+               email_free_account(&_account, 1);
                return FALSE;
        }
 
index d5b4206..23eea8c 100755 (executable)
@@ -154,20 +154,20 @@ int _composer_get_inline_images_size(EmailComposerUGD *ugd)
        int total_size = 0;
 
        if (EINA_TRUE == ugd->has_body_html) {
-               debug_log("attachment_inline_item_list count : %d", eina_list_count(ugd->attachment_inline_item_list));         
+               debug_log("attachment_inline_item_list count : %d", eina_list_count(ugd->attachment_inline_item_list));
                if (eina_list_count(ugd->attachment_inline_item_list) > 0) {
 
                        Eina_List *list = ugd->attachment_inline_item_list;
                        Eina_List *l = NULL;
                        email_attachment_data_t *attachment_data = NULL;
-               
+
                        Eina_List *inline_list = NULL;
-               
+
                        EINA_LIST_FOREACH(list, l, attachment_data) {
                                if (attachment_data != NULL) {
                                        if (attachment_data->attachment_path != NULL) {
                                                debug_log("Inline image : %s", attachment_data->attachment_path);
-                                               inline_list = eina_list_append(inline_list, attachment_data->attachment_path);                                                  
+                                               inline_list = eina_list_append(inline_list, attachment_data->attachment_path);
                                        }
                                }
                        }
@@ -622,7 +622,9 @@ Evas_Object *_composer_attachment_make_thumbnail(EmailComposerUGD *ugd, char *fi
 
                        debug_log("file path : %s", filePath);
 
-                       if (strncmp(type, ATTACHMENT_MEDIA_IMAGE, 5) == 0 || strncmp(type, ATTACHMENT_MEDIA_VIDEO, 5) == 0) {
+                       if (strncmp(type, ATTACHMENT_MEDIA_IMAGE, 5) == 0) {
+                               strncpy(thumb_path, filePath, MAX_ATTACHMENT_FILE_LEN);
+                       } else if (strncmp(type, ATTACHMENT_MEDIA_VIDEO, 5) == 0) {
                                int err = _composer_attachment_make_ethumb(filePath, thumb_path);
 
                                if (err != COMPOSER_ERROR_NONE)
@@ -733,7 +735,6 @@ Evas_Object *_composer_attachment_make_thumbnail(EmailComposerUGD *ugd, char *fi
                free(type);
                type = NULL;
        }
-
        if (temp) {
                free(temp);
                temp = NULL;
@@ -748,90 +749,74 @@ Evas_Object *_composer_attachment_make_thumbnail(EmailComposerUGD *ugd, char *fi
 
 int _composer_attachment_make_ethumb(const char *source, char *target)
 {
-       debug_log("");
-
-/*     debug_log("file path: %s", source);
-       efreet_mime_init();
-       char *type = (char *)efreet_mime_type_get(ecore_file_file_get(source));
-       char *mime_type = g_strdup(type);
-       debug_log("mime type: %s", mime_type);
-       efreet_mime_shutdown();
-
-       if (mime_type) {
-               if (strncmp(mime_type, "image", 5) == 0) {
-                       strncpy(target, source, MAX_ATTACHMENT_FILE_LEN);
-#endif
-               } else if (strncmp(mime_type, "video", 5) == 0) {*/
-                       metadata_extractor_h metadata = NULL;
-                       int ret = METADATA_EXTRACTOR_ERROR_NONE;
-                       char *video_width = NULL;
-                       char *video_height = NULL;
-                       char *video_track_cnt = NULL;
-                       void *video_thumbnail = NULL;
-                       int video_thumbnail_len = 0;
-                       int video_w = 0;
-                       int video_h = 0;
-
-                       ret = metadata_extractor_create(&metadata);
-                       debug_log("metadata_extractor_create: %d", ret);
-                       if (!metadata) {
-                               debug_log("metadata extractor create failed");
-                               return COMPOSER_ERROR_ETHUMB_FAIL;
-                       }
+       debug_enter();
+
+       metadata_extractor_h metadata = NULL;
+       int ret = METADATA_EXTRACTOR_ERROR_NONE;
+       char *video_width = NULL;
+       char *video_height = NULL;
+       char *video_track_cnt = NULL;
+       void *video_thumbnail = NULL;
+       int video_thumbnail_len = 0;
+       int video_w = 0;
+       int video_h = 0;
+
+       ret = metadata_extractor_create(&metadata);
+       debug_log("metadata_extractor_create: %d", ret);
+       if (!metadata) {
+               debug_log("metadata extractor create failed");
+               return COMPOSER_ERROR_ETHUMB_FAIL;
+       }
 
-                       ret = metadata_extractor_set_path(metadata, source);
-                       debug_log("metadata_extractor_set_path: %d", ret);
-
-                       ret = metadata_extractor_get_metadata(metadata, METADATA_VIDEO_WIDTH, &video_width);
-                       debug_log("metadata_extractor_get_metadata: %d [video_width:%s]", ret, video_width);
-                       ret = metadata_extractor_get_metadata(metadata, METADATA_VIDEO_HEIGHT, &video_height);
-                       debug_log("metadata_extractor_get_metadata: %d [video_height:%s]", ret, video_height);
-                       ret = metadata_extractor_get_metadata(metadata, METADATA_HAS_VIDEO, &video_track_cnt);
-                       debug_log("metadata_extractor_get_metadata: %d [video_track_cnt:%s]", ret, video_track_cnt);
-
-                       ret = metadata_extractor_get_frame(metadata, &video_thumbnail, &video_thumbnail_len);
-                       debug_log("metadata_extractor_get_frame: %d (video_thumbnail_len:%d)", ret, video_thumbnail_len);
-
-                       if (video_thumbnail) {
-                               int mm_ret = 0;
-                               char filename[MAX_ATTACHMENT_FILE_LEN] = { 0, };
-                               char *file_name = NULL;
-                               char *file_ext = NULL;
-
-                               email_parse_get_filename_n_ext_from_path(source, &file_name, &file_ext);
-                               snprintf(filename, sizeof(filename), "%s%s%s%s", EMAIL_TMP_FOLDER"/", file_name, file_ext, ".jpg");
-                               g_free(file_name);
-                               g_free(file_ext);
-
-                               if (video_width)
-                                       video_w = atoi(video_width);
-                               if (video_height)
-                                       video_h = atoi(video_height);
-                               mm_ret = image_util_encode_jpeg(video_thumbnail,
-                                                                                                       video_w, video_h,
-                                                                                                       IMAGE_UTIL_COLORSPACE_RGB888, 70, filename);
-
-                               if (ecore_file_exists(filename)) {
-                                       strncpy(target, filename, MAX_ATTACHMENT_FILE_LEN);
-                                       debug_log("file : %s, thumb_path : %s", source, target);
-                               }
-                               g_free(video_thumbnail);
-                       }
+       ret = metadata_extractor_set_path(metadata, source);
+       debug_log("metadata_extractor_set_path: %d", ret);
+
+       ret = metadata_extractor_get_metadata(metadata, METADATA_VIDEO_WIDTH, &video_width);
+       debug_log("metadata_extractor_get_metadata: %d [video_width:%s]", ret, video_width);
+       ret = metadata_extractor_get_metadata(metadata, METADATA_VIDEO_HEIGHT, &video_height);
+       debug_log("metadata_extractor_get_metadata: %d [video_height:%s]", ret, video_height);
+       ret = metadata_extractor_get_metadata(metadata, METADATA_HAS_VIDEO, &video_track_cnt);
+       debug_log("metadata_extractor_get_metadata: %d [video_track_cnt:%s]", ret, video_track_cnt);
+
+       ret = metadata_extractor_get_frame(metadata, &video_thumbnail, &video_thumbnail_len);
+       debug_log("metadata_extractor_get_frame: %d (video_thumbnail_len:%d)", ret, video_thumbnail_len);
+
+       if (video_thumbnail) {
+               int mm_ret = 0;
+               char filename[MAX_ATTACHMENT_FILE_LEN] = { 0, };
+               char *file_name = NULL;
+               char *file_ext = NULL;
+
+               email_parse_get_filename_n_ext_from_path(source, &file_name, &file_ext);
+               snprintf(filename, sizeof(filename), "%s%s%s%s", EMAIL_TMP_FOLDER"/", file_name, file_ext, ".jpg");
+               g_free(file_name);
+               g_free(file_ext);
+
+               if (video_width)
+                       video_w = atoi(video_width);
+               if (video_height)
+                       video_h = atoi(video_height);
+               mm_ret = image_util_encode_jpeg(video_thumbnail,
+                                                                                       video_w, video_h,
+                                                                                       IMAGE_UTIL_COLORSPACE_RGB888, 70, filename);
+
+               if (ecore_file_exists(filename)) {
+                       strncpy(target, filename, MAX_ATTACHMENT_FILE_LEN);
+                       debug_log("file : %s, thumb_path : %s", source, target);
+               }
+               g_free(video_thumbnail);
+       }
 
-                       if (video_width)
-                               g_free(video_width);
-                       if (video_height)
-                               g_free(video_height);
-                       if (video_track_cnt)
-                               g_free(video_track_cnt);
+       if (video_width)
+               g_free(video_width);
+       if (video_height)
+               g_free(video_height);
+       if (video_track_cnt)
+               g_free(video_track_cnt);
 
-                       ret = metadata_extractor_destroy(metadata);
-                       debug_log("metadata_extractor_destroy: %d", ret);
-/*             }
-       }
+       ret = metadata_extractor_destroy(metadata);
+       debug_log("metadata_extractor_destroy: %d", ret);
 
-       g_free(mime_type);
-*/
        return COMPOSER_ERROR_NONE;
 }
 
index 0629599..c29b991 100755 (executable)
@@ -2814,7 +2814,7 @@ void _composer_get_image_list_cb(Evas_Object *o, const char *result, void *data)
                                        }
 
                                        tokens = g_strsplit(url + 7, "/", -1);
-                                       
+
                                        email_attachment_data_t *attachment_data = (email_attachment_data_t *)calloc(1, sizeof(email_attachment_data_t));
                                        attachment_data->account_id = ugd->account_info->account_id;
                                        attachment_data->attachment_id = 0;
@@ -2827,7 +2827,7 @@ void _composer_get_image_list_cb(Evas_Object *o, const char *result, void *data)
                                        attachment_data->mail_id = 0;
                                        attachment_data->save_status = 1;
                                        attachment_data->attachment_mime_type = NULL;
-                                       debug_log("attachment_name = %s, attachment_path = %s", attachment_data->attachment_name, attachment_data->attachment_path);                                    
+                                       debug_log("attachment_name = %s, attachment_path = %s", attachment_data->attachment_name, attachment_data->attachment_path);
                                        ugd->attachment_inline_item_list = eina_list_append(ugd->attachment_inline_item_list, attachment_data);
                                        g_strfreev(tokens);
                                }
index 10ab971..4f6fe7c 100755 (executable)
@@ -62,6 +62,9 @@ static void _changed_cb(void *data, Evas_Object *obj, void *event_info) // This
                else
                        elm_object_signal_emit(data, "elm,state,eraser,show", "elm");
        }
+
+       if (!elm_entry_is_empty(obj))
+               elm_object_signal_emit(data, "elm,state,guidetext,hide", "elm");
 }
 
 static void _focused_cb(void *data, Evas_Object *obj, void *event_info) // Focused callback will show X marked button and hide guidetext.
@@ -372,7 +375,7 @@ static void _composer_webkit_focused_cb(void *data, Evas *e, Evas_Object *obj, v
        ugd->selected_entry = ugd->body_ewkview;
        evas_object_focus_set(ugd->body_ewkview, EINA_TRUE);
 
-       ugd->focus_status = COMPOSER_FOCUS_STATUS_NONE; // focus handling when rte is clicked
+       ugd->focus_status = COMPOSER_FOCUS_STATUS_NONE;
        _composer_attachment_contract_items(ugd);
 
        elm_layout_sizing_eval(ugd->c_layout);
index 6743015..b7aa0d4 100755 (executable)
@@ -788,7 +788,7 @@ int _composer_make_mail(EmailComposerUGD *ugd, Eina_Bool b_save_to_draft)
                                        nCount++;
                                }
                        }
-               }               
+               }
        }
 
        ugd->new_mail_info->mail_data->flags_draft_field = 1;
index 8a0b1d4..31bc1fa 100755 (executable)
@@ -498,6 +498,7 @@ static void on_event(ui_gadget_h ug, enum ug_event event, service_h data, void *
                        snprintf(recp_string, sizeof(recp_string), "<font_size=36><color=#000000>%s%s</color></font_size>", _("IDS_EMAIL_BODY_FROM"), ":");
                        elm_object_text_set(ugd->from_mbe, recp_string);
                }
+               return;
        case UG_EVENT_REGION_CHANGE:
        case UG_EVENT_LOW_MEMORY:
        case UG_EVENT_LOW_BATTERY:
@@ -1541,7 +1542,6 @@ static int _composer_pre_parse_bundle(EmailComposerUGD *ugd, service_h data)
                }
 
                return COMPOSER_ERROR_NONE;
-
        } else {
                if (operation == NULL) {        /* ug called by ug_create */
                        debug_log("ug called by ug_create");
index 55ae18b..0f96a24 100755 (executable)
@@ -220,8 +220,8 @@ static Evas_Object *_gl_mailbox_list_content_get(void *data, Evas_Object *obj, c
                char folder_icon_path[1024] = { 0, };
                Evas_Object *ic = elm_icon_add(obj);
                snprintf(folder_icon_path, sizeof(folder_icon_path), IMGDIR "/U01_icon_folder.png");
-               elm_icon_file_set(ic, folder_icon_path, NULL);
-               elm_icon_resizable_set(ic, 0, 0);
+               elm_image_file_set(ic, folder_icon_path, NULL);
+               elm_image_resizable_set(ic, 0, 0);
                evas_object_image_smooth_scale_set(ic, 0);
                evas_object_show(ic);
 
index 456afd9..b17c700 100755 (executable)
@@ -503,15 +503,15 @@ static void _item_followup_flag_touched_cb(void *data, Evas * evas, Evas_Object
        {
                case EMAIL_FLAG_TASK_STATUS_CLEAR:
                        ld->followup_flag = EMAIL_FLAG_TASK_STATUS_ACTIVE;
-                       elm_icon_file_set(ld->flag_ic, IMGDIR "/M02_email_Flag_Active.png", NULL);
+                       elm_image_file_set(ld->flag_ic, IMGDIR "/M02_email_Flag_Active.png", NULL);
                        break;
                case EMAIL_FLAG_TASK_STATUS_ACTIVE:
                        ld->followup_flag = EMAIL_FLAG_TASK_STATUS_COMPLETE;
-                       elm_icon_file_set(ld->flag_ic, IMGDIR "/M02_email_Flag_Complete.png", NULL);
+                       elm_image_file_set(ld->flag_ic, IMGDIR "/M02_email_Flag_Complete.png", NULL);
                        break;
                case EMAIL_FLAG_TASK_STATUS_COMPLETE:
                        ld->followup_flag = EMAIL_FLAG_TASK_STATUS_CLEAR;
-                       elm_icon_file_set(ld->flag_ic, IMGDIR "/M02_email_Flag_Clear.png", NULL);
+                       elm_image_file_set(ld->flag_ic, IMGDIR "/M02_email_Flag_Clear.png", NULL);
                        break;
                default :
                        debug_log("mail item has no followup flag");
@@ -553,22 +553,22 @@ static Evas_Object *_gl_mail_item_content_get(void *data, Evas_Object *obj, cons
        } else if(!g_strcmp0(source, "elm.icon.2")){
                if(ld->priority == EMAIL_OPTION_PRIORITY_HIGH) {
                        icon = elm_icon_add(obj);
-                       elm_icon_file_set(icon, IMGDIR "/M02_email_icon_priority.png", NULL);
-                       elm_icon_resizable_set(icon, 0, 0);
+                       elm_image_file_set(icon, IMGDIR "/M02_email_icon_priority.png", NULL);
+                       elm_image_resizable_set(icon, 0, 0);
                        evas_object_image_smooth_scale_set(icon, 0);
                        evas_object_show(icon);
                        return (void *)icon;
                } else if(ld->reply_flag) {
                        icon = elm_icon_add(obj);
-                       elm_icon_file_set(icon, IMGDIR "/M02_email_icon_reply.png", NULL);
-                       elm_icon_resizable_set(icon, 0, 0);
+                       elm_image_file_set(icon, IMGDIR "/M02_email_icon_reply.png", NULL);
+                       elm_image_resizable_set(icon, 0, 0);
                        evas_object_image_smooth_scale_set(icon, 0);
                        evas_object_show(icon);
                        return (void *)icon;
                } else if (ld->forward_flag) {
                        icon = elm_icon_add(obj);
-                       elm_icon_file_set(icon, IMGDIR "/M02_email_icon_forward.png", NULL);
-                       elm_icon_resizable_set(icon, 0, 0);
+                       elm_image_file_set(icon, IMGDIR "/M02_email_icon_forward.png", NULL);
+                       elm_image_resizable_set(icon, 0, 0);
                        evas_object_image_smooth_scale_set(icon, 0);
                        evas_object_show(icon);
                        return (void *)icon;
@@ -593,7 +593,7 @@ static Evas_Object *_gl_mail_item_content_get(void *data, Evas_Object *obj, cons
                if(ld->is_attachment == true)
                {
                        icon = elm_icon_add(obj);
-                       elm_icon_file_set(icon, IMGDIR "/M02_email_icon_attach.png", NULL);
+                       elm_image_file_set(icon, IMGDIR "/M02_email_icon_attach.png", NULL);
                        evas_object_size_hint_min_set(icon, 35, 35);
                        evas_object_show(icon);
                        elm_box_pack_start(box, icon);
@@ -693,8 +693,8 @@ static Evas_Object *_gl_mail_item_content_get(void *data, Evas_Object *obj, cons
        {
                if(ld->priority == EMAIL_OPTION_PRIORITY_HIGH) {
                        Evas_Object *ic = elm_icon_add(obj);
-                       elm_icon_file_set(ic, IMGDIR "/M02_email_icon_priority.png", NULL);
-                       elm_icon_resizable_set(ic, 0, 0);
+                       elm_image_file_set(ic, IMGDIR "/M02_email_icon_priority.png", NULL);
+                       elm_image_resizable_set(ic, 0, 0);
                        evas_object_image_smooth_scale_set(ic, 0);
                        evas_object_show(ic);
                        return (void *)ic;
@@ -703,8 +703,8 @@ static Evas_Object *_gl_mail_item_content_get(void *data, Evas_Object *obj, cons
                        if(ld->item)
                                edje_object_signal_emit((Evas_Object *)elm_genlist_item_object_get(ld->item), "elm,state,priority", "elm");
                        Evas_Object *ic = elm_icon_add(obj);
-                       elm_icon_file_set(ic, IMGDIR "/M02_email_icon_priority.png", NULL);
-                       elm_icon_resizable_set(ic, 0, 0);
+                       elm_image_file_set(ic, IMGDIR "/M02_email_icon_priority.png", NULL);
+                       elm_image_resizable_set(ic, 0, 0);
                        evas_object_image_smooth_scale_set(ic, 0);
                        evas_object_show(ic);
                        return (void *)ic;
@@ -2595,7 +2595,7 @@ void _make_account_mail_list(void *data)
                        }
                                break;
                }
-               elm_icon_file_set(mailbox_ugd->sp_icon, ICON_TITLE_ALL_ACC, NULL);
+               elm_image_file_set(mailbox_ugd->sp_icon, ICON_TITLE_ALL_ACC, NULL);
                elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_sub", _("IDS_EMAIL_HEADER_ALL_ACCOUNTS"));
        }
        else {
@@ -2609,13 +2609,13 @@ void _make_account_mail_list(void *data)
                int err = 0;
                err = email_get_account(mailbox_ugd->account_id, EMAIL_ACC_GET_OPT_DEFAULT, &account);
                if (err == EMAIL_ERROR_NONE) {
-                       elm_icon_file_set(mailbox_ugd->sp_icon, account->logo_icon_path, NULL);
+                       elm_image_file_set(mailbox_ugd->sp_icon, account->logo_icon_path, NULL);
                }
 
                elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_sub", mailbox_ugd->user_email);
 
                if (account) {
-                       elm_icon_file_set(mailbox_ugd->sp_icon, account->logo_icon_path, NULL);
+                       elm_image_file_set(mailbox_ugd->sp_icon, account->logo_icon_path, NULL);
                        email_free_account(&account, 1);
                }
        }
index 03cba67..266180b 100755 (executable)
@@ -101,8 +101,8 @@ void mailbox_create_searchbar(EmailMailboxUGD *mailbox_ugd)
        //searchbar category button
        mailbox_ugd->searchby_button = elm_button_add(searchbar_layout);
        Evas_Object *searchby_icon = elm_icon_add(mailbox_ugd->searchby_button);
-       elm_icon_file_set(searchby_icon, IMGDIR"/M02_email_icon_popup_all_press.png", NULL);
-       elm_icon_resizable_set(searchby_icon, 0, 0);
+       elm_image_file_set(searchby_icon, IMGDIR"/M02_email_icon_popup_all_press.png", NULL);
+       elm_image_resizable_set(searchby_icon, 0, 0);
        evas_object_image_smooth_scale_set(searchby_icon, 0);
        elm_object_content_set(mailbox_ugd->searchby_button, searchby_icon);
        evas_object_smart_callback_add(mailbox_ugd->searchby_button, "clicked", _searchby_clicked_cb, mailbox_ugd);
@@ -188,15 +188,15 @@ static void _searchby_clicked_cb(void *data, Evas_Object *obj, void *event_info)
 
        Evas_Object* icon;
        icon = elm_icon_add(mailbox_ugd->searchby_ctx_popup);
-       elm_icon_file_set(icon, IMGDIR "/M02_email_icon_popup_all.png", NULL);
+       elm_image_file_set(icon, IMGDIR "/M02_email_icon_popup_all.png", NULL);
        elm_ctxpopup_item_append(mailbox_ugd->searchby_ctx_popup, dgettext("sys_string", "IDS_COM_BODY_ALL"), icon, _searchby_ctxpopup_cb, mailbox_ugd);
 
        icon = elm_icon_add(mailbox_ugd->searchby_ctx_popup);
-       elm_icon_file_set(icon, IMGDIR "/M02_email_icon_popup_title.png", NULL);
+       elm_image_file_set(icon, IMGDIR "/M02_email_icon_popup_title.png", NULL);
        elm_ctxpopup_item_append(mailbox_ugd->searchby_ctx_popup, dgettext("sys_string", "IDS_COM_BODY_DETAILS_TITLE"), icon, _searchby_ctxpopup_cb, mailbox_ugd);
 
        icon = elm_icon_add(mailbox_ugd->searchby_ctx_popup);
-       elm_icon_file_set(icon, IMGDIR "/M02_email_icon_popup_sender.png", NULL);
+       elm_image_file_set(icon, IMGDIR "/M02_email_icon_popup_sender.png", NULL);
 
        if ((mailbox_ugd->mailbox_type == EMAIL_MAILBOX_TYPE_SENTBOX)
                        || (mailbox_ugd->mailbox_type == EMAIL_MAILBOX_TYPE_OUTBOX)
@@ -207,11 +207,11 @@ static void _searchby_clicked_cb(void *data, Evas_Object *obj, void *event_info)
        }
 
        icon = elm_icon_add(mailbox_ugd->searchby_ctx_popup);
-       elm_icon_file_set(icon, IMGDIR "/M02_email_icon_popup_date.png", NULL);
+       elm_image_file_set(icon, IMGDIR "/M02_email_icon_popup_date.png", NULL);
        elm_ctxpopup_item_append(mailbox_ugd->searchby_ctx_popup, _("IDS_EMAIL_OPT_DATE"), icon, _searchby_ctxpopup_cb, mailbox_ugd);
 
        icon = elm_icon_add(mailbox_ugd->searchby_ctx_popup);
-       elm_icon_file_set(icon, IMGDIR "/M02_email_icon_popup_advanced.png", NULL);
+       elm_image_file_set(icon, IMGDIR "/M02_email_icon_popup_advanced.png", NULL);
        elm_ctxpopup_item_append(mailbox_ugd->searchby_ctx_popup, _("IDS_EMAIL_OPT_ADVANCED"), icon, _searchby_ctxpopup_cb, mailbox_ugd);
 
        _move_searchby_ctxpopup(mailbox_ugd->searchby_ctx_popup, obj);
@@ -282,26 +282,26 @@ static void _searchby_ctxpopup_cb(void *data, Evas_Object *obj, void *event_info
 
        if (search_type == EMAIL_SEARCH_ALL)            // All
        {
-               elm_icon_file_set(searchby_icon, IMGDIR"/M02_email_icon_popup_all_press.png", NULL);
+               elm_image_file_set(searchby_icon, IMGDIR"/M02_email_icon_popup_all_press.png", NULL);
        }
        else if (search_type == EMAIL_SEARCH_SUBJECT)   // SUBJECT
        {
-               elm_icon_file_set(searchby_icon, IMGDIR"/M02_email_icon_popup_title_press.png", NULL);
+               elm_image_file_set(searchby_icon, IMGDIR"/M02_email_icon_popup_title_press.png", NULL);
        }
        else if (search_type == EMAIL_SEARCH_FROM || search_type == EMAIL_SEARCH_TO)    // FROM or Recipient(TO)
        {
-               elm_icon_file_set(searchby_icon, IMGDIR"/M02_email_icon_popup_sender_press.png", NULL);
+               elm_image_file_set(searchby_icon, IMGDIR"/M02_email_icon_popup_sender_press.png", NULL);
        }
        else if (search_type == EMAIL_SEARCH_DATE)      // Date
        {
-               elm_icon_file_set(searchby_icon, IMGDIR"/M02_email_icon_popup_date_press.png", NULL);
+               elm_image_file_set(searchby_icon, IMGDIR"/M02_email_icon_popup_date_press.png", NULL);
        }
        else if (search_type == EMAIL_SEARCH_ADVANCED)  // Advanced
        {
-               elm_icon_file_set(searchby_icon, IMGDIR"/M02_email_icon_popup_advanced_press.png", NULL);
+               elm_image_file_set(searchby_icon, IMGDIR"/M02_email_icon_popup_advanced_press.png", NULL);
        }
 
-       elm_icon_resizable_set(searchby_icon, 0, 0);
+       elm_image_resizable_set(searchby_icon, 0, 0);
        evas_object_image_smooth_scale_set(searchby_icon, 0);
        elm_object_content_set(mailbox_ugd->searchby_button, searchby_icon);
 
index 4acd2e7..99ad77b 100755 (executable)
@@ -1111,7 +1111,7 @@ void destroy_account_cb(ui_gadget_h ug, void *priv)
 
                if (oh_opened)
                {
-                       elm_icon_file_set(mailbox_ugd->title_arrow, ICON_CLOSE, NULL);
+                       elm_image_file_set(mailbox_ugd->title_arrow, ICON_CLOSE, NULL);
                        elm_object_item_data_set(nf_it, (void *) (!oh_opened));
                }
 
@@ -1551,8 +1551,8 @@ static void _create_view(EmailMailboxUGD *mailbox_ugd)
        mailbox_ugd->folder_button = elm_button_add(mailbox_ugd->navi_bar);
        elm_object_style_set(mailbox_ugd->folder_button, "naviframe/title_icon");
        Evas_Object *folder_icon = elm_icon_add(mailbox_ugd->folder_button);
-       elm_icon_file_set(folder_icon, ICON_FOLDERS, NULL);
-       elm_icon_resizable_set(folder_icon, 1, 1);
+       elm_image_file_set(folder_icon, ICON_FOLDERS, NULL);
+       elm_image_resizable_set(folder_icon, 1, 1);
        evas_object_image_smooth_scale_set(folder_icon, 0);
        elm_object_content_set(mailbox_ugd->folder_button, folder_icon);
        evas_object_smart_callback_add(mailbox_ugd->folder_button, "clicked", _folder_cb, mailbox_ugd);
@@ -1562,8 +1562,8 @@ static void _create_view(EmailMailboxUGD *mailbox_ugd)
        mailbox_ugd->update_button = elm_button_add(mailbox_ugd->navi_bar);
        elm_object_style_set(mailbox_ugd->update_button, "naviframe/title_icon");
        Evas_Object *update_icon = elm_icon_add(mailbox_ugd->update_button);
-       elm_icon_file_set(update_icon, ICON_UPDATE, NULL);
-       elm_icon_resizable_set(update_icon, 1, 1);
+       elm_image_file_set(update_icon, ICON_UPDATE, NULL);
+       elm_image_resizable_set(update_icon, 1, 1);
        evas_object_image_smooth_scale_set(update_icon, 0);
        elm_object_content_set(mailbox_ugd->update_button, update_icon);
        evas_object_smart_callback_add(mailbox_ugd->update_button, "clicked", _update_toolbar_clicked_cb, mailbox_ugd);
@@ -1587,13 +1587,13 @@ static void _create_view(EmailMailboxUGD *mailbox_ugd)
        mailbox_ugd->sp_icon = elm_icon_add(mailbox_ugd->navi_title_ly);
        evas_object_show(mailbox_ugd->sp_icon);
        elm_object_part_content_set(mailbox_ugd->navi_title_ly, "sub_left_icon", mailbox_ugd->sp_icon);
-       elm_icon_file_set(mailbox_ugd->sp_icon, ICON_TITLE_ALL_ACC, NULL);
+       elm_image_file_set(mailbox_ugd->sp_icon, ICON_TITLE_ALL_ACC, NULL);
 
        // add expand/collapse icon
        mailbox_ugd->title_arrow = elm_icon_add(mailbox_ugd->navi_title_ly);
        evas_object_show(mailbox_ugd->title_arrow);
        elm_object_part_content_set(mailbox_ugd->navi_title_ly, "sub_right_icon", mailbox_ugd->title_arrow);
-       elm_icon_file_set(mailbox_ugd->title_arrow, ICON_CLOSE, NULL);
+       elm_image_file_set(mailbox_ugd->title_arrow, ICON_CLOSE, NULL);
 
        _create_controlbar(mailbox_ugd);
 
@@ -1612,7 +1612,7 @@ static void _title_clicked_cb(void *data, Evas_Object *obj, const char *emission
 
        if (oh_opened)
        {
-               elm_icon_file_set(mailbox_ugd->title_arrow, ICON_CLOSE, NULL);
+               elm_image_file_set(mailbox_ugd->title_arrow, ICON_CLOSE, NULL);
                destroy_account_cb(mailbox_ugd->ug_account, mailbox_ugd);
                elm_object_item_data_set(nf_it, (void *) (!oh_opened));
        }
@@ -1620,7 +1620,7 @@ static void _title_clicked_cb(void *data, Evas_Object *obj, const char *emission
        {
                if (mailbox_ugd->view_type != EMAIL_VIEW_EDIT && mailbox_ugd->view_type != EMAIL_VIEW_SEARCH)
                {
-                       elm_icon_file_set(mailbox_ugd->title_arrow, ICON_OPEN, NULL);
+                       elm_image_file_set(mailbox_ugd->title_arrow, ICON_OPEN, NULL);
                        _account_cb(data, obj, NULL);
                        elm_object_item_data_set(nf_it, (void *) (!oh_opened));
                }
@@ -1997,7 +1997,7 @@ void _update_navigationbar_title(EmailMailboxUGD *mailbox_ugd)
 
        if (mailbox_ugd->mode == EMAIL_MAILBOX_MODE_ALL) {
 
-               elm_icon_file_set(mailbox_ugd->sp_icon, ICON_TITLE_ALL_ACC, NULL);
+               elm_image_file_set(mailbox_ugd->sp_icon, ICON_TITLE_ALL_ACC, NULL);
 
                switch(mailbox_ugd->mailbox_type)
                {
@@ -2066,7 +2066,7 @@ void _update_navigationbar_title(EmailMailboxUGD *mailbox_ugd)
                email_account_t *account;
                email_get_account(mailbox_ugd->account_id, 0, &account);
                if (account) {
-                       elm_icon_file_set(mailbox_ugd->sp_icon, account->logo_icon_path, NULL);
+                       elm_image_file_set(mailbox_ugd->sp_icon, account->logo_icon_path, NULL);
                        email_free_account(&account, 1);
                }
        }
index 58385a3..12b950e 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       org.tizen.email
 Summary:    Native email application
-Version:    0.0.13
+Version:    0.0.14
 Release:    1
 Group:      devel
 License:    Flora
index 05349f2..06532df 100755 (executable)
@@ -3554,8 +3554,44 @@ static Eina_Bool _save_email_prog_cb(void *data)
        debug_log("email_get_attachment_data_list - err (%d)", err);
 
        if (err == EMAIL_ERROR_NONE) {
+               if (!email_check_dir_exist(DIR_DEFAULT_MEDIA_PHONE"/Saved Email")) {
+                       int nErr = -1;
+                       nErr = mkdir(DIR_DEFAULT_MEDIA_PHONE"/Saved Email", 0755);
+                       debug_log("errno: %d", nErr);
+                       if (nErr == -1) {
+                               debug_log("Eml file folder creation failed");
+                               return -1;
+                       }
+               } else
+                       debug_log("Eml file folder already exists.");
+
+               char *subject = elm_entry_utf8_to_markup(ug_data->property->subject);
+               if (!g_strcmp0(subject, "")) {
+                       g_free(subject);
+                       subject = g_strdup(_("IDS_EMAIL_BODY_NO_SUBJECT"));
+               }
+
+               tzset(); /* MUST BE. */
+               
+               time_t now_time = time(NULL);
+               
+               struct tm *dummy = localtime(&now_time);
+               struct tm now_tm;
+               memcpy(&now_tm, dummy, sizeof(struct tm));
+
+               char date[9] = { 0, };
+               if (now_tm.tm_mon + 1 < 10 && now_tm.tm_mday < 10)
+                       snprintf(date, sizeof(date), "%d0%d0%d", now_tm.tm_year + 1900, now_tm.tm_mon + 1, now_tm.tm_mday);
+               else if (now_tm.tm_mon + 1 < 10 && now_tm.tm_mday >= 10)
+                       snprintf(date, sizeof(date), "%d0%d%d", now_tm.tm_year + 1900, now_tm.tm_mon + 1, now_tm.tm_mday);
+               else if (now_tm.tm_mon + 1 >= 10 && now_tm.tm_mday < 10)
+                       snprintf(date, sizeof(date), "%d%d0%d", now_tm.tm_year + 1900, now_tm.tm_mon + 1, now_tm.tm_mday);
+               else
+                       snprintf(date, sizeof(date), "%d%d%d", now_tm.tm_year + 1900, now_tm.tm_mon + 1, now_tm.tm_mday);
+               debug_log("date(%s)", date);
+
                char file_name[MAX_PATH_LEN] = { 0, };
-               snprintf(file_name, sizeof(file_name), "%s_%d_%d.%s", DIR_DEFAULT_MEDIA_PHONE"/Downloads/email", ug_data->account_id, ug_data->mail_id, "eml");
+               snprintf(file_name, sizeof(file_name), "%s/%s_%d_%d_%s.%s", DIR_DEFAULT_MEDIA_PHONE"/Saved Email", subject, ug_data->account_id, ug_data->mail_id, date,  "eml");
                char *output_file_path = g_strdup(file_name);
                debug_log("output_file_path(%s)", file_name, output_file_path);
 
@@ -3563,6 +3599,7 @@ static Eina_Bool _save_email_prog_cb(void *data)
                debug_log("email_write_mime_file - err(%d)", err);
 
                g_free(output_file_path);
+               g_free(subject);
        }
 
        if (mail_t) {
@@ -3603,7 +3640,7 @@ static Eina_Bool _save_email_prog_cb(void *data)
 
 static void _ctxpopup_detail_contact_cb(void *data, Evas_Object *obj, void *event_info)
 {
-       debug_log("");
+       debug_log("data(%s)", data);
        if (data == NULL || _g_ug_data == NULL) {
                debug_log("data is NULL");
                return;