* update for tinymail changes (don't include tny-device.h)
[modest] / src / modest-tny-account-store.c
index e670403..a370f4b 100644 (file)
@@ -9,7 +9,6 @@
 #include <tny-store-account-iface.h>
 #include <tny-transport-account-iface.h>
 #include <tny-device-iface.h>
-#include <tny-device.h>
 #include <tny-account-store.h>
 
 #include <tny-store-account.h>
@@ -85,7 +84,7 @@ modest_tny_account_store_get_type (void)
                my_type = g_type_register_static (TNY_TYPE_ACCOUNT_STORE,
                                                  "ModestTnyAccountStore", &my_info, 0);
 
-                g_type_add_interface_static (my_type, TNY_TYPE_ACCOUNT_STORE_IFACE,
+               g_type_add_interface_static (my_type, TNY_TYPE_ACCOUNT_STORE_IFACE,
                                             &iface_info);
        }
        return my_type;
@@ -165,7 +164,7 @@ modest_tny_account_store_finalize (GObject *obj)
                g_object_unref (G_OBJECT(priv->tny_session_camel));
                priv->tny_session_camel = NULL;
        }
-       
+
        if (priv->device) {
                g_object_unref (G_OBJECT(priv->device));
                priv->device = NULL;
@@ -221,8 +220,6 @@ get_password (TnyAccountIface *account, const gchar *prompt)
        ModestTnyAccountStorePrivate *priv;
        gchar *val;
 
-        g_message (__FUNCTION__);
-
        g_return_val_if_fail (account, NULL);
 
        key = tny_account_iface_get_id (account);
@@ -233,8 +230,8 @@ get_password (TnyAccountIface *account, const gchar *prompt)
 
        val = modest_account_mgr_get_server_account_string (priv->modest_acc_mgr, key,
                                                            MODEST_ACCOUNT_PASSWORD,
-                                                           NULL);
-       if (!val || strlen(val)==0)
+                                                            NULL);
+       if (!val)
         {
                 /* FIXME:
                  * append the prompt to the emitted signal,
@@ -341,7 +338,8 @@ tny_account_from_key (ModestTnyAccountStore *self, const gchar *key,
                                             TNY_ACCOUNT_STORE_IFACE(self));
        /* id */
        tny_account_iface_set_id (tny_account, key);
-
+       tny_account_iface_set_name (tny_account, key);
+       
        /* proto */
        val = modest_account_mgr_get_server_account_string (priv->modest_acc_mgr, key,
                                                            MODEST_ACCOUNT_PROTO, NULL);
@@ -354,7 +352,6 @@ tny_account_from_key (ModestTnyAccountStore *self, const gchar *key,
                return NULL;
        }
 
-
        /* hostname */
        val = modest_account_mgr_get_server_account_string (priv->modest_acc_mgr, key,
                                                            MODEST_ACCOUNT_HOSTNAME,
@@ -429,12 +426,9 @@ modest_tny_account_store_get_store_accounts  (TnyAccountStoreIface *iface)
                                                         MODEST_PROTO_TYPE_STORE,
                                                         NULL, FALSE);
 
-       g_message ("accounts: %d", g_slist_length (accounts));
        tny_accounts = tny_accounts_from_server_accounts (self, accounts, TRUE);
        g_slist_free (accounts);
-       g_message ("store accounts: %d", g_list_length (tny_accounts));
-
-
+       
        /*
         * FIXME: after gconf notification support is added,
         * we can simply return priv->store_account
@@ -502,9 +496,6 @@ tny_account_store_get_session (TnyAccountStore *self)
 
        priv = MODEST_TNY_ACCOUNT_STORE_GET_PRIVATE(self);
 
-       g_message ("returning tny session camel %p",
-                  priv->tny_session_camel);
-
        return priv->tny_session_camel;
 }
 
@@ -541,7 +532,9 @@ modest_tny_account_store_get_cache_dir (TnyAccountStoreIface *self)
 static const TnyDeviceIface*
 modest_tny_account_store_get_device (TnyAccountStoreIface *self)
 {
-       ModestTnyAccountStorePrivate *priv = MODEST_TNY_ACCOUNT_STORE_GET_PRIVATE (self);
+       ModestTnyAccountStorePrivate *priv;
+
+       priv = MODEST_TNY_ACCOUNT_STORE_GET_PRIVATE (self);
 
        return priv->device;
 }