#include <gtk/gtk.h>
#include <tny-list.h>
-#include <tny-account-store-iface.h>
-#include <tny-list-iface.h>
+#include <tny-account-store.h>
+#include <tny-list.h>
+#include <tny-simple-list.h>
#include "modest-conf.h"
#include "modest-account-mgr.h"
static GOptionEntry options[] = {
{ "debug", 'd', 0, G_OPTION_ARG_NONE, &debug,
- "Run in debug mode" },
+ "Run in debug mode", NULL},
{ "mailto", 'm', 0, G_OPTION_ARG_STRING, &mailto,
- "New email to <addresses> (comma-separated)"},
+ "New email to <addresses> (comma-separated)", NULL},
{ "subject", 's', 0, G_OPTION_ARG_STRING, &subject,
- "Subject for a new mail"},
+ "Subject for a new mail", NULL},
{ "body", 'b', 0, G_OPTION_ARG_STRING, &body,
- "Body for a new email"},
+ "Body for a new email", NULL},
{ "cc", 'c', 0, G_OPTION_ARG_STRING, &cc,
- "Cc: addresses for a new mail (comma-separated)"},
+ "Cc: addresses for a new mail (comma-separated)", NULL},
{ "bcc", 'x', 0, G_OPTION_ARG_STRING, &bcc,
- "Bcc: addresses for a new mail (comma-separated)"},
+ "Bcc: addresses for a new mail (comma-separated)", NULL},
{ "batch", 'y', 0, G_OPTION_ARG_NONE, &batch,
- "Run in batch mode (don't show UI)"},
- { NULL }
+ "Run in batch mode (don't show UI)", NULL},
+ { NULL, 0, 0, 0, NULL, NULL, NULL }
};
g_type_init ();
ModestAccountMgr *acc_mgr = NULL;
ModestTnyAccountStore *acc_store = NULL;
- TnyListIface *accounts = NULL;
- TnyIteratorIface *iter = NULL;
- TnyTransportAccountIface *account = NULL;
+ TnyList *accounts = NULL;
+ TnyIterator *iter = NULL;
+ TnyTransportAccount *account = NULL;
int retval;
acc_mgr = modest_account_mgr_new (conf);
acc_store = modest_tny_account_store_new (acc_mgr);
- accounts = TNY_LIST_IFACE(tny_list_new ());
- tny_account_store_iface_get_accounts (TNY_ACCOUNT_STORE_IFACE(acc_store), accounts,
- TNY_ACCOUNT_STORE_IFACE_TRANSPORT_ACCOUNTS);
+ accounts = TNY_LIST(tny_simple_list_new ());
+ tny_account_store_get_accounts (TNY_ACCOUNT_STORE(acc_store), accounts,
+ TNY_ACCOUNT_STORE_TRANSPORT_ACCOUNTS);
- iter = tny_list_iface_create_iterator(accounts);
- tny_iterator_iface_first (iter);
- if (tny_iterator_iface_is_done (iter)) {
+ iter = tny_list_create_iterator(accounts);
+ tny_iterator_first (iter);
+ if (tny_iterator_is_done (iter)) {
g_printerr("modest: no transport accounts defined\n");
retval = MODEST_ERR_SEND;
goto cleanup;
}
- account = TNY_TRANSPORT_ACCOUNT_IFACE (tny_iterator_iface_current(iter));
+ account = TNY_TRANSPORT_ACCOUNT (tny_iterator_get_current(iter));
- if (!modest_tny_transport_actions_send_message ( account,
+ if (!modest_tny_transport_actions_send_message (account,
"<>", mailto, cc, bcc, subject, body,
NULL)) {
retval = MODEST_ERR_SEND;