Patch: remove can_idle warnings on tny-demoui startup



	Hi,

	This code just avoids calling can_idle when there's no service
available (it was happening on tny-demoui when it retrieved the mails in
outbox from a send queue).

Changelog would be:
* Avoid criticals on calling can_idle if queue does not have service.

-- 
José Dapena Paz <jdapena igalia com>
Igalia
Index: libtinymail-camel/tny-camel-queue.c
===================================================================
--- libtinymail-camel/tny-camel-queue.c	(revisión: 3803)
+++ libtinymail-camel/tny-camel-queue.c	(copia de trabajo)
@@ -217,7 +217,8 @@
 			wait = TRUE;
 		/* If no next item is scheduled then we can go idle after finishing operation */
 		apriv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (queue->account);
-		camel_service_can_idle (apriv->service, !first || !first->next);
+		if (apriv->service)
+			camel_service_can_idle (apriv->service, !first || !first->next);
 		g_static_rec_mutex_unlock (queue->lock);
 
 		if (item) {
@@ -444,7 +445,8 @@
 
 	/* If no next item is scheduled then we can go idle after finishing operation */
 	apriv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (queue->account);
-	camel_service_can_idle (apriv->service, !queue->list || !queue->list->next);
+	if (apriv->service)
+		camel_service_can_idle (apriv->service, !queue->list || !queue->list->next);
 
 	if (queue->stopped) 
 	{


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]