aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/dialogs
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-04-26 22:26:55 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-06-30 00:41:57 +0800
commit5294ca6fc8ae393c88678b8a61cb71a22ee067af (patch)
tree8ffc2ca73c50588f77b690e095354af3c268320c /calendar/gui/dialogs
parent801450b0f391a90ce1b2726ecb571026819673b9 (diff)
downloadgsoc2013-evolution-5294ca6fc8ae393c88678b8a61cb71a22ee067af.tar.gz
gsoc2013-evolution-5294ca6fc8ae393c88678b8a61cb71a22ee067af.tar.zst
gsoc2013-evolution-5294ca6fc8ae393c88678b8a61cb71a22ee067af.zip
Add e_meeting_store_find_self().
Convenience function that uses registered mail identities to find the user among meeting attendees.
Diffstat (limited to 'calendar/gui/dialogs')
-rw-r--r--calendar/gui/dialogs/event-editor.c23
-rw-r--r--calendar/gui/dialogs/task-editor.c24
2 files changed, 11 insertions, 36 deletions
diff --git a/calendar/gui/dialogs/event-editor.c b/calendar/gui/dialogs/event-editor.c
index b66063dd73..41985bd8b7 100644
--- a/calendar/gui/dialogs/event-editor.c
+++ b/calendar/gui/dialogs/event-editor.c
@@ -33,7 +33,6 @@
#include <glib/gi18n.h>
#include <misc/e-dateedit.h>
-#include <e-util/e-account-utils.h>
#include <e-util/e-plugin-ui.h>
#include <e-util/e-util-private.h>
#include <e-util/e-ui-manager.h>
@@ -674,23 +673,11 @@ event_editor_edit_comp (CompEditor *editor, ECalComponent *comp)
/* If we aren't the organizer we can still change our own status */
if (!comp_editor_get_user_org (editor)) {
- EAccountList *accounts;
- EAccount *account;
- EIterator *it;
-
- accounts = e_get_account_list ();
- for (it = e_list_get_iterator ((EList *)accounts);
- e_iterator_is_valid (it);
- e_iterator_next (it)) {
- EMeetingAttendee *ia;
-
- account = (EAccount*)e_iterator_get (it);
-
- ia = e_meeting_store_find_attendee (priv->model, account->id->address, &row);
- if (ia != NULL)
- e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_STATUS);
- }
- g_object_unref (it);
+ EMeetingAttendee *ia;
+
+ ia = e_meeting_store_find_self (priv->model, &row);
+ if (ia != NULL)
+ e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_STATUS);
} else if (e_cal_get_organizer_must_attend (client)) {
EMeetingAttendee *ia;
diff --git a/calendar/gui/dialogs/task-editor.c b/calendar/gui/dialogs/task-editor.c
index 2deee3b6ec..110b66692a 100644
--- a/calendar/gui/dialogs/task-editor.c
+++ b/calendar/gui/dialogs/task-editor.c
@@ -32,7 +32,6 @@
#include <string.h>
#include <glib/gi18n.h>
-#include "e-util/e-account-utils.h"
#include "e-util/e-plugin-ui.h"
#include "e-util/e-util-private.h"
@@ -422,23 +421,12 @@ task_editor_edit_comp (CompEditor *editor, ECalComponent *comp)
/* If we aren't the organizer we can still change our own status */
if (!comp_editor_get_user_org (editor)) {
- EAccountList *accounts;
- EAccount *account;
- EIterator *it;
-
- accounts = e_get_account_list ();
- for (it = e_list_get_iterator ((EList *)accounts);
- e_iterator_is_valid (it);
- e_iterator_next (it)) {
- EMeetingAttendee *ia;
-
- account = (EAccount*)e_iterator_get (it);
-
- ia = e_meeting_store_find_attendee (priv->model, account->id->address, &row);
- if (ia != NULL)
- e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_STATUS);
- }
- g_object_unref (it);
+ EMeetingAttendee *ia;
+
+ ia = e_meeting_store_find_self (priv->model, &row);
+
+ if (ia != NULL)
+ e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_STATUS);
} else if (e_cal_get_organizer_must_attend (client)) {
EMeetingAttendee *ia;