TnyAccount *tny_account = NULL;
type = modest_protocol_info_get_protocol_type (proto);
-
+
if (type == MODEST_PROTOCOL_TYPE_TRANSPORT)
tny_account = TNY_ACCOUNT(tny_camel_transport_account_new ());
else if (proto == MODEST_PROTOCOL_STORE_POP)
tny_account = TNY_ACCOUNT(tny_camel_pop_store_account_new ());
else if (proto == MODEST_PROTOCOL_STORE_IMAP)
tny_account = TNY_ACCOUNT(tny_camel_imap_store_account_new ());
- else
+ else
g_return_val_if_reached (NULL);
if (tny_account)
priv = MODEST_TNY_ACCOUNT_STORE_GET_PRIVATE(self);
/* proto */
+ if (account_data->proto == MODEST_PROTOCOL_UNKNOWN) {
+ g_printerr ("modest: '%s' does not provide a protocol\n",
+ account_data->account_name);
+ return NULL;
+ }
+
tny_account = tny_account_for_proto (account_data->proto);
if (!tny_account) {
g_printerr ("modest: could not create tny account for '%s'\n",
server_account = account_data->store_account;
else if (type == TNY_ACCOUNT_STORE_TRANSPORT_ACCOUNTS && account_data->transport_account)
server_account = account_data->transport_account;
- else
- g_return_val_if_reached (NULL);
if (!server_account) {
g_printerr ("modest: no %s account defined for '%s'\n",
tny_session_camel_set_account_store (priv->tny_session_camel, iface);
}
-
-/*
- * the cache dir will be ~/.modest/cache
- * might want to change this in a simple #define...
- */
static const gchar*
modest_tny_account_store_get_cache_dir (TnyAccountStore *self)
{
priv = MODEST_TNY_ACCOUNT_STORE_GET_PRIVATE(self);
if (!priv->cache_dir)
- priv->cache_dir = g_build_filename (g_get_home_dir(), ".modest",
+ priv->cache_dir = g_build_filename (g_get_home_dir(),
+ MODEST_DIR,
+ MODEST_CACHE_DIR,
"cache", NULL);
return priv->cache_dir;
}