X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fmodest-tny-account.c;h=57a58e7c4817cb475808c838c3772fa4af758cc7;hp=ab7149e879adda8c7fb40fa41e70a7acacb4caa9;hb=5c6d0fb527a735c4a53b4041c57c325927fb4cfe;hpb=6f7aa1b5e15f3024db75ccfe3138f520c607dc5d diff --git a/src/modest-tny-account.c b/src/modest-tny-account.c index ab7149e..57a58e7 100644 --- a/src/modest-tny-account.c +++ b/src/modest-tny-account.c @@ -345,7 +345,6 @@ modest_tny_account_new_from_server_account_name (ModestAccountMgr *account_mgr, ModestServerAccountSettings *server_settings; TnyAccount *tny_account; ModestProtocolRegistry *protocol_registry; - TnyConnectionPolicy *policy; g_return_val_if_fail (session, NULL); g_return_val_if_fail (server_account_name, NULL); @@ -369,20 +368,25 @@ modest_tny_account_new_from_server_account_name (ModestAccountMgr *account_mgr, modest_tny_account_set_parent_modest_account_name_for_server_account (tny_account, server_account_name); } - if (!tny_account) + if (!tny_account) { g_warning ("%s: failed to create tny_account", __FUNCTION__); - else if (!update_tny_account (tny_account, server_settings)) - g_warning ("%s: failed to initialize tny_account", __FUNCTION__); - else { - tny_account_set_forget_pass_func (tny_account, - forget_pass_func ? forget_pass_func : forget_pass_dummy); - tny_account_set_pass_func (tny_account, - get_pass_func ? get_pass_func: get_pass_dummy); - } + } else { + TnyConnectionPolicy *policy; - policy = modest_default_connection_policy_new (); - tny_account_set_connection_policy (tny_account, policy); - g_object_unref (policy); + if (!update_tny_account (tny_account, server_settings)) { + g_warning ("%s: failed to initialize tny_account", __FUNCTION__); + } else { + + tny_account_set_forget_pass_func (tny_account, + forget_pass_func ? forget_pass_func : forget_pass_dummy); + tny_account_set_pass_func (tny_account, + get_pass_func ? get_pass_func: get_pass_dummy); + + } + policy = modest_default_connection_policy_new (); + tny_account_set_connection_policy (tny_account, policy); + g_object_unref (policy); + } g_object_unref (server_settings); @@ -633,11 +637,13 @@ on_modest_file_system_info (HildonFileSystemInfoHandle *handle, void modest_tny_account_get_mmc_account_name (TnyStoreAccount* self, ModestTnyAccountGetMmcAccountNameCallback callback, gpointer user_data) { #ifndef MODEST_TOOLKIT_GTK - /* Just use the hard-coded path for the single memory card, + /* Just use the path for the single memory card, * rather than try to figure out the path to the specific card by * looking at the maildir URI: */ - const gchar *uri_real = MODEST_MCC1_VOLUMEPATH_URI; + gchar *uri_real = g_strconcat (MODEST_MMC1_VOLUMEPATH_URI_PREFIX, + g_getenv (MODEST_MMC1_VOLUMEPATH_ENV), + NULL); /* gchar* uri = tny_account_get_url_string (TNY_ACCOUNT (self)); @@ -667,7 +673,7 @@ void modest_tny_account_get_mmc_account_name (TnyStoreAccount* self, ModestTnyAc hildon_file_system_info_async_new(uri_real, on_modest_file_system_info, callback_data /* user_data */); - /* g_free (uri_real); */ + g_free (uri_real); } /* g_free (uri); */ @@ -726,7 +732,7 @@ modest_tny_account_new_for_local_folders (ModestAccountMgr *account_mgr, TnySess * via a derived TnyCamelStoreAccount ? */ const gboolean is_mmc = location_filepath && - (strcmp (location_filepath, MODEST_MCC1_VOLUMEPATH) == 0); + (strcmp (location_filepath, g_getenv (MODEST_MMC1_VOLUMEPATH_ENV)) == 0); /* The name of memory card locations will be updated asynchronously. * This is just a default: */