- small cleanups
* modest-tny-account-store.c:
- update to ModestProtocolInfo
pmo-trunk-r622
typedef struct _ModestConf ModestConf;
typedef struct _ModestConfClass ModestConfClass;
typedef struct _ModestConf ModestConf;
typedef struct _ModestConfClass ModestConfClass;
-/* typedef enum _ModestConfEvent ModestConfEvent; */
-/* typedef enum _ModestConfValueType ModestConfValueType; */
typedef enum _ModestConfValueType {
MODEST_CONF_VALUE_INT,
typedef enum _ModestConfValueType {
MODEST_CONF_VALUE_INT,
#include <modest-tny-platform-factory.h>
#include <modest-mail-operation.h>
#include <modest-tny-platform-factory.h>
#include <modest-mail-operation.h>
+#include <camel/camel-url.h>
+
#if MODEST_PLATFORM_ID==2 /* maemo */
#include <libosso.h>
#endif /* MODEST_PLATFORM==2 */
#if MODEST_PLATFORM_ID==2 /* maemo */
#include <libosso.h>
#endif /* MODEST_PLATFORM==2 */
int retval = MODEST_ERR_NONE;
static gboolean batch=FALSE;
int retval = MODEST_ERR_NONE;
static gboolean batch=FALSE;
- static gchar *mailto, *subject, *bcc, *cc, *body;
+ static gchar *mailto, *subject, *bcc, *cc, *body, *account;
static GOptionEntry options[] = {
{ "mailto", 'm', 0, G_OPTION_ARG_STRING, &mailto,
static GOptionEntry options[] = {
{ "mailto", 'm', 0, G_OPTION_ARG_STRING, &mailto,
- "New email to <addresses> (comma-separated)", NULL},
+ N_("New email to <addresses> (comma-separated)"), NULL},
{ "subject", 's', 0, G_OPTION_ARG_STRING, &subject,
{ "subject", 's', 0, G_OPTION_ARG_STRING, &subject,
- "Subject for a new mail", NULL},
+ N_("Subject for a new mail"), NULL},
{ "body", 'b', 0, G_OPTION_ARG_STRING, &body,
{ "body", 'b', 0, G_OPTION_ARG_STRING, &body,
- "Body for a new email", NULL},
+ N_("Body for a new email"), NULL},
{ "cc", 'c', 0, G_OPTION_ARG_STRING, &cc,
{ "cc", 'c', 0, G_OPTION_ARG_STRING, &cc,
- "Cc: addresses for a new mail (comma-separated)", NULL},
+ N_("Cc: addresses for a new mail (comma-separated)"), NULL},
{ "bcc", 'x', 0, G_OPTION_ARG_STRING, &bcc,
{ "bcc", 'x', 0, G_OPTION_ARG_STRING, &bcc,
- "Bcc: addresses for a new mail (comma-separated)", NULL},
+ N_("Bcc: addresses for a new mail (comma-separated)"), NULL},
+ { "account", 'a', 0, G_OPTION_ARG_STRING, &account,
+ N_("Account to use (if specified, default account is used)"), NULL},
{ "batch", 'y', 0, G_OPTION_ARG_NONE, &batch,
{ "batch", 'y', 0, G_OPTION_ARG_NONE, &batch,
- "Run in batch mode (don't show UI)", NULL},
+ N_("Run in batch mode (don't show UI)"), NULL},
{ NULL, 0, 0, 0, NULL, NULL, NULL }
};
{ NULL, 0, 0, 0, NULL, NULL, NULL }
};
retval = start_ui (mailto, cc, bcc, subject, body, account_store);
} else
retval = send_mail (mailto, cc, bcc, subject, body);
retval = start_ui (mailto, cc, bcc, subject, body, account_store);
} else
retval = send_mail (mailto, cc, bcc, subject, body);
- g_object_unref (G_OBJECT(fact));
+ if (fact)
+ g_object_unref (G_OBJECT(fact));
/* this will clean up account_store as well */
return retval;
/* this will clean up account_store as well */
return retval;
static int
send_mail (const gchar* mailto, const gchar *cc, const gchar *bcc,
const gchar* subject, const gchar *body)
static int
send_mail (const gchar* mailto, const gchar *cc, const gchar *bcc,
const gchar* subject, const gchar *body)
ModestAccountMgr *acc_mgr = NULL;
TnyPlatformFactory *fact = NULL;
TnyAccountStore *acc_store = NULL;
ModestAccountMgr *acc_mgr = NULL;
TnyPlatformFactory *fact = NULL;
TnyAccountStore *acc_store = NULL;
- ModestMailOperation *mail_operation;
+ ModestMailOperation *mail_operation = NULL;
TnyList *accounts = NULL;
TnyIterator *iter = NULL;
TnyList *accounts = NULL;
TnyIterator *iter = NULL;
#include <tny-account.h>
#include <tny-account-store.h>
#include <tny-account.h>
#include <tny-account-store.h>
#include <tny-camel-imap-store-account.h>
#include <tny-camel-pop-store-account.h>
#include <modest-marshal.h>
#include <tny-camel-imap-store-account.h>
#include <tny-camel-pop-store-account.h>
#include <modest-marshal.h>
+#include <modest-protocol-info.h>
#include "modest-account-mgr.h"
#include "modest-tny-account-store.h"
#include "modest-tny-platform-factory.h"
#include "modest-account-mgr.h"
#include "modest-tny-account-store.h"
#include "modest-tny-platform-factory.h"
return modest_account_mgr_add_server_account (priv->account_mgr,
account_name,
hostname, username, NULL,
return modest_account_mgr_add_server_account (priv->account_mgr,
account_name,
hostname, username, NULL,
+ modest_protocol_info_get_protocol(proto));
modest_type = MODEST_PROTOCOL_TYPE_STORE;
break;
case TNY_ACCOUNT_STORE_BOTH:
modest_type = MODEST_PROTOCOL_TYPE_STORE;
break;
case TNY_ACCOUNT_STORE_BOTH:
- modest_type = MODEST_PROTOCOL_TYPE_ANY;
+ modest_type = MODEST_PROTOCOL_TYPE_UNKNOWN;
break;
default:
g_assert_not_reached ();
break;
default:
g_assert_not_reached ();
- if (modest_type == MODEST_PROTOCOL_TYPE_TRANSPORT || modest_type == MODEST_PROTOCOL_TYPE_ANY) {
+ if (modest_type == MODEST_PROTOCOL_TYPE_TRANSPORT || modest_type == MODEST_PROTOCOL_TYPE_UNKNOWN) {
server_account = get_server_account_for_account (self, account_name,
MODEST_PROTOCOL_TYPE_TRANSPORT);
if (server_account) {
server_account = get_server_account_for_account (self, account_name,
MODEST_PROTOCOL_TYPE_TRANSPORT);
if (server_account) {
g_free (server_account);
}
g_free (server_account);
}
- if (modest_type == MODEST_PROTOCOL_TYPE_STORE || modest_type == MODEST_PROTOCOL_TYPE_ANY) {
+ if (modest_type == MODEST_PROTOCOL_TYPE_STORE || modest_type == MODEST_PROTOCOL_TYPE_UNKNOWN) {
server_account = get_server_account_for_account (self, account_name,
MODEST_PROTOCOL_TYPE_STORE);
if (server_account) {
server_account = get_server_account_for_account (self, account_name,
MODEST_PROTOCOL_TYPE_STORE);
if (server_account) {