aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-service.c
diff options
context:
space:
mode:
authorPeter Williams <peterw@src.gnome.org>2000-08-31 01:09:42 +0800
committerPeter Williams <peterw@src.gnome.org>2000-08-31 01:09:42 +0800
commit2bdcfe5c47e9add476eab5d848b30d9d1715c153 (patch)
tree03ea965b34ee45f22bc00a737e9d9af1dd1992f7 /camel/camel-service.c
parente8df3eea83688f5656c076952dfcffb297c08ad1 (diff)
downloadgsoc2013-evolution-2bdcfe5c47e9add476eab5d848b30d9d1715c153.tar
gsoc2013-evolution-2bdcfe5c47e9add476eab5d848b30d9d1715c153.tar.gz
gsoc2013-evolution-2bdcfe5c47e9add476eab5d848b30d9d1715c153.tar.bz2
gsoc2013-evolution-2bdcfe5c47e9add476eab5d848b30d9d1715c153.tar.lz
gsoc2013-evolution-2bdcfe5c47e9add476eab5d848b30d9d1715c153.tar.xz
gsoc2013-evolution-2bdcfe5c47e9add476eab5d848b30d9d1715c153.tar.zst
gsoc2013-evolution-2bdcfe5c47e9add476eab5d848b30d9d1715c153.zip
Make CamelServices connect only when told to (old behavior). Make CamelRemoteStore do its stuff in service::connect, not ::post_connect.
svn path=/trunk/; revision=5116
Diffstat (limited to 'camel/camel-service.c')
-rw-r--r--camel/camel-service.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/camel/camel-service.c b/camel/camel-service.c
index 9df7837bf7..63af88f4cb 100644
--- a/camel/camel-service.c
+++ b/camel/camel-service.c
@@ -176,6 +176,7 @@ camel_service_new (CamelType type, CamelSession *session, CamelProvider *provide
service->connected = FALSE;
+#if 0
if (!url->empty) {
if (CSERV_CLASS (service)->connect (service, ex) == FALSE) {
camel_object_unref (CAMEL_OBJECT (service));
@@ -184,6 +185,7 @@ camel_service_new (CamelType type, CamelSession *session, CamelProvider *provide
service->connected = TRUE;
}
+#endif
return service;
}
@@ -224,7 +226,12 @@ camel_service_connect (CamelService *service, CamelException *ex)
return TRUE;
}
- return CSERV_CLASS (service)->connect (service, ex);
+ if (CSERV_CLASS (service)->connect (service, ex)) {
+ service->connected = TRUE;
+ return TRUE;
+ }
+
+ return FALSE;
}
static gboolean
@@ -253,13 +260,17 @@ service_disconnect (CamelService *service, CamelException *ex)
gboolean
camel_service_disconnect (CamelService *service, CamelException *ex)
{
+ gboolean res;
+
if (!service->connected) {
camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_NOT_CONNECTED,
"Trying to disconnect from a service that isn't connected");
return FALSE;
}
- return CSERV_CLASS (service)->disconnect (service, ex);
+ res = CSERV_CLASS (service)->disconnect (service, ex);
+ service->connected = FALSE;
+ return res;
}
/**
@@ -387,13 +398,12 @@ query_auth_types_func (CamelService *service, CamelException *ex)
GList *
camel_service_query_auth_types (CamelService *service, CamelException *ex)
{
- if (service->connected)
- return CSERV_CLASS (service)->query_auth_types_connected (service, ex);
- else
+ if (service->url->empty)
return CSERV_CLASS (service)->query_auth_types_generic (service, ex);
+ else
+ return CSERV_CLASS (service)->query_auth_types_connected (service, ex);
}
-
static void
free_auth_types (CamelService *service, GList *authtypes)
{