Changeset 1271
- Timestamp:
- 11/28/06 18:22:12
- Files:
-
- trunk/libtinymail-camel/tny-camel-account.c (modified) (1 diff)
- trunk/libtinymailui-gtk/tny-gtk-account-list-model.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libtinymail-camel/tny-camel-account.c
r1107 r1271 492 492 TnyCamelAccountPriv *priv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (self); 493 493 494 /* TODO locking & error handling */ 495 494 496 if (!priv->service) 495 497 return; 496 498 497 499 _tny_camel_account_start_camel_operation (self, NULL, NULL, NULL); 498 500 499 501 if (offline) 500 502 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 537 539 } 538 540 trunk/libtinymailui-gtk/tny-gtk-account-list-model.c
r978 r1271 61 61 destroy_accs (gpointer item, gpointer user_data) 62 62 { 63 if (item && G_IS_OBJECT (item))63 if (item && G_IS_OBJECT (item)) 64 64 g_object_unref (G_OBJECT (item)); 65 return;65 return; 66 66 } 67 67 … … 70 70 { 71 71 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) 75 75 { 76 76 g_list_foreach (me->first, destroy_accs, NULL); … … 78 78 } 79 79 g_mutex_unlock (me->iterator_lock); 80 80 81 81 (*parent_class->finalize) (object); 82 82 } … … 104 104 me->iterator_lock = g_mutex_new (); 105 105 me->first = NULL; 106 106 107 107 gtk_list_store_set_column_types (store, 108 108 TNY_GTK_ACCOUNT_LIST_MODEL_N_COLUMNS, types); … … 130 130 GtkTreeIter iter; 131 131 TnyAccount *account = TNY_ACCOUNT (item); 132 132 133 133 g_mutex_lock (me->iterator_lock); 134 134 g_object_ref (G_OBJECT (item)); … … 148 148 GtkTreeIter iter; 149 149 TnyAccount *account = TNY_ACCOUNT (item); 150 150 151 151 g_mutex_lock (me->iterator_lock); 152 152 g_object_ref (G_OBJECT (item)); … … 165 165 guint retval = 0; 166 166 GtkTreeIter iter; 167 167 168 168 g_mutex_lock (me->iterator_lock); 169 169 retval = me->first?g_list_length (me->first):0; … … 188 188 189 189 me->first = g_list_remove (me->first, (gconstpointer)item); 190 190 191 191 if (gtk_tree_model_get_iter_first (model, &iter)) 192 192 while (gtk_tree_model_iter_next (model, &iter)) … … 230 230 TnyGtkAccountListModel *me = (TnyGtkAccountListModel*)self; 231 231 TnyGtkAccountListModel *copy = g_object_new (TNY_TYPE_GTK_ACCOUNT_LIST_MODEL, NULL); 232 232 233 233 g_mutex_lock (me->iterator_lock); 234 234 GList *list_copy = g_list_copy (me->first);
