GtkWidget *scroll;
guint scroll_drag_timeout_id;
+ gdouble last_upper;
gint last_cid;
TnyList *attachments;
priv->sent = FALSE;
priv->scroll_drag_timeout_id = 0;
+ priv->last_upper = 0.0;
modest_window_mgr_register_help_id (modest_runtime_get_window_mgr(),
GTK_WINDOW(obj),"applications_email_editor");
priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE(w);
+ if (!gtk_widget_is_focus (priv->msg_body))
+ return;
+
insert = gtk_text_buffer_get_insert (priv->text_buffer);
gtk_text_buffer_get_iter_at_mark (priv->text_buffer, &iter, insert);
void vadj_changed (GtkAdjustment *adj,
ModestMsgEditWindow *window)
{
- correct_scroll (window);
+ ModestMsgEditWindowPrivate *priv;
+
+ priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE (window);
+
+ if (priv->last_upper != adj->upper) {
+ priv->last_upper = adj->upper;
+ correct_scroll (window);
+ }
}
static void
}
g_object_unref (part);
}
+ g_object_unref (iter);
}
static void
}
g_object_unref (part);
}
+ g_object_unref (iter);
}
static void
g_object_unref (part);
tny_iterator_next (att_iter);
}
+ g_object_unref (att_iter);
data->priority_flags = priv->priority_flags;
result = gnome_vfs_open (&handle, uri, GNOME_VFS_OPEN_READ);
if (result == GNOME_VFS_OK) {
GdkPixbuf *pixbuf;
- GnomeVFSFileInfo info;
+ GnomeVFSFileInfo *info;
gchar *filename, *basename, *escaped_filename;
TnyMimePart *mime_part;
gchar *content_id;
filename = gnome_vfs_unescape_string_for_display (escaped_filename);
g_free (escaped_filename);
gnome_vfs_uri_unref (vfs_uri);
+ info = gnome_vfs_file_info_new ();
- if (gnome_vfs_get_file_info (uri, &info, GNOME_VFS_FILE_INFO_GET_MIME_TYPE
+ if (gnome_vfs_get_file_info (uri, info, GNOME_VFS_FILE_INFO_GET_MIME_TYPE
| GNOME_VFS_FILE_INFO_FORCE_SLOW_MIME_TYPE)
== GNOME_VFS_OK)
- mime_type = gnome_vfs_file_info_get_mime_type (&info);
+ mime_type = gnome_vfs_file_info_get_mime_type (info);
mime_part = tny_platform_factory_new_mime_part
(modest_runtime_get_platform_factory ());
gtk_text_buffer_set_modified (priv->text_buffer, TRUE);
g_free (filename);
g_object_unref (mime_part);
+ gnome_vfs_file_info_unref (info);
}
}
gchar *escaped_filename;
gchar *filename;
gchar *content_id;
- GnomeVFSFileInfo info;
+ GnomeVFSFileInfo *info;
GnomeVFSURI *vfs_uri;
vfs_uri = gnome_vfs_uri_new (uri);
filename = gnome_vfs_unescape_string_for_display (escaped_filename);
g_free (escaped_filename);
gnome_vfs_uri_unref (vfs_uri);
+
+ info = gnome_vfs_file_info_new ();
if (gnome_vfs_get_file_info (uri,
- &info,
+ info,
GNOME_VFS_FILE_INFO_GET_MIME_TYPE)
== GNOME_VFS_OK)
- mime_type = gnome_vfs_file_info_get_mime_type (&info);
+ mime_type = gnome_vfs_file_info_get_mime_type (info);
mime_part = tny_platform_factory_new_mime_part
(modest_runtime_get_platform_factory ());
stream = TNY_STREAM (tny_vfs_stream_new (handle));
tny_list_prepend (priv->attachments, (GObject *) mime_part);
modest_attachments_view_add_attachment (MODEST_ATTACHMENTS_VIEW (priv->attachments_view),
mime_part,
- info.size == 0, info.size);
+ info->size == 0, info->size);
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);
+ gnome_vfs_file_info_unref (info);
}
}
gtk_text_buffer_set_modified (priv->text_buffer, TRUE);
g_object_unref (mime_part);
}
+ g_object_unref (iter);
}
g_object_unref (att_list);