GList* of TnyMimeParts to use TnyLists to maintain a more intuitive list
of references.
* src/widget/modest-gtkhtml-msg-view.[ch]:
* Use TnyList of attachments
* src/widgets/modest-msg-edit-window.h:
* Use TnyList instead of GList for attachments.
* src/widgets/modest-msg-view.[ch]:
* Use TnyList instead of GList for attachments.
* src/widgets/modest-attachment-view.c:
* Now the ModestAttachmentView always keep a reference
to the mime part with g_object_ref.
* src/widgets/modest-msg-view-window.h:
* Use TnyList instead of GList for attachments.
* src/widgets/modest-attachments-view.[ch]:
* Missing unreferencing on iteration.
* Use TnyList instead of GList for attachmetns.
* src/modest-tny-msg.c:
* Use TnyList and unrefernce an attachment list properly.
* src/modest-ui-actions.c:
* Mail operations for saving to drafts or sending mails from
edit window shouldn't keep a reference to the edit window.
* Fixed minor bug assigning a g_strdup.
* Some frees in error cases in modest_ui_actions_on_send.
* src/maemo/modest-msg-edit-window.c:
* Fixed some leaked references.
* Use TnyList instead of GList for lists of attachments.
* src/maemo/modest-msg-view-window.c:
* Use TnyList instead of GList for lists of attachments.
* Fixed some counting leaks.
* src/modest-utils.[ch]:
* New method modest_list_index (), that finds the ordinal index
of an item in a list.
* src/modest-ui-dimming-rules.c:
* Use TnyList instead of GList for lists of attachments.
pmo-trunk-r3996
16 files changed:
gint last_vadj_upper;
gint last_cid;
gint last_vadj_upper;
gint last_cid;
- GList *attachments;
- GList *images;
+ TnyList *attachments;
+ TnyList *images;
TnyHeaderFlags priority_flags;
TnyHeaderFlags priority_flags;
priv->cc_field = NULL;
priv->bcc_field = NULL;
priv->subject_field = NULL;
priv->cc_field = NULL;
priv->bcc_field = NULL;
priv->subject_field = NULL;
- priv->attachments = NULL;
- priv->images = NULL;
+ priv->attachments = TNY_LIST (tny_simple_list_new ());
+ priv->images = TNY_LIST (tny_simple_list_new ());
priv->last_cid = 0;
priv->cc_caption = NULL;
priv->last_cid = 0;
priv->cc_caption = NULL;
g_free (priv->last_search);
g_slist_free (priv->font_items_group);
g_slist_free (priv->size_items_group);
g_free (priv->last_search);
g_slist_free (priv->font_items_group);
g_slist_free (priv->size_items_group);
- g_list_foreach (priv->attachments, (GFunc) g_object_unref, NULL);
- g_list_free (priv->attachments);
- g_list_foreach (priv->images, (GFunc) g_object_unref, NULL);
- g_list_free (priv->images);
+ g_object_unref (priv->attachments);
+ g_object_unref (priv->images);
/* This had to stay alive for as long as the combobox that used it: */
modest_pair_list_free (priv->from_field_protos);
/* This had to stay alive for as long as the combobox that used it: */
modest_pair_list_free (priv->from_field_protos);
-replace_with_images (ModestMsgEditWindow *self, GList *attachments)
+replace_with_images (ModestMsgEditWindow *self, TnyList *attachments)
{
ModestMsgEditWindowPrivate *priv;
{
ModestMsgEditWindowPrivate *priv;
priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE (self);
priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE (self);
- for (node = attachments; node != NULL; node = g_list_next (node)) {
- TnyMimePart *part = (TnyMimePart *) node->data;
+ for (iter = tny_list_create_iterator (attachments);
+ !tny_iterator_is_done (iter);
+ tny_iterator_next (iter)) {
+ TnyMimePart *part = (TnyMimePart *) tny_iterator_get_current (iter);
const gchar *cid = tny_mime_part_get_content_id (part);
const gchar *mime_type = tny_mime_part_get_content_type (part);
if ((cid != NULL)&&(mime_type != NULL)) {
const gchar *cid = tny_mime_part_get_content_id (part);
const gchar *mime_type = tny_mime_part_get_content_type (part);
if ((cid != NULL)&&(mime_type != NULL)) {
g_object_unref (pixbuf);
}
}
g_object_unref (pixbuf);
}
}
part = TNY_MIME_PART (tny_iterator_get_current (iter));
content_type = tny_mime_part_get_content_type (part);
if (content_type && g_str_has_prefix (content_type, "image/")) {
part = TNY_MIME_PART (tny_iterator_get_current (iter));
content_type = tny_mime_part_get_content_type (part);
if (content_type && g_str_has_prefix (content_type, "image/")) {
- priv->images = g_list_prepend (priv->images, part);
- } else {
- g_object_unref (part);
- }
+ tny_list_prepend (priv->images, (GObject *) part);
+ }
+ g_object_unref (part);
tny_iterator_next (iter);
}
g_object_unref (iter);
tny_iterator_next (iter);
}
g_object_unref (iter);
-update_last_cid (ModestMsgEditWindow *self, GList *attachments)
+update_last_cid (ModestMsgEditWindow *self, TnyList *attachments)
ModestMsgEditWindowPrivate *priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE (self);
ModestMsgEditWindowPrivate *priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE (self);
- for (node = attachments; node != NULL; node = g_list_next (node)) {
- TnyMimePart *part = (TnyMimePart *) node->data;
+ for (iter = tny_list_create_iterator (attachments) ;
+ !tny_iterator_is_done (iter);
+ tny_iterator_next (iter)) {
+ TnyMimePart *part = (TnyMimePart *) tny_iterator_get_current (iter);
const gchar *cid = tny_mime_part_get_content_id (part);
if (cid != NULL) {
char *invalid = NULL;
const gchar *cid = tny_mime_part_get_content_id (part);
if (cid != NULL) {
char *invalid = NULL;
priv->last_cid = int_cid;
}
}
priv->last_cid = int_cid;
}
}
/* Add attachments to the view */
modest_attachments_view_set_message (MODEST_ATTACHMENTS_VIEW (priv->attachments_view), msg);
priv->attachments = modest_attachments_view_get_attachments (MODEST_ATTACHMENTS_VIEW (priv->attachments_view));
/* Add attachments to the view */
modest_attachments_view_set_message (MODEST_ATTACHMENTS_VIEW (priv->attachments_view), msg);
priv->attachments = modest_attachments_view_get_attachments (MODEST_ATTACHMENTS_VIEW (priv->attachments_view));
- if (priv->attachments == NULL) {
+ if (tny_list_get_length (priv->attachments) == 0) {
gtk_widget_hide (priv->attachments_caption);
} else {
gtk_widget_set_no_show_all (priv->attachments_caption, FALSE);
gtk_widget_hide (priv->attachments_caption);
} else {
gtk_widget_set_no_show_all (priv->attachments_caption, FALSE);
MsgData *data;
const gchar *account_name;
ModestMsgEditWindowPrivate *priv;
MsgData *data;
const gchar *account_name;
ModestMsgEditWindowPrivate *priv;
g_return_val_if_fail (MODEST_IS_MSG_EDIT_WINDOW (edit_window), NULL);
g_return_val_if_fail (MODEST_IS_MSG_EDIT_WINDOW (edit_window), NULL);
data->html_body = NULL;
/* deep-copy the data */
data->html_body = NULL;
/* deep-copy the data */
- GList *cursor = priv->attachments;
+ att_iter = tny_list_create_iterator (priv->attachments);
data->attachments = NULL;
data->attachments = NULL;
- while (cursor) {
- if (!(TNY_IS_MIME_PART(cursor->data))) {
+ while (!tny_iterator_is_done (att_iter)) {
+ TnyMimePart *part = (TnyMimePart *) tny_iterator_get_current (att_iter);
+ if (!(TNY_IS_MIME_PART(part))) {
g_warning ("strange data in attachment list");
g_warning ("strange data in attachment list");
- cursor = g_list_next (cursor);
+ g_object_unref (part);
+ tny_iterator_next (att_iter);
continue;
}
data->attachments = g_list_append (data->attachments,
continue;
}
data->attachments = g_list_append (data->attachments,
- g_object_ref (cursor->data));
- cursor = g_list_next (cursor);
+ part);
+ tny_iterator_next (att_iter);
+ g_object_unref (att_iter);
GtkTextTagTable *tag_table = gtk_text_buffer_get_tag_table (GTK_TEXT_BUFFER (priv->text_buffer));
GtkTextTagTable *tag_table = gtk_text_buffer_get_tag_table (GTK_TEXT_BUFFER (priv->text_buffer));
+ att_iter = tny_list_create_iterator (priv->images);
+ while (!tny_iterator_is_done (att_iter)) {
+ TnyMimePart *part = (TnyMimePart *) tny_iterator_get_current (att_iter);
- if (!(TNY_IS_MIME_PART(cursor->data))) {
+ if (!(TNY_IS_MIME_PART(part))) {
g_warning ("strange data in attachment list");
g_warning ("strange data in attachment list");
- cursor = g_list_next (cursor);
+ g_object_unref (part);
+ tny_iterator_next (att_iter);
- cid = tny_mime_part_get_content_id (cursor->data);
+ cid = tny_mime_part_get_content_id (part);
if (cid) {
gchar *image_tag_id;
GtkTextTag *image_tag;
if (cid) {
gchar *image_tag_id;
GtkTextTag *image_tag;
((gtk_text_iter_has_tag (&iter, image_tag))||
(gtk_text_iter_forward_to_tag_toggle (&iter, image_tag))))
data->images = g_list_append (data->images,
((gtk_text_iter_has_tag (&iter, image_tag))||
(gtk_text_iter_forward_to_tag_toggle (&iter, image_tag))))
data->images = g_list_append (data->images,
- g_object_ref (cursor->data));
- cursor = g_list_next (cursor);
+ g_object_unref (part);
+ tny_iterator_next (att_iter);
}
data->priority_flags = priv->priority_flags;
}
data->priority_flags = priv->priority_flags;
wp_text_buffer_insert_image (WP_TEXT_BUFFER (priv->text_buffer), &position, g_strdup (tny_mime_part_get_content_id (mime_part)), pixbuf);
}
wp_text_buffer_insert_image (WP_TEXT_BUFFER (priv->text_buffer), &position, g_strdup (tny_mime_part_get_content_id (mime_part)), pixbuf);
}
- priv->images = g_list_prepend (priv->images, mime_part);
+ tny_list_prepend (priv->images, (GObject *) mime_part);
gtk_text_buffer_set_modified (priv->text_buffer, TRUE);
g_free (filename);
gtk_text_buffer_set_modified (priv->text_buffer, TRUE);
g_free (filename);
+ g_object_unref (mime_part);
stream = TNY_STREAM (tny_vfs_stream_new (handle));
tny_mime_part_construct_from_stream (mime_part, stream, mime_type);
stream = TNY_STREAM (tny_vfs_stream_new (handle));
tny_mime_part_construct_from_stream (mime_part, stream, mime_type);
+
+ g_object_unref (stream);
content_id = g_strdup_printf ("%d", priv->last_cid);
tny_mime_part_set_content_id (mime_part, content_id);
content_id = g_strdup_printf ("%d", priv->last_cid);
tny_mime_part_set_content_id (mime_part, content_id);
tny_mime_part_set_filename (mime_part, basename);
g_free (basename);
tny_mime_part_set_filename (mime_part, basename);
g_free (basename);
- priv->attachments = g_list_prepend (priv->attachments, g_object_ref(mime_part));
+ tny_list_prepend (priv->attachments, (GObject *) mime_part);
modest_attachments_view_add_attachment (MODEST_ATTACHMENTS_VIEW (priv->attachments_view),
mime_part);
gtk_widget_set_no_show_all (priv->attachments_caption, FALSE);
gtk_widget_show_all (priv->attachments_caption);
gtk_text_buffer_set_modified (priv->text_buffer, TRUE);
g_free (filename);
modest_attachments_view_add_attachment (MODEST_ATTACHMENTS_VIEW (priv->attachments_view),
mime_part);
gtk_widget_set_no_show_all (priv->attachments_caption, FALSE);
gtk_widget_show_all (priv->attachments_caption);
gtk_text_buffer_set_modified (priv->text_buffer, TRUE);
g_free (filename);
+ g_object_unref (mime_part);
}
}
void
modest_msg_edit_window_remove_attachments (ModestMsgEditWindow *window,
}
}
void
modest_msg_edit_window_remove_attachments (ModestMsgEditWindow *window,
{
ModestMsgEditWindowPrivate *priv;
{
ModestMsgEditWindowPrivate *priv;
- gboolean clean_list = FALSE;
g_return_if_fail (MODEST_IS_MSG_EDIT_WINDOW (window));
priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE (window);
if (att_list == NULL) {
att_list = modest_attachments_view_get_selection (MODEST_ATTACHMENTS_VIEW (priv->attachments_view));
g_return_if_fail (MODEST_IS_MSG_EDIT_WINDOW (window));
priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE (window);
if (att_list == NULL) {
att_list = modest_attachments_view_get_selection (MODEST_ATTACHMENTS_VIEW (priv->attachments_view));
+ } else {
+ g_object_ref (att_list);
- if (att_list == NULL) {
+ if (tny_list_get_length (att_list) == 0) {
hildon_banner_show_information (NULL, NULL, _("TODO: no attachments selected to remove"));
} else {
GtkWidget *confirmation_dialog = NULL;
gboolean dialog_response;
hildon_banner_show_information (NULL, NULL, _("TODO: no attachments selected to remove"));
} else {
GtkWidget *confirmation_dialog = NULL;
gboolean dialog_response;
gchar *message = NULL;
gchar *filename = NULL;
gchar *message = NULL;
gchar *filename = NULL;
- if (att_list->next == NULL) {
- if (TNY_IS_MSG (att_list->data)) {
- TnyHeader *header = tny_msg_get_header (TNY_MSG (att_list->data));
+ if (tny_list_get_length (att_list) == 1) {
+ TnyMimePart *part;
+ iter = tny_list_create_iterator (att_list);
+ part = (TnyMimePart *) tny_iterator_get_current (iter);
+ g_object_unref (iter);
+ if (TNY_IS_MSG (part)) {
+ TnyHeader *header = tny_msg_get_header (TNY_MSG (part));
if (header) {
filename = g_strdup (tny_header_get_subject (header));
g_object_unref (header);
if (header) {
filename = g_strdup (tny_header_get_subject (header));
g_object_unref (header);
filename = g_strdup (_("mail_va_no_subject"));
}
} else {
filename = g_strdup (_("mail_va_no_subject"));
}
} else {
- filename = g_strdup (tny_mime_part_get_filename (TNY_MIME_PART (att_list->data)));
+ filename = g_strdup (tny_mime_part_get_filename (TNY_MIME_PART (part)));
} else {
filename = g_strdup ("");
}
message = g_strdup_printf (ngettext("emev_nc_delete_attachment", "emev_nc_delete_attachments",
} else {
filename = g_strdup ("");
}
message = g_strdup_printf (ngettext("emev_nc_delete_attachment", "emev_nc_delete_attachments",
- att_list->next == NULL), filename);
+ (tny_list_get_length (att_list) == 1)), filename);
g_free (filename);
confirmation_dialog = hildon_note_new_confirmation (GTK_WINDOW (window), message);
g_free (message);
dialog_response = (gtk_dialog_run (GTK_DIALOG (confirmation_dialog))==GTK_RESPONSE_OK);
gtk_widget_destroy (confirmation_dialog);
if (!dialog_response) {
g_free (filename);
confirmation_dialog = hildon_note_new_confirmation (GTK_WINDOW (window), message);
g_free (message);
dialog_response = (gtk_dialog_run (GTK_DIALOG (confirmation_dialog))==GTK_RESPONSE_OK);
gtk_widget_destroy (confirmation_dialog);
if (!dialog_response) {
- if (clean_list)
- g_list_free (att_list);
+ g_object_unref (att_list);
return;
}
hildon_banner_show_information (NULL, NULL, _("mcen_ib_removing_attachment"));
return;
}
hildon_banner_show_information (NULL, NULL, _("mcen_ib_removing_attachment"));
-
- for (node = att_list; node != NULL; node = g_list_next (node)) {
- TnyMimePart *mime_part = (TnyMimePart *) node->data;
+
+ for (iter = tny_list_create_iterator (att_list);
+ !tny_iterator_is_done (iter);
+ tny_iterator_next (iter)) {
+ TnyMimePart *mime_part = (TnyMimePart *) tny_iterator_get_current (iter);
- priv->attachments = g_list_remove (priv->attachments, mime_part);
+ tny_list_remove (priv->attachments, (GObject *) mime_part);
modest_attachments_view_remove_attachment (MODEST_ATTACHMENTS_VIEW (priv->attachments_view),
mime_part);
modest_attachments_view_remove_attachment (MODEST_ATTACHMENTS_VIEW (priv->attachments_view),
mime_part);
- if (priv->attachments == NULL)
+ if (tny_list_get_length (priv->attachments) == 0)
gtk_widget_hide (priv->attachments_caption);
att_id = tny_mime_part_get_content_id (mime_part);
if (att_id != NULL)
text_buffer_delete_images_by_id (gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->msg_body)),
att_id);
gtk_widget_hide (priv->attachments_caption);
att_id = tny_mime_part_get_content_id (mime_part);
if (att_id != NULL)
text_buffer_delete_images_by_id (gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->msg_body)),
att_id);
- g_object_unref (mime_part);
gtk_text_buffer_set_modified (priv->text_buffer, TRUE);
gtk_text_buffer_set_modified (priv->text_buffer, TRUE);
+ g_object_unref (mime_part);
- if (clean_list)
- g_list_free (att_list);
+ g_object_unref (att_list);
/* if the last attachment has been removed, focus the Subject: field */
if (!modest_attachments_view_has_attachments (MODEST_ATTACHMENTS_VIEW (priv->attachments_view)))
/* if the last attachment has been removed, focus the Subject: field */
if (!modest_attachments_view_has_attachments (MODEST_ATTACHMENTS_VIEW (priv->attachments_view)))
ModestMsgEditWindowPrivate *priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE (window);
g_return_if_fail (TNY_IS_MIME_PART (part));
ModestMsgEditWindowPrivate *priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE (window);
g_return_if_fail (TNY_IS_MIME_PART (part));
- priv->attachments = g_list_prepend (priv->attachments, part);
- g_object_ref (part);
+ tny_list_prepend (priv->attachments, (GObject *) part);
modest_attachments_view_add_attachment (MODEST_ATTACHMENTS_VIEW (priv->attachments_view), part);
gtk_widget_set_no_show_all (priv->attachments_caption, FALSE);
gtk_widget_show_all (priv->attachments_caption);
modest_attachments_view_add_attachment (MODEST_ATTACHMENTS_VIEW (priv->attachments_view), part);
gtk_widget_set_no_show_all (priv->attachments_caption, FALSE);
gtk_widget_show_all (priv->attachments_caption);
modest_msg_view_window_get_attachments (ModestMsgViewWindow *win)
{
ModestMsgViewWindowPrivate *priv;
modest_msg_view_window_get_attachments (ModestMsgViewWindow *win)
{
ModestMsgViewWindowPrivate *priv;
- GList *selected_attachments = NULL;
+ TnyList *selected_attachments = NULL;
g_return_val_if_fail (MODEST_IS_MSG_VIEW_WINDOW (win), NULL);
priv = MODEST_MSG_VIEW_WINDOW_GET_PRIVATE (win);
g_return_val_if_fail (MODEST_IS_MSG_VIEW_WINDOW (win), NULL);
priv = MODEST_MSG_VIEW_WINDOW_GET_PRIVATE (win);
const gchar *msg_uid;
gchar *attachment_uid = NULL;
gint attachment_index = 0;
const gchar *msg_uid;
gchar *attachment_uid = NULL;
gint attachment_index = 0;
g_return_if_fail (MODEST_IS_MSG_VIEW_WINDOW (window));
g_return_if_fail (TNY_IS_MIME_PART (mime_part) || (mime_part == NULL));
g_return_if_fail (MODEST_IS_MSG_VIEW_WINDOW (window));
g_return_if_fail (TNY_IS_MIME_PART (mime_part) || (mime_part == NULL));
msg_uid = modest_msg_view_window_get_message_uid (MODEST_MSG_VIEW_WINDOW (window));
attachments = modest_msg_view_get_attachments (MODEST_MSG_VIEW (priv->msg_view));
msg_uid = modest_msg_view_window_get_message_uid (MODEST_MSG_VIEW_WINDOW (window));
attachments = modest_msg_view_get_attachments (MODEST_MSG_VIEW (priv->msg_view));
- attachment_index = g_list_index (attachments, mime_part);
- g_list_free (attachments);
+ attachment_index = modest_list_index (attachments, (GObject *) mime_part);
+ g_object_unref (attachments);
if (msg_uid && attachment_index >= 0) {
attachment_uid = g_strdup_printf ("%s/%d", msg_uid, attachment_index);
if (msg_uid && attachment_index >= 0) {
attachment_uid = g_strdup_printf ("%s/%d", msg_uid, attachment_index);
if (mime_part == NULL) {
gboolean error = FALSE;
if (mime_part == NULL) {
gboolean error = FALSE;
- GList *selected_attachments = modest_msg_view_get_selected_attachments (MODEST_MSG_VIEW (priv->msg_view));
- if (selected_attachments == NULL) {
+ TnyList *selected_attachments = modest_msg_view_get_selected_attachments (MODEST_MSG_VIEW (priv->msg_view));
+ if (selected_attachments == NULL || tny_list_get_length (selected_attachments) == 0) {
- } else if (g_list_length (selected_attachments) > 1) {
+ } else if (tny_list_get_length (selected_attachments) > 1) {
hildon_banner_show_information (NULL, NULL, _("mcen_ib_unable_to_display_more"));
error = TRUE;
} else {
hildon_banner_show_information (NULL, NULL, _("mcen_ib_unable_to_display_more"));
error = TRUE;
} else {
- mime_part = (TnyMimePart *) selected_attachments->data;
- g_object_ref (mime_part);
+ TnyIterator *iter;
+ iter = tny_list_create_iterator (selected_attachments);
+ mime_part = (TnyMimePart *) tny_iterator_get_current (iter);
+ g_object_unref (iter);
- g_list_foreach (selected_attachments, (GFunc) g_object_unref, NULL);
- g_list_free (selected_attachments);
+ g_object_unref (selected_attachments);
-modest_msg_view_window_save_attachments (ModestMsgViewWindow *window, GList *mime_parts)
+modest_msg_view_window_save_attachments (ModestMsgViewWindow *window, TnyList *mime_parts)
- gboolean clean_list = FALSE;
ModestMsgViewWindowPrivate *priv;
GList *files_to_save = NULL;
GtkWidget *save_dialog = NULL;
ModestMsgViewWindowPrivate *priv;
GList *files_to_save = NULL;
GtkWidget *save_dialog = NULL;
if (mime_parts == NULL) {
mime_parts = modest_msg_view_get_selected_attachments (MODEST_MSG_VIEW (priv->msg_view));
if (mime_parts == NULL) {
mime_parts = modest_msg_view_get_selected_attachments (MODEST_MSG_VIEW (priv->msg_view));
- if (mime_parts == NULL)
+ if (mime_parts == NULL || tny_list_get_length (mime_parts) == 0)
+ } else {
+ g_object_ref (mime_parts);
- if (mime_parts->next == NULL) {
+ if (tny_list_get_length (mime_parts) == 1) {
+ TnyIterator *iter;
/* only one attachment selected */
/* only one attachment selected */
- TnyMimePart *mime_part = (TnyMimePart *) mime_parts->data;
+ iter = tny_list_create_iterator (mime_parts);
+ TnyMimePart *mime_part = (TnyMimePart *) tny_iterator_get_current (iter);
+ g_object_unref (iter);
if (!TNY_IS_MSG (mime_part) && tny_mime_part_is_attachment (mime_part)) {
filename = tny_mime_part_get_filename (mime_part);
} else {
g_warning ("Tried to save a non-file attachment");
canceled = TRUE;
}
if (!TNY_IS_MSG (mime_part) && tny_mime_part_is_attachment (mime_part)) {
filename = tny_mime_part_get_filename (mime_part);
} else {
g_warning ("Tried to save a non-file attachment");
canceled = TRUE;
}
+ g_object_unref (mime_part);
} else {
save_multiple_str = g_strdup_printf (_FM("sfil_va_number_of_objects_attachments"),
} else {
save_multiple_str = g_strdup_printf (_FM("sfil_va_number_of_objects_attachments"),
- g_list_length (mime_parts));
+ tny_list_get_length (mime_parts));
}
save_dialog = hildon_file_chooser_dialog_new (GTK_WINDOW (window),
}
save_dialog = hildon_file_chooser_dialog_new (GTK_WINDOW (window),
hildon_banner_show_information
(NULL, NULL, dgettext("hildon-fm", "sfil_ib_readonly_location"));
} else {
hildon_banner_show_information
(NULL, NULL, dgettext("hildon-fm", "sfil_ib_readonly_location"));
} else {
- for (node = mime_parts; node != NULL; node = g_list_next (node)) {
- TnyMimePart *mime_part = (TnyMimePart *) node->data;
-
+ iter = tny_list_create_iterator (mime_parts);
+ while (!tny_iterator_is_done (iter)) {
+ TnyMimePart *mime_part = (TnyMimePart *) tny_iterator_get_current (iter);
+
+ tny_iterator_next (iter);
if (tny_mime_part_is_attachment (mime_part)) {
SaveMimePartPair *pair;
if (tny_mime_part_is_attachment (mime_part)) {
SaveMimePartPair *pair;
- if ((mime_parts->next != NULL) &&
- (tny_mime_part_get_filename (mime_part) == NULL))
+ if ((!tny_iterator_is_done (iter)) &&
+ (tny_mime_part_get_filename (mime_part) == NULL)) {
+ g_object_unref (mime_part);
pair = g_slice_new0 (SaveMimePartPair);
pair = g_slice_new0 (SaveMimePartPair);
- if (mime_parts->next == NULL) {
+ if (tny_iterator_is_done (iter)) {
pair->filename = g_strdup (chooser_uri);
} else {
pair->filename =
g_build_filename (chooser_uri,
tny_mime_part_get_filename (mime_part), NULL);
}
pair->filename = g_strdup (chooser_uri);
} else {
pair->filename =
g_build_filename (chooser_uri,
tny_mime_part_get_filename (mime_part), NULL);
}
- pair->part = g_object_ref (mime_part);
+ pair->part = mime_part;
files_to_save = g_list_prepend (files_to_save, pair);
}
}
files_to_save = g_list_prepend (files_to_save, pair);
}
}
}
g_free (chooser_uri);
}
gtk_widget_destroy (save_dialog);
}
g_free (chooser_uri);
}
gtk_widget_destroy (save_dialog);
- if (clean_list) {
- g_list_foreach (mime_parts, (GFunc) g_object_unref, NULL);
- g_list_free (mime_parts);
- }
+ g_object_unref (mime_parts);
if (files_to_save != NULL) {
SaveMimePartInfo *info = g_slice_new0 (SaveMimePartInfo);
if (files_to_save != NULL) {
SaveMimePartInfo *info = g_slice_new0 (SaveMimePartInfo);
modest_msg_view_window_remove_attachments (ModestMsgViewWindow *window, gboolean get_all)
{
ModestMsgViewWindowPrivate *priv;
modest_msg_view_window_remove_attachments (ModestMsgViewWindow *window, gboolean get_all)
{
ModestMsgViewWindowPrivate *priv;
- GList *mime_parts = NULL, *node;
+ TnyList *mime_parts = NULL;
gchar *confirmation_message;
gint response;
gint n_attachments;
TnyMsg *msg;
gchar *confirmation_message;
gint response;
gint n_attachments;
TnyMsg *msg;
/* TnyFolder *folder; */
g_return_if_fail (MODEST_IS_MSG_VIEW_WINDOW (window));
/* TnyFolder *folder; */
g_return_if_fail (MODEST_IS_MSG_VIEW_WINDOW (window));
mime_parts = modest_msg_view_get_selected_attachments (MODEST_MSG_VIEW (priv->msg_view));
/* Remove already purged messages from mime parts list */
mime_parts = modest_msg_view_get_selected_attachments (MODEST_MSG_VIEW (priv->msg_view));
/* Remove already purged messages from mime parts list */
- node = mime_parts;
- while (node != NULL) {
- TnyMimePart *part = TNY_MIME_PART (node->data);
+ iter = tny_list_create_iterator (mime_parts);
+ while (!tny_iterator_is_done (iter)) {
+ TnyMimePart *part = TNY_MIME_PART (tny_iterator_get_current (iter));
+ tny_iterator_next (iter);
if (tny_mime_part_is_purged (part)) {
if (tny_mime_part_is_purged (part)) {
- GList *deleted_node = node;
- node = g_list_next (node);
- g_object_unref (part);
- mime_parts = g_list_delete_link (mime_parts, deleted_node);
- } else {
- node = g_list_next (node);
+ tny_list_remove (mime_parts, (GObject *) part);
- if (mime_parts == NULL)
+ if (tny_list_get_length (mime_parts) == 0) {
+ g_object_unref (mime_parts);
- n_attachments = g_list_length (mime_parts);
+ n_attachments = tny_list_get_length (mime_parts);
if (n_attachments == 1) {
const gchar *filename;
if (n_attachments == 1) {
const gchar *filename;
- if (TNY_IS_MSG (mime_parts->data)) {
+ iter = tny_list_create_iterator (mime_parts);
+ part = (TnyMimePart *) tny_iterator_get_current (iter);
+ g_object_unref (iter);
+ if (TNY_IS_MSG (part)) {
- header = tny_msg_get_header (TNY_MSG (mime_parts->data));
+ header = tny_msg_get_header (TNY_MSG (part));
filename = tny_header_get_subject (header);
g_object_unref (header);
if (filename == NULL)
filename = _("mail_va_no_subject");
} else {
filename = tny_header_get_subject (header);
g_object_unref (header);
if (filename == NULL)
filename = _("mail_va_no_subject");
} else {
- filename = tny_mime_part_get_filename (TNY_MIME_PART (mime_parts->data));
+ filename = tny_mime_part_get_filename (TNY_MIME_PART (part));
}
confirmation_message = g_strdup_printf (_("mcen_nc_purge_file_text"), filename);
}
confirmation_message = g_strdup_printf (_("mcen_nc_purge_file_text"), filename);
} else {
confirmation_message = g_strdup_printf (ngettext("mcen_nc_purge_file_text",
"mcen_nc_purge_files_text",
} else {
confirmation_message = g_strdup_printf (ngettext("mcen_nc_purge_file_text",
"mcen_nc_purge_files_text",
confirmation_message);
g_free (confirmation_message);
confirmation_message);
g_free (confirmation_message);
- if (response != GTK_RESPONSE_OK)
+ if (response != GTK_RESPONSE_OK) {
+ g_object_unref (mime_parts);
priv->purge_timeout = g_timeout_add (2000, show_remove_attachment_information, window);
/* folder = tny_msg_get_folder (msg); */
priv->purge_timeout = g_timeout_add (2000, show_remove_attachment_information, window);
/* folder = tny_msg_get_folder (msg); */
/* tny_folder_refresh (folder, NULL); */
/* g_object_unref (folder); */
/* tny_folder_refresh (folder, NULL); */
/* g_object_unref (folder); */
- for (node = mime_parts; node != NULL; node = g_list_next (node)) {
- tny_mime_part_set_purged (TNY_MIME_PART (node->data));
+ iter = tny_list_create_iterator (mime_parts);
+ while (!tny_iterator_is_done (iter)) {
+ TnyMimePart *part;
+
+ part = (TnyMimePart *) tny_iterator_get_current (iter);
+ tny_mime_part_set_purged (TNY_MIME_PART (part));
/* modest_msg_view_remove_attachment (MODEST_MSG_VIEW (priv->msg_view), node->data); */
/* modest_msg_view_remove_attachment (MODEST_MSG_VIEW (priv->msg_view), node->data); */
+ g_object_unref (part);
+ tny_iterator_next (iter);
msg = tny_msg_view_get_msg (TNY_MSG_VIEW (priv->msg_view));
tny_msg_view_clear (TNY_MSG_VIEW (priv->msg_view));
tny_msg_rewrite_cache (msg);
tny_msg_view_set_msg (TNY_MSG_VIEW (priv->msg_view), msg);
msg = tny_msg_view_get_msg (TNY_MSG_VIEW (priv->msg_view));
tny_msg_view_clear (TNY_MSG_VIEW (priv->msg_view));
tny_msg_rewrite_cache (msg);
tny_msg_view_set_msg (TNY_MSG_VIEW (priv->msg_view), msg);
- g_list_foreach (mime_parts, (GFunc) g_object_unref, NULL);
- g_list_free (mime_parts);
+ g_object_unref (mime_parts);
if (priv->purge_timeout > 0) {
g_source_remove (priv->purge_timeout);
if (priv->purge_timeout > 0) {
g_source_remove (priv->purge_timeout);
add_attachments (TNY_MIME_PART (new_msg), attachments_list, FALSE);
/* Clean */
add_attachments (TNY_MIME_PART (new_msg), attachments_list, FALSE);
/* Clean */
+ if (attachments_list) {
+ g_list_foreach (attachments_list, (GFunc) g_object_unref, NULL);
g_list_free (attachments_list);
g_list_free (attachments_list);
g_object_unref (G_OBJECT (parts));
return new_msg;
g_object_unref (G_OBJECT (parts));
return new_msg;
from = modest_account_mgr_get_from_string (account_mgr, account_name);
/* Create the mail operation */
from = modest_account_mgr_get_from_string (account_mgr, account_name);
/* Create the mail operation */
- mail_operation = modest_mail_operation_new (G_OBJECT(edit_window));
+ mail_operation = modest_mail_operation_new (NULL);
modest_mail_operation_queue_add (modest_runtime_get_mail_operation_queue (), mail_operation);
modest_mail_operation_save_to_drafts (mail_operation,
modest_mail_operation_queue_add (modest_runtime_get_mail_operation_queue (), mail_operation);
modest_mail_operation_save_to_drafts (mail_operation,
ModestAccountMgr *account_mgr = modest_runtime_get_account_mgr();
gchar *account_name = g_strdup (data->account_name);
if (!account_name)
ModestAccountMgr *account_mgr = modest_runtime_get_account_mgr();
gchar *account_name = g_strdup (data->account_name);
if (!account_name)
- g_strdup(modest_window_get_active_account (MODEST_WINDOW(edit_window)));
+ account_name = g_strdup(modest_window_get_active_account (MODEST_WINDOW(edit_window)));
if (!account_name)
account_name = modest_account_mgr_get_default_account (account_mgr);
if (!account_name)
account_name = modest_account_mgr_get_default_account (account_mgr);
if (!account_name) {
modest_msg_edit_window_free_msg_data (edit_window, data);
/* Run account setup wizard */
if (!account_name) {
modest_msg_edit_window_free_msg_data (edit_window, data);
/* Run account setup wizard */
- if (!modest_ui_actions_run_account_setup_wizard (MODEST_WINDOW(edit_window)))
+ if (!modest_ui_actions_run_account_setup_wizard (MODEST_WINDOW(edit_window))) {
}
/* Get the currently-active transport account for this modest account: */
}
/* Get the currently-active transport account for this modest account: */
}
if (!transport_account) {
}
if (!transport_account) {
+ modest_msg_edit_window_free_msg_data (edit_window, data);
/* Run account setup wizard */
if (!modest_ui_actions_run_account_setup_wizard(MODEST_WINDOW(edit_window)))
return;
/* Run account setup wizard */
if (!modest_ui_actions_run_account_setup_wizard(MODEST_WINDOW(edit_window)))
return;
gchar *from = modest_account_mgr_get_from_string (account_mgr, account_name);
/* Create the mail operation */
gchar *from = modest_account_mgr_get_from_string (account_mgr, account_name);
/* Create the mail operation */
- ModestMailOperation *mail_operation = modest_mail_operation_new (G_OBJECT(edit_window));
+ ModestMailOperation *mail_operation = modest_mail_operation_new (NULL);
modest_mail_operation_queue_add (modest_runtime_get_mail_operation_queue (), mail_operation);
modest_mail_operation_send_new_mail (mail_operation,
modest_mail_operation_queue_add (modest_runtime_get_mail_operation_queue (), mail_operation);
modest_mail_operation_send_new_mail (mail_operation,
state = modest_window_get_dimming_state (win);
if (!dimmed) {
state = modest_window_get_dimming_state (win);
if (!dimmed) {
- GList *selected_attachments = NULL;
+ TnyList *selected_attachments = NULL;
gint n_att_selected = 0;
GtkWidget *attachments_view;
attachments_view = modest_msg_edit_window_get_child_widget (
gint n_att_selected = 0;
GtkWidget *attachments_view;
attachments_view = modest_msg_edit_window_get_child_widget (
selected_attachments = modest_attachments_view_get_selection (
MODEST_ATTACHMENTS_VIEW (attachments_view));
selected_attachments = modest_attachments_view_get_selection (
MODEST_ATTACHMENTS_VIEW (attachments_view));
- n_att_selected = g_list_length (selected_attachments);
- g_list_free (selected_attachments);
+ n_att_selected = tny_list_get_length (selected_attachments);
+ g_object_unref (selected_attachments);
dimmed = (n_att_selected != 1);
}
dimmed = (n_att_selected != 1);
}
gboolean for_remove,
ModestDimmingRule *rule)
{
gboolean for_remove,
ModestDimmingRule *rule)
{
- GList *attachments, *node;
gint n_selected;
TnyHeaderFlags flags;
gboolean nested_attachments = FALSE;
gint n_selected;
TnyHeaderFlags flags;
gboolean nested_attachments = FALSE;
/* Get selected atachments */
attachments = modest_msg_view_window_get_attachments (MODEST_MSG_VIEW_WINDOW(win));
/* Get selected atachments */
attachments = modest_msg_view_window_get_attachments (MODEST_MSG_VIEW_WINDOW(win));
- n_selected = g_list_length (attachments);
+ n_selected = tny_list_get_length (attachments);
/* Check unique */
if (!result) {
/* Check unique */
if (!result) {
/* Check attached type (view operation not required) */
if (!result && !for_view) {
/* Check attached type (view operation not required) */
if (!result && !for_view) {
- for (node = attachments; node != NULL && !result; node = g_list_next (node)) {
- TnyMimePart *mime_part = TNY_MIME_PART (node->data);
+ TnyIterator *iter;
+ iter = tny_list_create_iterator (attachments);
+ while (!tny_iterator_is_done (iter) && !result) {
+ TnyMimePart *mime_part = TNY_MIME_PART (tny_iterator_get_current (iter));
TnyList *nested_list = tny_simple_list_new ();
if (!for_remove && TNY_IS_MSG (mime_part)) {
selected_messages = TRUE;
TnyList *nested_list = tny_simple_list_new ();
if (!for_remove && TNY_IS_MSG (mime_part)) {
selected_messages = TRUE;
result = TRUE;
}
g_object_unref (nested_list);
result = TRUE;
}
g_object_unref (nested_list);
+ g_object_unref (mime_part);
+ tny_iterator_next (iter);
}
/* Set notifications */
}
/* Set notifications */
- g_list_free (attachments);
+ g_object_unref (attachments);
static gboolean
_purged_attach_selected (ModestWindow *win, gboolean all, ModestDimmingRule *rule)
{
static gboolean
_purged_attach_selected (ModestWindow *win, gboolean all, ModestDimmingRule *rule)
{
- GList *attachments = NULL, *node;
+ TnyList *attachments = NULL;
+ TnyIterator *iter;
gint purged = 0;
gint n_attachments = 0;
gboolean result = FALSE;
gint purged = 0;
gint n_attachments = 0;
gboolean result = FALSE;
if (attachments == NULL)
return FALSE;
if (attachments == NULL)
return FALSE;
- for (node = attachments; node != NULL; node = g_list_next (node)) {
- TnyMimePart *mime_part = TNY_MIME_PART (node->data);
+ if (tny_list_get_length (attachments)) {
+ g_object_unref (attachments);
+ return FALSE;
+ }
+
+ iter = tny_list_create_iterator (attachments);
+ while (!tny_iterator_is_done (iter)) {
+ TnyMimePart *mime_part = TNY_MIME_PART (tny_iterator_get_current (iter));
if (tny_mime_part_is_purged (mime_part)) {
purged++;
}
n_attachments++;
if (tny_mime_part_is_purged (mime_part)) {
purged++;
}
n_attachments++;
+ g_object_unref (mime_part);
+ tny_iterator_next (iter);
- g_list_free (attachments);
+ g_object_unref (attachments);
if (all)
result = (purged == n_attachments);
if (all)
result = (purged == n_attachments);
/* If it's POP then dim */
if (modest_protocol_info_get_transport_store_protocol (proto_str) ==
MODEST_PROTOCOL_STORE_POP) {
/* If it's POP then dim */
if (modest_protocol_info_get_transport_store_protocol (proto_str) ==
MODEST_PROTOCOL_STORE_POP) {
- GList *attachments = NULL;
+ TnyList *attachments = NULL;
gint n_selected = 0;
result = TRUE;
gint n_selected = 0;
result = TRUE;
* murrayc */
if (MODEST_IS_MSG_VIEW_WINDOW (win)) {
attachments = modest_msg_view_window_get_attachments (MODEST_MSG_VIEW_WINDOW(win));
* murrayc */
if (MODEST_IS_MSG_VIEW_WINDOW (win)) {
attachments = modest_msg_view_window_get_attachments (MODEST_MSG_VIEW_WINDOW(win));
- n_selected = g_list_length (attachments);
- g_list_free (attachments);
+ n_selected = tny_list_get_length (attachments);
+ g_object_unref (attachments);
}
modest_dimming_rule_set_notification (rule,
}
modest_dimming_rule_set_notification (rule,
+
+gint
+modest_list_index (TnyList *list, GObject *object)
+{
+ TnyIterator *iter;
+ gint index = 0;
+
+ iter = tny_list_create_iterator (list);
+ while (!tny_iterator_is_done (iter)) {
+ GObject *current = tny_iterator_get_current (iter);
+
+ g_object_unref (current);
+ if (current == object)
+ break;
+
+ tny_iterator_next (iter);
+ index++;
+ }
+
+ if (tny_iterator_is_done (iter))
+ index = -1;
+ g_object_unref (iter);
+ return index;
+}
*/
void modest_utils_toggle_action_set_active_block_notify (GtkToggleAction *action, gboolean value);
*/
void modest_utils_toggle_action_set_active_block_notify (GtkToggleAction *action, gboolean value);
+/**
+ * modest_list_index:
+ * @list: a #TnyList
+ * @object: a #GObject
+ *
+ * finds the index of @object in @list
+ *
+ * Returns: the index of @object, or -1 if @object is not in @list
+ */
+gint modest_list_index (TnyList *list, GObject *object);
+
#endif /*__MODEST_MAEMO_UTILS_H__*/
#endif /*__MODEST_MAEMO_UTILS_H__*/
g_object_unref (priv->mime_part);
}
g_object_unref (priv->mime_part);
}
- priv->mime_part = mime_part;
+ priv->mime_part = g_object_ref (mime_part);
priv->size = 0;
priv->is_purged = tny_mime_part_is_purged (mime_part);
priv->size = 0;
priv->is_purged = tny_mime_part_is_purged (mime_part);
tny_iterator_next (iter);
}
tny_iterator_next (iter);
}
+ g_object_unref (iter);
+ g_object_unref (parts);
+
gtk_widget_queue_draw (GTK_WIDGET (attachments_view));
gtk_widget_queue_draw (GTK_WIDGET (attachments_view));
unselect_all (atts_view);
}
unselect_all (atts_view);
}
modest_attachments_view_get_selection (ModestAttachmentsView *atts_view)
{
ModestAttachmentsViewPrivate *priv;
modest_attachments_view_get_selection (ModestAttachmentsView *atts_view)
{
ModestAttachmentsViewPrivate *priv;
- GList *selection, *node;
+ TnyList *selection;
+ GList *node;
g_return_val_if_fail (MODEST_IS_ATTACHMENTS_VIEW (atts_view), NULL);
priv = MODEST_ATTACHMENTS_VIEW_GET_PRIVATE (atts_view);
g_return_val_if_fail (MODEST_IS_ATTACHMENTS_VIEW (atts_view), NULL);
priv = MODEST_ATTACHMENTS_VIEW_GET_PRIVATE (atts_view);
+ selection = tny_simple_list_new ();
for (node = priv->selected; node != NULL; node = g_list_next (node)) {
ModestAttachmentView *att_view = (ModestAttachmentView *) node->data;
TnyMimePart *part = tny_mime_part_view_get_part (TNY_MIME_PART_VIEW (att_view));
for (node = priv->selected; node != NULL; node = g_list_next (node)) {
ModestAttachmentView *att_view = (ModestAttachmentView *) node->data;
TnyMimePart *part = tny_mime_part_view_get_part (TNY_MIME_PART_VIEW (att_view));
- selection = g_list_append (selection, part);
+ tny_list_append (selection, (GObject *) part);
+ g_object_unref (part);
modest_attachments_view_get_attachments (ModestAttachmentsView *atts_view)
{
ModestAttachmentsViewPrivate *priv;
modest_attachments_view_get_attachments (ModestAttachmentsView *atts_view)
{
ModestAttachmentsViewPrivate *priv;
- GList *children, *node, *att_list = NULL;
+ TnyList *att_list;
+ GList *children, *node= NULL;
g_return_val_if_fail (MODEST_IS_ATTACHMENTS_VIEW (atts_view), NULL);
priv = MODEST_ATTACHMENTS_VIEW_GET_PRIVATE (atts_view);
g_return_val_if_fail (MODEST_IS_ATTACHMENTS_VIEW (atts_view), NULL);
priv = MODEST_ATTACHMENTS_VIEW_GET_PRIVATE (atts_view);
+ att_list = TNY_LIST (tny_simple_list_new ());
+
children = gtk_container_get_children (GTK_CONTAINER (priv->box));
for (node = children; node != NULL; node = g_list_next (node)) {
GtkWidget *att_view = GTK_WIDGET (node->data);
TnyMimePart *mime_part = tny_mime_part_view_get_part (TNY_MIME_PART_VIEW (att_view));
children = gtk_container_get_children (GTK_CONTAINER (priv->box));
for (node = children; node != NULL; node = g_list_next (node)) {
GtkWidget *att_view = GTK_WIDGET (node->data);
TnyMimePart *mime_part = tny_mime_part_view_get_part (TNY_MIME_PART_VIEW (att_view));
- att_list = g_list_prepend (att_list, mime_part);
+ tny_list_append (att_list, (GObject *) mime_part);
+ g_object_unref (mime_part);
}
g_list_free (children);
}
g_list_free (children);
- att_list = g_list_reverse (att_list);
void modest_attachments_view_add_attachment (ModestAttachmentsView *attachments_view, TnyMimePart *part);
void modest_attachments_view_remove_attachment (ModestAttachmentsView *attachments_view, TnyMimePart *part);
void modest_attachments_view_remove_attachment_by_id (ModestAttachmentsView *attachments_view, const gchar *att_id);
void modest_attachments_view_add_attachment (ModestAttachmentsView *attachments_view, TnyMimePart *part);
void modest_attachments_view_remove_attachment (ModestAttachmentsView *attachments_view, TnyMimePart *part);
void modest_attachments_view_remove_attachment_by_id (ModestAttachmentsView *attachments_view, const gchar *att_id);
-GList *modest_attachments_view_get_attachments (ModestAttachmentsView *attachments_view);
-GList *modest_attachments_view_get_selection (ModestAttachmentsView *attachments_view);
+TnyList *modest_attachments_view_get_attachments (ModestAttachmentsView *attachments_view);
+TnyList *modest_attachments_view_get_selection (ModestAttachmentsView *attachments_view);
void modest_attachments_view_select_all (ModestAttachmentsView *attachments_view);
gboolean modest_attachments_view_has_attachments (ModestAttachmentsView *attachments_view);
void modest_attachments_view_select_all (ModestAttachmentsView *attachments_view);
gboolean modest_attachments_view_has_attachments (ModestAttachmentsView *attachments_view);
static GtkShadowType modest_gtkhtml_msg_view_get_shadow_type (ModestMsgView *self);
static TnyHeaderFlags modest_gtkhtml_msg_view_get_priority (ModestMsgView *self);
static void modest_gtkhtml_msg_view_set_priority (ModestMsgView *self, TnyHeaderFlags flags);
static GtkShadowType modest_gtkhtml_msg_view_get_shadow_type (ModestMsgView *self);
static TnyHeaderFlags modest_gtkhtml_msg_view_get_priority (ModestMsgView *self);
static void modest_gtkhtml_msg_view_set_priority (ModestMsgView *self, TnyHeaderFlags flags);
-static GList *modest_gtkhtml_msg_view_get_selected_attachments (ModestMsgView *self);
-static GList *modest_gtkhtml_msg_view_get_attachments (ModestMsgView *self);
+static TnyList *modest_gtkhtml_msg_view_get_selected_attachments (ModestMsgView *self);
+static TnyList *modest_gtkhtml_msg_view_get_attachments (ModestMsgView *self);
static void modest_gtkhtml_msg_view_grab_focus (ModestMsgView *self);
static void modest_gtkhtml_msg_view_remove_attachment (ModestMsgView *view, TnyMimePart *attachment);
static GtkAdjustment *modest_gtkhtml_msg_view_get_vadjustment_default (ModestMsgView *self);
static void modest_gtkhtml_msg_view_grab_focus (ModestMsgView *self);
static void modest_gtkhtml_msg_view_remove_attachment (ModestMsgView *view, TnyMimePart *attachment);
static GtkAdjustment *modest_gtkhtml_msg_view_get_vadjustment_default (ModestMsgView *self);
static GtkShadowType modest_gtkhtml_msg_view_get_shadow_type_default (ModestMsgView *self);
static TnyHeaderFlags modest_gtkhtml_msg_view_get_priority_default (ModestMsgView *self);
static void modest_gtkhtml_msg_view_set_priority_default (ModestMsgView *self, TnyHeaderFlags flags);
static GtkShadowType modest_gtkhtml_msg_view_get_shadow_type_default (ModestMsgView *self);
static TnyHeaderFlags modest_gtkhtml_msg_view_get_priority_default (ModestMsgView *self);
static void modest_gtkhtml_msg_view_set_priority_default (ModestMsgView *self, TnyHeaderFlags flags);
-static GList *modest_gtkhtml_msg_view_get_selected_attachments_default (ModestMsgView *self);
-static GList *modest_gtkhtml_msg_view_get_attachments_default (ModestMsgView *self);
+static TnyList *modest_gtkhtml_msg_view_get_selected_attachments_default (ModestMsgView *self);
+static TnyList *modest_gtkhtml_msg_view_get_attachments_default (ModestMsgView *self);
static void modest_gtkhtml_msg_view_grab_focus_default (ModestMsgView *self);
static void modest_gtkhtml_msg_view_remove_attachment_default (ModestMsgView *view, TnyMimePart *attachment);
static void modest_gtkhtml_msg_view_grab_focus_default (ModestMsgView *self);
static void modest_gtkhtml_msg_view_remove_attachment_default (ModestMsgView *view, TnyMimePart *attachment);
static GtkShadowType get_shadow_type (ModestGtkhtmlMsgView *self);
static TnyHeaderFlags get_priority (ModestGtkhtmlMsgView *self);
static void set_priority (ModestGtkhtmlMsgView *self, TnyHeaderFlags flags);
static GtkShadowType get_shadow_type (ModestGtkhtmlMsgView *self);
static TnyHeaderFlags get_priority (ModestGtkhtmlMsgView *self);
static void set_priority (ModestGtkhtmlMsgView *self, TnyHeaderFlags flags);
-static GList *get_selected_attachments (ModestGtkhtmlMsgView *self);
-static GList *get_attachments (ModestGtkhtmlMsgView *self);
+static TnyList *get_selected_attachments (ModestGtkhtmlMsgView *self);
+static TnyList *get_attachments (ModestGtkhtmlMsgView *self);
static void grab_focus (ModestGtkhtmlMsgView *self);
static void remove_attachment (ModestGtkhtmlMsgView *view, TnyMimePart *attachment);
static void grab_focus (ModestGtkhtmlMsgView *self);
static void remove_attachment (ModestGtkhtmlMsgView *view, TnyMimePart *attachment);
get_selected_attachments (ModestGtkhtmlMsgView *self)
{
ModestGtkhtmlMsgViewPrivate *priv;
get_selected_attachments (ModestGtkhtmlMsgView *self)
{
ModestGtkhtmlMsgViewPrivate *priv;
get_attachments (ModestGtkhtmlMsgView *self)
{
ModestGtkhtmlMsgViewPrivate *priv;
get_attachments (ModestGtkhtmlMsgView *self)
{
ModestGtkhtmlMsgViewPrivate *priv;
return get_priority (MODEST_GTKHTML_MSG_VIEW (self));
}
return get_priority (MODEST_GTKHTML_MSG_VIEW (self));
}
modest_gtkhtml_msg_view_get_selected_attachments (ModestMsgView *self)
{
return MODEST_GTKHTML_MSG_VIEW_GET_CLASS (self)->get_selected_attachments_func (self);
}
modest_gtkhtml_msg_view_get_selected_attachments (ModestMsgView *self)
{
return MODEST_GTKHTML_MSG_VIEW_GET_CLASS (self)->get_selected_attachments_func (self);
}
modest_gtkhtml_msg_view_get_selected_attachments_default (ModestMsgView *self)
{
return get_selected_attachments (MODEST_GTKHTML_MSG_VIEW (self));
}
modest_gtkhtml_msg_view_get_selected_attachments_default (ModestMsgView *self)
{
return get_selected_attachments (MODEST_GTKHTML_MSG_VIEW (self));
}
modest_gtkhtml_msg_view_get_attachments (ModestMsgView *self)
{
return MODEST_GTKHTML_MSG_VIEW_GET_CLASS (self)->get_attachments_func (self);
}
modest_gtkhtml_msg_view_get_attachments (ModestMsgView *self)
{
return MODEST_GTKHTML_MSG_VIEW_GET_CLASS (self)->get_attachments_func (self);
}
modest_gtkhtml_msg_view_get_attachments_default (ModestMsgView *self)
{
return get_attachments (MODEST_GTKHTML_MSG_VIEW (self));
modest_gtkhtml_msg_view_get_attachments_default (ModestMsgView *self)
{
return get_attachments (MODEST_GTKHTML_MSG_VIEW (self));
GtkShadowType (*get_shadow_type_func) (ModestMsgView *self);
TnyHeaderFlags (*get_priority_func) (ModestMsgView *self);
void (*set_priority_func) (ModestMsgView *self, TnyHeaderFlags flags);
GtkShadowType (*get_shadow_type_func) (ModestMsgView *self);
TnyHeaderFlags (*get_priority_func) (ModestMsgView *self);
void (*set_priority_func) (ModestMsgView *self, TnyHeaderFlags flags);
- GList * (*get_selected_attachments_func) (ModestMsgView *self);
- GList * (*get_attachments_func) (ModestMsgView *self);
+ TnyList * (*get_selected_attachments_func) (ModestMsgView *self);
+ TnyList * (*get_attachments_func) (ModestMsgView *self);
void (*grab_focus_func) (ModestMsgView *self);
void (*remove_attachment_func) (ModestMsgView *view, TnyMimePart *attachment);
void (*grab_focus_func) (ModestMsgView *self);
void (*remove_attachment_func) (ModestMsgView *view, TnyMimePart *attachment);
* remove attachments in @att_list, with a confirmation dialog
*/
void modest_msg_edit_window_remove_attachments (ModestMsgEditWindow *window,
* remove attachments in @att_list, with a confirmation dialog
*/
void modest_msg_edit_window_remove_attachments (ModestMsgEditWindow *window,
/**
* modest_msg_edit_window_add_part:
/**
* modest_msg_edit_window_add_part:
*
* Get selected attachments from #ModetMsgView private object.
*/
*
* Get selected attachments from #ModetMsgView private object.
*/
-GList * modest_msg_view_window_get_attachments (ModestMsgViewWindow *win);
+TnyList * modest_msg_view_window_get_attachments (ModestMsgViewWindow *win);
/**
* modest_msg_view_window_save_attachments:
* @window: a #ModestMsgViewWindow
/**
* modest_msg_view_window_save_attachments:
* @window: a #ModestMsgViewWindow
- * @mime_parts: a #GList of #TnyMimePart
+ * @mime_parts: a #TnyList of #TnyMimePart
*
* Save the #TnyMimePart attachments in @mime_parts, or currently selected attachments
* if @mime_parts is %NULL, offering a dialog to the user to choose the location.
*/
void modest_msg_view_window_save_attachments (ModestMsgViewWindow *window,
*
* Save the #TnyMimePart attachments in @mime_parts, or currently selected attachments
* if @mime_parts is %NULL, offering a dialog to the user to choose the location.
*/
void modest_msg_view_window_save_attachments (ModestMsgViewWindow *window,
/**
* modest_msg_view_window_remove_attachments:
/**
* modest_msg_view_window_remove_attachments:
MODEST_MSG_VIEW_GET_IFACE (self)->set_priority_func (self, flags);
}
MODEST_MSG_VIEW_GET_IFACE (self)->set_priority_func (self, flags);
}
modest_msg_view_get_selected_attachments (ModestMsgView *self)
{
return MODEST_MSG_VIEW_GET_IFACE (self)->get_selected_attachments_func (self);
}
modest_msg_view_get_selected_attachments (ModestMsgView *self)
{
return MODEST_MSG_VIEW_GET_IFACE (self)->get_selected_attachments_func (self);
}
modest_msg_view_get_attachments (ModestMsgView *self)
{
return MODEST_MSG_VIEW_GET_IFACE (self)->get_attachments_func (self);
modest_msg_view_get_attachments (ModestMsgView *self)
{
return MODEST_MSG_VIEW_GET_IFACE (self)->get_attachments_func (self);
GtkShadowType (*get_shadow_type_func) (ModestMsgView *self);
TnyHeaderFlags (*get_priority_func) (ModestMsgView *self);
void (*set_priority_func) (ModestMsgView *self, TnyHeaderFlags flags);
GtkShadowType (*get_shadow_type_func) (ModestMsgView *self);
TnyHeaderFlags (*get_priority_func) (ModestMsgView *self);
void (*set_priority_func) (ModestMsgView *self, TnyHeaderFlags flags);
- GList * (*get_selected_attachments_func) (ModestMsgView *self);
- GList * (*get_attachments_func) (ModestMsgView *self);
+ TnyList * (*get_selected_attachments_func) (ModestMsgView *self);
+ TnyList * (*get_attachments_func) (ModestMsgView *self);
void (*grab_focus_func) (ModestMsgView *self);
void (*remove_attachment_func) (ModestMsgView *view, TnyMimePart *attachment);
void (*grab_focus_func) (ModestMsgView *self);
void (*remove_attachment_func) (ModestMsgView *view, TnyMimePart *attachment);
TnyHeaderFlags modest_msg_view_get_priority (ModestMsgView *self);
void modest_msg_view_set_priority (ModestMsgView *self, TnyHeaderFlags flags);
TnyHeaderFlags modest_msg_view_get_priority (ModestMsgView *self);
void modest_msg_view_set_priority (ModestMsgView *self, TnyHeaderFlags flags);
-GList *modest_msg_view_get_selected_attachments (ModestMsgView *self);
-GList *modest_msg_view_get_attachments (ModestMsgView *self);
+TnyList *modest_msg_view_get_selected_attachments (ModestMsgView *self);
+TnyList *modest_msg_view_get_attachments (ModestMsgView *self);
void modest_msg_view_grab_focus (ModestMsgView *self);
void modest_msg_view_remove_attachment (ModestMsgView *view, TnyMimePart *attachment);
void modest_msg_view_grab_focus (ModestMsgView *self);
void modest_msg_view_remove_attachment (ModestMsgView *view, TnyMimePart *attachment);