diff options
author | Jeffrey Stedfast <fejj@novell.com> | 2006-05-26 02:15:54 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2006-05-26 02:15:54 +0800 |
commit | f9a13fe3bb5eed38ddfb9e26dc43208d9ad92f4f (patch) | |
tree | fce2f81b0e23822de7d7eede439f01633d7189a6 /composer | |
parent | b5a0acb45a80237d7640118ea11c68f0400bfc88 (diff) | |
download | gsoc2013-evolution-f9a13fe3bb5eed38ddfb9e26dc43208d9ad92f4f.tar.gz gsoc2013-evolution-f9a13fe3bb5eed38ddfb9e26dc43208d9ad92f4f.tar.zst gsoc2013-evolution-f9a13fe3bb5eed38ddfb9e26dc43208d9ad92f4f.zip |
Instead of g_free()ing 'str' in the if and else blocks, just g_free it
2006-05-25 Jeffrey Stedfast <fejj@novell.com>
* e-msg-composer.c (drop_action): Instead of g_free()ing 'str' in
the if and else blocks, just g_free it after the if-else block.
svn path=/trunk/; revision=32033
Diffstat (limited to 'composer')
-rw-r--r-- | composer/ChangeLog | 3 | ||||
-rw-r--r-- | composer/e-msg-composer.c | 49 |
2 files changed, 24 insertions, 28 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog index 1f0db2e8fb..317e305386 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -1,5 +1,8 @@ 2006-05-25 Jeffrey Stedfast <fejj@novell.com> + * e-msg-composer.c (drop_action): Instead of g_free()ing 'str' in + the if and else blocks, just g_free it after the if-else block. + * e-msg-composer-select-file.c (select_attach_response): Replace 'if (!filename)' with 'if (filename)', fixes a bug in Srini's patch. diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index fe66322c43..f77c947ea4 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -1783,18 +1783,18 @@ add_to_bar (EMsgComposer *composer, GSList *names, int is_inline) while (names) { CamelURL *url; - - url = camel_url_new (names->data, NULL); - if (url == NULL) + + if (!(url = camel_url_new (names->data, NULL))) continue; - + if (!g_ascii_strcasecmp (url->protocol, "file")) { e_attachment_bar_attach((EAttachmentBar *)p->attachment_bar, url->path, is_inline ? "inline" : "attachment"); } else { e_attachment_bar_attach_remote_file ((EAttachmentBar *)p->attachment_bar, names->data, is_inline ? "inline" : "attachment"); } - names = g_slist_next(names); + camel_url_free (url); + names = names->next; } } @@ -2958,33 +2958,29 @@ drop_action(EMsgComposer *composer, GdkDragContext *context, guint32 action, Gtk g_free(str); continue; } - + if (!g_ascii_strncasecmp (str, "mailto:", 7)) { handle_mailto (composer, str); - g_free (str); } else { - url = camel_url_new (str, NULL); - - if (url == NULL) { + if (!(url = camel_url_new (str, NULL))) { g_free (str); continue; } - + if (!g_ascii_strcasecmp (url->protocol, "file")) { - type=attachment_guess_mime_type (str); - if (strncmp (type, "image", 5) || (!p->send_html && !strncmp (type, "image", 5))) - e_attachment_bar_attach - (E_ATTACHMENT_BAR (p->attachment_bar), - url->path, - "attachment"); + type = attachment_guess_mime_type (str); + if (strncmp (type, "image", 5) || (!p->send_html && !strncmp (type, "image", 5))) + e_attachment_bar_attach (E_ATTACHMENT_BAR (p->attachment_bar), + url->path, "attachment"); } else { - e_attachment_bar_attach_remote_file - (E_ATTACHMENT_BAR (p->attachment_bar), - str, "attachment"); + e_attachment_bar_attach_remote_file (E_ATTACHMENT_BAR (p->attachment_bar), + str, "attachment"); } - g_free (str); + camel_url_free (url); } + + g_free (str); } g_free (urls); @@ -2999,13 +2995,11 @@ drop_action(EMsgComposer *composer, GdkDragContext *context, guint32 action, Gtk camel_mime_part_set_content (mime_part, selection->data, selection->length, content_type); camel_mime_part_set_disposition (mime_part, "inline"); - e_attachment_bar_attach_mime_part - (E_ATTACHMENT_BAR (p->attachment_bar), - mime_part); + e_attachment_bar_attach_mime_part (E_ATTACHMENT_BAR (p->attachment_bar), mime_part); camel_object_unref (mime_part); g_free (content_type); - + success = TRUE; break; case DND_TYPE_X_UID_LIST: { @@ -3099,10 +3093,9 @@ drop_action(EMsgComposer *composer, GdkDragContext *context, guint32 action, Gtk break; } - if (e_attachment_bar_get_num_attachments(E_ATTACHMENT_BAR(p->attachment_bar))) { + if (e_attachment_bar_get_num_attachments(E_ATTACHMENT_BAR(p->attachment_bar))) show_attachments (composer, TRUE); - } - + gtk_drag_finish(context, success, delete, time); } |