Changeset 2310

Show
Ignore:
Timestamp:
06/29/07 13:12:46
Author:
pvanhoof
Message:

Bugfix in the prepare method of TnyCamelTransportAccount

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ChangeLog

    r2309 r2310  
     12007-06-29  Philip Van Hoof  <pvanhoof@gnome.org> 
     2 
     3        * Bugfix in TnyCamelTransportAccount: rewrote the prepare method 
     4        implementation 
     5 
    162007-06-29  Murray Cumming  <murrayc@murrayc.com> 
    27 
  • trunk/libtinymail-camel/tny-camel-transport-account.c

    r2250 r2310  
    6666 
    6767        g_static_rec_mutex_lock (apriv->service_lock); 
    68         /* camel_session_get_service can launch GUI things */ 
    69         if (apriv->session && apriv->url_string) 
    70         { 
     68 
     69        if (!apriv->service && reservice) 
     70        { 
     71                if (apriv->service && CAMEL_IS_SERVICE (apriv->service)) 
     72                { 
     73                        camel_object_unref (CAMEL_OBJECT (apriv->service)); 
     74                        apriv->service = NULL; 
     75                }  
     76 
    7177                if (camel_exception_is_set (apriv->ex)) 
    7278                        camel_exception_clear (apriv->ex); 
    73  
    74                 if (apriv->service && CAMEL_IS_OBJECT (apriv->service)) 
    75                         camel_object_unref (CAMEL_OBJECT (apriv->service)); 
    7679 
    7780                apriv->service = camel_session_get_service 
     
    7982                        apriv->type, apriv->ex); 
    8083 
    81                 if (apriv->service) 
     84                if (apriv->service && !camel_exception_is_set (apriv->ex))  
     85                { 
    8286                        apriv->service->data = self; 
     87                        apriv->service->connecting = (con_op) NULL; 
     88                        apriv->service->disconnecting = (con_op) NULL; 
     89                        apriv->service->reconnecter = (con_op) NULL; 
     90                        apriv->service->reconnection = (con_op) NULL; 
     91 
     92                } else if (camel_exception_is_set (apriv->ex) && apriv->service) 
     93                { 
     94                        g_warning ("Must cleanup service pointer\n"); 
     95                        apriv->service = NULL; 
     96                } 
    8397 
    8498        } else { 
     
    168182        g_static_rec_mutex_lock (apriv->service_lock); 
    169183        /* camel_service_connect can launch GUI things */ 
    170         if (!camel_service_connect (apriv->service, &ex)) 
     184 
     185        if (!apriv->service || !camel_service_connect (apriv->service, &ex)) 
    171186        { 
    172187                if (camel_exception_is_set (&ex))