Changeset 1271

Show
Ignore:
Timestamp:
11/28/06 18:22:12
Author:
pvanhoof
Message:

--

Files:

Legend:

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

    r1107 r1271  
    492492        TnyCamelAccountPriv *priv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (self); 
    493493 
     494        /* TODO locking & error handling */ 
     495 
    494496        if (!priv->service) 
    495497                return; 
    496  
     498         
    497499        _tny_camel_account_start_camel_operation (self, NULL, NULL, NULL); 
    498  
     500         
    499501        if (offline) 
    500502                camel_service_cancel_connect (priv->service); 
    501  
    502         if (CAMEL_IS_DISCO_STORE (priv->service)) { 
    503                 if (!offline) { 
    504                         camel_disco_store_set_status (CAMEL_DISCO_STORE (priv->service), 
    505                                                       CAMEL_DISCO_STORE_ONLINE, priv->ex); 
    506                         goto done; 
    507                 } else if (camel_disco_store_can_work_offline (CAMEL_DISCO_STORE (priv->service))) { 
    508  
    509                         camel_disco_store_set_status (CAMEL_DISCO_STORE (priv->service), 
    510                                                       CAMEL_DISCO_STORE_OFFLINE, 
    511                                                       priv->ex); 
    512                         goto done; 
    513                
    514         } else if (CAMEL_IS_OFFLINE_STORE (priv->service)) { 
    515  
    516                 if (!offline) { 
    517  
    518                         camel_offline_store_set_network_state (CAMEL_OFFLINE_STORE (priv->service), 
    519                                                                CAMEL_OFFLINE_STORE_NETWORK_AVAIL, 
    520                                                                priv->ex); 
    521                         goto done; 
    522                 } else { 
    523                         camel_offline_store_set_network_state (CAMEL_OFFLINE_STORE (priv->service), 
    524                                                                CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL, 
    525                                                                priv->ex); 
    526                         goto done; 
    527                
    528        
    529  
    530         if (offline) 
    531                 camel_service_disconnect (CAMEL_SERVICE (priv->service), 
    532                                           TRUE, priv->ex); 
    533 done: 
    534  
    535         _tny_camel_account_stop_camel_operation (self); 
    536  
     503         
     504       if (CAMEL_IS_DISCO_STORE (priv->service)) { 
     505               if (!offline) { 
     506                       camel_disco_store_set_status (CAMEL_DISCO_STORE (priv->service), 
     507                                                                                 CAMEL_DISCO_STORE_ONLINE, priv->ex); 
     508                       goto done; 
     509               } else if (camel_disco_store_can_work_offline (CAMEL_DISCO_STORE (priv->service))) { 
     510                         
     511                       camel_disco_store_set_status (CAMEL_DISCO_STORE (priv->service), 
     512                                                                                 CAMEL_DISCO_STORE_OFFLINE, 
     513                                                                                 priv->ex); 
     514                       goto done; 
     515               
     516       } else if (CAMEL_IS_OFFLINE_STORE (priv->service)) { 
     517                 
     518               if (!offline) { 
     519                         
     520                       camel_offline_store_set_network_state (CAMEL_OFFLINE_STORE (priv->service), 
     521                                                                                                  CAMEL_OFFLINE_STORE_NETWORK_AVAIL, 
     522                                                                                                  priv->ex); 
     523                       goto done; 
     524               } else { 
     525                       camel_offline_store_set_network_state (CAMEL_OFFLINE_STORE (priv->service), 
     526                                                                                                  CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL, 
     527                                                                                                  priv->ex); 
     528                       goto done; 
     529               
     530       
     531         
     532       if (offline) 
     533               camel_service_disconnect (CAMEL_SERVICE (priv->service), 
     534                                                                 TRUE, priv->ex); 
     535       done: 
     536                 
     537               _tny_camel_account_stop_camel_operation (self); 
     538         
    537539} 
    538540 
  • trunk/libtinymailui-gtk/tny-gtk-account-list-model.c

    r978 r1271  
    6161destroy_accs (gpointer item, gpointer user_data) 
    6262{ 
    63       if (item && G_IS_OBJECT (item)) 
     63      if (item && G_IS_OBJECT (item)) 
    6464                g_object_unref (G_OBJECT (item)); 
    65       return; 
     65      return; 
    6666} 
    6767 
     
    7070{ 
    7171        TnyGtkAccountListModel *me = (TnyGtkAccountListModel*) object; 
    72      
    73         g_mutex_lock (me->iterator_lock); 
    74       if (me->first) 
     72 
     73        g_mutex_lock (me->iterator_lock); 
     74      if (me->first) 
    7575        { 
    7676                g_list_foreach (me->first, destroy_accs, NULL); 
     
    7878        } 
    7979        g_mutex_unlock (me->iterator_lock); 
    80      
     80 
    8181        (*parent_class->finalize) (object); 
    8282} 
     
    104104        me->iterator_lock = g_mutex_new (); 
    105105        me->first = NULL; 
    106      
     106 
    107107        gtk_list_store_set_column_types (store,  
    108108                TNY_GTK_ACCOUNT_LIST_MODEL_N_COLUMNS, types); 
     
    130130        GtkTreeIter iter; 
    131131        TnyAccount *account = TNY_ACCOUNT (item); 
    132      
     132 
    133133        g_mutex_lock (me->iterator_lock); 
    134134        g_object_ref (G_OBJECT (item)); 
     
    148148        GtkTreeIter iter; 
    149149        TnyAccount *account = TNY_ACCOUNT (item); 
    150          
     150 
    151151        g_mutex_lock (me->iterator_lock); 
    152152        g_object_ref (G_OBJECT (item));  
     
    165165        guint retval = 0; 
    166166        GtkTreeIter iter; 
    167      
     167 
    168168        g_mutex_lock (me->iterator_lock); 
    169169        retval = me->first?g_list_length (me->first):0; 
     
    188188         
    189189        me->first = g_list_remove (me->first, (gconstpointer)item); 
    190      
     190 
    191191        if (gtk_tree_model_get_iter_first (model, &iter)) 
    192192          while (gtk_tree_model_iter_next (model, &iter)) 
     
    230230        TnyGtkAccountListModel *me = (TnyGtkAccountListModel*)self; 
    231231        TnyGtkAccountListModel *copy = g_object_new (TNY_TYPE_GTK_ACCOUNT_LIST_MODEL, NULL); 
    232      
     232 
    233233        g_mutex_lock (me->iterator_lock); 
    234234        GList *list_copy = g_list_copy (me->first);