/* Pick my reference. Nothing to do with the mail operation */
priv->folder = g_object_ref (folder);
- /* no message selected */
+ /* Clear the selection if exists */
+ selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(self));
+ gtk_tree_selection_unselect_all(selection);
g_signal_emit (G_OBJECT(self), signals[HEADER_SELECTED_SIGNAL], 0, NULL);
+ /* create the helper */
info = g_malloc0 (sizeof(SetFolderHelper));
info->header_view = self;
info->cb = callback;
info->user_data = user_data;
- /* bug 57631: Clear the selection if exists */
- selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(self));
- gtk_tree_selection_unselect_all(selection);
-
/* Create the mail operation (source will be the parent widget) */
mail_op = modest_mail_operation_new (MODEST_MAIL_OPERATION_TYPE_RECEIVE, source);
modest_mail_operation_queue_add (modest_runtime_get_mail_operation_queue (),
ModestHeaderViewPrivate *priv = NULL;
TnyFolderChangeChanged changed;
HeadersCountChangedHelper *helper = NULL;
+ TnyFolder *folder = NULL;
changed = tny_folder_change_get_changed (change);
view has changed before this call to the observer
happens */
priv = MODEST_HEADER_VIEW_GET_PRIVATE (MODEST_HEADER_VIEW (self));
- if (tny_folder_change_get_folder (change) != priv->folder)
- return;
+ folder = tny_folder_change_get_folder (change);
+ if (folder != priv->folder)
+ goto frees;
/* Check folder count */
if ((changed & TNY_FOLDER_CHANGE_CHANGED_ADDED_HEADERS) ||
helper = g_slice_new0 (HeadersCountChangedHelper);
helper->self = MODEST_HEADER_VIEW(self);
helper->change = g_object_ref(change);
-
- g_idle_add_full (G_PRIORITY_DEFAULT,
- idle_notify_headers_count_changed,
- helper,
- idle_notify_headers_count_changed_destroy);
+
+/* if (folder != NULL) */
+/* tny_folder_poke_status (folder); */
+
+ idle_notify_headers_count_changed (helper);
+ idle_notify_headers_count_changed_destroy (helper);
}
+
+ /* Free */
+ frees:
+ if (folder != NULL)
+ g_object_unref (folder);
}
gboolean