X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fwidgets%2Fmodest-msg-view-window.c;h=d36cebe824561e120e7620e0b3e9654225fa8ed0;hb=2c7c0e311cf57d4c11d1666b04533cca6a00a880;hp=ab14268d6ee8d3b523f57e6e1e6ab039a9a47cee;hpb=1627fed39da6170e55f9e0616d3fa493986fa084;p=modest diff --git a/src/widgets/modest-msg-view-window.c b/src/widgets/modest-msg-view-window.c index ab14268..d36cebe 100644 --- a/src/widgets/modest-msg-view-window.c +++ b/src/widgets/modest-msg-view-window.c @@ -283,7 +283,7 @@ static const GtkToggleActionEntry msg_view_toggle_action_entries [] = { MODEST_TYPE_MSG_VIEW_WINDOW, \ ModestMsgViewWindowPrivate)) /* globals */ -static GtkWindowClass *parent_class = NULL; +static ModestWindowParentClass *parent_class = NULL; /* uncomment the following if you have defined any signals */ static guint signals[LAST_SIGNAL] = {0}; @@ -579,7 +579,6 @@ init_window (ModestMsgViewWindow *obj) "horizontal-max-overshoot", 0, NULL); gtk_container_add (GTK_CONTAINER (priv->main_scroll), priv->msg_view); - g_object_ref (priv->msg_view); gtk_box_pack_start (GTK_BOX(main_vbox), priv->main_scroll, TRUE, TRUE, 0); gtk_container_add (GTK_CONTAINER(obj), main_vbox); @@ -659,7 +658,6 @@ modest_msg_view_window_finalize (GObject *obj) /* Sanity check: shouldn't be needed, the window mgr should call this function before */ modest_msg_view_window_disconnect_signals (MODEST_WINDOW (obj)); - g_object_unref (priv->msg_view); if (priv->fetch_image_redraw_handler > 0) { g_source_remove (priv->fetch_image_redraw_handler); @@ -2230,10 +2228,10 @@ view_msg_cb (ModestMailOperation *mail_op, modest_window_mgr_unregister_header (modest_runtime_get_window_mgr (), header); row_reference = (GtkTreeRowReference *) user_data; - if (canceled) { + self = (ModestMsgViewWindow *) modest_mail_operation_get_source (mail_op); + if (canceled || !self || MODEST_MSG_VIEW_WINDOW_GET_PRIVATE (self)->msg_view == NULL ) { if (row_reference) gtk_tree_row_reference_free (row_reference); - self = (ModestMsgViewWindow *) modest_mail_operation_get_source (mail_op); if (self) { /* Restore window title */ update_window_title (self); @@ -2247,7 +2245,6 @@ view_msg_cb (ModestMailOperation *mail_op, if (!modest_ui_actions_msg_retrieval_check (mail_op, header, msg)) { if (row_reference) gtk_tree_row_reference_free (row_reference); - self = (ModestMsgViewWindow *) modest_mail_operation_get_source (mail_op); if (self) { priv = MODEST_MSG_VIEW_WINDOW_GET_PRIVATE (self); /* First we check if the parent is a folder window */ @@ -2311,7 +2308,6 @@ view_msg_cb (ModestMailOperation *mail_op, } /* Get the window */ - self = (ModestMsgViewWindow *) modest_mail_operation_get_source (mail_op); g_return_if_fail (MODEST_IS_MSG_VIEW_WINDOW (self)); priv = MODEST_MSG_VIEW_WINDOW_GET_PRIVATE (self); @@ -2779,7 +2775,7 @@ on_decode_to_stream_async_handler (TnyMimePart *mime_part, account = modest_account_mgr_get_default_account (modest_runtime_get_account_mgr ()); msg = tny_camel_msg_new (); - tny_camel_msg_parse (TNY_CAMEL_MSG (msg), file_stream); + tny_camel_msg_parse (msg, file_stream); if (priv->top_msg) top_msg = g_object_ref (priv->top_msg);