Commit 8f13fe2b authored by Milan Crha's avatar Milan Crha

Bug 692361 - e_cal_client_get_free_busy() broken

parent 47b9959d
......@@ -1525,24 +1525,6 @@ typedef struct {
#define USER_SUB "%u"
#define DOMAIN_SUB "%d"
static void
client_free_busy_data_cb (ECalClient *client,
const GSList *ecalcomps,
FreeBusyAsyncData *fbd)
{
const GSList *iter;
g_return_if_fail (fbd != NULL);
for (iter = ecalcomps; iter != NULL; iter = iter->next) {
ECalComponent *comp = iter->data;
if (comp != NULL)
fbd->fb_data = g_slist_prepend (
fbd->fb_data, g_object_ref (comp));
}
}
static gboolean
freebusy_async (gpointer data)
{
......@@ -1554,24 +1536,14 @@ freebusy_async (gpointer data)
EMeetingStorePrivate *priv = fbd->store->priv;
if (fbd->client) {
guint sigid;
/* FIXME This a workaround for getting all the free busy
* information for the users. We should be able to
* get free busy asynchronously. */
g_mutex_lock (&mutex);
priv->num_queries++;
sigid = g_signal_connect (
fbd->client, "free-busy-data",
G_CALLBACK (client_free_busy_data_cb), fbd);
e_cal_client_get_free_busy_sync (
fbd->client, fbd->startt,
fbd->endt, fbd->users, NULL, NULL);
/* This is to workaround broken dispatch of "free-busy-data" signal,
* introduced in 3.8.0. This code can be removed once the below bug is
* properly fixed: https://bugzilla.gnome.org/show_bug.cgi?id=692361
*/
g_usleep (G_USEC_PER_SEC / 10);
g_signal_handler_disconnect (fbd->client, sigid);
fbd->endt, fbd->users, &fbd->fb_data, NULL, NULL);
priv->num_queries--;
g_mutex_unlock (&mutex);
......
......@@ -31,23 +31,6 @@
#include "publish-format-fb.h"
static void
free_busy_data_cb (ECalClient *client,
const GSList *free_busy_ecalcomps,
GSList **pobjects)
{
const GSList *iter;
g_return_if_fail (pobjects != NULL);
for (iter = free_busy_ecalcomps; iter != NULL; iter = iter->next) {
ECalComponent *comp = iter->data;
if (comp)
*pobjects = g_slist_prepend (*pobjects, g_object_ref (comp));
}
}
static gboolean
write_calendar (const gchar *uid,
GOutputStream *stream,
......@@ -65,7 +48,6 @@ write_calendar (const gchar *uid,
icalcomponent *top_level;
gchar *email = NULL;
GSList *users = NULL;
gulong handler_id;
gboolean success = FALSE;
utc = icaltimezone_get_utc_timezone ();
......@@ -112,29 +94,12 @@ write_calendar (const gchar *uid,
top_level = e_cal_util_new_top_level ();
handler_id = g_signal_connect (
client, "free-busy-data",
G_CALLBACK (free_busy_data_cb), &objects);
success = e_cal_client_get_free_busy_sync (
E_CAL_CLIENT (client), start, end, users, NULL, error);
if (handler_id > 0)
g_signal_handler_disconnect (client, handler_id);
E_CAL_CLIENT (client), start, end, users, &objects, NULL, error);
if (success) {
gchar *ical_string;
GSList *iter;
gboolean done = FALSE;
/* This is to workaround broken dispatch of "free-busy-data" signal,
* introduced in 3.8.0. This code can be removed once the below bug is
* properly fixed: https://bugzilla.gnome.org/show_bug.cgi?id=692361
*/
while (!done) {
g_usleep (G_USEC_PER_SEC / 10);
done = !g_main_context_iteration (NULL, FALSE);
}
for (iter = objects; iter; iter = iter->next) {
ECalComponent *comp = iter->data;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment