#include <tny-list.h>
#include <tny-simple-list.h>
+#include "config.h"
#include "modest-conf.h"
#include "modest-account-mgr.h"
#include "modest-ui.h"
#include "modest-icon-factory.h"
#include "modest-tny-account-store.h"
#include "modest-tny-platform-factory.h"
+#include "modest-mail-operation.h"
-#ifdef MODEST_ENABLE_HILDON /* Hildon includes */
+#if MODEST_PLATFORM_ID==2
#include <libosso.h>
-#endif /* MODEST_ENABLE_HILDON */
+#endif /* MODEST_PLATFORM==2 */
/* return values */
#define MODEST_ERR_NONE 0
{ NULL, 0, 0, 0, NULL, NULL, NULL }
};
- g_type_init ();
+ bindtextdomain (GETTEXT_PACKAGE, MODESTLOCALEDIR);
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+ textdomain (GETTEXT_PACKAGE);
+
+ g_type_init ();
+ g_thread_init (NULL);
context = g_option_context_new (NULL);
g_option_context_add_main_entries (context, options, NULL);
static gboolean
hildon_init ()
{
-#ifdef MODEST_ENABLE_HILDON
-
+#if MODEST_PLATFORM_ID==2
+
osso_context_t *osso_context =
osso_initialize(PACKAGE, PACKAGE_VERSION,
TRUE, NULL);
return FALSE;
}
-#endif /* MODEST_ENABLE_HILDON */
+
+#endif /* MODEST_PLATFORM_ID==2 */
return TRUE;
}
ModestAccountMgr *acc_mgr = NULL;
TnyPlatformFactory *fact = NULL;
TnyAccountStore *acc_store = NULL;
+ ModestMailOperation *mail_operation;
TnyList *accounts = NULL;
TnyIterator *iter = NULL;
account = TNY_TRANSPORT_ACCOUNT (tny_iterator_get_current(iter));
- if (!modest_mail_operation_send_mail (account,
- "djcb@djcbsoftware.nl", mailto, cc, bcc, subject, body,
- NULL)) {
+ mail_operation = modest_mail_operation_new ();
+
+ modest_mail_operation_send_new_mail (mail_operation,
+ account,
+ "djcb@djcbsoftware.nl", mailto, cc, bcc,
+ subject, body, NULL);
+
+
+ if (modest_mail_operation_get_status (mail_operation) ==
+ MODEST_MAIL_OPERATION_STATUS_FAILED) {
retval = MODEST_ERR_SEND;
goto cleanup;
} else
retval = MODEST_ERR_NONE; /* hurray! */
cleanup:
- if (iter)
- g_object_unref (G_OBJECT(iter));
- if (accounts)
- g_object_unref (G_OBJECT(accounts));
-
+ if (iter) g_object_unref (G_OBJECT (iter));
+ if (accounts) g_object_unref (G_OBJECT (accounts));
+ if (mail_operation) g_object_unref (G_OBJECT (mail_operation));
+
return retval;
}