Changeset 3590

Show
Ignore:
Timestamp:
04/15/08 15:02:22
Author:
pvanhoof
Message:

Url-string to property sync

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libtinymail-camel/tny-camel-account.c

    r3583 r3590  
    224224                if (urlneedfree) 
    225225                        camel_url_free (url); 
     226        } else if (apriv->url_string) { 
     227                CamelException uex = CAMEL_EXCEPTION_INITIALISER; 
     228                CamelURL *url = camel_url_new (apriv->url_string, &uex); 
     229                if (camel_exception_is_set (&uex)) 
     230                        camel_exception_clear (&uex); 
     231 
     232                if (url) { 
     233                        if (apriv->proto) 
     234                                g_free (apriv->proto); 
     235                        if (url->protocol) 
     236                                apriv->proto = g_strdup (url->protocol); 
     237                        else 
     238                                apriv->proto = NULL; 
     239 
     240                        if (apriv->user) 
     241                                g_free (apriv->user); 
     242                        if (url->user) 
     243                                apriv->user = g_strdup (url->user); 
     244                        else 
     245                                apriv->user = NULL; 
     246 
     247                        if (url->port != -1) 
     248                                apriv->port = url->port; 
     249 
     250                        if (apriv->host) 
     251                                g_free (apriv->host); 
     252                        if (url->host) 
     253                                apriv->host = g_strdup (url->host); 
     254                        else 
     255                                apriv->host = NULL; 
     256 
     257                        if (apriv->mech) 
     258                                g_free (apriv->mech); 
     259                        if (url->authmech) 
     260                                apriv->mech = g_strdup (url->authmech); 
     261                        else 
     262                                apriv->mech = NULL; 
     263 
     264 
     265                        camel_url_free (url); 
     266                } 
     267 
    226268        } 
    227269