"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/calendar/gui/e-meeting-store.c" between
evolution-3.32.4.tar.xz and evolution-3.34.0.tar.xz

About: Evolution is a personal information management application that provides integrated mail, calendaring and address book functionality (GNOME desktop).

e-meeting-store.c  (evolution-3.32.4.tar.xz):e-meeting-store.c  (evolution-3.34.0.tar.xz)
skipping to change at line 52 skipping to change at line 52
#define E_MEETING_STORE_GET_PRIVATE(obj) \ #define E_MEETING_STORE_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE \ (G_TYPE_INSTANCE_GET_PRIVATE \
((obj), E_TYPE_MEETING_STORE, EMeetingStorePrivate)) ((obj), E_TYPE_MEETING_STORE, EMeetingStorePrivate))
struct _EMeetingStorePrivate { struct _EMeetingStorePrivate {
GPtrArray *attendees; GPtrArray *attendees;
gint stamp; gint stamp;
ECalClient *client; ECalClient *client;
icaltimezone *zone; ICalTimezone *zone;
gint default_reminder_interval; gint default_reminder_interval;
EDurationType default_reminder_units; EDurationType default_reminder_units;
gchar *fb_uri; gchar *fb_uri;
GPtrArray *refresh_queue; GPtrArray *refresh_queue;
GHashTable *refresh_data; GHashTable *refresh_data;
GMutex mutex; GMutex mutex;
guint refresh_idle_id; guint refresh_idle_id;
skipping to change at line 107 skipping to change at line 107
}; };
/* Forward Declarations */ /* Forward Declarations */
static void ems_tree_model_init (GtkTreeModelIface *iface); static void ems_tree_model_init (GtkTreeModelIface *iface);
G_DEFINE_TYPE_WITH_CODE ( G_DEFINE_TYPE_WITH_CODE (
EMeetingStore, e_meeting_store, GTK_TYPE_LIST_STORE, EMeetingStore, e_meeting_store, GTK_TYPE_LIST_STORE,
G_IMPLEMENT_INTERFACE (E_TYPE_EXTENSIBLE, NULL) G_IMPLEMENT_INTERFACE (E_TYPE_EXTENSIBLE, NULL)
G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_MODEL, ems_tree_model_init)) G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_MODEL, ems_tree_model_init))
static icalparameter_cutype static ICalParameterCutype
text_to_type (const gchar *type) text_to_type (const gchar *type)
{ {
if (!e_util_utf8_strcasecmp (type, _("Individual"))) if (!e_util_utf8_strcasecmp (type, _("Individual")))
return ICAL_CUTYPE_INDIVIDUAL; return I_CAL_CUTYPE_INDIVIDUAL;
else if (!e_util_utf8_strcasecmp (type, _("Group"))) else if (!e_util_utf8_strcasecmp (type, _("Group")))
return ICAL_CUTYPE_GROUP; return I_CAL_CUTYPE_GROUP;
else if (!e_util_utf8_strcasecmp (type, _("Resource"))) else if (!e_util_utf8_strcasecmp (type, _("Resource")))
return ICAL_CUTYPE_RESOURCE; return I_CAL_CUTYPE_RESOURCE;
else if (!e_util_utf8_strcasecmp (type, _("Room"))) else if (!e_util_utf8_strcasecmp (type, _("Room")))
return ICAL_CUTYPE_ROOM; return I_CAL_CUTYPE_ROOM;
else else
return ICAL_CUTYPE_NONE; return I_CAL_CUTYPE_NONE;
} }
static gchar * static gchar *
type_to_text (icalparameter_cutype type) type_to_text (ICalParameterCutype type)
{ {
switch (type) { switch (type) {
case ICAL_CUTYPE_INDIVIDUAL: case I_CAL_CUTYPE_INDIVIDUAL:
return _("Individual"); return _("Individual");
case ICAL_CUTYPE_GROUP: case I_CAL_CUTYPE_GROUP:
return _("Group"); return _("Group");
case ICAL_CUTYPE_RESOURCE: case I_CAL_CUTYPE_RESOURCE:
return _("Resource"); return _("Resource");
case ICAL_CUTYPE_ROOM: case I_CAL_CUTYPE_ROOM:
return _("Room"); return _("Room");
default: default:
return _("Unknown"); return _("Unknown");
} }
return NULL; return NULL;
} }
static icalparameter_role static ICalParameterRole
text_to_role (const gchar *role) text_to_role (const gchar *role)
{ {
if (!e_util_utf8_strcasecmp (role, _("Chair"))) if (!e_util_utf8_strcasecmp (role, _("Chair")))
return ICAL_ROLE_CHAIR; return I_CAL_ROLE_CHAIR;
else if (!e_util_utf8_strcasecmp (role, _("Required Participant"))) else if (!e_util_utf8_strcasecmp (role, _("Required Participant")))
return ICAL_ROLE_REQPARTICIPANT; return I_CAL_ROLE_REQPARTICIPANT;
else if (!e_util_utf8_strcasecmp (role, _("Optional Participant"))) else if (!e_util_utf8_strcasecmp (role, _("Optional Participant")))
return ICAL_ROLE_OPTPARTICIPANT; return I_CAL_ROLE_OPTPARTICIPANT;
else if (!e_util_utf8_strcasecmp (role, _("Non-Participant"))) else if (!e_util_utf8_strcasecmp (role, _("Non-Participant")))
return ICAL_ROLE_NONPARTICIPANT; return I_CAL_ROLE_NONPARTICIPANT;
else else
return ICAL_ROLE_NONE; return I_CAL_ROLE_NONE;
} }
static gchar * static gchar *
role_to_text (icalparameter_role role) role_to_text (ICalParameterRole role)
{ {
switch (role) { switch (role) {
case ICAL_ROLE_CHAIR: case I_CAL_ROLE_CHAIR:
return _("Chair"); return _("Chair");
case ICAL_ROLE_REQPARTICIPANT: case I_CAL_ROLE_REQPARTICIPANT:
return _("Required Participant"); return _("Required Participant");
case ICAL_ROLE_OPTPARTICIPANT: case I_CAL_ROLE_OPTPARTICIPANT:
return _("Optional Participant"); return _("Optional Participant");
case ICAL_ROLE_NONPARTICIPANT: case I_CAL_ROLE_NONPARTICIPANT:
return _("Non-Participant"); return _("Non-Participant");
default: default:
return _("Unknown"); return _("Unknown");
} }
} }
static gboolean static ICalParameterPartstat
text_to_boolean (const gchar *role)
{
if (!e_util_utf8_strcasecmp (role, _("Yes")))
return TRUE;
else
return FALSE;
}
static gchar *
boolean_to_text (gboolean b)
{
if (b)
return _("Yes");
else
return _("No");
}
static icalparameter_partstat
text_to_partstat (const gchar *partstat) text_to_partstat (const gchar *partstat)
{ {
if (!e_util_utf8_strcasecmp (partstat, _("Needs Action"))) if (!e_util_utf8_strcasecmp (partstat, _("Needs Action")))
return ICAL_PARTSTAT_NEEDSACTION; return I_CAL_PARTSTAT_NEEDSACTION;
else if (!e_util_utf8_strcasecmp (partstat, _("Accepted"))) else if (!e_util_utf8_strcasecmp (partstat, _("Accepted")))
return ICAL_PARTSTAT_ACCEPTED; return I_CAL_PARTSTAT_ACCEPTED;
else if (!e_util_utf8_strcasecmp (partstat, _("Declined"))) else if (!e_util_utf8_strcasecmp (partstat, _("Declined")))
return ICAL_PARTSTAT_DECLINED; return I_CAL_PARTSTAT_DECLINED;
else if (!e_util_utf8_strcasecmp (partstat, _("Tentative"))) else if (!e_util_utf8_strcasecmp (partstat, _("Tentative")))
return ICAL_PARTSTAT_TENTATIVE; return I_CAL_PARTSTAT_TENTATIVE;
else if (!e_util_utf8_strcasecmp (partstat, _("Delegated"))) else if (!e_util_utf8_strcasecmp (partstat, _("Delegated")))
return ICAL_PARTSTAT_DELEGATED; return I_CAL_PARTSTAT_DELEGATED;
else if (!e_util_utf8_strcasecmp (partstat, _("Completed"))) else if (!e_util_utf8_strcasecmp (partstat, _("Completed")))
return ICAL_PARTSTAT_COMPLETED; return I_CAL_PARTSTAT_COMPLETED;
else if (!e_util_utf8_strcasecmp (partstat, _("In Process"))) else if (!e_util_utf8_strcasecmp (partstat, _("In Process")))
return ICAL_PARTSTAT_INPROCESS; return I_CAL_PARTSTAT_INPROCESS;
else else
return ICAL_PARTSTAT_NONE; return I_CAL_PARTSTAT_NONE;
} }
static gchar * static gchar *
partstat_to_text (icalparameter_partstat partstat) partstat_to_text (ICalParameterPartstat partstat)
{ {
switch (partstat) { switch (partstat) {
case ICAL_PARTSTAT_NEEDSACTION: case I_CAL_PARTSTAT_NEEDSACTION:
return _("Needs Action"); return _("Needs Action");
case ICAL_PARTSTAT_ACCEPTED: case I_CAL_PARTSTAT_ACCEPTED:
return _("Accepted"); return _("Accepted");
case ICAL_PARTSTAT_DECLINED: case I_CAL_PARTSTAT_DECLINED:
return _("Declined"); return _("Declined");
case ICAL_PARTSTAT_TENTATIVE: case I_CAL_PARTSTAT_TENTATIVE:
return _("Tentative"); return _("Tentative");
case ICAL_PARTSTAT_DELEGATED: case I_CAL_PARTSTAT_DELEGATED:
return _("Delegated"); return _("Delegated");
case ICAL_PARTSTAT_COMPLETED: case I_CAL_PARTSTAT_COMPLETED:
return _("Completed"); return _("Completed");
case ICAL_PARTSTAT_INPROCESS: case I_CAL_PARTSTAT_INPROCESS:
return _("In Process"); return _("In Process");
case ICAL_PARTSTAT_NONE: case I_CAL_PARTSTAT_NONE:
default: default:
return _("Unknown"); return _("Unknown");
} }
} }
static GtkTreeModelFlags static GtkTreeModelFlags
get_flags (GtkTreeModel *model) get_flags (GtkTreeModel *model)
{ {
g_return_val_if_fail (E_IS_MEETING_STORE (model), 0); g_return_val_if_fail (E_IS_MEETING_STORE (model), 0);
skipping to change at line 264 skipping to change at line 246
get_column_type (GtkTreeModel *model, get_column_type (GtkTreeModel *model,
gint col) gint col)
{ {
g_return_val_if_fail (E_IS_MEETING_STORE (model), G_TYPE_INVALID); g_return_val_if_fail (E_IS_MEETING_STORE (model), G_TYPE_INVALID);
switch (col) { switch (col) {
case E_MEETING_STORE_ADDRESS_COL: case E_MEETING_STORE_ADDRESS_COL:
case E_MEETING_STORE_MEMBER_COL: case E_MEETING_STORE_MEMBER_COL:
case E_MEETING_STORE_TYPE_COL: case E_MEETING_STORE_TYPE_COL:
case E_MEETING_STORE_ROLE_COL: case E_MEETING_STORE_ROLE_COL:
case E_MEETING_STORE_RSVP_COL:
case E_MEETING_STORE_DELTO_COL: case E_MEETING_STORE_DELTO_COL:
case E_MEETING_STORE_DELFROM_COL: case E_MEETING_STORE_DELFROM_COL:
case E_MEETING_STORE_STATUS_COL: case E_MEETING_STORE_STATUS_COL:
case E_MEETING_STORE_CN_COL: case E_MEETING_STORE_CN_COL:
case E_MEETING_STORE_LANGUAGE_COL: case E_MEETING_STORE_LANGUAGE_COL:
case E_MEETING_STORE_ATTENDEE_COL: case E_MEETING_STORE_ATTENDEE_COL:
return G_TYPE_STRING; return G_TYPE_STRING;
case E_MEETING_STORE_RSVP_COL:
return G_TYPE_BOOLEAN;
case E_MEETING_STORE_ATTENDEE_UNDERLINE_COL: case E_MEETING_STORE_ATTENDEE_UNDERLINE_COL:
return PANGO_TYPE_UNDERLINE; return PANGO_TYPE_UNDERLINE;
default: default:
return G_TYPE_INVALID; return G_TYPE_INVALID;
} }
} }
static gboolean static gboolean
get_iter (GtkTreeModel *model, get_iter (GtkTreeModel *model,
GtkTreeIter *iter, GtkTreeIter *iter,
skipping to change at line 366 skipping to change at line 349
value, type_to_text ( value, type_to_text (
e_meeting_attendee_get_cutype (attendee))); e_meeting_attendee_get_cutype (attendee)));
break; break;
case E_MEETING_STORE_ROLE_COL: case E_MEETING_STORE_ROLE_COL:
g_value_init (value, G_TYPE_STRING); g_value_init (value, G_TYPE_STRING);
g_value_set_string ( g_value_set_string (
value, role_to_text ( value, role_to_text (
e_meeting_attendee_get_role (attendee))); e_meeting_attendee_get_role (attendee)));
break; break;
case E_MEETING_STORE_RSVP_COL: case E_MEETING_STORE_RSVP_COL:
g_value_init (value, G_TYPE_STRING); g_value_init (value, G_TYPE_BOOLEAN);
g_value_set_string ( g_value_set_boolean (
value, boolean_to_text ( value, e_meeting_attendee_get_rsvp (attendee));
e_meeting_attendee_get_rsvp (attendee)));
break; break;
case E_MEETING_STORE_DELTO_COL: case E_MEETING_STORE_DELTO_COL:
g_value_init (value, G_TYPE_STRING); g_value_init (value, G_TYPE_STRING);
g_value_set_string ( g_value_set_string (
value, itip_strip_mailto ( value, itip_strip_mailto (
e_meeting_attendee_get_delto (attendee))); e_meeting_attendee_get_delto (attendee)));
break; break;
case E_MEETING_STORE_DELFROM_COL: case E_MEETING_STORE_DELFROM_COL:
g_value_init (value, G_TYPE_STRING); g_value_init (value, G_TYPE_STRING);
g_value_set_string ( g_value_set_string (
value, itip_strip_mailto ( value, itip_strip_mailto (
e_meeting_attendee_get_delfrom (attendee))); e_meeting_attendee_get_delfrom (attendee)));
break; break;
case E_MEETING_STORE_STATUS_COL: case E_MEETING_STORE_STATUS_COL:
g_value_init (value, G_TYPE_STRING); g_value_init (value, G_TYPE_STRING);
g_value_set_string ( g_value_set_string (
value, partstat_to_text ( value, partstat_to_text (
e_meeting_attendee_get_status (attendee))); e_meeting_attendee_get_partstat (attendee)));
break; break;
case E_MEETING_STORE_CN_COL: case E_MEETING_STORE_CN_COL:
g_value_init (value, G_TYPE_STRING); g_value_init (value, G_TYPE_STRING);
g_value_set_string ( g_value_set_string (
value, e_meeting_attendee_get_cn (attendee)); value, e_meeting_attendee_get_cn (attendee));
break; break;
case E_MEETING_STORE_LANGUAGE_COL: case E_MEETING_STORE_LANGUAGE_COL:
g_value_init (value, G_TYPE_STRING); g_value_init (value, G_TYPE_STRING);
g_value_set_string ( g_value_set_string (
value, e_meeting_attendee_get_language (attendee)); value, e_meeting_attendee_get_language (attendee));
skipping to change at line 538 skipping to change at line 520
iface->iter_nth_child = iter_nth_child; iface->iter_nth_child = iter_nth_child;
iface->iter_parent = iter_parent; iface->iter_parent = iter_parent;
} }
void void
e_meeting_store_set_value (EMeetingStore *store, e_meeting_store_set_value (EMeetingStore *store,
gint row, gint row,
gint col, gint col,
const gchar *val) const gchar *val)
{ {
icalparameter_cutype type; ICalParameterCutype cutype;
EMeetingAttendee *attendee = g_ptr_array_index (store->priv->attendees, r ow); EMeetingAttendee *attendee = g_ptr_array_index (store->priv->attendees, r ow);
switch (col) { switch (col) {
case E_MEETING_STORE_ADDRESS_COL: case E_MEETING_STORE_ADDRESS_COL:
if (val != NULL && *((gchar *) val)) if (val != NULL && *((gchar *) val)) {
e_meeting_attendee_set_address ( gchar *mailto;
attendee, g_strdup_printf (
"mailto:%s", (gchar *) val)); mailto = g_strdup_printf ("mailto:%s", (const gchar *) va
l);
e_meeting_attendee_set_address (attendee, mailto);
g_free (mailto);
}
break; break;
case E_MEETING_STORE_MEMBER_COL: case E_MEETING_STORE_MEMBER_COL:
e_meeting_attendee_set_member (attendee, g_strdup (val)); e_meeting_attendee_set_member (attendee, val);
break; break;
case E_MEETING_STORE_TYPE_COL: case E_MEETING_STORE_TYPE_COL:
type = text_to_type (val); cutype = text_to_type (val);
e_meeting_attendee_set_cutype (attendee, text_to_type (val)); e_meeting_attendee_set_cutype (attendee, cutype);
if (type == ICAL_CUTYPE_RESOURCE) { if (cutype == I_CAL_CUTYPE_RESOURCE) {
e_meeting_attendee_set_role (attendee, ICAL_ROLE_NONPARTI e_meeting_attendee_set_role (attendee, I_CAL_ROLE_NONPART
CIPANT); ICIPANT);
} }
break; break;
case E_MEETING_STORE_ROLE_COL: case E_MEETING_STORE_ROLE_COL:
e_meeting_attendee_set_role (attendee, text_to_role (val)); e_meeting_attendee_set_role (attendee, text_to_role (val));
break; break;
case E_MEETING_STORE_RSVP_COL: case E_MEETING_STORE_RSVP_COL:
e_meeting_attendee_set_rsvp (attendee, text_to_boolean (val)); e_meeting_attendee_set_rsvp (attendee, val != NULL);
break; break;
case E_MEETING_STORE_DELTO_COL: case E_MEETING_STORE_DELTO_COL:
e_meeting_attendee_set_delto (attendee, g_strdup (val)); e_meeting_attendee_set_delto (attendee, val);
break; break;
case E_MEETING_STORE_DELFROM_COL: case E_MEETING_STORE_DELFROM_COL:
e_meeting_attendee_set_delfrom (attendee, g_strdup (val)); e_meeting_attendee_set_delfrom (attendee, val);
break; break;
case E_MEETING_STORE_STATUS_COL: case E_MEETING_STORE_STATUS_COL:
e_meeting_attendee_set_status (attendee, text_to_partstat (val)); e_meeting_attendee_set_partstat (attendee, text_to_partstat (val) );
break; break;
case E_MEETING_STORE_CN_COL: case E_MEETING_STORE_CN_COL:
e_meeting_attendee_set_cn (attendee, g_strdup (val)); e_meeting_attendee_set_cn (attendee, val);
break; break;
case E_MEETING_STORE_LANGUAGE_COL: case E_MEETING_STORE_LANGUAGE_COL:
e_meeting_attendee_set_language (attendee, g_strdup (val)); e_meeting_attendee_set_language (attendee, val);
break; break;
} }
} }
struct FindAttendeeData struct FindAttendeeData
{ {
EMeetingAttendee *find; EMeetingAttendee *find;
EMeetingStoreQueueData *qdata; EMeetingStoreQueueData *qdata;
}; };
skipping to change at line 683 skipping to change at line 668
case PROP_SHOW_ADDRESS: case PROP_SHOW_ADDRESS:
e_meeting_store_set_show_address ( e_meeting_store_set_show_address (
E_MEETING_STORE (object), E_MEETING_STORE (object),
g_value_get_boolean (value)); g_value_get_boolean (value));
return; return;
case PROP_TIMEZONE: case PROP_TIMEZONE:
e_meeting_store_set_timezone ( e_meeting_store_set_timezone (
E_MEETING_STORE (object), E_MEETING_STORE (object),
g_value_get_pointer (value)); g_value_get_object (value));
return; return;
} }
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
} }
static void static void
meeting_store_get_property (GObject *object, meeting_store_get_property (GObject *object,
guint property_id, guint property_id,
GValue *value, GValue *value,
skipping to change at line 733 skipping to change at line 718
return; return;
case PROP_SHOW_ADDRESS: case PROP_SHOW_ADDRESS:
g_value_set_boolean ( g_value_set_boolean (
value, value,
e_meeting_store_get_show_address ( e_meeting_store_get_show_address (
E_MEETING_STORE (object))); E_MEETING_STORE (object)));
return; return;
case PROP_TIMEZONE: case PROP_TIMEZONE:
g_value_set_pointer ( g_value_set_object (
value, value,
e_meeting_store_get_timezone ( e_meeting_store_get_timezone (
E_MEETING_STORE (object))); E_MEETING_STORE (object)));
return; return;
} }
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
} }
static void static void
skipping to change at line 779 skipping to change at line 764
E_MEETING_STORE (object), E_MEETING_STORE (object),
g_ptr_array_index (priv->refresh_queue, 0)); g_ptr_array_index (priv->refresh_queue, 0));
g_ptr_array_free (priv->refresh_queue, TRUE); g_ptr_array_free (priv->refresh_queue, TRUE);
g_hash_table_destroy (priv->refresh_data); g_hash_table_destroy (priv->refresh_data);
if (priv->refresh_idle_id) if (priv->refresh_idle_id)
g_source_remove (priv->refresh_idle_id); g_source_remove (priv->refresh_idle_id);
g_free (priv->fb_uri); g_free (priv->fb_uri);
g_clear_object (&priv->zone);
g_mutex_clear (&priv->mutex); g_mutex_clear (&priv->mutex);
/* Chain up to parent's finalize() method. */ /* Chain up to parent's finalize() method. */
G_OBJECT_CLASS (e_meeting_store_parent_class)->finalize (object); G_OBJECT_CLASS (e_meeting_store_parent_class)->finalize (object);
} }
static void static void
e_meeting_store_class_init (EMeetingStoreClass *class) e_meeting_store_class_init (EMeetingStoreClass *class)
{ {
GObjectClass *object_class; GObjectClass *object_class;
skipping to change at line 855 skipping to change at line 842
"show-address", "show-address",
"Show email addresses", "Show email addresses",
NULL, NULL,
FALSE, FALSE,
G_PARAM_READWRITE | G_PARAM_READWRITE |
G_PARAM_CONSTRUCT)); G_PARAM_CONSTRUCT));
g_object_class_install_property ( g_object_class_install_property (
object_class, object_class,
PROP_TIMEZONE, PROP_TIMEZONE,
g_param_spec_pointer ( g_param_spec_object (
"timezone", "timezone",
"Timezone", "Timezone",
NULL, NULL,
I_CAL_TYPE_TIMEZONE,
G_PARAM_READWRITE)); G_PARAM_READWRITE));
} }
static void static void
e_meeting_store_init (EMeetingStore *store) e_meeting_store_init (EMeetingStore *store)
{ {
store->priv = E_MEETING_STORE_GET_PRIVATE (store); store->priv = E_MEETING_STORE_GET_PRIVATE (store);
store->priv->attendees = g_ptr_array_new (); store->priv->attendees = g_ptr_array_new ();
store->priv->refresh_queue = g_ptr_array_new (); store->priv->refresh_queue = g_ptr_array_new ();
skipping to change at line 980 skipping to change at line 968
if (g_strcmp0 (store->priv->fb_uri, free_busy_template) == 0) if (g_strcmp0 (store->priv->fb_uri, free_busy_template) == 0)
return; return;
g_free (store->priv->fb_uri); g_free (store->priv->fb_uri);
store->priv->fb_uri = g_strdup (free_busy_template); store->priv->fb_uri = g_strdup (free_busy_template);
g_object_notify (G_OBJECT (store), "free-busy-template"); g_object_notify (G_OBJECT (store), "free-busy-template");
} }
icaltimezone * ICalTimezone *
e_meeting_store_get_timezone (EMeetingStore *store) e_meeting_store_get_timezone (EMeetingStore *store)
{ {
g_return_val_if_fail (E_IS_MEETING_STORE (store), NULL); g_return_val_if_fail (E_IS_MEETING_STORE (store), NULL);
return store->priv->zone; return store->priv->zone;
} }
void void
e_meeting_store_set_timezone (EMeetingStore *store, e_meeting_store_set_timezone (EMeetingStore *store,
icaltimezone *timezone) const ICalTimezone *timezone)
{ {
g_return_if_fail (E_IS_MEETING_STORE (store)); g_return_if_fail (E_IS_MEETING_STORE (store));
if (store->priv->zone == timezone) if (store->priv->zone == timezone)
return; return;
store->priv->zone = timezone; g_clear_object (&store->priv->zone);
store->priv->zone = e_cal_util_copy_timezone (timezone);
g_object_notify (G_OBJECT (store), "timezone"); g_object_notify (G_OBJECT (store), "timezone");
} }
gboolean gboolean
e_meeting_store_get_show_address (EMeetingStore *store) e_meeting_store_get_show_address (EMeetingStore *store)
{ {
g_return_val_if_fail (E_IS_MEETING_STORE (store), FALSE); g_return_val_if_fail (E_IS_MEETING_STORE (store), FALSE);
return store->priv->show_address; return store->priv->show_address;
skipping to change at line 1077 skipping to change at line 1066
gtk_tree_path_append_index (path, store->priv->attendees->len - 1); gtk_tree_path_append_index (path, store->priv->attendees->len - 1);
get_iter (GTK_TREE_MODEL (store), &iter, path); get_iter (GTK_TREE_MODEL (store), &iter, path);
gtk_tree_model_row_inserted (GTK_TREE_MODEL (store), path, &iter); gtk_tree_model_row_inserted (GTK_TREE_MODEL (store), path, &iter);
gtk_tree_path_free (path); gtk_tree_path_free (path);
} }
EMeetingAttendee * EMeetingAttendee *
e_meeting_store_add_attendee_with_defaults (EMeetingStore *store) e_meeting_store_add_attendee_with_defaults (EMeetingStore *store)
{ {
EMeetingAttendee *attendee; EMeetingAttendee *attendee;
gchar *str;
attendee = E_MEETING_ATTENDEE (e_meeting_attendee_new ()); attendee = E_MEETING_ATTENDEE (e_meeting_attendee_new ());
e_meeting_attendee_set_address (attendee, g_strdup ("")); e_meeting_attendee_set_address (attendee, "");
e_meeting_attendee_set_member (attendee, g_strdup ("")); e_meeting_attendee_set_member (attendee, "");
e_meeting_attendee_set_cutype (attendee, text_to_type (_("Individual")));
e_meeting_attendee_set_role (attendee, text_to_role (_("Required Particip
ant")));
e_meeting_attendee_set_rsvp (attendee, TRUE);
str = g_strdup (_("Individual")); e_meeting_attendee_set_delto (attendee, "");
e_meeting_attendee_set_cutype (attendee, text_to_type (str)); e_meeting_attendee_set_delfrom (attendee, "");
g_free (str);
str = g_strdup (_("Required Participant"));
e_meeting_attendee_set_role (attendee, text_to_role (str));
g_free (str);
str = g_strdup (_("Yes"));
e_meeting_attendee_set_rsvp (attendee, text_to_boolean (str));
g_free (str);
e_meeting_attendee_set_delto (attendee, g_strdup (""));
e_meeting_attendee_set_delfrom (attendee, g_strdup (""));
str = g_strdup (_("Needs Action"));
e_meeting_attendee_set_status (attendee, text_to_partstat (str));
g_free (str);
e_meeting_attendee_set_cn (attendee, g_strdup ("")); e_meeting_attendee_set_partstat (attendee, text_to_partstat (_("Needs Act
e_meeting_attendee_set_language (attendee, g_strdup ("en")); ion")));
e_meeting_attendee_set_cn (attendee, "");
e_meeting_attendee_set_language (attendee, "");
e_meeting_store_add_attendee (store, attendee); e_meeting_store_add_attendee (store, attendee);
return attendee; return attendee;
} }
void void
e_meeting_store_remove_attendee (EMeetingStore *store, e_meeting_store_remove_attendee (EMeetingStore *store,
EMeetingAttendee *attendee) EMeetingAttendee *attendee)
{ {
skipping to change at line 1311 skipping to change at line 1291
} }
const GPtrArray * const GPtrArray *
e_meeting_store_get_attendees (EMeetingStore *store) e_meeting_store_get_attendees (EMeetingStore *store)
{ {
g_return_val_if_fail (E_IS_MEETING_STORE (store), NULL); g_return_val_if_fail (E_IS_MEETING_STORE (store), NULL);
return store->priv->attendees; return store->priv->attendees;
} }
static icaltimezone * static ICalTimezone *
find_zone (icalproperty *ip, find_zone (ICalProperty *in_prop,
icalcomponent *tz_top_level) ICalComponent *tz_top_level)
{ {
icalparameter *param; ICalParameter *param;
icalcomponent *sub_comp; ICalComponent *subcomp;
const gchar *tzid; const gchar *tzid;
icalcompiter iter; ICalCompIter *iter;
if (tz_top_level == NULL) if (tz_top_level == NULL)
return NULL; return NULL;
param = icalproperty_get_first_parameter (ip, ICAL_TZID_PARAMETER); param = i_cal_property_get_first_parameter (in_prop, I_CAL_TZID_PARAMETER );
if (param == NULL) if (param == NULL)
return NULL; return NULL;
tzid = icalparameter_get_tzid (param); tzid = i_cal_parameter_get_tzid (param);
iter = icalcomponent_begin_component (tz_top_level, ICAL_VTIMEZONE_COMPON iter = i_cal_component_begin_component (tz_top_level, I_CAL_VTIMEZONE_COM
ENT); PONENT);
while ((sub_comp = icalcompiter_deref (&iter)) != NULL) { subcomp = i_cal_comp_iter_deref (iter);
icalcomponent *clone; while (subcomp) {
icalproperty *prop; ICalComponent *next_subcomp;
const gchar *tz_tzid; ICalProperty *prop;
prop = icalcomponent_get_first_property (sub_comp, ICAL_TZID_PROP next_subcomp = i_cal_comp_iter_next (iter);
ERTY);
tz_tzid = icalproperty_get_tzid (prop); prop = i_cal_component_get_first_property (subcomp, I_CAL_TZID_PR
if (!strcmp (tzid, tz_tzid)) { OPERTY);
icaltimezone *zone; if (prop && !g_strcmp0 (tzid, i_cal_property_get_tzid (prop))) {
ICalComponent *clone;
zone = icaltimezone_new (); ICalTimezone *zone;
clone = icalcomponent_new_clone (sub_comp);
icaltimezone_set_component (zone, clone); zone = i_cal_timezone_new ();
clone = i_cal_component_clone (subcomp);
i_cal_timezone_set_component (zone, clone);
g_clear_object (&next_subcomp);
g_clear_object (&subcomp);
g_clear_object (&param);
g_clear_object (&prop);
g_clear_object (&iter);
return zone; return zone;
} }
icalcompiter_next (&iter); g_clear_object (&prop);
g_object_unref (subcomp);
subcomp = next_subcomp;
} }
g_clear_object (&param);
g_clear_object (&iter);
return NULL; return NULL;
} }
static void static void
process_callbacks (EMeetingStoreQueueData *qdata) process_callbacks (EMeetingStoreQueueData *qdata)
{ {
EMeetingStore *store; EMeetingStore *store;
gint i; gint i;
store = qdata->store; store = qdata->store;
skipping to change at line 1379 skipping to change at line 1372
g_mutex_lock (&store->priv->mutex); g_mutex_lock (&store->priv->mutex);
store->priv->num_threads--; store->priv->num_threads--;
g_mutex_unlock (&store->priv->mutex); g_mutex_unlock (&store->priv->mutex);
refresh_queue_remove (qdata->store, qdata->attendee); refresh_queue_remove (qdata->store, qdata->attendee);
g_object_unref (store); g_object_unref (store);
} }
static void static void
process_free_busy_comp_get_xfb (icalproperty *ip, process_free_busy_comp_get_xfb (ICalProperty *ip,
gchar **summary, gchar **summary,
gchar **location) gchar **location)
{ {
const gchar *tmp = NULL; gchar *tmp;
g_return_if_fail (ip != NULL); g_return_if_fail (ip != NULL);
g_return_if_fail (summary != NULL && *summary == NULL); g_return_if_fail (summary != NULL && *summary == NULL);
g_return_if_fail (location != NULL && *location == NULL); g_return_if_fail (location != NULL && *location == NULL);
/* We extract extended free/busy information from the icalproperty /* We extract extended free/busy information from the ICalProperty
* here (X-SUMMARY and X-LOCATION). If the property carries such, * here (X-SUMMARY and X-LOCATION). If the property carries such,
* it will be displayed as a tooltip for the busy period. Otherwise, * it will be displayed as a tooltip for the busy period. Otherwise,
* nothing will happen (*summary and/or *location will be NULL) * nothing will happen (*summary and/or *location will be NULL)
*/ */
tmp = icalproperty_get_parameter_as_string ( tmp = i_cal_property_get_parameter_as_string (ip, E_MEETING_FREE_BUSY_XPR
ip, E_MEETING_FREE_BUSY_XPROP_SUMMARY); OP_SUMMARY);
*summary = e_meeting_xfb_utf8_string_new_from_ical ( *summary = e_meeting_xfb_utf8_string_new_from_ical (tmp, E_MEETING_FREE_B
tmp, E_MEETING_FREE_BUSY_XPROP_MAXLEN); USY_XPROP_MAXLEN);
tmp = icalproperty_get_parameter_as_string ( g_free (tmp);
ip, E_MEETING_FREE_BUSY_XPROP_LOCATION);
*location = e_meeting_xfb_utf8_string_new_from_ical ( tmp = i_cal_property_get_parameter_as_string (ip, E_MEETING_FREE_BUSY_XPR
tmp, E_MEETING_FREE_BUSY_XPROP_MAXLEN); OP_LOCATION);
*location = e_meeting_xfb_utf8_string_new_from_ical (tmp, E_MEETING_FREE_
BUSY_XPROP_MAXLEN);
g_free (tmp);
} }
static void static void
process_free_busy_comp (EMeetingAttendee *attendee, process_free_busy_comp (EMeetingAttendee *attendee,
icalcomponent *fb_comp, ICalComponent *fb_comp,
icaltimezone *zone, ICalTimezone *zone,
icalcomponent *tz_top_level) ICalComponent *tz_top_level)
{ {
icalproperty *ip; ICalProperty *ip;
ip = icalcomponent_get_first_property (fb_comp, ICAL_DTSTART_PROPERTY); ip = i_cal_component_get_first_property (fb_comp, I_CAL_DTSTART_PROPERTY) ;
if (ip != NULL) { if (ip != NULL) {
struct icaltimetype dtstart; ICalTime *dtstart;
icaltimezone *ds_zone; ICalTimezone *ds_zone;
dtstart = i_cal_property_get_dtstart (ip);
if (dtstart) {
if (!i_cal_time_is_utc (dtstart))
ds_zone = find_zone (ip, tz_top_level);
else
ds_zone = g_object_ref (i_cal_timezone_get_utc_ti
mezone ());
i_cal_time_convert_timezone (dtstart, ds_zone, zone);
dtstart = icalproperty_get_dtstart (ip); e_meeting_attendee_set_start_busy_range (
if (!icaltime_is_utc (dtstart)) attendee,
ds_zone = find_zone (ip, tz_top_level); i_cal_time_get_year (dtstart),
else i_cal_time_get_month (dtstart),
ds_zone = icaltimezone_get_utc_timezone (); i_cal_time_get_day (dtstart),
icaltimezone_convert_time (&dtstart, ds_zone, zone); i_cal_time_get_hour (dtstart),
e_meeting_attendee_set_start_busy_range ( i_cal_time_get_minute (dtstart));
attendee,
dtstart.year, g_clear_object (&ds_zone);
dtstart.month, g_clear_object (&dtstart);
dtstart.day, }
dtstart.hour,
dtstart.minute);
} }
g_clear_object (&ip);
ip = icalcomponent_get_first_property (fb_comp, ICAL_DTEND_PROPERTY); ip = i_cal_component_get_first_property (fb_comp, I_CAL_DTEND_PROPERTY);
if (ip != NULL) { if (ip != NULL) {
struct icaltimetype dtend; ICalTime *dtend;
icaltimezone *de_zone; ICalTimezone *de_zone;
dtend = i_cal_property_get_dtend (ip);
if (dtend) {
if (!i_cal_time_is_utc (dtend))
de_zone = find_zone (ip, tz_top_level);
else
de_zone = g_object_ref (i_cal_timezone_get_utc_ti
mezone ());
i_cal_time_convert_timezone (dtend, de_zone, zone);
e_meeting_attendee_set_end_busy_range (
attendee,
i_cal_time_get_year (dtend),
i_cal_time_get_month (dtend),
i_cal_time_get_day (dtend),
i_cal_time_get_hour (dtend),
i_cal_time_get_minute (dtend));
g_clear_object (&de_zone);
g_clear_object (&dtend);
}
}
g_clear_object (&ip);
dtend = icalproperty_get_dtend (ip); for (ip = i_cal_component_get_first_property (fb_comp, I_CAL_FREEBUSY_PRO
if (!icaltime_is_utc (dtend)) PERTY);
de_zone = find_zone (ip, tz_top_level); ip;
else g_object_unref (ip), ip = i_cal_component_get_next_property (fb_comp
de_zone = icaltimezone_get_utc_timezone (); , I_CAL_FREEBUSY_PROPERTY)) {
icaltimezone_convert_time (&dtend, de_zone, zone); ICalParameter *param;
e_meeting_attendee_set_end_busy_range ( ICalPeriod *fb;
attendee,
dtend.year,
dtend.month,
dtend.day,
dtend.hour,
dtend.minute);
}
ip = icalcomponent_get_first_property (fb_comp, ICAL_FREEBUSY_PROPERTY);
while (ip != NULL) {
icalparameter *param;
struct icalperiodtype fb;
EMeetingFreeBusyType busy_type = E_MEETING_FREE_BUSY_LAST; EMeetingFreeBusyType busy_type = E_MEETING_FREE_BUSY_LAST;
icalparameter_fbtype fbtype = ICAL_FBTYPE_BUSY; ICalParameterFbtype fbtype = I_CAL_FBTYPE_BUSY;
fb = icalproperty_get_freebusy (ip); fb = i_cal_property_get_freebusy (ip);
param = icalproperty_get_first_parameter (ip, ICAL_FBTYPE_PARAMET param = i_cal_property_get_first_parameter (ip, I_CAL_FBTYPE_PARA
ER); METER);
if (param != NULL) if (param) {
fbtype = icalparameter_get_fbtype (param); fbtype = i_cal_parameter_get_fbtype (param);
g_clear_object (&param);
}
switch (fbtype) { switch (fbtype) {
case ICAL_FBTYPE_BUSY: case I_CAL_FBTYPE_BUSY:
busy_type = E_MEETING_FREE_BUSY_BUSY; busy_type = E_MEETING_FREE_BUSY_BUSY;
break; break;
case ICAL_FBTYPE_BUSYUNAVAILABLE: case I_CAL_FBTYPE_BUSYUNAVAILABLE:
busy_type = E_MEETING_FREE_BUSY_OUT_OF_OFFICE; busy_type = E_MEETING_FREE_BUSY_OUT_OF_OFFICE;
break; break;
case ICAL_FBTYPE_BUSYTENTATIVE: case I_CAL_FBTYPE_BUSYTENTATIVE:
busy_type = E_MEETING_FREE_BUSY_TENTATIVE; busy_type = E_MEETING_FREE_BUSY_TENTATIVE;
break; break;
case ICAL_FBTYPE_FREE: case I_CAL_FBTYPE_FREE:
busy_type = E_MEETING_FREE_BUSY_FREE; busy_type = E_MEETING_FREE_BUSY_FREE;
break; break;
default: default:
break; break;
} }
if (busy_type != E_MEETING_FREE_BUSY_LAST) { if (busy_type != E_MEETING_FREE_BUSY_LAST) {
icaltimezone *utc_zone = icaltimezone_get_utc_timezone () ICalTimezone *utc_zone = i_cal_timezone_get_utc_timezone
; ();
ICalTime *fbstart, *fbend;
gchar *summary = NULL; gchar *summary = NULL;
gchar *location = NULL; gchar *location = NULL;
icaltimezone_convert_time (&fb.start, utc_zone, zone); fbstart = i_cal_period_get_start (fb);
icaltimezone_convert_time (&fb.end, utc_zone, zone); fbend = i_cal_period_get_end (fb);
i_cal_time_convert_timezone (fbstart, utc_zone, zone);
i_cal_time_convert_timezone (fbend, utc_zone, zone);
/* Extract extended free/busy (XFB) information from /* Extract extended free/busy (XFB) information from
* the icalproperty, if it carries such. * the ICalProperty, if it carries such.
* See the comment for the EMeetingXfbData structure * See the comment for the EMeetingXfbData structure
* for a reference. * for a reference.
*/ */
process_free_busy_comp_get_xfb (ip, &summary, &location); process_free_busy_comp_get_xfb (ip, &summary, &location);
e_meeting_attendee_add_busy_period ( e_meeting_attendee_add_busy_period (
attendee, attendee,
fb.start.year, i_cal_time_get_year (fbstart),
fb.start.month, i_cal_time_get_month (fbstart),
fb.start.day, i_cal_time_get_day (fbstart),
fb.start.hour, i_cal_time_get_hour (fbstart),
fb.start.minute, i_cal_time_get_minute (fbstart),
fb.end.year, i_cal_time_get_year (fbend),
fb.end.month, i_cal_time_get_month (fbend),
fb.end.day, i_cal_time_get_day (fbend),
fb.end.hour, i_cal_time_get_hour (fbend),
fb.end.minute, i_cal_time_get_minute (fbend),
busy_type, busy_type,
summary, summary,
location); location);
if (summary != NULL) g_clear_object (&fbstart);
g_free (summary); g_clear_object (&fbend);
if (location != NULL) g_free (summary);
g_free (location); g_free (location);
} }
ip = icalcomponent_get_next_property (fb_comp, ICAL_FREEBUSY_PROP ERTY); g_clear_object (&fb);
} }
} }
static void static void
process_free_busy (EMeetingStoreQueueData *qdata, process_free_busy (EMeetingStoreQueueData *qdata,
gchar *text) const gchar *text)
{ {
EMeetingStore *store = qdata->store; EMeetingStore *store = qdata->store;
EMeetingStorePrivate *priv; EMeetingStorePrivate *priv;
EMeetingAttendee *attendee = qdata->attendee; EMeetingAttendee *attendee = qdata->attendee;
icalcomponent *main_comp; ICalComponent *main_comp;
icalcomponent_kind kind = ICAL_NO_COMPONENT; ICalComponentKind kind = I_CAL_NO_COMPONENT;
priv = store->priv; priv = store->priv;
main_comp = icalparser_parse_string (text); main_comp = i_cal_parser_parse_string (text);
if (main_comp == NULL) { if (main_comp == NULL) {
process_callbacks (qdata); process_callbacks (qdata);
return; return;
} }
kind = icalcomponent_isa (main_comp); kind = i_cal_component_isa (main_comp);
if (kind == ICAL_VCALENDAR_COMPONENT) { if (kind == I_CAL_VCALENDAR_COMPONENT) {
icalcompiter iter; ICalCompIter *iter;
icalcomponent *tz_top_level, *sub_comp; ICalComponent *tz_top_level, *subcomp;
tz_top_level = e_cal_util_new_top_level (); tz_top_level = e_cal_util_new_top_level ();
iter = icalcomponent_begin_component (main_comp, ICAL_VTIMEZONE_C iter = i_cal_component_begin_component (main_comp, I_CAL_VTIMEZON
OMPONENT); E_COMPONENT);
while ((sub_comp = icalcompiter_deref (&iter)) != NULL) { subcomp = i_cal_comp_iter_deref (iter);
icalcomponent *clone; while (subcomp) {
ICalComponent *next_subcomp;
clone = icalcomponent_new_clone (sub_comp); next_subcomp = i_cal_comp_iter_next (iter);
icalcomponent_add_component (tz_top_level, clone);
icalcompiter_next (&iter); i_cal_component_take_component (tz_top_level,
i_cal_component_clone (subcomp));
g_object_unref (subcomp);
subcomp = next_subcomp;
} }
iter = icalcomponent_begin_component (main_comp, ICAL_VFREEBUSY_C g_clear_object (&iter);
OMPONENT);
while ((sub_comp = icalcompiter_deref (&iter)) != NULL) { iter = i_cal_component_begin_component (main_comp, I_CAL_VFREEBUS
process_free_busy_comp (attendee, sub_comp, priv->zone, t Y_COMPONENT);
z_top_level); subcomp = i_cal_comp_iter_deref (iter);
while (subcomp) {
ICalComponent *next_subcomp;
next_subcomp = i_cal_comp_iter_next (iter);
icalcompiter_next (&iter); process_free_busy_comp (attendee, subcomp, priv->zone, tz
_top_level);
g_object_unref (subcomp);
subcomp = next_subcomp;
} }
icalcomponent_free (tz_top_level);
} else if (kind == ICAL_VFREEBUSY_COMPONENT) { g_clear_object (&iter);
g_clear_object (&tz_top_level);
} else if (kind == I_CAL_VFREEBUSY_COMPONENT) {
process_free_busy_comp (attendee, main_comp, priv->zone, NULL); process_free_busy_comp (attendee, main_comp, priv->zone, NULL);
} }
icalcomponent_free (main_comp); g_clear_object (&main_comp);
process_callbacks (qdata); process_callbacks (qdata);
} }
/* /*
* Replace all instances of from_value in string with to_value * Replace all instances of from_value in string with to_value
* In the returned newly allocated string. * In the returned newly allocated string.
*/ */
static gchar * static gchar *
replace_string (gchar *string, replace_string (gchar *string,
skipping to change at line 1750 skipping to change at line 1777
fbd->users = NULL; fbd->users = NULL;
fbd->fb_data = NULL; fbd->fb_data = NULL;
fbd->qdata = qdata; fbd->qdata = qdata;
fbd->fb_uri = priv->fb_uri; fbd->fb_uri = priv->fb_uri;
fbd->store = store; fbd->store = store;
fbd->email = g_strdup (itip_strip_mailto ( fbd->email = g_strdup (itip_strip_mailto (
e_meeting_attendee_get_address (attendee))); e_meeting_attendee_get_address (attendee)));
/* Check the server for free busy data */ /* Check the server for free busy data */
if (priv->client) { if (priv->client) {
struct icaltimetype itt; ICalTime *itt;
itt = icaltime_null_time (); itt = i_cal_time_new_null_time ();
itt.year = g_date_get_year (&qdata->start.date); i_cal_time_set_date (itt,
itt.month = g_date_get_month (&qdata->start.date); g_date_get_year (&qdata->start.date),
itt.day = g_date_get_day (&qdata->start.date); g_date_get_month (&qdata->start.date),
itt.hour = qdata->start.hour; g_date_get_day (&qdata->start.date));
itt.minute = qdata->start.minute; i_cal_time_set_time (itt,
fbd->startt = icaltime_as_timet_with_zone (itt, priv->zone); qdata->start.hour,
qdata->start.minute,
itt = icaltime_null_time (); 0);
itt.year = g_date_get_year (&qdata->end.date); fbd->startt = i_cal_time_as_timet_with_zone (itt, priv->zone);
itt.month = g_date_get_month (&qdata->end.date); g_clear_object (&itt);
itt.day = g_date_get_day (&qdata->end.date);
itt.hour = qdata->end.hour; itt = i_cal_time_new_null_time ();
itt.minute = qdata->end.minute; i_cal_time_set_date (itt,
fbd->endt = icaltime_as_timet_with_zone (itt, priv->zone); g_date_get_year (&qdata->end.date),
fbd->qdata = qdata; g_date_get_month (&qdata->end.date),
g_date_get_day (&qdata->end.date));
i_cal_time_set_time (itt,
qdata->end.hour,
qdata->end.minute,
0);
fbd->endt = i_cal_time_as_timet_with_zone (itt, priv->zone);
g_clear_object (&itt);
fbd->qdata = qdata;
fbd->users = g_slist_append (fbd->users, g_strdup (fbd->email)); fbd->users = g_slist_append (fbd->users, g_strdup (fbd->email));
} }
g_mutex_lock (&store->priv->mutex); g_mutex_lock (&store->priv->mutex);
store->priv->num_threads++; store->priv->num_threads++;
g_mutex_unlock (&store->priv->mutex); g_mutex_unlock (&store->priv->mutex);
thread = g_thread_try_new (NULL, (GThreadFunc) freebusy_async, fbd, &erro r); thread = g_thread_try_new (NULL, (GThreadFunc) freebusy_async, fbd, &erro r);
if (!thread) { if (!thread) {
skipping to change at line 1905 skipping to change at line 1940
} }
g_return_if_fail (read >= 0); g_return_if_fail (read >= 0);
if (read == 0) { if (read == 0) {
g_input_stream_close (istream, NULL, NULL); g_input_stream_close (istream, NULL, NULL);
g_object_unref (istream); g_object_unref (istream);
process_free_busy (qdata, qdata->string->str); process_free_busy (qdata, qdata->string->str);
} else { } else {
qdata->buffer[read] = '\0'; qdata->buffer[read] = '\0';
qdata->string = g_string_append (qdata->string, qdata->buffer); g_string_append (qdata->string, qdata->buffer);
g_input_stream_read_async ( g_input_stream_read_async (
istream, qdata->buffer, BUF_SIZE - 1, istream, qdata->buffer, BUF_SIZE - 1,
G_PRIORITY_DEFAULT, NULL, async_read, qdata); G_PRIORITY_DEFAULT, NULL, async_read, qdata);
} }
} }
static void static void
soup_authenticate (SoupSession *session, soup_authenticate (SoupSession *session,
SoupMessage *msg, SoupMessage *msg,
skipping to change at line 1976 skipping to change at line 2011
g_string_append_printf ( g_string_append_printf (
description, _("Enter password to access " description, _("Enter password to access "
"free/busy information on server %s as user %s"), "free/busy information on server %s as user %s"),
bold_host, bold_user); bold_host, bold_user);
g_free (bold_host); g_free (bold_host);
g_free (bold_user); g_free (bold_user);
if (retrying && msg->reason_phrase && *msg->reason_phrase) { if (retrying && msg->reason_phrase && *msg->reason_phrase) {
g_string_append (description, "\n"); g_string_append_c (description, '\n');
g_string_append_printf ( g_string_append_printf (
description, _("Failure reason: %s"), description, _("Failure reason: %s"),
msg->reason_phrase); msg->reason_phrase);
} }
password = e_passwords_ask_password ( password = e_passwords_ask_password (
_("Enter password"), orig_uri, _("Enter password"), orig_uri,
description->str, E_PASSWORDS_REMEMBER_FOREVER | description->str, E_PASSWORDS_REMEMBER_FOREVER |
E_PASSWORDS_SECRET | E_PASSWORDS_ONLINE | E_PASSWORDS_SECRET | E_PASSWORDS_ONLINE |
(retrying ? E_PASSWORDS_REPROMPT : 0), (retrying ? E_PASSWORDS_REPROMPT : 0),
&remember, NULL); &remember, NULL);
g_string_free (description, TRUE); g_string_free (description, TRUE);
if (password) { if (password) {
soup_auth_authenticate (auth, suri->user, password); soup_auth_authenticate (auth, suri->user, password);
tried = TRUE;
memset (password, 0, strlen (password)); memset (password, 0, strlen (password));
g_free (password); g_free (password);
} }
} }
soup_uri_free (suri); soup_uri_free (suri);
} }
static void static void
 End of changes. 117 change blocks. 
261 lines changed or deleted 306 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)