Changeset 3710
- Timestamp:
- 07/01/08 15:47:45
- Files:
-
- releases/modest/diablo-pe2/ChangeLog (modified) (11 diffs)
- releases/modest/diablo-pe2/libtinymail-camel/camel-lite/camel/camel.c (modified) (2 diffs)
- releases/modest/diablo-pe2/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c (modified) (1 diff)
- releases/modest/diablo-pe2/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c (modified) (4 diffs)
- releases/modest/diablo-pe2/libtinymail-camel/tny-camel-account.c (modified) (2 diffs)
- releases/modest/diablo-pe2/libtinymail-camel/tny-camel-bs-mime-part.c (modified) (2 diffs)
- releases/modest/diablo-pe2/libtinymail-camel/tny-camel-folder.c (modified) (3 diffs)
- releases/modest/diablo-pe2/libtinymail-camel/tny-camel-queue-priv.h (modified) (1 diff)
- releases/modest/diablo-pe2/libtinymail-camel/tny-camel-queue.c (modified) (15 diffs)
- releases/modest/diablo-pe2/libtinymail-camel/tny-camel-store-account.c (modified) (1 diff)
- releases/modest/diablo-pe2/libtinymail-camel/tny-session-camel.c (modified) (2 diffs)
- releases/modest/diablo-pe2/libtinymailui-gtk/tny-gtk-folder-store-tree-model.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
releases/modest/diablo-pe2/ChangeLog
r3709 r3710 1 2008-07-01 Jose Dapena Paz <jdapena@igalia.com> 2 3 * libtinymail-camel/tny-camel-folder.c: 4 Fix camel operation references 5 6 * libtinymail-camel/tny-camel-bs-mime-part.c: 7 Fix camel operation references 8 9 * libtinymail-camel/tny-camel-queue.c: 10 Make queue reference to account be weak. 11 12 * libtinymail-camel/tny-camel-account.c: 13 More camel operation reference fixes 14 15 2008-07-01 Philip Van Hoof <pvanhoof@gnome.org> 16 17 * libtinymail-camel/tny-camel-queue.c: Letting the thread wait for 18 more items instead of exiting 19 1 20 2008-06-26 Philip Van Hoof <pvanhoof@gnome.org> 2 21 … … 593 612 594 613 * Attempt at making mime parsing use the seekable capability of 595 streams in stead of copying them in memory. This is experimental!614 streams instead of copying them in memory. This is experimental! 596 615 597 616 2008-03-04 Philip Van Hoof <pvanhoof@gnome.org> … … 1015 1034 1016 1035 * Code robustness 1017 * Changed the account item of a folder to be hard referenced in stead1036 * Changed the account item of a folder to be hard referenced instead 1018 1037 of weakly 1019 1038 … … 1142 1161 2007-12-12 Philip Van Hoof <pvanhoof@gnome.org> 1143 1162 1144 * Experimental appending in stead of rewriting the summary.mmap1163 * Experimental appending instead of rewriting the summary.mmap 1145 1164 1146 1165 2007-12-11 Philip Van Hoof <pvanhoof@gnome.org> … … 1443 1462 observers 1444 1463 * Cyclic references fix. tny_folder_store_add_observer and 1445 tny_folder_add_observer no longer add strong references, in stead they1464 tny_folder_add_observer no longer add strong references, instead they 1446 1465 add weak references 1447 1466 … … 1449 1468 root folder C, and then move A into B, that A would only become a 1450 1469 subfolder of B after you restart the application. The problem was that 1451 A and B got created with _tny_camel_folder_new in stead of the1470 A and B got created with _tny_camel_folder_new instead of the 1452 1471 tny_camel_store_account_factor_folder. This made the observers 1453 1472 infrastructure of the model confuse when a new list of folder was … … 1457 1476 1458 1477 For future, let's be extremely careful not to use 1459 _tny_camel_folder_new but in stead to make sure that the factory is1478 _tny_camel_folder_new but instead to make sure that the factory is 1460 1479 always used. 1461 1480 … … 1635 1654 1636 1655 * Fixed regression on the regression fix of a few days ago :) 1637 * Renamed Maildir filenames to have '!' in stead of '_' or ':' in1656 * Renamed Maildir filenames to have '!' instead of '_' or ':' in 1638 1657 their filenames 1639 1658 … … 3258 3277 * Support for tny_header_get_uid on TnyMsg's header instance 3259 3278 * Removed the warning in libtinymail/tny-folder.c: please use the 3260 support for DBC in stead. It's specifically designed for this. Read3279 support for DBC instead. It's specifically designed for this. Read 3261 3280 the documentation in building.txt to find out how to enable it. 3262 3281 … … 4884 4903 consumption on initial download of both IMAP and NNTP folders. 4885 4904 * libtinymail-gnome-desktop: Default status of the device is now 4886 offline in stead of online (for example in case network manager4905 offline instead of online (for example in case network manager 4887 4906 installation was invalid or not found) 4888 4907 * Bugfix reported by Nitin.Mahajan@nokia.com … … 4897 4916 4898 4917 * libtinymail-camel/camel-lite: Allocation of the CamelFolderInfo is 4899 now with GSlice in stead of many different malloc ways. This one needs4918 now with GSlice instead of many different malloc ways. This one needs 4900 4919 testing! 4901 4920 releases/modest/diablo-pe2/libtinymail-camel/camel-lite/camel/camel.c
r3365 r3710 55 55 return; 56 56 57 initialised = FALSE; 57 58 certdb = camel_certdb_get_default (); 58 59 if (certdb) { … … 66 67 #endif /* HAVE_NSS */ 67 68 68 initialised = FALSE;69 69 } 70 70 releases/modest/diablo-pe2/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c
r3677 r3710 4149 4149 } 4150 4150 4151 store->in_idle = FALSE; 4151 4152 camel_object_unref (folder); 4152 4153 releases/modest/diablo-pe2/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c
r3709 r3710 235 235 CAMEL_SERVICE_REC_LOCK (store, connect_lock); 236 236 nwritten = camel_stream_printf (store->ostream, "DONE\r\n"); 237 store->in_idle = FALSE;238 237 if (nwritten != -1) { 239 238 resp = NULL; … … 397 396 398 397 let_idle_die (imap_store, TRUE); 398 399 camel_imap_store_stop_idle (imap_store); 399 400 400 401 if (imap_store->current_folder) { … … 2101 2102 imap_debug ("imap_connect_offline\n"); 2102 2103 2103 /* let_idle_die (store, TRUE); */ 2104 let_idle_die (store, TRUE); 2105 camel_imap_store_stop_idle (store); 2104 2106 2105 2107 if (!disco_store->diary) … … 2118 2120 imap_debug ("imap_disconnect_offline\n"); 2119 2121 2120 /*let_idle_die (store, TRUE);*/ 2122 let_idle_die (store, TRUE); 2123 camel_imap_store_stop_idle (store); 2121 2124 2122 2125 if (store->istream) { releases/modest/diablo-pe2/libtinymail-camel/tny-camel-account.c
r3667 r3710 775 775 priv->inuse_spin = TRUE; 776 776 777 if (priv->cancel) 777 if (priv->cancel) { 778 778 _tny_camel_account_actual_uncancel (self); 779 camel_operation_unregister (priv->cancel); 780 } 779 781 780 782 priv->cancel = camel_operation_new (func, user_data); 781 783 782 camel_operation_ref (priv->cancel);783 camel_operation_register (priv->cancel);784 784 camel_operation_start (priv->cancel, (char*)what); 785 785 … … 2163 2163 } 2164 2164 camel_object_unref (CAMEL_OBJECT (priv->service)); 2165 priv->service = NULL; 2165 2166 } 2166 2167 releases/modest/diablo-pe2/libtinymail-camel/tny-camel-bs-mime-part.c
r3684 r3710 557 557 if (fpriv->account && TNY_IS_CAMEL_ACCOUNT (fpriv->account)) { 558 558 TnyCamelAccountPriv *apriv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (fpriv->account); 559 camel_operation_ref (cancel); 559 560 apriv->getmsg_cancel = cancel; 560 561 } 561 562 } 562 563 563 camel_operation_ref (cancel);564 564 camel_operation_register (cancel); 565 565 camel_operation_start (cancel, (char *) "Getting message part"); … … 589 589 TnyCamelAccountPriv *apriv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (fpriv->account); 590 590 apriv->getmsg_cancel = NULL; 591 camel_operation_unref (cancel); 591 592 } 592 593 } releases/modest/diablo-pe2/libtinymail-camel/tny-camel-folder.c
r3685 r3710 2470 2470 TnyCamelAccountPriv *apriv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (priv->account); 2471 2471 apriv->getmsg_cancel = cancel; 2472 camel_operation_ref (cancel); 2472 2473 } 2473 2474 … … 2476 2477 /* g_static_rec_mutex_lock (priv->folder_lock); */ 2477 2478 2478 camel_operation_ref (cancel);2479 2479 camel_operation_register (cancel); 2480 2480 camel_operation_start (cancel, (char *) "Getting message"); … … 2497 2497 TnyCamelAccountPriv *apriv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (priv->account); 2498 2498 apriv->getmsg_cancel = NULL; 2499 camel_operation_unref (cancel); 2499 2500 } 2500 2501 releases/modest/diablo-pe2/libtinymail-camel/tny-camel-queue-priv.h
r3685 r3710 46 46 GList *list; 47 47 GThread *thread; 48 GCond *condition; 49 GMutex *mutex; 50 gboolean is_waiting; 48 51 GStaticRecMutex *lock; 49 52 gboolean stopped, next_uncancel; releases/modest/diablo-pe2/libtinymail-camel/tny-camel-queue.c
r3667 r3710 40 40 (G_TYPE_INSTANCE_GET_PRIVATE ((o), TNY_TYPE_CAMEL_QUEUE, TnyCamelQueuePriv)) 41 41 42 static void account_finalized (TnyCamelQueue *queue, GObject *finalized_account); 42 43 43 44 static void … … 47 48 48 49 self->stopped = TRUE; 50 51 g_mutex_lock (self->mutex); 52 if (self->account) 53 g_object_weak_unref (G_OBJECT (self->account), (GWeakNotify) account_finalized, self); 54 g_mutex_unlock (self->mutex); 49 55 50 56 g_static_rec_mutex_lock (self->lock); … … 53 59 g_static_rec_mutex_unlock (self->lock); 54 60 61 g_cond_free (self->condition); 62 g_mutex_free (self->mutex); 63 55 64 /* g_static_rec_mutex_free (self->lock); */ 56 65 g_free (self->lock); … … 60 69 61 70 return; 71 } 72 73 static void 74 account_finalized (TnyCamelQueue *queue, GObject *finalized_account) 75 { 76 g_mutex_lock (queue->mutex); 77 queue->account = NULL; 78 queue->stopped = TRUE; 79 if (queue->is_waiting) { 80 g_cond_broadcast (queue->condition); 81 } 82 g_mutex_unlock (queue->mutex); 62 83 } 63 84 … … 76 97 77 98 self->account = account; 99 g_object_weak_ref (G_OBJECT (account), (GWeakNotify) account_finalized, self); 78 100 79 101 return TNY_CAMEL_QUEUE (self); … … 167 189 GList *first = NULL; 168 190 QueueItem *item = NULL; 169 gboolean deleted = FALSE ;191 gboolean deleted = FALSE, wait = FALSE; 170 192 171 193 g_static_rec_mutex_lock (queue->lock); … … 173 195 if (queue->next_uncancel) 174 196 { 175 _tny_camel_account_actual_uncancel (TNY_CAMEL_ACCOUNT (queue->account)); 197 g_mutex_lock (queue->mutex); 198 if (queue->account) { 199 g_object_ref (queue->account); 200 g_mutex_unlock (queue->mutex); 201 _tny_camel_account_actual_uncancel (TNY_CAMEL_ACCOUNT (queue->account)); 202 g_object_unref (queue->account); 203 } else { 204 g_mutex_unlock (queue->mutex); 205 } 176 206 queue->next_uncancel = FALSE; 177 207 } … … 184 214 queue->current = item; 185 215 } else 186 queue->stopped= TRUE;216 wait = TRUE; 187 217 g_static_rec_mutex_unlock (queue->lock); 188 218 … … 234 264 queue->current = NULL; 235 265 236 if (g_list_length (queue->list) == 0) { 237 queue->thread = NULL; 238 queue->stopped = TRUE; 239 } 266 if (g_list_length (queue->list) == 0) 267 wait = TRUE; 240 268 g_static_rec_mutex_unlock (queue->lock); 241 269 242 270 if (item) 243 271 g_slice_free (QueueItem, item); 272 273 if (wait) { 274 g_mutex_lock (queue->mutex); 275 queue->is_waiting = TRUE; 276 g_cond_wait (queue->condition, queue->mutex); 277 queue->is_waiting = FALSE; 278 g_mutex_unlock (queue->mutex); 279 } 244 280 } 245 281 … … 247 283 queue->stopped = TRUE; 248 284 249 g_object_unref (queue->account);250 285 g_object_unref (queue); 251 286 … … 326 361 if (item->flags & TNY_CAMEL_QUEUE_CANCELLABLE_ITEM) { 327 362 if (!(item->flags & TNY_CAMEL_QUEUE_SYNC_ITEM)) { 328 _tny_camel_account_actual_cancel (TNY_CAMEL_ACCOUNT (queue->account)); 363 if (queue->account) 364 _tny_camel_account_actual_cancel (TNY_CAMEL_ACCOUNT (queue->account)); 329 365 queue->next_uncancel = TRUE; 330 366 } … … 379 415 380 416 g_static_rec_mutex_lock (queue->lock); 417 418 if (queue->account == NULL) 419 g_assert ("We should never be running tny_camel_queue_launch_wflags if account was unreferenced"); 381 420 382 421 if (flags & TNY_CAMEL_QUEUE_PRIORITY_ITEM) … … 404 443 queue->stopped = FALSE; 405 444 g_object_ref (queue); 406 g_object_ref (queue->account);407 445 queue->thread = g_thread_create (tny_camel_queue_thread_main_func, 408 446 queue, FALSE, &err); … … 410 448 queue->stopped = TRUE; 411 449 } 450 } else { 451 g_mutex_lock (queue->mutex); 452 if (queue->is_waiting) 453 g_cond_broadcast (queue->condition); 454 g_mutex_unlock (queue->mutex); 412 455 } 413 456 … … 465 508 TnyCamelQueue *self = (TnyCamelQueue*)instance; 466 509 510 self->is_waiting = FALSE; 511 self->mutex = g_mutex_new (); 512 self->condition = g_cond_new (); 467 513 self->account = NULL; 468 514 self->stopped = TRUE; 469 515 self->list = NULL; 516 517 /* We don't use a GThreadPool because we need control over the queued 518 * items: we must remove them sometimes for example. */ 519 470 520 self->thread = NULL; 471 521 self->lock = g_new0 (GStaticRecMutex, 1); releases/modest/diablo-pe2/libtinymail-camel/tny-camel-store-account.c
r3667 r3710 1412 1412 priv->iter = iter; 1413 1413 priv->cant_reuse_iter = FALSE; 1414 1415 if (priv->iter_store) { 1416 camel_object_unref (CAMEL_OBJECT (store)); 1417 } 1414 1418 1415 1419 camel_object_ref (CAMEL_OBJECT (store)); releases/modest/diablo-pe2/libtinymail-camel/tny-session-camel.c
r3306 r3710 983 983 * have embraced references either. So be careful! */ 984 984 985 priv->device = device;985 priv->device = g_object_ref (device); 986 986 987 987 return; … … 1090 1090 g_signal_handler_disconnect (G_OBJECT (priv->device), 1091 1091 priv->connchanged_signal); 1092 } 1093 1094 if (priv->device) { 1095 g_object_unref (priv->device); 1092 1096 } 1093 1097 releases/modest/diablo-pe2/libtinymailui-gtk/tny-gtk-folder-store-tree-model.c
r3667 r3710 339 339 * start asking the account about its folders. */ 340 340 341 if (status == TNY_CONNECTION_STATUS_RECONNECTING )341 if (status == TNY_CONNECTION_STATUS_RECONNECTING || status == TNY_CONNECTION_STATUS_DISCONNECTED) 342 342 return; 343 343
