Changeset 199
- Timestamp:
- 04/28/06 10:56:36
- Files:
-
- trunk/libtinymail-camel/tny-account-priv.h (modified) (1 diff)
- trunk/libtinymail-camel/tny-account.c (modified) (10 diffs)
- trunk/libtinymail-camel/tny-session-camel.c (modified) (6 diffs)
- trunk/libtinymail-camel/tny-session-camel.h (modified) (2 diffs)
- trunk/libtinymail/tny-account-iface.c (modified) (4 diffs)
- trunk/libtinymail/tny-account-iface.h (modified) (4 diffs)
- trunk/libtinymail/tny-shared.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libtinymail-camel/tny-account-priv.h
r194 r199 32 32 CamelException *ex; 33 33 gchar *url_string, *id, *user, *host, *proto; 34 GetPassFunc get_pass_func;35 ForgetPassFunc forget_pass_func;34 TnyGetPassFunc get_pass_func; 35 TnyForgetPassFunc forget_pass_func; 36 36 gboolean pass_func_set, forget_pass_func_set; 37 37 const TnyAccountStoreIface *store; trunk/libtinymail-camel/tny-account.c
r196 r199 47 47 TnyAccountPriv *priv = TNY_ACCOUNT_GET_PRIVATE (self); 48 48 49 if (priv->store) 50 g_object_unref (G_OBJECT (priv->store)); 51 52 g_object_ref (G_OBJECT (store)); 49 /* No need to reference (would also be cross reference): If store dies, 50 self should also die. */ 51 53 52 priv->store = store; 54 53 … … 71 70 72 71 g_static_rec_mutex_lock (priv->service_lock); 72 73 73 if (priv->id) 74 74 g_free (priv->id); … … 87 87 88 88 g_static_rec_mutex_lock (priv->service_lock); 89 89 90 if (priv->proto) 90 91 g_free (priv->proto); … … 105 106 106 107 g_static_rec_mutex_lock (priv->service_lock); 108 107 109 if (priv->user) 108 110 g_free (priv->user); … … 123 125 124 126 g_static_rec_mutex_lock (priv->service_lock); 127 125 128 if (priv->host) 126 129 g_free (priv->host); … … 136 139 137 140 void 138 tny_account_set_pass_func (TnyAccountIface *self, GetPassFunc get_pass_func) 139 { 140 TnyAccountPriv *priv = TNY_ACCOUNT_GET_PRIVATE (self); 141 142 g_static_rec_mutex_lock (priv->service_lock); 141 tny_account_set_pass_func (TnyAccountIface *self, TnyGetPassFunc get_pass_func) 142 { 143 TnyAccountPriv *priv = TNY_ACCOUNT_GET_PRIVATE (self); 144 145 g_static_rec_mutex_lock (priv->service_lock); 146 143 147 tny_session_camel_set_pass_func (priv->session, self, get_pass_func); 144 148 priv->get_pass_func = get_pass_func; 145 149 priv->pass_func_set = TRUE; 146 150 151 if (!TNY_ACCOUNT_GET_CLASS (self)->reconnect_func) 152 g_error ("This TnyAccountIface instance isn't a fully implemented type\n"); 153 147 154 TNY_ACCOUNT_GET_CLASS (self)->reconnect_func (TNY_ACCOUNT (self)); 148 155 … … 153 160 154 161 void 155 tny_account_set_forget_pass_func (TnyAccountIface *self, ForgetPassFunc get_forget_pass_func) 156 { 157 TnyAccountPriv *priv = TNY_ACCOUNT_GET_PRIVATE (self); 158 159 g_static_rec_mutex_lock (priv->service_lock); 162 tny_account_set_forget_pass_func (TnyAccountIface *self, TnyForgetPassFunc get_forget_pass_func) 163 { 164 TnyAccountPriv *priv = TNY_ACCOUNT_GET_PRIVATE (self); 165 166 g_static_rec_mutex_lock (priv->service_lock); 167 160 168 tny_session_camel_set_forget_pass_func (priv->session, self, get_forget_pass_func); 161 169 priv->forget_pass_func = get_forget_pass_func; 162 170 priv->forget_pass_func_set = TRUE; 171 163 172 g_static_rec_mutex_unlock (priv->service_lock); 164 173 … … 218 227 } 219 228 220 GetPassFunc229 TnyGetPassFunc 221 230 tny_account_get_pass_func (TnyAccountIface *self) 222 231 { 223 232 TnyAccountPriv *priv = TNY_ACCOUNT_GET_PRIVATE (self); 224 GetPassFunc retval;233 TnyGetPassFunc retval; 225 234 226 235 g_static_rec_mutex_lock (priv->service_lock); … … 231 240 } 232 241 233 ForgetPassFunc242 TnyForgetPassFunc 234 243 tny_account_get_forget_pass_func (TnyAccountIface *self) 235 244 { 236 245 TnyAccountPriv *priv = TNY_ACCOUNT_GET_PRIVATE (self); 237 ForgetPassFunc retval;246 TnyForgetPassFunc retval; 238 247 239 248 g_static_rec_mutex_lock (priv->service_lock); … … 321 330 g_free (priv->proto); 322 331 g_static_rec_mutex_unlock (priv->service_lock); 323 324 if (priv->store)325 g_object_unref (G_OBJECT (priv->store));326 332 327 333 camel_exception_free (priv->ex); trunk/libtinymail-camel/tny-session-camel.c
r194 r199 52 52 { 53 53 CamelService *service; 54 GetPassFunc func;54 TnyGetPassFunc func; 55 55 TnyAccountIface *account; 56 56 … … 60 60 { 61 61 CamelService *service; 62 ForgetPassFunc func;62 TnyForgetPassFunc func; 63 63 TnyAccountIface *account; 64 64 … … 80 80 **/ 81 81 void 82 tny_session_camel_set_forget_pass_func (TnySessionCamel *self, TnyAccountIface *account, ForgetPassFunc get_forget_pass_func)82 tny_session_camel_set_forget_pass_func (TnySessionCamel *self, TnyAccountIface *account, TnyForgetPassFunc get_forget_pass_func) 83 83 { 84 84 GList *copy = forget_password_funcs, *mark_del = NULL; … … 141 141 **/ 142 142 void 143 tny_session_camel_set_pass_func (TnySessionCamel *self, TnyAccountIface *account, GetPassFunc get_pass_func)143 tny_session_camel_set_pass_func (TnySessionCamel *self, TnyAccountIface *account, TnyGetPassFunc get_pass_func) 144 144 { 145 145 GList *copy = password_funcs, *mark_del = NULL; … … 195 195 { 196 196 GList *copy = password_funcs; 197 GetPassFunc func;197 TnyGetPassFunc func; 198 198 TnyAccountIface *account; 199 199 gboolean found = FALSE; … … 229 229 { 230 230 GList *copy = forget_password_funcs; 231 ForgetPassFunc func;231 TnyForgetPassFunc func; 232 232 TnyAccountIface *account; 233 233 gboolean found = FALSE; trunk/libtinymail-camel/tny-session-camel.h
r139 r199 46 46 CamelSessionClass parent_class; 47 47 48 void (*set_pass_func_func) (TnySessionCamel *self, TnyAccountIface *account, GetPassFunc get_pass_func);49 void (*set_forget_pass_func_func) (TnySessionCamel *self, TnyAccountIface *account, ForgetPassFunc forget_pass_func);48 void (*set_pass_func_func) (TnySessionCamel *self, TnyAccountIface *account, TnyGetPassFunc get_pass_func); 49 void (*set_forget_pass_func_func) (TnySessionCamel *self, TnyAccountIface *account, TnyForgetPassFunc forget_pass_func); 50 50 51 51 }; … … 54 54 TnySessionCamel* tny_session_camel_get_instance (void); 55 55 56 void tny_session_camel_set_pass_func (TnySessionCamel *self, TnyAccountIface *account, GetPassFunc get_pass_func);57 void tny_session_camel_set_forget_pass_func (TnySessionCamel *self, TnyAccountIface *account, ForgetPassFunc get_forget_pass_func);56 void tny_session_camel_set_pass_func (TnySessionCamel *self, TnyAccountIface *account, TnyGetPassFunc get_pass_func); 57 void tny_session_camel_set_forget_pass_func (TnySessionCamel *self, TnyAccountIface *account, TnyForgetPassFunc get_forget_pass_func); 58 58 59 59 G_END_DECLS trunk/libtinymail/tny-account-iface.c
r181 r199 90 90 **/ 91 91 void 92 tny_account_iface_set_forget_pass_func (TnyAccountIface *self, ForgetPassFunc get_forget_pass_func)92 tny_account_iface_set_forget_pass_func (TnyAccountIface *self, TnyForgetPassFunc get_forget_pass_func) 93 93 { 94 94 TNY_ACCOUNT_IFACE_GET_CLASS (self)->set_forget_pass_func_func (self, get_forget_pass_func); … … 104 104 * Return value: A pointer to the forget-password function 105 105 **/ 106 ForgetPassFunc106 TnyForgetPassFunc 107 107 tny_account_iface_get_forget_pass_func (TnyAccountIface *self) 108 108 { … … 166 166 **/ 167 167 void 168 tny_account_iface_set_pass_func (TnyAccountIface *self, GetPassFunc get_pass_func)168 tny_account_iface_set_pass_func (TnyAccountIface *self, TnyGetPassFunc get_pass_func) 169 169 { 170 170 TNY_ACCOUNT_IFACE_GET_CLASS (self)->set_pass_func_func (self, get_pass_func); … … 222 222 * Return value: A pointer to the get-password function 223 223 **/ 224 GetPassFunc224 TnyGetPassFunc 225 225 tny_account_iface_get_pass_func (TnyAccountIface *self) 226 226 { trunk/libtinymail/tny-account-iface.h
r181 r199 43 43 void (*set_user_func) (TnyAccountIface *self, const gchar *user); 44 44 void (*set_hostname_func) (TnyAccountIface *self, const gchar *host); 45 void (*set_pass_func_func) (TnyAccountIface *self, GetPassFunc get_pass_func);46 void (*set_forget_pass_func_func) (TnyAccountIface *self, ForgetPassFunc get_forget_pass_func);45 void (*set_pass_func_func) (TnyAccountIface *self, TnyGetPassFunc get_pass_func); 46 void (*set_forget_pass_func_func) (TnyAccountIface *self, TnyForgetPassFunc get_forget_pass_func); 47 47 48 48 const gchar* (*get_id_func ) (TnyAccountIface *self); … … 51 51 const gchar* (*get_hostname_func) (TnyAccountIface *self); 52 52 53 GetPassFunc (*get_pass_func_func) (TnyAccountIface *self);54 ForgetPassFunc (*get_forget_pass_func_func) (TnyAccountIface *self);53 TnyGetPassFunc (*get_pass_func_func) (TnyAccountIface *self); 54 TnyForgetPassFunc (*get_forget_pass_func_func) (TnyAccountIface *self); 55 55 56 56 void (*set_account_store_func) (TnyAccountIface *self, const TnyAccountStoreIface *store); … … 66 66 void tny_account_iface_set_user (TnyAccountIface *self, const gchar *user); 67 67 void tny_account_iface_set_hostname (TnyAccountIface *self, const gchar *host); 68 void tny_account_iface_set_pass_func (TnyAccountIface *self, GetPassFunc get_pass_func);68 void tny_account_iface_set_pass_func (TnyAccountIface *self, TnyGetPassFunc get_pass_func); 69 69 70 70 const gchar* tny_account_iface_get_id (TnyAccountIface *self); … … 73 73 const gchar* tny_account_iface_get_user (TnyAccountIface *self); 74 74 const gchar* tny_account_iface_get_hostname (TnyAccountIface *self); 75 GetPassFunc tny_account_iface_get_pass_func (TnyAccountIface *self);75 TnyGetPassFunc tny_account_iface_get_pass_func (TnyAccountIface *self); 76 76 77 void tny_account_iface_set_forget_pass_func (TnyAccountIface *self, ForgetPassFunc get_forget_pass_func);78 ForgetPassFunc77 void tny_account_iface_set_forget_pass_func (TnyAccountIface *self, TnyForgetPassFunc get_forget_pass_func); 78 TnyForgetPassFunc 79 79 tny_account_iface_get_forget_pass_func (TnyAccountIface *self); 80 80 trunk/libtinymail/tny-shared.h
r172 r199 43 43 typedef struct _TnyMsgHeaderProxy TnyMsgHeaderProxy; 44 44 typedef struct _TnyMsgHeaderProxyClass TnyMsgHeaderProxyClass; 45 typedef gchar* (* GetPassFunc) (TnyAccountIface *self, const gchar *prompt);46 typedef void (* ForgetPassFunc) (TnyAccountIface *self);45 typedef gchar* (*TnyGetPassFunc) (TnyAccountIface *self, const gchar *prompt); 46 typedef void (*TnyForgetPassFunc) (TnyAccountIface *self); 47 47 typedef enum _TnyStoreAccountFolderType TnyStoreAccountFolderType; 48 48
