aboutsummaryrefslogtreecommitdiffstats
path: root/modules/calendar/e-cal-shell-view.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-01-04 11:47:27 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-01-05 09:22:21 +0800
commit5c80f1534b435ff5c1c9cc88eb9f5c5c1124f82a (patch)
tree92b05ad7116690bf2da53a0fa6ba813fcbea50c7 /modules/calendar/e-cal-shell-view.c
parent69945127d8a7933512bb14eb20ff85354704b5cc (diff)
downloadgsoc2013-evolution-5c80f1534b435ff5c1c9cc88eb9f5c5c1124f82a.tar
gsoc2013-evolution-5c80f1534b435ff5c1c9cc88eb9f5c5c1124f82a.tar.gz
gsoc2013-evolution-5c80f1534b435ff5c1c9cc88eb9f5c5c1124f82a.tar.bz2
gsoc2013-evolution-5c80f1534b435ff5c1c9cc88eb9f5c5c1124f82a.tar.lz
gsoc2013-evolution-5c80f1534b435ff5c1c9cc88eb9f5c5c1124f82a.tar.xz
gsoc2013-evolution-5c80f1534b435ff5c1c9cc88eb9f5c5c1124f82a.tar.zst
gsoc2013-evolution-5c80f1534b435ff5c1c9cc88eb9f5c5c1124f82a.zip
Coding style and whitespace cleanup.
Diffstat (limited to 'modules/calendar/e-cal-shell-view.c')
-rw-r--r--modules/calendar/e-cal-shell-view.c61
1 files changed, 32 insertions, 29 deletions
diff --git a/modules/calendar/e-cal-shell-view.c b/modules/calendar/e-cal-shell-view.c
index 5b9940b1dd..c2eac56216 100644
--- a/modules/calendar/e-cal-shell-view.c
+++ b/modules/calendar/e-cal-shell-view.c
@@ -316,49 +316,52 @@ cal_shell_view_update_actions (EShellView *shell_view)
for (iter = list; iter != NULL; iter = iter->next) {
ECalendarViewEvent *event = iter->data;
+ ECal *client;
+ ECalComponent *comp;
+ icalcomponent *icalcomp;
+ gchar *user_email = NULL;
+ gboolean user_org = FALSE;
gboolean read_only = TRUE;
if (!event || !event->comp_data)
continue;
- e_cal_is_read_only (event->comp_data->client, &read_only, NULL);
+ client = event->comp_data->client;
+ icalcomp = event->comp_data->icalcomp;
+
+ e_cal_is_read_only (client, &read_only, NULL);
editable = editable && !read_only;
- if (e_cal_util_component_has_recurrences (event->comp_data->icalcomp))
- recurring = TRUE;
+ is_instance |= e_cal_util_component_is_instance (icalcomp);
- if (e_cal_util_component_is_instance (event->comp_data->icalcomp)) {
- recurring = TRUE;
- is_instance = TRUE;
- }
+ recurring |=
+ e_cal_util_component_is_instance (icalcomp) ||
+ e_cal_util_component_has_recurrences (icalcomp);
- if (iter == list && !iter->next) {
- ECalComponent *comp;
- gchar *user_email = NULL;
- gboolean user_org = FALSE;
+ /* The following tests only apply if one event is selected. */
+ if (iter != list || n_selected > 1)
+ continue;
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
- user_email = itip_get_comp_attendee (comp, event->comp_data->client);
+ comp = e_cal_component_new ();
+ e_cal_component_set_icalcomponent (
+ comp, icalcomponent_new_clone (icalcomp));
+ user_email = itip_get_comp_attendee (comp, client);
- is_meeting = e_cal_util_component_has_attendee (event->comp_data->icalcomp);
+ is_meeting = e_cal_util_component_has_attendee (icalcomp);
- if (e_cal_util_component_has_organizer (event->comp_data->icalcomp)) {
- if (itip_organizer_is_user (comp, event->comp_data->client)) {
- user_org = TRUE;
- }
- }
+ user_org =
+ e_cal_util_component_has_organizer (icalcomp) &&
+ itip_organizer_is_user (comp, client);
- if (e_cal_get_static_capability (event->comp_data->client, CAL_STATIC_CAPABILITY_DELEGATE_SUPPORTED)) {
- if (e_cal_get_static_capability (event->comp_data->client, CAL_STATIC_CAPABILITY_DELEGATE_TO_MANY))
- is_delegatable = TRUE;
- else if (!user_org && !is_delegated (event->comp_data->icalcomp, user_email))
- is_delegatable = TRUE;
- }
+ is_delegatable =
+ e_cal_get_static_capability (
+ client, CAL_STATIC_CAPABILITY_DELEGATE_SUPPORTED) &&
+ ((e_cal_get_static_capability (
+ client, CAL_STATIC_CAPABILITY_DELEGATE_TO_MANY)) ||
+ (!user_org && !is_delegated (icalcomp, user_email)));
- g_free (user_email);
- g_object_unref (comp);
- }
+ g_free (user_email);
+ g_object_unref (comp);
}
g_list_free (list);