- int num_cols = g_list_length(cols);
- int sort_ids[num_cols];
- int sort_model_ids[num_cols];
- GtkTreeViewColumn *sort_cols[num_cols];
- for (tmp=cols; tmp; tmp=tmp->next) {
- gint col_id = GPOINTER_TO_INT (g_object_get_data(G_OBJECT(tmp->data), MODEST_HEADER_VIEW_COLUMN));
- switch (col_id) {
- case MODEST_HEADER_VIEW_COLUMN_COMPACT_FLAG:
- sort_key = hildon_sort_dialog_add_sort_key (dialog, _("mcen_li_sort_attachment"));
- sort_ids[sort_key] = col_id;
- sort_model_ids[sort_key] = TNY_HEADER_FLAG_ATTACHMENTS;
- sort_cols[sort_key] = tmp->data;
-
- sort_key = hildon_sort_dialog_add_sort_key (dialog, _("mcen_li_sort_priority"));
- sort_ids[sort_key] = col_id;
- sort_model_ids[sort_key] = TNY_HEADER_FLAG_PRIORITY;
- sort_cols[sort_key] = tmp->data;
- break;
- case MODEST_HEADER_VIEW_COLUMN_COMPACT_HEADER_OUT:
- sort_key = hildon_sort_dialog_add_sort_key (dialog, _("mcen_li_sort_sender_recipient"));
- sort_ids[sort_key] = col_id;
- sort_model_ids[sort_key] = TNY_GTK_HEADER_LIST_MODEL_TO_COLUMN;
- sort_cols[sort_key] = tmp->data;
-
- sort_key = hildon_sort_dialog_add_sort_key (dialog, _("mcen_li_sort_subject"));
- sort_ids[sort_key] = col_id;
- sort_model_ids[sort_key] = TNY_GTK_HEADER_LIST_MODEL_SUBJECT_COLUMN;
- sort_cols[sort_key] = tmp->data;
- break;
- case MODEST_HEADER_VIEW_COLUMN_COMPACT_HEADER_IN:
- sort_key = hildon_sort_dialog_add_sort_key (dialog, _("mcen_li_sort_sender_recipient"));
- sort_ids[sort_key] = col_id;
- sort_model_ids[sort_key] = TNY_GTK_HEADER_LIST_MODEL_FROM_COLUMN;
- sort_cols[sort_key] = tmp->data;
-
- sort_key = hildon_sort_dialog_add_sort_key (dialog, _("mcen_li_sort_subject"));
- sort_ids[sort_key] = col_id;
- sort_model_ids[sort_key] = TNY_GTK_HEADER_LIST_MODEL_SUBJECT_COLUMN;
- sort_cols[sort_key] = tmp->data;
- break;
- case MODEST_HEADER_VIEW_COLUMN_COMPACT_RECEIVED_DATE:
- sort_key = hildon_sort_dialog_add_sort_key (dialog, _("mcen_li_sort_date"));
- sort_ids[sort_key] = col_id;
- sort_model_ids[sort_key] = TNY_GTK_HEADER_LIST_MODEL_DATE_RECEIVED_TIME_T_COLUMN,
- sort_cols[sort_key] = tmp->data;
- default_key = sort_key;
- break;
- case MODEST_HEADER_VIEW_COLUMN_COMPACT_SENT_DATE:
- sort_key = hildon_sort_dialog_add_sort_key (dialog, _("mcen_li_sort_date"));
- sort_ids[sort_key] = col_id;
- sort_model_ids[sort_key] = TNY_GTK_HEADER_LIST_MODEL_DATE_SENT_TIME_T_COLUMN,
- sort_cols[sort_key] = tmp->data;
- default_key = sort_key;
- break;
- default:
- g_printerr ("modest: column (id: %i) not valid", col_id);
- goto frees;
- }