- tny_account = TNY_ACCOUNT_IFACE(tny_transport_account_new ());
-
- tny_account_iface_set_account_store (tny_account,
- TNY_ACCOUNT_STORE_IFACE(self));
- /* id */
- tny_account_iface_set_id (tny_account, key);
-
- /* hostname */
- val = modest_account_mgr_get_account_string (priv->modest_acc_mgr, key,
- MODEST_ACCOUNT_HOSTNAME, NULL);
- g_warning (val);
- tny_account_iface_set_hostname (tny_account, val);
- g_free (val);
-
- /* username */
- val = modest_account_mgr_get_account_string (priv->modest_acc_mgr, key,
- MODEST_ACCOUNT_USERNAME, NULL);
- g_warning (val);
- tny_account_iface_set_user (tny_account, val);
- g_free (val);
-
- /* proto */
- val = modest_account_mgr_get_account_string (priv->modest_acc_mgr, key,
- MODEST_ACCOUNT_PROTO, NULL);
- g_warning (val);
- tny_account_iface_set_proto (tny_account, val);
- g_free (val);
-
- g_warning ("set_pass");
- tny_account_iface_set_pass_func (tny_account, get_password);
- tny_account_iface_set_forget_pass_func (tny_account, forget_password);
-
- return tny_account;
-}
-
-
-static GList*
-tny_accounts_from_server_accounts (ModestTnyAccountStore *self, GSList *accounts,
- gboolean is_store)
-{
- GSList *cursor = accounts;
- GList *tny_accounts = NULL;
-
- g_return_val_if_fail (self, NULL);
-
- while (cursor) {
- TnyAccountIface *tny_account;
- tny_account = tny_account_from_key (self, (gchar*)cursor->data, is_store);
- if (!tny_account) {
- g_warning ("could not create tnyaccount for %s",
- (gchar*)cursor->data);
- } else {
- g_warning ("added %s",(gchar*)cursor->data);
- tny_accounts =
- g_list_append (tny_accounts, tny_account);
- }
- cursor = cursor->next;