X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fmodest-tny-account-store.c;h=e67040346cf17a578cc5fff211989ef2e74cb727;hb=df6be154c51576cb795b074615358107bccd603b;hp=0ad616a13cdad9ae69ab7eccf2fa65245c3db4eb;hpb=dc65f9ff58d0c6ac3d24c8023741e34e2b4cad58;p=modest diff --git a/src/modest-tny-account-store.c b/src/modest-tny-account-store.c index 0ad616a..e670403 100644 --- a/src/modest-tny-account-store.c +++ b/src/modest-tny-account-store.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -46,6 +47,7 @@ struct _ModestTnyAccountStorePrivate { gchar *cache_dir; TnySessionCamel *tny_session_camel; + TnyDeviceIface *device; ModestAccountMgr *modest_acc_mgr; }; @@ -118,6 +120,7 @@ modest_tny_account_store_init (ModestTnyAccountStore *obj) MODEST_TNY_ACCOUNT_STORE_GET_PRIVATE(obj); priv->modest_acc_mgr = NULL; + priv->device = NULL; priv->store_accounts = NULL; priv->transport_accounts = NULL; @@ -162,6 +165,11 @@ 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; + } priv->store_accounts = free_gobject_list (priv->store_accounts); priv->transport_accounts = free_gobject_list (priv->store_accounts); @@ -186,10 +194,16 @@ modest_tny_account_store_new (ModestAccountMgr *modest_acc_mgr) priv = MODEST_TNY_ACCOUNT_STORE_GET_PRIVATE(obj); g_object_ref(G_OBJECT(priv->modest_acc_mgr = modest_acc_mgr)); + priv->device = (TnyDeviceIface*)tny_device_new(); + if (!priv->device) { + g_warning ("Cannot create Device instance"); + g_object_unref (obj); + return NULL; + } priv->tny_session_camel = tny_session_camel_new (TNY_ACCOUNT_STORE_IFACE(obj)); if (!priv->tny_session_camel) { - g_warning ("cannot create TnySessionCamel instance"); + g_warning ("Cannot create TnySessionCamel instance"); g_object_unref (obj); return NULL; } @@ -207,7 +221,7 @@ get_password (TnyAccountIface *account, const gchar *prompt) ModestTnyAccountStorePrivate *priv; gchar *val; - g_message (__FUNCTION__); + g_message (__FUNCTION__); g_return_val_if_fail (account, NULL); @@ -221,18 +235,17 @@ get_password (TnyAccountIface *account, const gchar *prompt) MODEST_ACCOUNT_PASSWORD, NULL); if (!val || strlen(val)==0) - { - g_message("Key vor Aufruf: %s", key); - /* g_signal_emit (G_OBJECT(self), signals[PASSWORD_REQUESTED_SIGNAL], 0, key); */ - g_signal_emit (G_OBJECT(self), signals[PASSWORD_REQUESTED_SIGNAL], 0, key); + { + /* FIXME: + * append the prompt to the emitted signal, + * so the password dialog shows the prompt supplied by the caller of this function. + */ + g_signal_emit (G_OBJECT(self), signals[PASSWORD_REQUESTED_SIGNAL], 0, + key); -<<<<<<< .mine } return val; -======= - return val; ->>>>>>> .r67 } @@ -468,7 +481,8 @@ modest_tny_account_store_get_transport_accounts (TnyAccountStoreIface *iface) } -ModestAccountMgr *modest_tny_account_store_get_accout_mgr(ModestTnyAccountStore *self) +ModestAccountMgr +*modest_tny_account_store_get_accout_mgr(ModestTnyAccountStore *self) { ModestTnyAccountStorePrivate *priv; g_return_val_if_fail (self, NULL); @@ -527,7 +541,9 @@ modest_tny_account_store_get_cache_dir (TnyAccountStoreIface *self) static const TnyDeviceIface* modest_tny_account_store_get_device (TnyAccountStoreIface *self) { - return NULL; /* FIXME */ + ModestTnyAccountStorePrivate *priv = MODEST_TNY_ACCOUNT_STORE_GET_PRIVATE (self); + + return priv->device; }