diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2013-05-17 01:10:26 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2013-05-20 01:07:20 +0800 |
commit | c025ffbb296501d2da8cba78aa6a14008055cf87 (patch) | |
tree | 1ef1bb4d02d699fc67e731e54bb1017852be4d83 /mail | |
parent | cd5a55f9812643109be6c2b0ed5d8f8ce655a4a9 (diff) | |
download | gsoc2013-evolution-c025ffbb296501d2da8cba78aa6a14008055cf87.tar gsoc2013-evolution-c025ffbb296501d2da8cba78aa6a14008055cf87.tar.gz gsoc2013-evolution-c025ffbb296501d2da8cba78aa6a14008055cf87.tar.bz2 gsoc2013-evolution-c025ffbb296501d2da8cba78aa6a14008055cf87.tar.lz gsoc2013-evolution-c025ffbb296501d2da8cba78aa6a14008055cf87.tar.xz gsoc2013-evolution-c025ffbb296501d2da8cba78aa6a14008055cf87.tar.zst gsoc2013-evolution-c025ffbb296501d2da8cba78aa6a14008055cf87.zip |
Add e_mail_part_get_id().
Diffstat (limited to 'mail')
-rw-r--r-- | mail/e-mail-display.c | 14 | ||||
-rw-r--r-- | mail/em-utils.c | 15 |
2 files changed, 16 insertions, 13 deletions
diff --git a/mail/e-mail-display.c b/mail/e-mail-display.c index 00c5d2df4f..b899ca46fd 100644 --- a/mail/e-mail-display.c +++ b/mail/e-mail-display.c @@ -1201,21 +1201,19 @@ mail_parts_bind_dom (GObject *object, for (link = head; link != NULL; link = g_list_next (link)) { EMailPart *part = E_MAIL_PART (link->data); + WebKitDOMElement *element; + const gchar *part_id; /* Iterate only the parts rendered in * the frame and all it's subparts. */ if (!g_str_has_prefix (part->id, frame_name)) break; - if (part->bind_func != NULL) { - WebKitDOMElement *element; + part_id = e_mail_part_get_id (part); + element = find_element_by_id (document, part_id); - element = find_element_by_id (document, part->id); - if (element != NULL) { - d (printf ("/*bind_func*/ for %s\n", part->id)); - part->bind_func (part, element); - } - } + if (element != NULL && part->bind_func != NULL) + part->bind_func (part, element); } while (!g_queue_is_empty (&queue)) diff --git a/mail/em-utils.c b/mail/em-utils.c index 8e7d48bd19..3e3f9f022b 100644 --- a/mail/em-utils.c +++ b/mail/em-utils.c @@ -1198,6 +1198,7 @@ static gboolean is_only_text_part_in_this_level (GList *parts, EMailPart *text_html_part) { + const gchar *text_html_part_id; const gchar *dot; gint level_len; GList *iter; @@ -1205,13 +1206,16 @@ is_only_text_part_in_this_level (GList *parts, g_return_val_if_fail (parts != NULL, FALSE); g_return_val_if_fail (text_html_part != NULL, FALSE); - dot = strrchr (text_html_part->id, '.'); + text_html_part_id = e_mail_part_get_id (text_html_part); + + dot = strrchr (text_html_part_id, '.'); if (!dot) return FALSE; - level_len = dot - text_html_part->id; + level_len = dot - text_html_part_id; for (iter = parts; iter; iter = iter->next) { EMailPart *part = E_MAIL_PART (iter->data); + const gchar *part_id; if (part == NULL) continue; @@ -1228,9 +1232,10 @@ is_only_text_part_in_this_level (GList *parts, if (part->mime_type == NULL) continue; - dot = strrchr (part->id, '.'); - if (dot - part->id != level_len || - strncmp (text_html_part->id, part->id, level_len) != 0) + part_id = e_mail_part_get_id (part); + dot = strrchr (part_id, '.'); + if (dot - part_id != level_len || + strncmp (text_html_part_id, part_id, level_len) != 0) continue; if (g_ascii_strncasecmp (part->mime_type, "text/", 5) == 0) |