aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChenthill Palanisamy <pchenthill@novell.com>2007-08-17 15:46:35 +0800
committerChenthill Palanisamy <pchen@src.gnome.org>2007-08-17 15:46:35 +0800
commit18c39ea2cabf9d7611d8f2320df4342256ba720a (patch)
tree45a8204dd29aad5f23ca2bf8cc5f691200475830
parent03799599ca20ba1218efa6564494a381863b0da7 (diff)
downloadgsoc2013-evolution-18c39ea2cabf9d7611d8f2320df4342256ba720a.tar
gsoc2013-evolution-18c39ea2cabf9d7611d8f2320df4342256ba720a.tar.gz
gsoc2013-evolution-18c39ea2cabf9d7611d8f2320df4342256ba720a.tar.bz2
gsoc2013-evolution-18c39ea2cabf9d7611d8f2320df4342256ba720a.tar.lz
gsoc2013-evolution-18c39ea2cabf9d7611d8f2320df4342256ba720a.tar.xz
gsoc2013-evolution-18c39ea2cabf9d7611d8f2320df4342256ba720a.tar.zst
gsoc2013-evolution-18c39ea2cabf9d7611d8f2320df4342256ba720a.zip
Fixes #274070 (bnc)
2007-08-17 Chenthill Palanisamy <pchenthill@novell.com> Fixes #274070 (bnc) * gui/e-meeting-attendee.[ch]: (e_meeting_attendee_finalize), (e_meeting_attendee_get_fburi), (e_meeting_attendee_set_fburi): * gui/e-meeting-list-view.c: (process_section): * gui/e-meeting-store.c: (freebusy_async), (start_async_read): If the contact has a free busy url specified with it, use it to show free busy information. svn path=/trunk/; revision=34021
-rw-r--r--calendar/ChangeLog10
-rw-r--r--calendar/gui/e-meeting-attendee.c26
-rw-r--r--calendar/gui/e-meeting-attendee.h3
-rw-r--r--calendar/gui/e-meeting-list-view.c14
-rw-r--r--calendar/gui/e-meeting-store.c20
5 files changed, 62 insertions, 11 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 889c9250f7..815084d1fc 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,13 @@
+2007-08-17 Chenthill Palanisamy <pchenthill@novell.com>
+
+ Fixes #274070 (bnc)
+ * gui/e-meeting-attendee.[ch]: (e_meeting_attendee_finalize),
+ (e_meeting_attendee_get_fburi), (e_meeting_attendee_set_fburi):
+ * gui/e-meeting-list-view.c: (process_section):
+ * gui/e-meeting-store.c: (freebusy_async), (start_async_read):
+ If the contact has a free busy url specified with it, use it to show
+ free busy information.
+
2007-08-16 Milan Crha <mcrha@redhat.com>
** Part of fix for bug #350539
diff --git a/calendar/gui/e-meeting-attendee.c b/calendar/gui/e-meeting-attendee.c
index b346b85154..100238b850 100644
--- a/calendar/gui/e-meeting-attendee.c
+++ b/calendar/gui/e-meeting-attendee.c
@@ -31,6 +31,7 @@
struct _EMeetingAttendeePrivate {
gchar *address;
gchar *member;
+ gchar *fburi;
icalparameter_cutype cutype;
icalparameter_role role;
@@ -168,6 +169,7 @@ e_meeting_attendee_finalize (GObject *obj)
g_free (priv->address);
g_free (priv->member);
+ g_free (priv->fburi);
g_free (priv->delto);
g_free (priv->delfrom);
@@ -237,6 +239,30 @@ e_meeting_attendee_as_e_cal_component_attendee (EMeetingAttendee *ia)
return ca;
}
+const gchar *
+e_meeting_attendee_get_fburi (EMeetingAttendee *ia)
+{
+ EMeetingAttendeePrivate *priv;
+
+ priv = ia->priv;
+
+ return priv->fburi;
+}
+
+void
+e_meeting_attendee_set_fburi (EMeetingAttendee *ia, gchar *fburi)
+{
+ EMeetingAttendeePrivate *priv;
+
+ priv = ia->priv;
+
+ if (priv->fburi != NULL)
+ g_free (priv->fburi);
+
+ priv->fburi = string_test (fburi);
+
+ notify_changed (ia);
+}
const gchar *
e_meeting_attendee_get_address (EMeetingAttendee *ia)
diff --git a/calendar/gui/e-meeting-attendee.h b/calendar/gui/e-meeting-attendee.h
index 42c5e13c2e..df28e80885 100644
--- a/calendar/gui/e-meeting-attendee.h
+++ b/calendar/gui/e-meeting-attendee.h
@@ -132,6 +132,9 @@ void e_meeting_attendee_set_edit_level (EMeetingAttendee *ia, EMeetingAttendeeEd
gboolean e_meeting_attendee_get_has_calendar_info (EMeetingAttendee *ia);
void e_meeting_attendee_set_has_calendar_info (EMeetingAttendee *ia, gboolean has_calendar_info);
+const gchar * e_meeting_attendee_get_fburi (EMeetingAttendee *ia);
+void e_meeting_attendee_set_fburi (EMeetingAttendee *ia, gchar *fburi);
+
const GArray *e_meeting_attendee_get_busy_periods (EMeetingAttendee *ia);
gint e_meeting_attendee_find_first_busy_period (EMeetingAttendee *ia, GDate *date);
gboolean e_meeting_attendee_add_busy_period (EMeetingAttendee *ia,
diff --git a/calendar/gui/e-meeting-list-view.c b/calendar/gui/e-meeting-list-view.c
index 15391fef91..6f104d985e 100644
--- a/calendar/gui/e-meeting-list-view.c
+++ b/calendar/gui/e-meeting-list-view.c
@@ -755,8 +755,9 @@ process_section (EMeetingListView *view, GList *destinations, icalparameter_role
for (l = list_dests; l; l = l->next) {
EDestination *dest = l->data;
+ EContact *contact;
const char *name, *attendee = NULL;
- char *attr = NULL;
+ char *attr = NULL, *fburi = NULL;
name = e_destination_get_name (dest);
@@ -765,7 +766,6 @@ process_section (EMeetingListView *view, GList *destinations, icalparameter_role
&attr, NULL)) {
/* FIXME this should be more general */
if (!g_ascii_strcasecmp (attr, "icscalendar")) {
- EContact *contact;
/* FIXME: this does not work, have to use first
e_destination_use_contact() */
@@ -782,9 +782,14 @@ process_section (EMeetingListView *view, GList *destinations, icalparameter_role
if (attendee == NULL || *attendee == '\0') {
attendee = e_destination_get_email (dest);
}
-
+
if (attendee == NULL || *attendee == '\0')
continue;
+
+ contact = e_destination_get_contact (dest);
+ if (contact)
+ fburi = e_contact_get (contact, E_CONTACT_FREEBUSY_URL);
+
if (e_meeting_store_find_attendee (priv->store, attendee, NULL) == NULL) {
EMeetingAttendee *ia = e_meeting_store_add_attendee_with_defaults (priv->store);
@@ -794,6 +799,9 @@ process_section (EMeetingListView *view, GList *destinations, icalparameter_role
if (role == ICAL_ROLE_NONPARTICIPANT)
e_meeting_attendee_set_cutype (ia, ICAL_CUTYPE_RESOURCE);
e_meeting_attendee_set_cn (ia, g_strdup (name));
+
+ if (fburi)
+ e_meeting_attendee_set_fburi (ia, fburi);
} else {
if (g_slist_length (*la) == 1) {
g_slist_free (*la);
diff --git a/calendar/gui/e-meeting-store.c b/calendar/gui/e-meeting-store.c
index e9a083fe89..db8803277f 100644
--- a/calendar/gui/e-meeting-store.c
+++ b/calendar/gui/e-meeting-store.c
@@ -1150,9 +1150,11 @@ freebusy_async (gpointer data)
{
FreeBusyAsyncData *fbd = data;
EMeetingAttendee *attendee = fbd->attendee;
- gchar *default_fb_uri;
+ gchar *default_fb_uri = NULL;
+ const char *fburi = NULL;
static GStaticMutex mutex = G_STATIC_MUTEX_INIT;
EMeetingStorePrivate *priv = fbd->store->priv;
+ GnomeVFSAsyncHandle *handle;
if (fbd->client) {
/* FIXME this a work around for getting all th free busy information for the users
@@ -1184,13 +1186,17 @@ freebusy_async (gpointer data)
return TRUE;
}
-
-
/* Check for free busy info on the default server */
default_fb_uri = g_strdup (fbd->fb_uri);
+ fburi = g_strdup (e_meeting_attendee_get_fburi (attendee));
- if (default_fb_uri != NULL && !g_str_equal (default_fb_uri, "")) {
- GnomeVFSAsyncHandle *handle;
+ if (fburi) {
+ priv->num_queries++;
+ gnome_vfs_async_open (&handle, fburi, GNOME_VFS_OPEN_READ,
+ GNOME_VFS_PRIORITY_DEFAULT, start_async_read,
+ fbd->qdata);
+ g_free (fburi);
+ } else if (default_fb_uri != NULL && !g_str_equal (default_fb_uri, "")) {
gchar *tmp_fb_uri;
gchar **split_email;
@@ -1204,7 +1210,6 @@ freebusy_async (gpointer data)
gnome_vfs_async_open (&handle, default_fb_uri, GNOME_VFS_OPEN_READ,
GNOME_VFS_PRIORITY_DEFAULT, start_async_read,
fbd->qdata);
- priv->num_queries--;
g_free (tmp_fb_uri);
g_strfreev (split_email);
@@ -1214,8 +1219,6 @@ freebusy_async (gpointer data)
}
return TRUE;
-
-
}
#undef USER_SUB
@@ -1431,6 +1434,7 @@ start_async_read (GnomeVFSAsyncHandle *handle,
EMeetingStoreQueueData *qdata = data;
GnomeVFSFileSize buf_size = BUF_SIZE - 1;
+ qdata->store->priv->num_queries--;
if (result != GNOME_VFS_OK) {
g_warning ("Unable to access free/busy url: %s",
gnome_vfs_result_to_string (result));