Changeset 1304

Show
Ignore:
Timestamp:
12/08/06 12:44:29
Author:
pvanhoof
Message:

Committing piece of shit solution for now

Files:

Legend:

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

    r1271 r1304  
    9090        priv->url_string = g_strdup (url_string); 
    9191 
    92         TNY_CAMEL_ACCOUNT_GET_CLASS (self)->reconnect_func (TNY_CAMEL_ACCOUNT (self)); 
     92        if (G_UNLIKELY (!TNY_CAMEL_ACCOUNT_GET_CLASS (self)->reconnect_func)) 
     93                g_error ("This TnyAccount instance isn't a fully implemented type\n"); 
     94 
     95        TNY_CAMEL_ACCOUNT_GET_CLASS (self)->reconnect_func ((TnyCamelAccount*)self); 
    9396 
    9497        return; 
  • trunk/libtinymail-camel/tny-camel-store-account.c

    r1292 r1304  
    126126                        camel_url_free (url); 
    127127 
     128                        /* TODO: lock ->service */ 
    128129                        priv->service = camel_session_get_service 
    129130                                ((CamelSession*) priv->session, priv->url_string,  
    130131                                priv->type, priv->ex); 
    131132 
     133                        /* TODO: lock ->service */ 
    132134                        if (priv->service == NULL) 
    133135                                report_error (priv); 
     
    137139                /* un officially supported provider */ 
    138140 
     141                /* TODO: lock ->service */ 
    139142                priv->service = camel_session_get_service 
    140143                        ((CamelSession*) priv->session, priv->url_string,  
    141144                        priv->type, priv->ex); 
    142145 
     146                /* TODO: lock ->service */ 
    143147                if (priv->service == NULL) 
    144148                        report_error (priv); 
  • trunk/libtinymail-camel/tny-camel-transport-account.c

    r1287 r1304  
    2121 
    2222#include <glib.h> 
     23#include <glib/gi18n-lib.h> 
    2324 
    2425#include <string.h> 
     
    5859        TnyCamelAccountPriv *priv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (self); 
    5960 
     61        printf ("recon\n"); 
     62 
    6063        if (G_LIKELY (priv->session) && G_UNLIKELY (priv->proto) && G_UNLIKELY (priv->host)) 
    6164        { 
     
    7881                priv->url_string = urlstr->str; 
    7982 
     83                /* TODO: lock ->service */ 
     84                priv->service = camel_session_get_service 
     85                        ((CamelSession*) priv->session, priv->url_string,  
     86                        priv->type, priv->ex); 
     87                /* TODO: check ex and handle it with a GError */ 
     88                if (camel_exception_is_set (priv->ex)) 
     89                        g_error ("Can't get service for transport account (%s)\n",  
     90                                         camel_exception_get_description (priv->ex)); 
     91 
     92                if (!camel_service_connect (priv->service, priv->ex)) 
     93                { 
     94                        g_warning (_("Not connected with %s: %s\n"), priv->url_string, 
     95                                   camel_exception_get_description (priv->ex)); 
     96                        camel_exception_clear (priv->ex); 
     97                } 
     98         
    8099                g_string_free (urlstr, FALSE); 
     100        } else if (priv->url_string) 
     101        { 
     102                 
     103                /* TODO: lock ->service */ 
     104                /* TODO: check for old instance and clear it */ 
     105 
     106                priv->service = camel_session_get_service 
     107                        ((CamelSession*) priv->session, priv->url_string,  
     108                        priv->type, priv->ex); 
     109 
     110                if (camel_exception_is_set (priv->ex)) 
     111                        g_error ("Can't get service for transport account (%s)\n",  
     112                                         camel_exception_get_description (priv->ex)); 
     113                /* TODO: check ex and handle it with a GError */ 
     114                 
     115                if (!camel_service_connect (priv->service, priv->ex)) 
     116                { 
     117                        g_warning (_("Not connected with %s: %s\n"), priv->url_string, 
     118                                   camel_exception_get_description (priv->ex)); 
     119                        camel_exception_clear (priv->ex); 
     120                } 
    81121        } 
    82122} 
     
    104144        g_assert (CAMEL_IS_SESSION (apriv->session)); 
    105145 
    106         transport = camel_session_get_transport ((CamelSession*) apriv->session,  
     146        /* TODO: lock ->service */ 
     147        if (!apriv->service) 
     148        { /* TODO do some more checking on ->service */ 
     149                g_critical ("No service, going to try getting a forced online one"); 
     150                transport = camel_session_get_transport ((CamelSession*) apriv->session,  
    107151                        apriv->url_string, &ex); 
     152                if (camel_exception_is_set (&ex)) 
     153                        g_critical ("Didn't work (%s)", 
     154                                camel_exception_get_description (&ex)); 
     155                apriv->service = (CamelService*) transport; 
     156        } else 
     157        { 
     158                if (!camel_service_connect (apriv->service, apriv->ex)) 
     159                { 
     160                        g_warning (_("Not connected with %s: %s\n"), apriv->url_string, 
     161                                   camel_exception_get_description (apriv->ex)); 
     162                        camel_exception_clear (apriv->ex); 
     163                } 
     164        } 
    108165 
    109166        if (camel_exception_is_set (&ex) || !transport) 
     
    181238        TnyCamelAccountPriv *apriv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (self); 
    182239 
     240        apriv->service = NULL; 
    183241        apriv->connected = FALSE; 
    184242        apriv->type = CAMEL_PROVIDER_TRANSPORT; 
  • trunk/libtinymail-camel/tny-session-camel.c

    r949 r1304  
    162162                pf = copy->data; 
    163163 
    164                 if (G_UNLIKELY (pf->service == NULL) || G_UNLIKELY (pf->account == NULL)) 
     164                if (G_UNLIKELY (pf->service == NULL) || G_UNLIKELY (pf->account == NULL) || 
     165                        !CAMEL_IS_SERVICE (pf->service) || !TNY_IS_ACCOUNT (pf->account)) 
    165166                { 
    166167                        mark_del = g_list_prepend (mark_del, copy); 
  • trunk/libtinymail-gnome-desktop/tny-gnome-account-store.c

    r1290 r1304  
    188188        const gchar *accountid; 
    189189 
    190         gdk_threads_enter (); 
    191  
    192190        accountid = tny_account_get_id (account); 
    193191 
     
    231229        } 
    232230 
    233         gdk_threads_leave (); 
    234  
    235231        return retval; 
    236232} 
     233 
    237234 
    238235static void 
     
    258255 
    259256#endif 
    260  
    261257 
    262258static gboolean 
     
    281277        } 
    282278 
    283         gdk_threads_enter (); 
    284  
    285279        dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, 
    286                                   gtktype, GTK_BUTTONS_YES_NO, prompt); 
     280               gtktype, GTK_BUTTONS_YES_NO, prompt); 
    287281 
    288282        if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_YES) 
     
    291285        gtk_widget_destroy (dialog); 
    292286 
    293         gdk_threads_leave (); 
    294  
    295287        return retval; 
    296288} 
     289 
    297290 
    298291static void 
     
    391384                                account = TNY_ACCOUNT (tny_camel_transport_account_new ()); 
    392385                } else if (type && (types == TNY_ACCOUNT_STORE_BOTH || types == TNY_ACCOUNT_STORE_STORE_ACCOUNTS)) 
    393                 {               
     386                { 
    394387                        if (!g_ascii_strncasecmp (proto, "imap", 4)) 
    395388                                account = TNY_ACCOUNT (tny_camel_imap_store_account_new ()); 
     
    486479                        tny_account_set_pass_func (TNY_ACCOUNT (account), 
    487480                                per_account_get_pass_func); 
    488                      
     481 
    489482                        tny_list_prepend (list, (GObject*)account); 
    490483                        g_object_unref (G_OBJECT (account)); 
  • trunk/libtinymailui-gtk/tny-gtk-header-list-model.c

    r1302 r1304  
    264264 
    265265        readable_date_size = strftime (readable_date, 63, _("%Y-%m-%d, %-I:%M %p"), &file_time); 
    266          
     266 
    267267        return readable_date; 
    268268} 
     
    697697        GList *list; 
    698698        GFunc relaxed_func, final_func; 
    699       gpointer ffdata, ffudata; 
     699      gpointer ffdata, ffudata; 
    700700} RelaxedData; 
    701701 
  • trunk/tinymail/tny-demoui-summary-view.c

    r1287 r1304  
    556556                                { 
    557557 
    558 /* DEBUG                 
     558/* DEBUG                */ 
    559559                                        TnyAccountStore *astore = priv->account_store; 
    560560                                        TnyList *accs = tny_simple_list_new (); 
     
    573573                                        g_object_unref (G_OBJECT (iter)); 
    574574                                        g_object_unref (G_OBJECT (accs)); 
    575 */ 
     575 
    576576 
    577577                                        msgwin = tny_gtk_msg_window_new (