diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2007-11-15 06:04:21 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2007-11-15 06:04:21 +0800 |
commit | 9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91 (patch) | |
tree | 2e1e96f33404781354c422a7e9beaf458ebeb655 /plugins/itip-formatter | |
parent | 7e8f8bb9e5167b0219b48ab3e8062080d3740b0a (diff) | |
download | gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.tar gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.tar.gz gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.tar.bz2 gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.tar.lz gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.tar.xz gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.tar.zst gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.zip |
** Remove trailing whitespace from source code.
2007-11-14 Matthew Barnes <mbarnes@redhat.com>
** Remove trailing whitespace from source code.
svn path=/trunk/; revision=34537
Diffstat (limited to 'plugins/itip-formatter')
-rw-r--r-- | plugins/itip-formatter/itip-formatter.c | 400 | ||||
-rw-r--r-- | plugins/itip-formatter/itip-view.c | 492 | ||||
-rw-r--r-- | plugins/itip-formatter/itip-view.h | 6 |
3 files changed, 449 insertions, 449 deletions
diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c index e44740ff6e..7d7fabfe01 100644 --- a/plugins/itip-formatter/itip-formatter.c +++ b/plugins/itip-formatter/itip-formatter.c @@ -59,7 +59,7 @@ #define CLASSID "itip://" #define GCONF_KEY_DELETE "/apps/evolution/itip/delete_processed" -#define d(x) +#define d(x) void format_itip (EPlugin *ep, EMFormatHookTarget *target); GtkWidget *itip_formatter_page_factory (EPlugin *ep, EConfigHookItemFactoryData *hook_data); @@ -68,9 +68,9 @@ typedef struct { EMFormatHTMLPObject pobject; GtkWidget *view; - + ESourceList *source_lists[E_CAL_SOURCE_TYPE_LAST]; - GHashTable *ecals[E_CAL_SOURCE_TYPE_LAST]; + GHashTable *ecals[E_CAL_SOURCE_TYPE_LAST]; ECal *current_ecal; ECalSourceType type; @@ -84,14 +84,14 @@ typedef struct { icalproperty_method method; time_t start_time; time_t end_time; - + int current; int total; gchar *calendar_uid; EAccountList *accounts; - + gchar *from_address; gchar *from_name; gchar *to_address; @@ -147,7 +147,7 @@ find_attendee (icalcomponent *ical_comp, const char *address) } g_free (text); } - + return prop; } @@ -183,7 +183,7 @@ find_attendee_if_sentby (icalcomponent *ical_comp, const char *address) } g_free (text); } - + return prop; } @@ -191,7 +191,7 @@ static void find_to_address (FormatItipPObject *pitip, icalcomponent *ical_comp, icalparameter_partstat *status) { EIterator *it; - + it = e_list_get_iterator((EList *)pitip->accounts); /* Look through the list of attendees to find the user's address */ @@ -236,14 +236,14 @@ find_to_address (FormatItipPObject *pitip, icalcomponent *ical_comp, icalparamet e_iterator_reset (it); /* If the user's address was not found in the attendee's list, then the user - * might be responding on behalf of his/her delegator. In this case, we - * would want to go through the SENT-BY fields of the attendees to find + * might be responding on behalf of his/her delegator. In this case, we + * would want to go through the SENT-BY fields of the attendees to find * the user's address. * - * Note: This functionality could have been (easily) implemented in the - * previous loop, but it would hurt the performance for all providers in + * Note: This functionality could have been (easily) implemented in the + * previous loop, but it would hurt the performance for all providers in * general. Hence, we choose to iterate through the accounts list again. - */ + */ if (!pitip->my_address) while (e_iterator_is_valid(it)) { @@ -320,7 +320,7 @@ find_from_address (FormatItipPObject *pitip, icalcomponent *ical_comp) return; pitip->from_address = g_strdup (organizer_clean); - + param = icalproperty_get_first_parameter (prop, ICAL_CN_PARAMETER); if (param) pitip->from_name = g_strdup (icalparameter_get_cn (param)); @@ -334,7 +334,7 @@ find_from_address (FormatItipPObject *pitip, icalcomponent *ical_comp) continue; } - if ((organizer_clean && !g_ascii_strcasecmp (organizer_clean, account->id->address)) + if ((organizer_clean && !g_ascii_strcasecmp (organizer_clean, account->id->address)) || (organizer_sentby_clean && !g_ascii_strcasecmp (organizer_sentby_clean, account->id->address))) { pitip->my_address = g_strdup (account->id->address); @@ -375,13 +375,13 @@ static void adjust_item (FormatItipPObject *pitip, ECalComponent *comp) { ECalComponent *real_comp; - + real_comp = get_real_item (pitip); if (real_comp != NULL) { ECalComponentText text; const char *string; GSList *l; - + e_cal_component_get_summary (real_comp, &text); e_cal_component_set_summary (comp, &text); e_cal_component_get_location (real_comp, &string); @@ -389,11 +389,11 @@ adjust_item (FormatItipPObject *pitip, ECalComponent *comp) e_cal_component_get_description_list (real_comp, &l); e_cal_component_set_description_list (comp, l); e_cal_component_free_text_list (l); - + g_object_unref (real_comp); } else { ECalComponentText text = {_("Unknown"), NULL}; - + e_cal_component_set_summary (comp, &text); } } @@ -401,11 +401,11 @@ adjust_item (FormatItipPObject *pitip, ECalComponent *comp) static void set_buttons_sensitive (FormatItipPObject *pitip) { - gboolean read_only = TRUE; - + gboolean read_only = TRUE; + if (pitip->current_ecal) e_cal_is_read_only (pitip->current_ecal, &read_only, NULL); - + itip_view_set_buttons_sensitive (ITIP_VIEW (pitip->view), pitip->current_ecal != NULL && !read_only); } @@ -419,7 +419,7 @@ cal_opened_cb (ECal *ecal, ECalendarStatus status, gpointer data) source_type = e_cal_get_source_type (ecal); source = e_cal_get_source (ecal); - + g_signal_handlers_disconnect_matched (ecal, G_SIGNAL_MATCH_FUNC, 0, 0, NULL, cal_opened_cb, NULL); if (status != E_CALENDAR_STATUS_OK) { @@ -428,7 +428,7 @@ cal_opened_cb (ECal *ecal, ECalendarStatus status, gpointer data) ITIP_VIEW_INFO_ITEM_TYPE_WARNING, _("Failed to load the calendar '%s'"), e_source_peek_name (source)); - + if (pitip->current_ecal == ecal) { pitip->current_ecal = NULL; itip_view_set_buttons_sensitive (ITIP_VIEW (pitip->view), FALSE); @@ -437,7 +437,7 @@ cal_opened_cb (ECal *ecal, ECalendarStatus status, gpointer data) g_hash_table_remove (pitip->ecals[source_type], e_source_peek_uid (source)); return; } - + if (e_cal_get_static_capability (ecal, CAL_STATIC_CAPABILITY_RECURRENCES_NO_MASTER)) { icalcomponent *icalcomp = e_cal_component_get_icalcomponent (pitip->comp); @@ -448,13 +448,13 @@ cal_opened_cb (ECal *ecal, ECalendarStatus status, gpointer data) } if (pitip->type == E_CAL_SOURCE_TYPE_JOURNAL) { - if (e_cal_get_static_capability (ecal, CAL_STATIC_CAPABILITY_HAS_UNACCEPTED_MEETING)) + if (e_cal_get_static_capability (ecal, CAL_STATIC_CAPABILITY_HAS_UNACCEPTED_MEETING)) itip_view_set_needs_decline (ITIP_VIEW (pitip->view), TRUE); else itip_view_set_needs_decline (ITIP_VIEW (pitip->view), FALSE); itip_view_set_mode (ITIP_VIEW (pitip->view), ITIP_VIEW_MODE_PUBLISH); } - + pitip->current_ecal = ecal; set_buttons_sensitive (pitip); @@ -465,7 +465,7 @@ start_calendar_server (FormatItipPObject *pitip, ESource *source, ECalSourceType { ECal *ecal; icaltimezone *zone = NULL; - + ecal = g_hash_table_lookup (pitip->ecals[type], e_source_peek_uid (source)); if (ecal) { pitip->current_ecal = ecal; @@ -475,18 +475,18 @@ start_calendar_server (FormatItipPObject *pitip, ESource *source, ECalSourceType set_buttons_sensitive (pitip); - return ecal; + return ecal; } - + ecal = auth_new_cal_from_source (source, type); - + if (!ecal) return NULL; - + g_signal_connect (G_OBJECT (ecal), "cal_opened", G_CALLBACK (func), data); g_hash_table_insert (pitip->ecals[type], g_strdup (e_source_peek_uid (source)), ecal); - + zone = calendar_config_get_icaltimezone (); e_cal_set_default_timezone (ecal, zone, NULL); @@ -509,7 +509,7 @@ start_calendar_server_by_uid (FormatItipPObject *pitip, const char *uid, ECalSou if (source) return start_calendar_server (pitip, source, type, cal_opened_cb, pitip); } - + return NULL; } @@ -517,7 +517,7 @@ static void source_selected_cb (ItipView *view, ESource *source, gpointer data) { FormatItipPObject *pitip = data; - + itip_view_set_buttons_sensitive (ITIP_VIEW (pitip->view), FALSE); start_calendar_server (pitip, source, pitip->type, cal_opened_cb, pitip); @@ -532,12 +532,12 @@ find_cal_opened_cb (ECal *ecal, ECalendarStatus status, gpointer data) ECalSourceType source_type; icalcomponent *icalcomp; GList *objects = NULL; - + source_type = e_cal_get_source_type (ecal); source = e_cal_get_source (ecal); - + fd->count--; - + g_signal_handlers_disconnect_matched (ecal, G_SIGNAL_MATCH_FUNC, 0, 0, NULL, find_cal_opened_cb, NULL); if (status != E_CALENDAR_STATUS_OK) { @@ -553,7 +553,7 @@ find_cal_opened_cb (ECal *ecal, ECalendarStatus status, gpointer data) pitip->current_ecal = NULL; itip_view_set_buttons_sensitive (ITIP_VIEW (pitip->view), FALSE); } - + g_hash_table_remove (pitip->ecals[source_type], e_source_peek_uid (source)); goto cleanup; } @@ -561,12 +561,12 @@ find_cal_opened_cb (ECal *ecal, ECalendarStatus status, gpointer data) /* Check for conflicts */ /* If the query fails, we'll just ignore it */ /* FIXME What happens for recurring conflicts? */ - if (pitip->type == E_CAL_SOURCE_TYPE_EVENT + if (pitip->type == E_CAL_SOURCE_TYPE_EVENT && e_source_get_property (E_SOURCE (source), "conflict") && !g_ascii_strcasecmp (e_source_get_property (E_SOURCE (source), "conflict"), "true") && e_cal_get_object_list (ecal, fd->sexp, &objects, NULL) && g_list_length (objects) > 0) { - itip_view_add_upper_info_item_printf (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_WARNING, + itip_view_add_upper_info_item_printf (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_WARNING, _("An appointment in the calendar '%s' conflicts with this meeting"), e_source_peek_name (source)); e_cal_free_object_list (objects); @@ -575,7 +575,7 @@ find_cal_opened_cb (ECal *ecal, ECalendarStatus status, gpointer data) if (!pitip->current_ecal && e_cal_get_object (ecal, fd->uid, fd->rid, &icalcomp, NULL)) { icalcomponent_free (icalcomp); - + pitip->current_ecal = ecal; /* Provide extra info, since its not in the component */ @@ -592,7 +592,7 @@ find_cal_opened_cb (ECal *ecal, ECalendarStatus status, gpointer data) pitip->progress_info_id = 0; /* FIXME Check read only state of calendar? */ - itip_view_add_lower_info_item_printf (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_INFO, + itip_view_add_lower_info_item_printf (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_INFO, _("Found the appointment in the calendar '%s'"), e_source_peek_name (source)); set_buttons_sensitive (pitip); @@ -610,7 +610,7 @@ find_cal_opened_cb (ECal *ecal, ECalendarStatus status, gpointer data) if (pitip->type == E_CAL_SOURCE_TYPE_JOURNAL) { /* TODO The static capability should be made generic to convey that the calendar contains unaccepted items */ - if (e_cal_get_static_capability (pitip->current_ecal, CAL_STATIC_CAPABILITY_HAS_UNACCEPTED_MEETING)) + if (e_cal_get_static_capability (pitip->current_ecal, CAL_STATIC_CAPABILITY_HAS_UNACCEPTED_MEETING)) itip_view_set_needs_decline (ITIP_VIEW (pitip->view), TRUE); else itip_view_set_needs_decline (ITIP_VIEW (pitip->view), FALSE); @@ -626,7 +626,7 @@ find_cal_opened_cb (ECal *ecal, ECalendarStatus status, gpointer data) itip_view_remove_lower_info_item (ITIP_VIEW (pitip->view), pitip->progress_info_id); pitip->progress_info_id = 0; - if ((pitip->method == ICAL_METHOD_PUBLISH || pitip->method == ICAL_METHOD_REQUEST) + if ((pitip->method == ICAL_METHOD_PUBLISH || pitip->method == ICAL_METHOD_REQUEST) && !pitip->current_ecal) { /* Reuse already declared one or rename? */ ESource *source = NULL; @@ -645,8 +645,8 @@ find_cal_opened_cb (ECal *ecal, ECalendarStatus status, gpointer data) default: uid = NULL; g_assert_not_reached (); - } - + } + if (uid) { source = e_source_list_peek_source_by_uid (pitip->source_lists[pitip->type], uid); g_free (uid); @@ -675,15 +675,15 @@ find_cal_opened_cb (ECal *ecal, ECalendarStatus status, gpointer data) } else if (!pitip->current_ecal) { switch (pitip->type) { case E_CAL_SOURCE_TYPE_EVENT: - itip_view_add_lower_info_item_printf (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_WARNING, + itip_view_add_lower_info_item_printf (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_WARNING, _("Unable to find this meeting in any calendar")); break; case E_CAL_SOURCE_TYPE_TODO: - itip_view_add_lower_info_item_printf (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_WARNING, + itip_view_add_lower_info_item_printf (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_WARNING, _("Unable to find this task in any task list")); break; case E_CAL_SOURCE_TYPE_JOURNAL: - itip_view_add_lower_info_item_printf (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_WARNING, + itip_view_add_lower_info_item_printf (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_WARNING, _("Unable to find this memo in any memo list")); break; default: @@ -691,7 +691,7 @@ find_cal_opened_cb (ECal *ecal, ECalendarStatus status, gpointer data) break; } } - + g_free (fd->uid); g_free (fd->rid); g_free (fd); @@ -723,21 +723,21 @@ find_server (FormatItipPObject *pitip, ECalComponent *comp) for (l = groups; l; l = l->next) { ESourceGroup *group; GSList *sources, *m; - + group = l->data; sources = e_source_group_peek_sources (group); for (m = sources; m; m = m->next) { char *source_uri = NULL; - + source = m->data; - + if (e_source_get_property (source, "conflict")) sources_conflict = g_slist_prepend (sources_conflict, source); if (current_source) continue; - + source_uri = e_source_get_uri (source); if (source_uri && (strcmp (uri, source_uri) == 0)) { current_source = source; @@ -746,17 +746,17 @@ find_server (FormatItipPObject *pitip, ECalComponent *comp) g_free (source_uri); continue; } - + all_sources = g_slist_prepend (all_sources, source); g_free (source_uri); - + } } - - if (current_source) + + if (current_source) l = sources_conflict; else { - pitip->progress_info_id = itip_view_add_lower_info_item (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_PROGRESS, + pitip->progress_info_id = itip_view_add_lower_info_item (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_PROGRESS, _("Searching for an existing version of this appointment")); l = all_sources; @@ -778,7 +778,7 @@ find_server (FormatItipPObject *pitip, ECalComponent *comp) start = isodate_from_time_t (pitip->start_time); end = isodate_from_time_t (pitip->end_time); - fd->sexp = g_strdup_printf ("(and (occur-in-time-range? (make-time \"%s\") (make-time \"%s\")) (not (uid? \"%s\")))", + fd->sexp = g_strdup_printf ("(and (occur-in-time-range? (make-time \"%s\") (make-time \"%s\")) (not (uid? \"%s\")))", start, end, icalcomponent_get_uid (pitip->ical_comp)); } @@ -790,10 +790,10 @@ find_server (FormatItipPObject *pitip, ECalComponent *comp) if (current_source == source) pitip->current_ecal = start_calendar_server (pitip, source, pitip->type, find_cal_opened_cb, fd); - else + else ecal = start_calendar_server (pitip, source, pitip->type, find_cal_opened_cb, fd); - } + } g_slist_free (all_sources); g_slist_free (sources_conflict); @@ -804,11 +804,11 @@ static void cleanup_ecal (gpointer data) { ECal *ecal = data; - + /* Clean up any signals */ g_signal_handlers_disconnect_matched (ecal, G_SIGNAL_MATCH_FUNC, 0, 0, NULL, cal_opened_cb, NULL); g_signal_handlers_disconnect_matched (ecal, G_SIGNAL_MATCH_FUNC, 0, 0, NULL, find_cal_opened_cb, NULL); - + g_object_unref (ecal); } @@ -826,7 +826,7 @@ change_status (icalcomponent *ical_comp, const char *address, icalparameter_part icalproperty_add_parameter (prop, param); } else { icalparameter *param; - + if (address != NULL) { prop = icalproperty_new_attendee (address); icalcomponent_add_property (ical_comp, prop); @@ -840,16 +840,16 @@ change_status (icalcomponent *ical_comp, const char *address, icalparameter_part EAccount *a; a = itip_addresses_get_default (); - + prop = icalproperty_new_attendee (a->id->address); icalcomponent_add_property (ical_comp, prop); - + param = icalparameter_new_cn (a->id->name); - icalproperty_add_parameter (prop, param); + icalproperty_add_parameter (prop, param); param = icalparameter_new_role (ICAL_ROLE_REQPARTICIPANT); icalproperty_add_parameter (prop, param); - + param = icalparameter_new_partstat (status); icalproperty_add_parameter (prop, param); } @@ -869,19 +869,19 @@ message_foreach_part (CamelMimePart *part, GSList **part_list) return; *part_list = g_slist_append (*part_list, part); - + containee = camel_medium_get_content_object (CAMEL_MEDIUM (part)); - + if (containee == NULL) return; - + /* using the object types is more accurate than using the mime/types */ if (CAMEL_IS_MULTIPART (containee)) { parts = camel_multipart_get_number (CAMEL_MULTIPART (containee)); for (i = 0; go && i < parts; i++) { /* Reuse already declared *parts? */ CamelMimePart *part = camel_multipart_get_part (CAMEL_MULTIPART (containee), i); - + message_foreach_part (part, part_list); } } else if (CAMEL_IS_MIME_MESSAGE (containee)) { @@ -889,7 +889,7 @@ message_foreach_part (CamelMimePart *part, GSList **part_list) } } -static gboolean +static gboolean update_item (FormatItipPObject *pitip, ItipViewResponse response) { struct icaltimetype stamp; @@ -930,9 +930,9 @@ update_item (FormatItipPObject *pitip, ItipViewResponse response) && (response != ITIP_VIEW_RESPONSE_DECLINE)){ GSList *attachments = NULL, *new_attachments = NULL, *l; CamelMimeMessage *msg = ((EMFormat *) pitip->pobject.format)->message; - + e_cal_component_get_attachment_list (clone_comp, &attachments); - + for (l = attachments; l; l = l->next) { GSList *parts = NULL, *m; char *uri, *new_uri; @@ -972,13 +972,13 @@ update_item (FormatItipPObject *pitip, ItipViewResponse response) g_slist_foreach (attachments, (GFunc) g_free, NULL); g_slist_free (attachments); - + e_cal_component_set_attachment_list (clone_comp, new_attachments); } if (!e_cal_receive_objects (pitip->current_ecal, pitip->top_level, &error)) { itip_view_add_lower_info_item_printf (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_INFO, - _("Unable to send item to calendar '%s'. %s"), + _("Unable to send item to calendar '%s'. %s"), e_source_peek_name (source), error->message); g_error_free (error); result = FALSE; @@ -989,21 +989,21 @@ update_item (FormatItipPObject *pitip, ItipViewResponse response) switch (response) { case ITIP_VIEW_RESPONSE_ACCEPT: - itip_view_add_lower_info_item_printf (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_INFO, + itip_view_add_lower_info_item_printf (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_INFO, _("Sent to calendar '%s' as accepted"), e_source_peek_name (source)); break; case ITIP_VIEW_RESPONSE_TENTATIVE: - itip_view_add_lower_info_item_printf (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_INFO, + itip_view_add_lower_info_item_printf (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_INFO, _("Sent to calendar '%s' as tentative"), e_source_peek_name (source)); break; case ITIP_VIEW_RESPONSE_DECLINE: /* FIXME some calendars just might not save it at all, is this accurate? */ - itip_view_add_lower_info_item_printf (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_INFO, + itip_view_add_lower_info_item_printf (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_INFO, _("Sent to calendar '%s' as declined"), e_source_peek_name (source)); break; case ITIP_VIEW_RESPONSE_CANCEL: /* FIXME some calendars just might not save it at all, is this accurate? */ - itip_view_add_lower_info_item_printf (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_INFO, + itip_view_add_lower_info_item_printf (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_INFO, _("Sent to calendar '%s' as canceled"), e_source_peek_name (source)); break; default: @@ -1024,10 +1024,10 @@ update_item (FormatItipPObject *pitip, ItipViewResponse response) static void set_attendee (ECalComponent *comp, const char *address) { - icalproperty *prop; + icalproperty *prop; icalcomponent *icalcomp; gboolean found = FALSE; - + icalcomp = e_cal_component_get_icalcomponent (comp); for (prop = icalcomponent_get_first_property (icalcomp, ICAL_ATTENDEE_PROPERTY); @@ -1044,7 +1044,7 @@ set_attendee (ECalComponent *comp, const char *address) if (!found) { icalparameter *param; char *temp = g_strdup_printf ("MAILTO:%s", address); - + prop = icalproperty_new_attendee ((const char *) temp); icalcomponent_add_property (icalcomp, prop); @@ -1066,17 +1066,17 @@ set_attendee (ECalComponent *comp, const char *address) } static gboolean -send_comp_to_attendee (ECalComponentItipMethod method, ECalComponent *comp, const char *user, ECal *client, const char *comment) +send_comp_to_attendee (ECalComponentItipMethod method, ECalComponent *comp, const char *user, ECal *client, const char *comment) { gboolean status; - ECalComponent *send_comp = e_cal_component_clone (comp); - - set_attendee (send_comp, user); - + ECalComponent *send_comp = e_cal_component_clone (comp); + + set_attendee (send_comp, user); + if (comment) { GSList comments; ECalComponentText text; - + text.value = comment; text.altrep = NULL; @@ -1085,17 +1085,17 @@ send_comp_to_attendee (ECalComponentItipMethod method, ECalComponent *comp, cons e_cal_component_set_comment_list (send_comp, &comments); } - + /* FIXME send the attachments in the request */ status = itip_send_comp (method, send_comp, client, NULL, NULL, NULL); - + g_object_unref (send_comp); - return status; + return status; } -static void -remove_delegate (FormatItipPObject *pitip, const char *delegate, const char *delegator, ECalComponent *comp) +static void +remove_delegate (FormatItipPObject *pitip, const char *delegate, const char *delegator, ECalComponent *comp) { gboolean status; char *comment = g_strdup_printf (_("Organizer has removed the delegate %s "), itip_strip_mailto (delegate)); @@ -1104,7 +1104,7 @@ remove_delegate (FormatItipPObject *pitip, const char *delegate, const char *del status = send_comp_to_attendee (E_CAL_COMPONENT_METHOD_CANCEL, pitip->comp, delegate, pitip->current_ecal, comment); if (status) send_comp_to_attendee (E_CAL_COMPONENT_METHOD_REQUEST, pitip->comp, delegator, pitip->current_ecal, comment); - if (status) { + if (status) { itip_view_add_lower_info_item (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_INFO, _("Sent a cancelation notice to the delegate")); } else itip_view_add_lower_info_item (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_INFO, _("Could not send the cancelation notice to the delegate")); @@ -1121,7 +1121,7 @@ update_attendee_status (FormatItipPObject *pitip) const char *uid, *rid; const char *delegate; GError *error = NULL; - + /* Obtain our version */ e_cal_component_get_uid (pitip->comp, &uid); org_icalcomp = e_cal_component_get_icalcomponent (pitip->comp); @@ -1142,9 +1142,9 @@ update_attendee_status (FormatItipPObject *pitip) icalproperty *prop, *del_prop; prop = find_attendee (icalcomp, itip_strip_mailto (a->value)); - if ((a->status == ICAL_PARTSTAT_DELEGATED) && (del_prop = find_attendee (org_icalcomp, itip_strip_mailto (a->delto))) && !(find_attendee (icalcomp, itip_strip_mailto (a->delto)))) { + if ((a->status == ICAL_PARTSTAT_DELEGATED) && (del_prop = find_attendee (org_icalcomp, itip_strip_mailto (a->delto))) && !(find_attendee (icalcomp, itip_strip_mailto (a->delto)))) { gint response; - delegate = icalproperty_get_attendee (del_prop); + delegate = icalproperty_get_attendee (del_prop); response = e_error_run (NULL, "org.gnome.itip-formatter:add-delegate", itip_strip_mailto (a->value), itip_strip_mailto (delegate), NULL); @@ -1152,7 +1152,7 @@ update_attendee_status (FormatItipPObject *pitip) icalcomponent_add_property (icalcomp, icalproperty_new_clone (del_prop)); e_cal_component_rescan (comp); } else if (response == GTK_RESPONSE_NO) { - remove_delegate (pitip, delegate, itip_strip_mailto (a->value), comp); + remove_delegate (pitip, delegate, itip_strip_mailto (a->value), comp); goto cleanup; } else { goto cleanup; @@ -1161,7 +1161,7 @@ update_attendee_status (FormatItipPObject *pitip) if (prop == NULL) { gint response; - + if (a->delfrom && *a->delfrom) { response = e_error_run (NULL, "org.gnome.itip-formatter:add-delegate", itip_strip_mailto (a->delfrom), @@ -1191,7 +1191,7 @@ update_attendee_status (FormatItipPObject *pitip) goto cleanup; } } else if (a->status == ICAL_PARTSTAT_NONE || a->status == ICAL_PARTSTAT_X) { - itip_view_add_lower_info_item (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_ERROR, + itip_view_add_lower_info_item (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_ERROR, _("Attendee status could not be updated because the status is invalid")); goto cleanup; } else { @@ -1216,17 +1216,17 @@ update_attendee_status (FormatItipPObject *pitip) e_cal_component_commit_sequence (comp); itip_send_comp (E_CAL_COMPONENT_METHOD_REQUEST, comp, pitip->current_ecal, NULL, NULL, NULL); } - + if (!e_cal_modify_object (pitip->current_ecal, icalcomp, rid ? CALOBJ_MOD_THIS : CALOBJ_MOD_ALL, &error)) { - itip_view_add_lower_info_item_printf (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_ERROR, + itip_view_add_lower_info_item_printf (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_ERROR, _("Unable to update attendee. %s"), error->message); - + g_error_free (error); } else { itip_view_add_lower_info_item (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_INFO, _("Attendee status updated")); } } else { - itip_view_add_lower_info_item (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_WARNING, + itip_view_add_lower_info_item (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_WARNING, _("Attendee status can not be updated because the item no longer exists")); } @@ -1241,7 +1241,7 @@ send_item (FormatItipPObject *pitip) ECalComponent *comp; comp = get_real_item (pitip); - + if (comp != NULL) { itip_send_comp (E_CAL_COMPONENT_METHOD_REQUEST, comp, pitip->current_ecal, NULL, NULL, NULL); g_object_unref (comp); @@ -1290,7 +1290,7 @@ get_next (icalcompiter *iter) if (ret == NULL) break; kind = icalcomponent_isa (ret); - } while (ret != NULL + } while (ret != NULL && kind != ICAL_VEVENT_COMPONENT && kind != ICAL_VTODO_COMPONENT && kind != ICAL_VFREEBUSY_COMPONENT); @@ -1306,25 +1306,25 @@ set_itip_error (FormatItipPObject *pitip, GtkContainer *container, const char *p vbox = gtk_vbox_new (FALSE, 12); gtk_widget_show (vbox); - + message = g_strdup_printf ("<b>%s</b>", primary); label = gtk_label_new (NULL); - gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); - gtk_label_set_markup (GTK_LABEL (label), message); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + gtk_label_set_markup (GTK_LABEL (label), message); g_free (message); gtk_widget_show (label); - gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); label = gtk_label_new (secondary); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); gtk_widget_show (label); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); - + gtk_container_add (container, vbox); } static gboolean -extract_itip_data (FormatItipPObject *pitip, GtkContainer *container) +extract_itip_data (FormatItipPObject *pitip, GtkContainer *container) { CamelDataWrapper *content; CamelStream *mem; @@ -1342,9 +1342,9 @@ extract_itip_data (FormatItipPObject *pitip, GtkContainer *container) camel_data_wrapper_decode_to_stream (content, mem); if (((CamelStreamMem *) mem)->buffer->len == 0) { - camel_object_unref (mem); - set_itip_error (pitip, container, - _("The calendar attached is not valid"), + camel_object_unref (mem); + set_itip_error (pitip, container, + _("The calendar attached is not valid"), _("The message claims to contain a calendar, but the calendar is not a valid iCalendar.")); return FALSE; @@ -1352,14 +1352,14 @@ extract_itip_data (FormatItipPObject *pitip, GtkContainer *container) pitip->vcalendar = g_strndup ((char *)((CamelStreamMem *) mem)->buffer->data, ((CamelStreamMem *) mem)->buffer->len); - camel_object_unref (mem); + camel_object_unref (mem); pitip->top_level = e_cal_util_new_top_level (); pitip->main_comp = icalparser_parse_string (pitip->vcalendar); if (pitip->main_comp == NULL) { - set_itip_error (pitip, container, - _("The calendar attached is not valid"), + set_itip_error (pitip, container, + _("The calendar attached is not valid"), _("The message claims to contain a calendar, but the calendar is not a valid iCalendar.")); return FALSE; @@ -1394,11 +1394,11 @@ extract_itip_data (FormatItipPObject *pitip, GtkContainer *container) } if (pitip->ical_comp == NULL) { - set_itip_error (pitip, container, - _("The item in the calendar is not valid"), + set_itip_error (pitip, container, + _("The item in the calendar is not valid"), _("The message does contain a calendar, but the calendar contains no events, tasks or free/busy information")); - return FALSE; + return FALSE; } switch (icalcomponent_isa (pitip->ical_comp)) { @@ -1412,23 +1412,23 @@ extract_itip_data (FormatItipPObject *pitip, GtkContainer *container) pitip->type = E_CAL_SOURCE_TYPE_JOURNAL; break; default: - set_itip_error (pitip, container, - _("The item in the calendar is not valid"), + set_itip_error (pitip, container, + _("The item in the calendar is not valid"), _("The message does contain a calendar, but the calendar contains no events, tasks or free/busy information")); return FALSE; } - + pitip->total = icalcomponent_count_components (pitip->main_comp, ICAL_VEVENT_COMPONENT); pitip->total += icalcomponent_count_components (pitip->main_comp, ICAL_VTODO_COMPONENT); pitip->total += icalcomponent_count_components (pitip->main_comp, ICAL_VFREEBUSY_COMPONENT); pitip->total += icalcomponent_count_components (pitip->main_comp, ICAL_VJOURNAL_COMPONENT); if (pitip->total > 1) { - set_itip_error (pitip, container, - _("The calendar attached contains multiple items"), + set_itip_error (pitip, container, + _("The calendar attached contains multiple items"), _("To process all of these items, the file should be saved and the calendar imported")); - return FALSE; + return FALSE; } if (pitip->total > 0) { pitip->current = 1; } else { @@ -1449,7 +1449,7 @@ extract_itip_data (FormatItipPObject *pitip, GtkContainer *container) prop = find_attendee_if_sentby (pitip->ical_comp, my_address); if (prop) { icalparameter *param; - const char * delfrom; + const char * delfrom; if ((param = icalproperty_get_first_parameter (prop, ICAL_DELEGATEDFROM_PARAMETER))) { delfrom = icalparameter_get_delegatedfrom (param); @@ -1494,11 +1494,11 @@ extract_itip_data (FormatItipPObject *pitip, GtkContainer *container) g_object_unref (pitip->comp); pitip->comp = NULL; - set_itip_error (pitip, container, - _("The item in the calendar is not valid"), + set_itip_error (pitip, container, + _("The item in the calendar is not valid"), _("The message does contain a calendar, but the calendar contains no events, tasks or free/busy information")); - return FALSE; + return FALSE; }; /* Add default reminder if the config says so */ @@ -1524,10 +1524,10 @@ extract_itip_data (FormatItipPObject *pitip, GtkContainer *container) case CAL_MINUTES: trigger.u.rel_duration.minutes = interval; break; - case CAL_HOURS: + case CAL_HOURS: trigger.u.rel_duration.hours = interval; break; - case CAL_DAYS: + case CAL_DAYS: trigger.u.rel_duration.days = interval; break; default: @@ -1591,13 +1591,13 @@ static struct _mail_msg_op open_calendar_op = { }; static gboolean -idle_open_cb (gpointer data) +idle_open_cb (gpointer data) { - FormatItipPObject *pitip = data; + FormatItipPObject *pitip = data; struct _opencal_msg *m; - + m = mail_msg_new (&open_calendar_op, NULL, sizeof (*m)); - m->command = g_strdup_printf ("evolution \"calendar://?startdate=%s&enddate=%s\"", + m->command = g_strdup_printf ("evolution \"calendar://?startdate=%s&enddate=%s\"", isodate_from_time_t (pitip->start_time), isodate_from_time_t (pitip->end_time)); e_thread_put (mail_thread_queued_slow, (EMsg *)m); @@ -1625,7 +1625,7 @@ view_response_cb (GtkWidget *widget, ItipViewResponse response, gpointer data) /* check if it is a recur instance (no master object) and * add a property */ if (itip_view_get_recur_check_state (ITIP_VIEW (pitip->view))) { - prop = icalproperty_new_x ("All"); + prop = icalproperty_new_x ("All"); icalproperty_set_x_name (prop, "X-GW-RECUR-INSTANCES-MOD-TYPE"); icalcomponent_add_property (pitip->ical_comp, prop); } @@ -1633,7 +1633,7 @@ view_response_cb (GtkWidget *widget, ItipViewResponse response, gpointer data) switch (response) { case ITIP_VIEW_RESPONSE_ACCEPT: if (pitip->type != E_CAL_SOURCE_TYPE_JOURNAL) - status = change_status (pitip->ical_comp, pitip->to_address, + status = change_status (pitip->ical_comp, pitip->to_address, ICAL_PARTSTAT_ACCEPTED); else status = TRUE; @@ -1660,7 +1660,7 @@ view_response_cb (GtkWidget *widget, ItipViewResponse response, gpointer data) status = change_status (pitip->ical_comp, pitip->to_address, ICAL_PARTSTAT_DECLINED); else { - prop = icalproperty_new_x ("1"); + prop = icalproperty_new_x ("1"); icalproperty_set_x_name (prop, "X-GW-DECLINED"); icalcomponent_add_property (pitip->ical_comp, prop); status = TRUE; @@ -1718,7 +1718,7 @@ view_response_cb (GtkWidget *widget, ItipViewResponse response, gpointer data) camel_message_info_free (mi); } camel_folder_summary_array_free (((EMFormat *) pitip->pobject.format)->folder->summary, summary_array); - } + } } else { /* Either not a recurring appointment or "apply-to-all" is not selected. So just delete this instance alone */ camel_folder_summary_remove_uid(((EMFormat *) pitip->pobject.format)->folder->summary, ((EMFormat *) pitip->pobject.format)->uid); @@ -1726,14 +1726,14 @@ view_response_cb (GtkWidget *widget, ItipViewResponse response, gpointer data) } camel_object_trigger_event (((EMFormat *) pitip->pobject.format)->folder, "folder_changed", changes); camel_folder_change_info_free (changes); - } + } } if (!delete_invitation_from_cache && pitip->delete_message) { g_message ("Deleting!"); camel_folder_delete_message (((EMFormat *) pitip->pobject.format)->folder, ((EMFormat *) pitip->pobject.format)->uid); } - + if (itip_view_get_rsvp (ITIP_VIEW (pitip->view)) && status) { ECalComponent *comp = NULL; @@ -1742,11 +1742,11 @@ view_response_cb (GtkWidget *widget, ItipViewResponse response, gpointer data) const char *attendee, *comment; GSList *l, *list = NULL; gboolean found; - - comp = e_cal_component_clone (pitip->comp); + + comp = e_cal_component_clone (pitip->comp); if (comp == NULL) return; - + if (pitip->to_address == NULL) find_to_address (pitip, pitip->ical_comp, NULL); g_assert (pitip->to_address != NULL); @@ -1760,23 +1760,23 @@ view_response_cb (GtkWidget *widget, ItipViewResponse response, gpointer data) prop = icalcomponent_get_next_property (ical_comp, ICAL_ATTENDEE_PROPERTY)) { char *text; - + value = icalproperty_get_value (prop); if (!value) continue; - + attendee = icalvalue_get_string (value); - + text = g_strdup (itip_strip_mailto (attendee)); text = g_strstrip (text); - + /* We do this to ensure there is at most one * attendee in the response */ if (found || g_ascii_strcasecmp (pitip->to_address, text)) list = g_slist_prepend (list, prop); else if (!g_ascii_strcasecmp (pitip->to_address, text)) found = TRUE; - g_free (text); + g_free (text); } for (l = list; l; l = l->next) { @@ -1791,28 +1791,28 @@ view_response_cb (GtkWidget *widget, ItipViewResponse response, gpointer data) if (comment) { GSList comments; ECalComponentText text; - + text.value = comment; text.altrep = NULL; - + comments.data = &text; comments.next = NULL; - + e_cal_component_set_comment_list (comp, &comments); } - + e_cal_component_rescan (comp); if (itip_send_comp (E_CAL_COMPONENT_METHOD_REPLY, comp, pitip->current_ecal, pitip->top_level, NULL, NULL)) { camel_folder_set_message_flags (((EMFormat *) pitip->pobject.format)->folder, ((EMFormat *) pitip->pobject.format)->uid, CAMEL_MESSAGE_ANSWERED, CAMEL_MESSAGE_ANSWERED); } g_object_unref (comp); - + } } static gboolean -check_is_instance (icalcomponent *icalcomp) +check_is_instance (icalcomponent *icalcomp) { icalproperty *icalprop; @@ -1869,16 +1869,16 @@ format_itip_object (EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject /* Accounts */ pitip->accounts = itip_addresses_get (); - + /* Source Lists and open ecal clients */ for (i = 0; i < E_CAL_SOURCE_TYPE_LAST; i++) { if (!e_cal_get_sources (&pitip->source_lists[i], i, NULL)) /* FIXME More error handling? */ pitip->source_lists[i] = NULL; - /* Initialize the ecal hashes */ + /* Initialize the ecal hashes */ pitip->ecals[i] = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, cleanup_ecal); - } + } /* FIXME Handle multiple VEVENTS with the same UID, ie detached instances */ if (!extract_itip_data (pitip, GTK_CONTAINER (eb))) @@ -1931,7 +1931,7 @@ format_itip_object (EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject } itip_view_set_item_type (ITIP_VIEW (pitip->view), pitip->type); - + if (response_enabled) { switch (pitip->method) { case ICAL_METHOD_REQUEST: @@ -1967,7 +1967,7 @@ format_itip_object (EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject e_cal_component_get_attendee_list (pitip->comp, &list); if (list != NULL) { ECalComponentAttendee *attendee; - + attendee = list->data; itip_view_set_attendee (ITIP_VIEW (pitip->view), attendee->cn ? attendee->cn : itip_strip_mailto (attendee->value)); @@ -1978,13 +1978,13 @@ format_itip_object (EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject if (pitip->my_address) { if (!(attendee->value && !g_ascii_strcasecmp (itip_strip_mailto (attendee->value), pitip->my_address)) && !(attendee->sentby && !g_ascii_strcasecmp (itip_strip_mailto (attendee->sentby), pitip->my_address)) - && (pitip->from_address && g_ascii_strcasecmp (pitip->from_address, pitip->my_address))) + && (pitip->from_address && g_ascii_strcasecmp (pitip->from_address, pitip->my_address))) itip_view_set_proxy (ITIP_VIEW (pitip->view), pitip->from_name ? pitip->from_name : pitip->from_address); } e_cal_component_free_attendee_list (list); } - break; + break; default: g_assert_not_reached (); break; @@ -2001,8 +2001,8 @@ format_itip_object (EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject if (response_enabled && pitip->method == ICAL_METHOD_REPLY) { e_cal_component_get_attendee_list (pitip->comp, &list); if (list != NULL) { - ECalComponentAttendee *a = list->data; - + ECalComponentAttendee *a = list->data; + switch (a->status) { case ICAL_PARTSTAT_ACCEPTED: itip_view_set_status (ITIP_VIEW (pitip->view), _("Accepted")); @@ -2019,29 +2019,29 @@ format_itip_object (EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject default: itip_view_set_status (ITIP_VIEW (pitip->view), _("Unknown")); } - } + } e_cal_component_free_attendee_list (list); } - if (pitip->method == ICAL_METHOD_REPLY - || pitip->method == ICAL_METHOD_COUNTER + if (pitip->method == ICAL_METHOD_REPLY + || pitip->method == ICAL_METHOD_COUNTER || pitip->method == ICAL_METHOD_DECLINECOUNTER) { /* FIXME Check spec to see if multiple comments are actually valid */ /* Comments for iTIP are limited to one per object */ e_cal_component_get_comment_list (pitip->comp, &list); if (list) { ECalComponentText *text = list->data; - - if (text->value) + + if (text->value) itip_view_set_comment (ITIP_VIEW (pitip->view), text->value); - } + } e_cal_component_free_text_list (list); } - + e_cal_component_get_description_list (pitip->comp, &list); for (l = list; l; l = l->next) { ECalComponentText *text = l->data; - + if (!gstring && text->value) gstring = g_string_new (text->value); else if (text->value) @@ -2053,23 +2053,23 @@ format_itip_object (EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject itip_view_set_description (ITIP_VIEW (pitip->view), gstring->str); g_string_free (gstring, TRUE); } - + to_zone = calendar_config_get_icaltimezone (); - + e_cal_component_get_dtstart (pitip->comp, &datetime); pitip->start_time = 0; if (datetime.value) { struct tm start_tm; - + /* If the timezone is not in the component, guess the local time */ /* Should we guess if the timezone is an olsen name somehow? */ if (datetime.value->is_utc) from_zone = icaltimezone_get_utc_timezone (); - else if (!datetime.value->is_utc && datetime.tzid) + else if (!datetime.value->is_utc && datetime.tzid) from_zone = icalcomponent_get_timezone (pitip->top_level, datetime.tzid); - else + else from_zone = NULL; - + start_tm = icaltimetype_to_tm_with_zone (datetime.value, from_zone, to_zone); itip_view_set_start (ITIP_VIEW (pitip->view), &start_tm); @@ -2101,13 +2101,13 @@ format_itip_object (EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject /* Should we guess if the timezone is an olsen name somehow? */ if (datetime.value->is_utc) from_zone = icaltimezone_get_utc_timezone (); - else if (!datetime.value->is_utc && datetime.tzid) + else if (!datetime.value->is_utc && datetime.tzid) from_zone = icalcomponent_get_timezone (pitip->top_level, datetime.tzid); else from_zone = NULL; - + end_tm = icaltimetype_to_tm_with_zone (datetime.value, from_zone, to_zone); - + itip_view_set_end (ITIP_VIEW (pitip->view), &end_tm); pitip->end_time = icaltime_as_timet_with_zone (*datetime.value, from_zone); } @@ -2148,16 +2148,16 @@ format_itip_object (EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject } static void -pitip_free (EMFormatHTMLPObject *pobject) +pitip_free (EMFormatHTMLPObject *pobject) { FormatItipPObject *pitip = (FormatItipPObject *) pobject; int i; - + for (i = 0; i < E_CAL_SOURCE_TYPE_LAST; i++) { if (pitip->source_lists[i]) g_object_unref (pitip->source_lists[i]); pitip->source_lists[i] = NULL; - + g_hash_table_destroy (pitip->ecals[i]); pitip->ecals[i] = NULL; } @@ -2189,15 +2189,15 @@ pitip_free (EMFormatHTMLPObject *pobject) g_free (pitip->from_name); pitip->from_name = NULL; g_free (pitip->to_address); - pitip->to_address = NULL; + pitip->to_address = NULL; g_free (pitip->to_name); - pitip->to_name = NULL; + pitip->to_name = NULL; g_free (pitip->delegator_address); pitip->delegator_address = NULL; g_free (pitip->delegator_name); pitip->delegator_name = NULL; g_free (pitip->my_address); - pitip->my_address = NULL; + pitip->my_address = NULL; } void @@ -2206,7 +2206,7 @@ format_itip (EPlugin *ep, EMFormatHookTarget *target) FormatItipPObject *pitip; GConfClient *gconf; char *classid; - + classid = g_strdup_printf("itip:///%s", ((EMFormat *) target->format)->part_id->str); pitip = (FormatItipPObject *) em_format_html_add_pobject ((EMFormatHTML *) target->format, sizeof (FormatItipPObject), classid, target->part, format_itip_object); @@ -2215,7 +2215,7 @@ format_itip (EPlugin *ep, EMFormatHookTarget *target) gconf = gconf_client_get_default (); pitip->delete_message = gconf_client_get_bool (gconf, GCONF_KEY_DELETE, NULL); g_object_unref (gconf); - + camel_stream_printf (target->stream, "<table border=0 width=\"100%%\" cellpadding=3><tr>"); camel_stream_printf (target->stream, "<td valign=top><object classid=\"%s\"></object></td><td width=100%% valign=top>", classid); camel_stream_printf (target->stream, "</td></tr></table>"); @@ -2227,7 +2227,7 @@ static void delete_toggled_cb (GtkWidget *widget, gpointer data) { EMConfigTargetPrefs *target = data; - + gconf_client_set_bool (target->gconf, GCONF_KEY_DELETE, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)), NULL); } @@ -2299,7 +2299,7 @@ itip_formatter_page_factory (EPlugin *ep, EConfigHookItemFactoryData *hook_data) GtkWidget *scrolledwin; ESourceList *source_list; gchar *str; - + /* Create a new notebook page */ page = gtk_vbox_new (FALSE, 0); GTK_CONTAINER (page)->border_width = 12; @@ -2325,7 +2325,7 @@ itip_formatter_page_factory (EPlugin *ep, EConfigHookItemFactoryData *hook_data) gtk_box_pack_start (GTK_BOX (hbox), padding_label, FALSE, FALSE, 0); inner_vbox = gtk_vbox_new (FALSE, 6); gtk_box_pack_start (GTK_BOX (hbox), inner_vbox, FALSE, FALSE, 0); - + /* Delete message after acting */ /* FIXME Need a schema for this */ check = gtk_check_button_new_with_mnemonic (_("_Delete message after acting")); @@ -2351,7 +2351,7 @@ itip_formatter_page_factory (EPlugin *ep, EConfigHookItemFactoryData *hook_data) gtk_box_pack_start (GTK_BOX (hbox), padding_label, FALSE, FALSE, 0); inner_vbox = gtk_vbox_new (FALSE, 6); gtk_box_pack_start (GTK_BOX (hbox), inner_vbox, TRUE, TRUE, 0); - + /* Source selector */ label = gtk_label_new (_("Select the calendars to search for meeting conflicts")); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); @@ -2374,7 +2374,7 @@ itip_formatter_page_factory (EPlugin *ep, EConfigHookItemFactoryData *hook_data) gtk_container_add (GTK_CONTAINER (scrolledwin), ess); initialize_selection (E_SOURCE_SELECTOR (ess), source_list); - + g_signal_connect (ess, "selection_changed", G_CALLBACK (source_selection_changed), source_list); g_object_weak_ref (G_OBJECT (page), (GWeakNotify) g_object_unref, source_list); diff --git a/plugins/itip-formatter/itip-view.c b/plugins/itip-formatter/itip-view.c index d48973dd4b..fb60c4fa31 100644 --- a/plugins/itip-formatter/itip-view.c +++ b/plugins/itip-formatter/itip-view.c @@ -61,7 +61,7 @@ typedef struct { struct _ItipViewPrivate { ItipViewMode mode; ECalSourceType type; - + GtkWidget *sender_label; char *organizer; char *organizer_sentby; @@ -72,7 +72,7 @@ struct _ItipViewPrivate { GtkWidget *summary_label; char *summary; - + GtkWidget *location_header; GtkWidget *location_label; char *location; @@ -88,7 +88,7 @@ struct _ItipViewPrivate { GtkWidget *start_header; GtkWidget *start_label; struct tm *start_tm; - + GtkWidget *end_header; GtkWidget *end_label; struct tm *end_tm; @@ -108,7 +108,7 @@ struct _ItipViewPrivate { GtkWidget *escb; GtkWidget *escb_header; ESourceList *source_list; - + GtkWidget *rsvp_box; GtkWidget *rsvp_check; GtkWidget *rsvp_comment_header; @@ -121,7 +121,7 @@ struct _ItipViewPrivate { GtkWidget *update_box; GtkWidget *update_check; gboolean update_show; - + GtkWidget *button_box; gboolean buttons_sensitive; @@ -148,7 +148,7 @@ format_date_and_time_x (struct tm *date_tm, { char *format; struct tm tomorrow_tm, week_tm; - + /* Calculate a normalized "tomorrow" */ tomorrow_tm = *current_tm; /* Don't need this if date is in the past. Also, year assumption won't fail. */ @@ -160,7 +160,7 @@ format_date_and_time_x (struct tm *date_tm, } else { tomorrow_tm.tm_mon++; } - } else { + } else { tomorrow_tm.tm_mday++; } @@ -175,7 +175,7 @@ format_date_and_time_x (struct tm *date_tm, } else { week_tm.tm_mon++; } - } else { + } else { week_tm.tm_mday += 6; } @@ -189,11 +189,11 @@ format_date_and_time_x (struct tm *date_tm, format = _("Today"); } else if (use_24_hour_format) { if (!show_zero_seconds && date_tm->tm_sec == 0) - /* strftime format of a time, + /* strftime format of a time, in 24-hour format, without seconds. */ format = _("Today %H:%M"); else - /* strftime format of a time, + /* strftime format of a time, in 24-hour format. */ format = _("Today %H:%M:%S"); } else { @@ -202,12 +202,12 @@ format_date_and_time_x (struct tm *date_tm, in 12-hour format, without seconds. */ format = _("Today %l:%M %p"); else - /* strftime format of a time, + /* strftime format of a time, in 12-hour format. */ format = _("Today %l:%M:%S %p"); } - /* Tomorrow */ + /* Tomorrow */ } else if (date_tm->tm_mday == tomorrow_tm.tm_mday && date_tm->tm_mon == tomorrow_tm.tm_mon && date_tm->tm_year == tomorrow_tm.tm_year) { @@ -217,11 +217,11 @@ format_date_and_time_x (struct tm *date_tm, format = _("Tomorrow"); } else if (use_24_hour_format) { if (!show_zero_seconds && date_tm->tm_sec == 0) - /* strftime format of a time, + /* strftime format of a time, in 24-hour format, without seconds. */ format = _("Tomorrow %H:%M"); else - /* strftime format of a time, + /* strftime format of a time, in 24-hour format. */ format = _("Tomorrow %H:%M:%S"); } else { @@ -230,12 +230,12 @@ format_date_and_time_x (struct tm *date_tm, in 12-hour format, without seconds. */ format = _("Tomorrow %l:%M %p"); else - /* strftime format of a time, + /* strftime format of a time, in 12-hour format. */ format = _("Tomorrow %l:%M:%S %p"); } - /* Within 6 days */ + /* Within 6 days */ } else if ((date_tm->tm_year >= current_tm->tm_year && date_tm->tm_mon >= current_tm->tm_mon && date_tm->tm_mday >= current_tm->tm_mday) && @@ -272,7 +272,7 @@ format_date_and_time_x (struct tm *date_tm, format = _("%A %l:%M:%S %p"); } - /* This Year */ + /* This Year */ } else if (date_tm->tm_year == current_tm->tm_year) { if (!show_midnight && date_tm->tm_hour == 0 && date_tm->tm_min == 0 && date_tm->tm_sec == 0) { @@ -281,8 +281,8 @@ format_date_and_time_x (struct tm *date_tm, format = _("%A, %B %e"); } else if (use_24_hour_format) { if (!show_zero_seconds && date_tm->tm_sec == 0) - /* strftime format of a weekday, a date - without a year and a time, + /* strftime format of a weekday, a date + without a year and a time, in 24-hour format, without seconds. */ format = _("%A, %B %e %H:%M"); else @@ -291,7 +291,7 @@ format_date_and_time_x (struct tm *date_tm, format = _("%A, %B %e %H:%M:%S"); } else { if (!show_zero_seconds && date_tm->tm_sec == 0) - /* strftime format of a weekday, a date without a year + /* strftime format of a weekday, a date without a year and a time, in 12-hour format, without seconds. */ format = _("%A, %B %e %l:%M %p"); else @@ -324,7 +324,7 @@ format_date_and_time_x (struct tm *date_tm, format = _("%A, %B %e, %Y %l:%M:%S %p"); } } - + /* strftime returns 0 if the string doesn't fit, and leaves the buffer undefined, so we set it to the empty string in that case. */ if (e_utf8_strftime_fix_am_pm (buffer, buffer_size, format, date_tm) == 0) @@ -378,7 +378,7 @@ set_calendar_sender_text (ItipView *view) case ITIP_VIEW_MODE_REFRESH: if (priv->attendee_sentby) sender = g_strdup_printf (_("<b>%s</b> through %s wishes to receive the latest information for the following meeting:"), attendee, priv->attendee_sentby); - else + else sender = g_strdup_printf (_("<b>%s</b> wishes to receive the latest information for the following meeting:"), attendee); break; case ITIP_VIEW_MODE_REPLY: @@ -396,7 +396,7 @@ set_calendar_sender_text (ItipView *view) case ITIP_VIEW_MODE_COUNTER: if (priv->attendee_sentby) sender = g_strdup_printf (_("<b>%s</b> through %s has proposed the following meeting changes."), attendee, priv->attendee_sentby); - else + else sender = g_strdup_printf (_("<b>%s</b> has proposed the following meeting changes."), attendee); break; case ITIP_VIEW_MODE_DECLINECOUNTER: @@ -431,7 +431,7 @@ set_tasklist_sender_text (ItipView *view) organizer = priv->organizer ? priv->organizer : _("An unknown person"); attendee = priv->attendee ? priv->attendee : _("An unknown person"); - + /* The current account ID (i.e. the delegatee) is receiving a copy of the request/response. Here we ask the delegatee to respond/accept on behalf of the delegator. */ if (priv->organizer && priv->proxy) on_behalf_of = g_strdup_printf (_("Please respond on behalf of <b>%s</b>"), priv->proxy); @@ -519,7 +519,7 @@ set_journal_sender_text (ItipView *view) organizer = priv->organizer ? priv->organizer : _("An unknown person"); attendee = priv->attendee ? priv->attendee : _("An unknown person"); - + /* The current account ID (i.e. the delegatee) is receiving a copy of the request/response. Here we ask the delegatee to respond/accept on behalf of the delegator. */ if (priv->organizer && priv->proxy) on_behalf_of = g_strdup_printf (_("Please respond on behalf of <b>%s</b>"), priv->proxy); @@ -567,7 +567,7 @@ set_sender_text (ItipView *view) ItipViewPrivate *priv; priv = view->priv; - + switch (priv->type) { case E_CAL_SOURCE_TYPE_EVENT: set_calendar_sender_text (view); @@ -657,12 +657,12 @@ set_start_text (ItipView *view) char buffer[256]; time_t now; struct tm *now_tm; - + priv = view->priv; now = time (NULL); now_tm = localtime (&now); - + if (priv->start_tm) { format_date_and_time_x (priv->start_tm, now_tm, FALSE, TRUE, FALSE, buffer, 256); gtk_label_set_text (GTK_LABEL (priv->start_label), buffer); @@ -681,7 +681,7 @@ set_end_text (ItipView *view) char buffer[256]; time_t now; struct tm *now_tm; - + priv = view->priv; now = time (NULL); @@ -699,25 +699,25 @@ set_end_text (ItipView *view) } static void -set_info_items (GtkWidget *info_box, GSList *info_items) +set_info_items (GtkWidget *info_box, GSList *info_items) { GSList *l; - + gtk_container_foreach (GTK_CONTAINER (info_box), (GtkCallback) gtk_widget_destroy, NULL); - + for (l = info_items; l; l = l->next) { - ItipViewInfoItem *item = l->data; + ItipViewInfoItem *item = l->data; GtkWidget *hbox, *image, *label; - + hbox = gtk_hbox_new (FALSE, 0); switch (item->type) { case ITIP_VIEW_INFO_ITEM_TYPE_INFO: image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_INFO, GTK_ICON_SIZE_SMALL_TOOLBAR); break; - case ITIP_VIEW_INFO_ITEM_TYPE_WARNING: + case ITIP_VIEW_INFO_ITEM_TYPE_WARNING: image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_SMALL_TOOLBAR); - break; + break; case ITIP_VIEW_INFO_ITEM_TYPE_ERROR: image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_ERROR, GTK_ICON_SIZE_SMALL_TOOLBAR); break; @@ -728,26 +728,26 @@ set_info_items (GtkWidget *info_box, GSList *info_items) default: image = NULL; } - + if (image) { gtk_widget_show (image); gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 6); } - + label = gtk_label_new (item->message); gtk_widget_show (label); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 6); gtk_widget_show (hbox); gtk_box_pack_start (GTK_BOX (info_box), hbox, FALSE, FALSE, 6); - } + } } static void set_upper_info_items (ItipView *view) { ItipViewPrivate *priv; - + priv = view->priv; set_info_items (priv->upper_info_box, priv->upper_info_items); @@ -757,7 +757,7 @@ static void set_lower_info_items (ItipView *view) { ItipViewPrivate *priv; - + priv = view->priv; set_info_items (priv->lower_info_box, priv->lower_info_items); @@ -766,10 +766,10 @@ set_lower_info_items (ItipView *view) #define DATA_RESPONSE_KEY "ItipView::button_response" static void -button_clicked_cb (GtkWidget *widget, gpointer data) +button_clicked_cb (GtkWidget *widget, gpointer data) { ItipViewResponse response; - + response = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget), DATA_RESPONSE_KEY)); g_message ("Response %d", response); @@ -777,13 +777,13 @@ button_clicked_cb (GtkWidget *widget, gpointer data) } static void -set_one_button (ItipView *view, char *label, char *stock_id, ItipViewResponse response) +set_one_button (ItipView *view, char *label, char *stock_id, ItipViewResponse response) { ItipViewPrivate *priv; GtkWidget *button; GtkWidget *image; gpointer data; - + priv = view->priv; button = gtk_button_new_with_mnemonic (label); @@ -801,7 +801,7 @@ set_one_button (ItipView *view, char *label, char *stock_id, ItipViewResponse re } static void -set_buttons (ItipView *view) +set_buttons (ItipView *view) { ItipViewPrivate *priv; gboolean is_recur_set = FALSE; @@ -816,7 +816,7 @@ set_buttons (ItipView *view) /* Everything gets the open button */ set_one_button (view, _("_Open Calendar"), GTK_STOCK_JUMP_TO, ITIP_VIEW_RESPONSE_OPEN); - + switch (priv->mode) { case ITIP_VIEW_MODE_PUBLISH: /* FIXME Is this really the right button? */ @@ -863,12 +863,12 @@ set_buttons (ItipView *view) } static void -itip_view_destroy (GtkObject *object) +itip_view_destroy (GtkObject *object) { ItipView *view = ITIP_VIEW (object); ItipViewPrivate *priv = view->priv; - - if (priv) { + + if (priv) { g_free (priv->organizer); g_free (priv->organizer_sentby); g_free (priv->delegator); @@ -885,7 +885,7 @@ itip_view_destroy (GtkObject *object) itip_view_clear_upper_info_items (view); itip_view_clear_lower_info_items (view); - + g_free (priv); view->priv = NULL; } @@ -897,9 +897,9 @@ static void itip_view_class_init (ItipViewClass *klass) { GtkObjectClass *gtkobject_class; - + gtkobject_class = GTK_OBJECT_CLASS (klass); - + gtkobject_class->destroy = itip_view_destroy; signals[SOURCE_SELECTED] = @@ -922,14 +922,14 @@ itip_view_class_init (ItipViewClass *klass) } static void -rsvp_toggled_cb (GtkWidget *widget, gpointer data) +rsvp_toggled_cb (GtkWidget *widget, gpointer data) { ItipView *view = data; ItipViewPrivate *priv; gboolean rsvp; - + priv = view->priv; - + rsvp = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->rsvp_check)); gtk_widget_set_sensitive (priv->rsvp_comment_header, rsvp); @@ -937,13 +937,13 @@ rsvp_toggled_cb (GtkWidget *widget, gpointer data) } static void -recur_toggled_cb (GtkWidget *widget, gpointer data) +recur_toggled_cb (GtkWidget *widget, gpointer data) { ItipView *view = data; ItipViewPrivate *priv; - + priv = view->priv; - + itip_view_set_mode (view, priv->mode); } @@ -954,11 +954,11 @@ itip_view_init (ItipView *view) ItipViewPrivate *priv; GtkWidget *icon, *vbox, *hbox, *separator, *table, *label; - priv = g_new0 (ItipViewPrivate, 1); + priv = g_new0 (ItipViewPrivate, 1); view->priv = priv; priv->mode = ITIP_VIEW_MODE_NONE; - + gtk_box_set_spacing (GTK_BOX (view), 12); /* The meeting icon */ @@ -1004,7 +1004,7 @@ itip_view_init (ItipView *view) gtk_misc_set_alignment (GTK_MISC (priv->location_label), 0, 0.5); gtk_table_attach (GTK_TABLE (table), priv->location_header, 0, 1, 1, 2, GTK_FILL, 0, 0, 0); gtk_table_attach (GTK_TABLE (table), priv->location_label, 1, 2, 1, 2, GTK_FILL, 0, 0, 0); - + /* Start time */ priv->start_header = gtk_label_new (_("Start time:")); priv->start_label = gtk_label_new (NULL); @@ -1062,7 +1062,7 @@ itip_view_init (ItipView *view) priv->selector_box = gtk_hbox_new (FALSE, 12); gtk_widget_show (priv->selector_box); gtk_box_pack_start (GTK_BOX (vbox), priv->selector_box, FALSE, FALSE, 0); - + /* RSVP area */ priv->rsvp_box = gtk_vbox_new (FALSE, 12); gtk_box_pack_start (GTK_BOX (vbox), priv->rsvp_box, FALSE, FALSE, 0); @@ -1085,7 +1085,7 @@ itip_view_init (ItipView *view) gtk_widget_set_sensitive (priv->rsvp_comment_header, FALSE); gtk_widget_show (priv->rsvp_comment_header); gtk_box_pack_start (GTK_BOX (hbox), priv->rsvp_comment_header, FALSE, FALSE, 0); - + priv->rsvp_comment_entry = gtk_entry_new (); gtk_widget_set_sensitive (priv->rsvp_comment_entry, FALSE); gtk_widget_show (priv->rsvp_comment_entry); @@ -1123,7 +1123,7 @@ GtkWidget * itip_view_new (void) { ItipView *itip_view = g_object_new (ITIP_TYPE_VIEW, "homogeneous", FALSE, "spacing", 6, NULL); - + return GTK_WIDGET (itip_view); } @@ -1131,12 +1131,12 @@ void itip_view_set_mode (ItipView *view, ItipViewMode mode) { ItipViewPrivate *priv; - + g_return_if_fail (view != NULL); - g_return_if_fail (ITIP_IS_VIEW (view)); - + g_return_if_fail (ITIP_IS_VIEW (view)); + priv = view->priv; - + priv->mode = mode; set_sender_text (view); @@ -1150,9 +1150,9 @@ itip_view_get_mode (ItipView *view) g_return_val_if_fail (view != NULL, ITIP_VIEW_MODE_NONE); g_return_val_if_fail (ITIP_IS_VIEW (view), ITIP_VIEW_MODE_NONE); - + priv = view->priv; - + return priv->mode; } @@ -1160,12 +1160,12 @@ void itip_view_set_item_type (ItipView *view, ECalSourceType type) { ItipViewPrivate *priv; - + g_return_if_fail (view != NULL); - g_return_if_fail (ITIP_IS_VIEW (view)); - + g_return_if_fail (ITIP_IS_VIEW (view)); + priv = view->priv; - + priv->type = type; set_sender_text (view); @@ -1178,9 +1178,9 @@ itip_view_get_item_type (ItipView *view) g_return_val_if_fail (view != NULL, ITIP_VIEW_MODE_NONE); g_return_val_if_fail (ITIP_IS_VIEW (view), ITIP_VIEW_MODE_NONE); - + priv = view->priv; - + return priv->type; } @@ -1189,12 +1189,12 @@ void itip_view_set_organizer (ItipView *view, const char *organizer) { ItipViewPrivate *priv; - + g_return_if_fail (view != NULL); - g_return_if_fail (ITIP_IS_VIEW (view)); - + g_return_if_fail (ITIP_IS_VIEW (view)); + priv = view->priv; - + if (priv->organizer) g_free (priv->organizer); @@ -1205,14 +1205,14 @@ itip_view_set_organizer (ItipView *view, const char *organizer) const char * itip_view_get_organizer (ItipView *view) -{ +{ ItipViewPrivate *priv; g_return_val_if_fail (view != NULL, NULL); g_return_val_if_fail (ITIP_IS_VIEW (view), NULL); - + priv = view->priv; - + return priv->organizer; } @@ -1220,12 +1220,12 @@ void itip_view_set_organizer_sentby (ItipView *view, const char *sentby) { ItipViewPrivate *priv; - + g_return_if_fail (view != NULL); - g_return_if_fail (ITIP_IS_VIEW (view)); - + g_return_if_fail (ITIP_IS_VIEW (view)); + priv = view->priv; - + if (priv->organizer_sentby) g_free (priv->organizer_sentby); @@ -1241,9 +1241,9 @@ itip_view_get_organizer_sentby (ItipView *view) g_return_val_if_fail (view != NULL, NULL); g_return_val_if_fail (ITIP_IS_VIEW (view), NULL); - + priv = view->priv; - + return priv->organizer_sentby; } @@ -1251,18 +1251,18 @@ void itip_view_set_attendee (ItipView *view, const char *attendee) { ItipViewPrivate *priv; - + g_return_if_fail (view != NULL); - g_return_if_fail (ITIP_IS_VIEW (view)); - + g_return_if_fail (ITIP_IS_VIEW (view)); + priv = view->priv; - + if (priv->attendee) g_free (priv->attendee); priv->attendee = g_strdup (attendee); - set_sender_text (view); + set_sender_text (view); } const char * @@ -1272,9 +1272,9 @@ itip_view_get_attendee (ItipView *view) g_return_val_if_fail (view != NULL, NULL); g_return_val_if_fail (ITIP_IS_VIEW (view), NULL); - + priv = view->priv; - + return priv->attendee; } @@ -1282,12 +1282,12 @@ void itip_view_set_attendee_sentby (ItipView *view, const char *sentby) { ItipViewPrivate *priv; - + g_return_if_fail (view != NULL); - g_return_if_fail (ITIP_IS_VIEW (view)); - + g_return_if_fail (ITIP_IS_VIEW (view)); + priv = view->priv; - + if (priv->attendee_sentby) g_free (priv->attendee_sentby); @@ -1303,9 +1303,9 @@ itip_view_get_attendee_sentby (ItipView *view) g_return_val_if_fail (view != NULL, NULL); g_return_val_if_fail (ITIP_IS_VIEW (view), NULL); - + priv = view->priv; - + return priv->attendee_sentby; } @@ -1313,12 +1313,12 @@ void itip_view_set_proxy (ItipView *view, const char *proxy) { ItipViewPrivate *priv; - + g_return_if_fail (view != NULL); - g_return_if_fail (ITIP_IS_VIEW (view)); - + g_return_if_fail (ITIP_IS_VIEW (view)); + priv = view->priv; - + if (priv->proxy) g_free (priv->proxy); @@ -1334,9 +1334,9 @@ itip_view_get_proxy (ItipView *view) g_return_val_if_fail (view != NULL, NULL); g_return_val_if_fail (ITIP_IS_VIEW (view), NULL); - + priv = view->priv; - + return priv->proxy; } @@ -1344,18 +1344,18 @@ void itip_view_set_delegator (ItipView *view, const char *delegator) { ItipViewPrivate *priv; - + g_return_if_fail (view != NULL); - g_return_if_fail (ITIP_IS_VIEW (view)); - + g_return_if_fail (ITIP_IS_VIEW (view)); + priv = view->priv; - + if (priv->delegator) g_free (priv->delegator); priv->delegator = g_strdup (delegator); - set_sender_text (view); + set_sender_text (view); } const char * @@ -1365,9 +1365,9 @@ itip_view_get_delegator (ItipView *view) g_return_val_if_fail (view != NULL, NULL); g_return_val_if_fail (ITIP_IS_VIEW (view), NULL); - + priv = view->priv; - + return priv->delegator; } @@ -1375,12 +1375,12 @@ void itip_view_set_summary (ItipView *view, const char *summary) { ItipViewPrivate *priv; - + g_return_if_fail (view != NULL); - g_return_if_fail (ITIP_IS_VIEW (view)); - + g_return_if_fail (ITIP_IS_VIEW (view)); + priv = view->priv; - + if (priv->summary) g_free (priv->summary); @@ -1396,9 +1396,9 @@ itip_view_get_summary (ItipView *view) g_return_val_if_fail (view != NULL, NULL); g_return_val_if_fail (ITIP_IS_VIEW (view), NULL); - + priv = view->priv; - + return priv->summary; } @@ -1406,12 +1406,12 @@ void itip_view_set_location (ItipView *view, const char *location) { ItipViewPrivate *priv; - + g_return_if_fail (view != NULL); - g_return_if_fail (ITIP_IS_VIEW (view)); - + g_return_if_fail (ITIP_IS_VIEW (view)); + priv = view->priv; - + if (priv->location) g_free (priv->location); @@ -1427,9 +1427,9 @@ itip_view_get_location (ItipView *view) g_return_val_if_fail (view != NULL, NULL); g_return_val_if_fail (ITIP_IS_VIEW (view), NULL); - + priv = view->priv; - + return priv->location; } @@ -1437,12 +1437,12 @@ void itip_view_set_status (ItipView *view, const char *status) { ItipViewPrivate *priv; - + g_return_if_fail (view != NULL); - g_return_if_fail (ITIP_IS_VIEW (view)); - + g_return_if_fail (ITIP_IS_VIEW (view)); + priv = view->priv; - + if (priv->status) g_free (priv->status); @@ -1458,9 +1458,9 @@ itip_view_get_status (ItipView *view) g_return_val_if_fail (view != NULL, NULL); g_return_val_if_fail (ITIP_IS_VIEW (view), NULL); - + priv = view->priv; - + return priv->status; } @@ -1468,12 +1468,12 @@ void itip_view_set_comment (ItipView *view, const char *comment) { ItipViewPrivate *priv; - + g_return_if_fail (view != NULL); - g_return_if_fail (ITIP_IS_VIEW (view)); - + g_return_if_fail (ITIP_IS_VIEW (view)); + priv = view->priv; - + if (priv->comment) g_free (priv->comment); @@ -1489,9 +1489,9 @@ itip_view_get_comment (ItipView *view) g_return_val_if_fail (view != NULL, NULL); g_return_val_if_fail (ITIP_IS_VIEW (view), NULL); - + priv = view->priv; - + return priv->comment; } @@ -1500,12 +1500,12 @@ void itip_view_set_description (ItipView *view, const char *description) { ItipViewPrivate *priv; - + g_return_if_fail (view != NULL); - g_return_if_fail (ITIP_IS_VIEW (view)); - + g_return_if_fail (ITIP_IS_VIEW (view)); + priv = view->priv; - + if (priv->description) g_free (priv->description); @@ -1521,9 +1521,9 @@ itip_view_get_description (ItipView *view) g_return_val_if_fail (view != NULL, NULL); g_return_val_if_fail (ITIP_IS_VIEW (view), NULL); - + priv = view->priv; - + return priv->description; } @@ -1532,22 +1532,22 @@ void itip_view_set_start (ItipView *view, struct tm *start) { ItipViewPrivate *priv; - + g_return_if_fail (view != NULL); - g_return_if_fail (ITIP_IS_VIEW (view)); - + g_return_if_fail (ITIP_IS_VIEW (view)); + priv = view->priv; - + if (priv->start_tm && !start) { g_free (priv->start_tm); priv->start_tm = NULL; } else if (start) { if (!priv->start_tm) priv->start_tm = g_new0 (struct tm, 1); - + *priv->start_tm = *start; - } - + } + set_start_text (view); } @@ -1558,9 +1558,9 @@ itip_view_get_start (ItipView *view) g_return_val_if_fail (view != NULL, NULL); g_return_val_if_fail (ITIP_IS_VIEW (view), NULL); - + priv = view->priv; - + return priv->start_tm; } @@ -1568,22 +1568,22 @@ void itip_view_set_end (ItipView *view, struct tm *end) { ItipViewPrivate *priv; - + g_return_if_fail (view != NULL); - g_return_if_fail (ITIP_IS_VIEW (view)); - + g_return_if_fail (ITIP_IS_VIEW (view)); + priv = view->priv; - + if (priv->end_tm && !end) { g_free (priv->end_tm); priv->end_tm = NULL; } else if (end) { if (!priv->end_tm) priv->end_tm = g_new0 (struct tm, 1); - + *priv->end_tm = *end; - } - + } + set_end_text (view); } @@ -1594,9 +1594,9 @@ itip_view_get_end (ItipView *view) g_return_val_if_fail (view != NULL, NULL); g_return_val_if_fail (ITIP_IS_VIEW (view), NULL); - + priv = view->priv; - + return priv->end_tm; } @@ -1608,7 +1608,7 @@ itip_view_add_upper_info_item (ItipView *view, ItipViewInfoItemType type, const g_return_val_if_fail (view != NULL, 0); g_return_val_if_fail (ITIP_IS_VIEW (view), 0); - + priv = view->priv; item = g_new0 (ItipViewInfoItem, 1); @@ -1616,7 +1616,7 @@ itip_view_add_upper_info_item (ItipView *view, ItipViewInfoItemType type, const item->type = type; item->message = g_strdup (message); item->id = priv->next_info_item_id++; - + priv->upper_info_items = g_slist_append (priv->upper_info_items, item); set_upper_info_items (view); @@ -1630,17 +1630,17 @@ itip_view_add_upper_info_item_printf (ItipView *view, ItipViewInfoItemType type, va_list args; char *message; guint id; - + g_return_val_if_fail (view != NULL, 0); - g_return_val_if_fail (ITIP_IS_VIEW (view), 0); - + g_return_val_if_fail (ITIP_IS_VIEW (view), 0); + va_start (args, format); message = g_strdup_vprintf (format, args); va_end (args); id = itip_view_add_upper_info_item (view, type, message); g_free (message); - + return id; } @@ -1649,10 +1649,10 @@ itip_view_remove_upper_info_item (ItipView *view, guint id) { ItipViewPrivate *priv; GSList *l; - + g_return_if_fail (view != NULL); - g_return_if_fail (ITIP_IS_VIEW (view)); - + g_return_if_fail (ITIP_IS_VIEW (view)); + priv = view->priv; for (l = priv->upper_info_items; l; l = l->next) { @@ -1676,10 +1676,10 @@ itip_view_clear_upper_info_items (ItipView *view) { ItipViewPrivate *priv; GSList *l; - + g_return_if_fail (view != NULL); - g_return_if_fail (ITIP_IS_VIEW (view)); - + g_return_if_fail (ITIP_IS_VIEW (view)); + priv = view->priv; gtk_container_foreach (GTK_CONTAINER (priv->upper_info_box), (GtkCallback) gtk_widget_destroy, NULL); @@ -1702,8 +1702,8 @@ itip_view_add_lower_info_item (ItipView *view, ItipViewInfoItemType type, const ItipViewInfoItem *item; g_return_val_if_fail (view != NULL, 0); - g_return_val_if_fail (ITIP_IS_VIEW (view), 0); - + g_return_val_if_fail (ITIP_IS_VIEW (view), 0); + priv = view->priv; item = g_new0 (ItipViewInfoItem, 1); @@ -1711,7 +1711,7 @@ itip_view_add_lower_info_item (ItipView *view, ItipViewInfoItemType type, const item->type = type; item->message = g_strdup (message); item->id = priv->next_info_item_id++; - + priv->lower_info_items = g_slist_append (priv->lower_info_items, item); set_lower_info_items (view); @@ -1725,17 +1725,17 @@ itip_view_add_lower_info_item_printf (ItipView *view, ItipViewInfoItemType type, va_list args; char *message; guint id; - + g_return_val_if_fail (view != NULL, 0); - g_return_val_if_fail (ITIP_IS_VIEW (view), 0); - + g_return_val_if_fail (ITIP_IS_VIEW (view), 0); + va_start (args, format); message = g_strdup_vprintf (format, args); va_end (args); id = itip_view_add_lower_info_item (view, type, message); g_free (message); - + return id; } @@ -1744,10 +1744,10 @@ itip_view_remove_lower_info_item (ItipView *view, guint id) { ItipViewPrivate *priv; GSList *l; - + g_return_if_fail (view != NULL); - g_return_if_fail (ITIP_IS_VIEW (view)); - + g_return_if_fail (ITIP_IS_VIEW (view)); + priv = view->priv; for (l = priv->lower_info_items; l; l = l->next) { @@ -1771,10 +1771,10 @@ itip_view_clear_lower_info_items (ItipView *view) { ItipViewPrivate *priv; GSList *l; - + g_return_if_fail (view != NULL); - g_return_if_fail (ITIP_IS_VIEW (view)); - + g_return_if_fail (ITIP_IS_VIEW (view)); + priv = view->priv; gtk_container_foreach (GTK_CONTAINER (priv->lower_info_box), (GtkCallback) gtk_widget_destroy, NULL); @@ -1804,10 +1804,10 @@ void itip_view_set_source_list (ItipView *view, ESourceList *source_list) { ItipViewPrivate *priv; - + g_return_if_fail (view != NULL); - g_return_if_fail (ITIP_IS_VIEW (view)); - + g_return_if_fail (ITIP_IS_VIEW (view)); + priv = view->priv; if (priv->source_list) @@ -1815,7 +1815,7 @@ itip_view_set_source_list (ItipView *view, ESourceList *source_list) if (priv->escb) gtk_widget_destroy (priv->escb); - + if (!source_list) { if (priv->escb_header) gtk_widget_destroy (priv->escb_header); @@ -1823,12 +1823,12 @@ itip_view_set_source_list (ItipView *view, ESourceList *source_list) priv->source_list = NULL; priv->escb = NULL; priv->escb_header = NULL; - + return; } priv->source_list = g_object_ref (source_list); - + priv->escb = e_source_combo_box_new (source_list); gtk_widget_show (priv->escb); g_signal_connect ( @@ -1846,7 +1846,7 @@ itip_view_set_source_list (ItipView *view, ESourceList *source_list) gtk_label_set_mnemonic_widget (GTK_LABEL (priv->escb_header), priv->escb); gtk_widget_show (priv->escb_header); } - + gtk_box_pack_start (GTK_BOX (priv->selector_box), priv->escb_header, FALSE, TRUE, 6); gtk_box_pack_start (GTK_BOX (priv->selector_box), priv->escb, FALSE, TRUE, 0); } @@ -1858,9 +1858,9 @@ itip_view_get_source_list (ItipView *view) g_return_val_if_fail (view != NULL, NULL); g_return_val_if_fail (ITIP_IS_VIEW (view), NULL); - + priv = view->priv; - + return priv->source_list; } @@ -1868,10 +1868,10 @@ void itip_view_set_source (ItipView *view, ESource *source) { ItipViewPrivate *priv; - + g_return_if_fail (view != NULL); - g_return_if_fail (ITIP_IS_VIEW (view)); - + g_return_if_fail (ITIP_IS_VIEW (view)); + priv = view->priv; if (!priv->escb) @@ -1888,9 +1888,9 @@ itip_view_get_source (ItipView *view) g_return_val_if_fail (view != NULL, NULL); g_return_val_if_fail (ITIP_IS_VIEW (view), NULL); - + priv = view->priv; - + if (!priv->escb) return NULL; @@ -1902,12 +1902,12 @@ void itip_view_set_rsvp (ItipView *view, gboolean rsvp) { ItipViewPrivate *priv; - + g_return_if_fail (view != NULL); - g_return_if_fail (ITIP_IS_VIEW (view)); - + g_return_if_fail (ITIP_IS_VIEW (view)); + priv = view->priv; - + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->rsvp_check), rsvp); gtk_widget_set_sensitive (priv->rsvp_comment_header, rsvp); @@ -1921,9 +1921,9 @@ itip_view_get_rsvp (ItipView *view) g_return_val_if_fail (view != NULL, FALSE); g_return_val_if_fail (ITIP_IS_VIEW (view), FALSE); - + priv = view->priv; - + return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->rsvp_check)); } @@ -1931,12 +1931,12 @@ void itip_view_set_show_rsvp (ItipView *view, gboolean rsvp) { ItipViewPrivate *priv; - + g_return_if_fail (view != NULL); - g_return_if_fail (ITIP_IS_VIEW (view)); - + g_return_if_fail (ITIP_IS_VIEW (view)); + priv = view->priv; - + priv->rsvp_show = rsvp; priv->rsvp_show ? gtk_widget_show (priv->rsvp_box) : gtk_widget_hide (priv->rsvp_box); @@ -1949,9 +1949,9 @@ itip_view_get_show_rsvp (ItipView *view) g_return_val_if_fail (view != NULL, FALSE); g_return_val_if_fail (ITIP_IS_VIEW (view), FALSE); - + priv = view->priv; - + return priv->rsvp_show; } @@ -1959,12 +1959,12 @@ void itip_view_set_update (ItipView *view, gboolean update) { ItipViewPrivate *priv; - + g_return_if_fail (view != NULL); - g_return_if_fail (ITIP_IS_VIEW (view)); - + g_return_if_fail (ITIP_IS_VIEW (view)); + priv = view->priv; - + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->update_check), update); } @@ -1975,9 +1975,9 @@ itip_view_get_update (ItipView *view) g_return_val_if_fail (view != NULL, FALSE); g_return_val_if_fail (ITIP_IS_VIEW (view), FALSE); - + priv = view->priv; - + return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->update_check)); } @@ -1985,12 +1985,12 @@ void itip_view_set_show_update (ItipView *view, gboolean update) { ItipViewPrivate *priv; - + g_return_if_fail (view != NULL); - g_return_if_fail (ITIP_IS_VIEW (view)); - + g_return_if_fail (ITIP_IS_VIEW (view)); + priv = view->priv; - + priv->update_show = update; priv->update_show ? gtk_widget_show (priv->update_box) : gtk_widget_hide (priv->update_box); @@ -2003,9 +2003,9 @@ itip_view_get_show_update (ItipView *view) g_return_val_if_fail (view != NULL, FALSE); g_return_val_if_fail (ITIP_IS_VIEW (view), FALSE); - + priv = view->priv; - + return priv->update_show; } @@ -2013,12 +2013,12 @@ void itip_view_set_rsvp_comment (ItipView *view, const char *comment) { ItipViewPrivate *priv; - + g_return_if_fail (view != NULL); - g_return_if_fail (ITIP_IS_VIEW (view)); - + g_return_if_fail (ITIP_IS_VIEW (view)); + priv = view->priv; - + gtk_entry_set_text (GTK_ENTRY (priv->rsvp_comment_entry), comment); } @@ -2029,9 +2029,9 @@ itip_view_get_rsvp_comment (ItipView *view) g_return_val_if_fail (view != NULL, NULL); g_return_val_if_fail (ITIP_IS_VIEW (view), NULL); - + priv = view->priv; - + return gtk_entry_get_text (GTK_ENTRY (priv->rsvp_comment_entry)); } @@ -2039,12 +2039,12 @@ void itip_view_set_needs_decline (ItipView *view, gboolean needs_decline) { ItipViewPrivate *priv; - + g_return_if_fail (view != NULL); - g_return_if_fail (ITIP_IS_VIEW (view)); - + g_return_if_fail (ITIP_IS_VIEW (view)); + priv = view->priv; - + priv->needs_decline = needs_decline; } @@ -2052,12 +2052,12 @@ void itip_view_set_buttons_sensitive (ItipView *view, gboolean sensitive) { ItipViewPrivate *priv; - + g_return_if_fail (view != NULL); - g_return_if_fail (ITIP_IS_VIEW (view)); - + g_return_if_fail (ITIP_IS_VIEW (view)); + priv = view->priv; - + priv->buttons_sensitive = sensitive; gtk_widget_set_sensitive (priv->button_box, priv->buttons_sensitive); @@ -2070,13 +2070,13 @@ itip_view_get_buttons_sensitive (ItipView *view) g_return_val_if_fail (view != NULL, FALSE); g_return_val_if_fail (ITIP_IS_VIEW (view), FALSE); - + priv = view->priv; - + return priv->buttons_sensitive; } -gboolean +gboolean itip_view_get_recur_check_state (ItipView *view) { return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (view->priv->recur_check)); @@ -2086,8 +2086,8 @@ void itip_view_set_show_recur_check (ItipView *view, gboolean show) { g_return_if_fail (view != NULL); - g_return_if_fail (ITIP_IS_VIEW (view)); - + g_return_if_fail (ITIP_IS_VIEW (view)); + if (show) gtk_widget_show (view->priv->recur_check); else { diff --git a/plugins/itip-formatter/itip-view.h b/plugins/itip-formatter/itip-view.h index f66d1957a9..a93da5c53c 100644 --- a/plugins/itip-formatter/itip-view.h +++ b/plugins/itip-formatter/itip-view.h @@ -77,7 +77,7 @@ typedef enum { struct _ItipView { GtkHBox parent_instance; - + ItipViewPrivate *priv; GtkWidget *action_vbox; @@ -138,12 +138,12 @@ const struct tm *itip_view_get_start (ItipView *view); void itip_view_set_end (ItipView *view, struct tm *end); const struct tm *itip_view_get_end (ItipView *view); -guint itip_view_add_upper_info_item (ItipView *view, ItipViewInfoItemType type, const char *message); +guint itip_view_add_upper_info_item (ItipView *view, ItipViewInfoItemType type, const char *message); guint itip_view_add_upper_info_item_printf (ItipView *view, ItipViewInfoItemType, const char *format, ...) G_GNUC_PRINTF (3, 4); void itip_view_remove_upper_info_item (ItipView *view, guint id); void itip_view_clear_upper_info_items (ItipView *view); -guint itip_view_add_lower_info_item (ItipView *view, ItipViewInfoItemType type, const char *message); +guint itip_view_add_lower_info_item (ItipView *view, ItipViewInfoItemType type, const char *message); guint itip_view_add_lower_info_item_printf (ItipView *view, ItipViewInfoItemType type, const char *format, ...) G_GNUC_PRINTF (3, 4); void itip_view_remove_lower_info_item (ItipView *view, guint id); void itip_view_clear_lower_info_items (ItipView *view); |