Re: Added a view for tnymsgheaderiface



On Mon, 2006-05-22 at 21:43 +0200, Philip Van Hoof wrote:

> Or something like this (display all headers):

Oh, to avoid confusion. Rename the variable "headers" to "header_types"
or something like that. It wouldn't be "headers". It would have to be
"header types" (or however they call that): the result wouldn't contain
the values themselves, it would just be a list of available header
types.

I'm not sure whether to ask these types to the tnymsg or the
tnymsgheader.

> GList *headers = tny_msg_header_get_all_types (header);
> while (headers) {
>   gchar *type = headers->data;
>   tny_msg_header_view_iface_set_visible (self, type);
>   headers = g_list_next (headers);
> }
> tny_msg_header_view_iface_set_header (self, header);

So something like this, I'd agree with:

static void
on_show_all_headers_clicked (GtkWidget *menu, gpointer user_data)
{
  TnyMsgViewIface *self = user_data;

  ...

  TnyMsgHeaderIface *header = priv->header;
  TnyMsgHeaderViewIface *headerview = priv->headerview;

  GList *types = tny_msg_header_iface_get_all_types (header);

  while (types) 
  {
    const gchar *type = types->data;
    tny_msg_header_view_iface_add_visible (headerview, type);
    types = g_list_next (types); 
  }

  g_list_free (types);

  tny_msg_header_view_iface_set_header (headerview, header);

}



-- 
Philip Van Hoof, software developer at x-tend 
home: me at pvanhoof dot be 
gnome: pvanhoof at gnome dot org 
work: vanhoof at x-tend dot be 
http://www.pvanhoof.be - http://www.x-tend.be




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]