aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/cal-client
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2003-03-05 06:02:01 +0800
committerJP Rosevear <jpr@src.gnome.org>2003-03-05 06:02:01 +0800
commitaf8947c7c413379f6eca5fe81b930a5e0014bc8c (patch)
tree9a136a13172c2ac0d1e9ef8b18cd1e30cf95934d /calendar/cal-client
parentc1e2563e393921af0dea2d29eeb13d58e1bcd91b (diff)
downloadgsoc2013-evolution-af8947c7c413379f6eca5fe81b930a5e0014bc8c.tar
gsoc2013-evolution-af8947c7c413379f6eca5fe81b930a5e0014bc8c.tar.gz
gsoc2013-evolution-af8947c7c413379f6eca5fe81b930a5e0014bc8c.tar.bz2
gsoc2013-evolution-af8947c7c413379f6eca5fe81b930a5e0014bc8c.tar.lz
gsoc2013-evolution-af8947c7c413379f6eca5fe81b930a5e0014bc8c.tar.xz
gsoc2013-evolution-af8947c7c413379f6eca5fe81b930a5e0014bc8c.tar.zst
gsoc2013-evolution-af8947c7c413379f6eca5fe81b930a5e0014bc8c.zip
implement
2003-03-04 JP Rosevear <jpr@ximian.com> * pcs/cal.c (impl_Cal_get_ldap_attribute): implement * pcs/cal-backend.h: add virtual method * pcs/cal-backend.c (cal_backend_get_ldap_attribute): call get_ldap_attribute_method * pcs/cal-backend-file.c (cal_backend_file_class_init): overrid get_ldap_attribute method * idl/evolution-calendar.idl: add getLdapAttribute method * gui/e-meeting-model.c (process_section): take simple card list as arg and try to use the ldap attribute (if any) as the attendee, else use the email address (select_names_ok_cb): get the simple card list * cal-client/cal-client.h: add proto * cal-client/cal-client.c (cal_client_init): init ldap_attribute to NULL (cal_client_destroy): free ldap_attribute svn path=/trunk/; revision=20154
Diffstat (limited to 'calendar/cal-client')
-rw-r--r--calendar/cal-client/cal-client.c33
-rw-r--r--calendar/cal-client/cal-client.h1
2 files changed, 34 insertions, 0 deletions
diff --git a/calendar/cal-client/cal-client.c b/calendar/cal-client/cal-client.c
index 1f76b5e210..371e6c06e0 100644
--- a/calendar/cal-client/cal-client.c
+++ b/calendar/cal-client/cal-client.c
@@ -50,6 +50,7 @@ struct _CalClientPrivate {
/* Email address associated with this calendar, or NULL */
char *cal_address;
char *alarm_email_address;
+ char *ldap_attribute;
/* Scheduling info */
char *capabilities;
@@ -314,6 +315,7 @@ cal_client_init (CalClient *client, CalClientClass *klass)
priv->uri = NULL;
priv->cal_address = NULL;
priv->alarm_email_address = NULL;
+ priv->ldap_attribute = NULL;
priv->capabilities = FALSE;
priv->factories = NULL;
priv->timezones = g_hash_table_new (g_str_hash, g_str_equal);
@@ -457,6 +459,10 @@ cal_client_finalize (GObject *object)
g_free (priv->alarm_email_address);
priv->alarm_email_address = NULL;
}
+ if (priv->ldap_attribute) {
+ g_free (priv->ldap_attribute);
+ priv->ldap_attribute = NULL;
+ }
if (priv->capabilities) {
g_free (priv->capabilities);
priv->capabilities = NULL;
@@ -1219,6 +1225,33 @@ cal_client_get_alarm_email_address (CalClient *client)
return priv->alarm_email_address;
}
+const char *
+cal_client_get_ldap_attribute (CalClient *client)
+{
+ CalClientPrivate *priv;
+
+ g_return_val_if_fail (client != NULL, NULL);
+ g_return_val_if_fail (IS_CAL_CLIENT (client), NULL);
+
+ priv = client->priv;
+ g_return_val_if_fail (priv->load_state == CAL_CLIENT_LOAD_LOADED, NULL);
+
+ if (priv->ldap_attribute == NULL) {
+ CORBA_Environment ev;
+ CORBA_char *ldap_attribute;
+
+ CORBA_exception_init (&ev);
+ ldap_attribute = GNOME_Evolution_Calendar_Cal_getLdapAttribute (priv->cal, &ev);
+ if (!BONOBO_EX (&ev)) {
+ priv->ldap_attribute = g_strdup (ldap_attribute);
+ CORBA_free (ldap_attribute);
+ }
+ CORBA_exception_free (&ev);
+ }
+
+ return priv->ldap_attribute;
+}
+
static void
load_static_capabilities (CalClient *client)
{
diff --git a/calendar/cal-client/cal-client.h b/calendar/cal-client/cal-client.h
index a9d8d379b2..e44014b9be 100644
--- a/calendar/cal-client/cal-client.h
+++ b/calendar/cal-client/cal-client.h
@@ -156,6 +156,7 @@ gboolean cal_client_is_read_only (CalClient *client);
const char *cal_client_get_cal_address (CalClient *client);
const char *cal_client_get_alarm_email_address (CalClient *client);
+const char *cal_client_get_ldap_attribute (CalClient *client);
gboolean cal_client_get_one_alarm_only (CalClient *client);
gboolean cal_client_get_organizer_must_attend (CalClient *client);