From c003c99a75587ba39a45d164272760c33f9666b5 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 25 Feb 2011 16:20:41 +0100 Subject: Bug #614480 - Avoid using G_TYPE_INSTANCE_GET_PRIVATE repeatedly --- calendar/gui/dialogs/comp-editor-page.c | 8 ++------ calendar/gui/dialogs/comp-editor.c | 14 +++++--------- calendar/gui/dialogs/event-editor.c | 30 +++++++++++++----------------- calendar/gui/dialogs/event-page.c | 14 +++++--------- calendar/gui/dialogs/memo-editor.c | 12 ++++-------- calendar/gui/dialogs/memo-page.c | 14 +++++--------- calendar/gui/dialogs/recurrence-page.c | 14 +++++--------- calendar/gui/dialogs/schedule-page.c | 8 ++------ calendar/gui/dialogs/task-details-page.c | 8 ++------ calendar/gui/dialogs/task-editor.c | 28 ++++++++++++---------------- calendar/gui/dialogs/task-page.c | 10 +++------- 11 files changed, 58 insertions(+), 102 deletions(-) (limited to 'calendar/gui/dialogs') diff --git a/calendar/gui/dialogs/comp-editor-page.c b/calendar/gui/dialogs/comp-editor-page.c index 2281e5d0fc..657243d31b 100644 --- a/calendar/gui/dialogs/comp-editor-page.c +++ b/calendar/gui/dialogs/comp-editor-page.c @@ -31,10 +31,6 @@ #include "comp-editor.h" #include "comp-editor-page.h" -#define COMP_EDITOR_PAGE_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), TYPE_COMP_EDITOR_PAGE, CompEditorPagePrivate)) - struct _CompEditorPagePrivate { CompEditor *editor; /* not referenced */ gboolean updating; @@ -62,7 +58,7 @@ comp_editor_page_set_property (GObject *object, { CompEditorPagePrivate *priv; - priv = COMP_EDITOR_PAGE_GET_PRIVATE (object); + priv = COMP_EDITOR_PAGE (object)->priv; switch (property_id) { case PROP_EDITOR: @@ -176,7 +172,7 @@ comp_editor_page_class_init (CompEditorPageClass *class) static void comp_editor_page_init (CompEditorPage *page) { - page->priv = COMP_EDITOR_PAGE_GET_PRIVATE (page); + page->priv = G_TYPE_INSTANCE_GET_PRIVATE (page, TYPE_COMP_EDITOR_PAGE, CompEditorPagePrivate); page->accel_group = NULL; } diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index 2bb258b0e7..2d0f524c10 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -60,10 +60,6 @@ #include "e-util/e-alert-dialog.h" #include "e-util/e-ui-manager.h" -#define COMP_EDITOR_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), TYPE_COMP_EDITOR, CompEditorPrivate)) - #define d(x) /* Private part of the CompEditor structure */ @@ -1443,7 +1439,7 @@ comp_editor_dispose (GObject *object) { CompEditorPrivate *priv; - priv = COMP_EDITOR_GET_PRIVATE (object); + priv = COMP_EDITOR (object)->priv; if (priv->shell != NULL) { g_object_remove_weak_pointer ( @@ -1507,7 +1503,7 @@ comp_editor_finalize (GObject *object) { CompEditorPrivate *priv; - priv = COMP_EDITOR_GET_PRIVATE (object); + priv = COMP_EDITOR (object)->priv; g_free (priv->summary); @@ -1608,7 +1604,7 @@ comp_editor_drag_motion (GtkWidget *widget, CompEditorPrivate *priv; EAttachmentView *view; - priv = COMP_EDITOR_GET_PRIVATE (widget); + priv = COMP_EDITOR (widget)->priv; view = E_ATTACHMENT_VIEW (priv->attachment_view); return e_attachment_view_drag_motion (view, context, x, y, time); @@ -1626,7 +1622,7 @@ comp_editor_drag_data_received (GtkWidget *widget, CompEditorPrivate *priv; EAttachmentView *view; - priv = COMP_EDITOR_GET_PRIVATE (widget); + priv = COMP_EDITOR (widget)->priv; view = E_ATTACHMENT_VIEW (priv->attachment_view); /* Forward the data to the attachment view. Note that calling @@ -1835,7 +1831,7 @@ comp_editor_init (CompEditor *editor) express_mode = e_shell_get_express_mode (shell); meego_mode = e_shell_get_meego_mode (shell); - editor->priv = priv = COMP_EDITOR_GET_PRIVATE (editor); + editor->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE (editor, TYPE_COMP_EDITOR, CompEditorPrivate); g_object_weak_ref ( G_OBJECT (editor), (GWeakNotify) diff --git a/calendar/gui/dialogs/event-editor.c b/calendar/gui/dialogs/event-editor.c index 7ee860f457..055fc229c0 100644 --- a/calendar/gui/dialogs/event-editor.c +++ b/calendar/gui/dialogs/event-editor.c @@ -43,10 +43,6 @@ #include "cancel-comp.h" #include "event-editor.h" -#define EVENT_EDITOR_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), TYPE_EVENT_EDITOR, EventEditorPrivate)) - struct _EventEditorPrivate { EventPage *event_page; RecurrencePage *recur_page; @@ -121,7 +117,7 @@ create_schedule_page (CompEditor *editor) CompEditorPage *page; GtkWidget *content_area; - priv = EVENT_EDITOR_GET_PRIVATE (editor); + priv = EVENT_EDITOR (editor)->priv; priv->sched_window = gtk_dialog_new_with_buttons ( _("Free/Busy"), GTK_WINDOW (editor), GTK_DIALOG_DESTROY_WITH_PARENT, @@ -300,7 +296,7 @@ event_editor_constructor (GType type, type, n_construct_properties, construct_properties); editor = COMP_EDITOR (object); - priv = EVENT_EDITOR_GET_PRIVATE (object); + priv = EVENT_EDITOR (object)->priv; shell = comp_editor_get_shell (editor); @@ -398,7 +394,7 @@ event_editor_dispose (GObject *object) { EventEditorPrivate *priv; - priv = EVENT_EDITOR_GET_PRIVATE (object); + priv = EVENT_EDITOR (object)->priv; if (priv->event_page) { g_object_unref (priv->event_page); @@ -431,7 +427,7 @@ event_editor_constructed (GObject *object) { EventEditorPrivate *priv; - priv = EVENT_EDITOR_GET_PRIVATE (object); + priv = EVENT_EDITOR (object)->priv; g_object_bind_property ( object, "client", @@ -448,7 +444,7 @@ event_editor_show_categories (CompEditor *editor, { EventEditorPrivate *priv; - priv = EVENT_EDITOR_GET_PRIVATE (editor); + priv = EVENT_EDITOR (editor)->priv; event_page_set_show_categories (priv->event_page, visible); } @@ -459,7 +455,7 @@ event_editor_show_role (CompEditor *editor, { EventEditorPrivate *priv; - priv = EVENT_EDITOR_GET_PRIVATE (editor); + priv = EVENT_EDITOR (editor)->priv; event_page_set_view_role (priv->event_page, visible); } @@ -470,7 +466,7 @@ event_editor_show_rsvp (CompEditor *editor, { EventEditorPrivate *priv; - priv = EVENT_EDITOR_GET_PRIVATE (editor); + priv = EVENT_EDITOR (editor)->priv; event_page_set_view_rsvp (priv->event_page, visible); } @@ -481,7 +477,7 @@ event_editor_show_status (CompEditor *editor, { EventEditorPrivate *priv; - priv = EVENT_EDITOR_GET_PRIVATE (editor); + priv = EVENT_EDITOR (editor)->priv; event_page_set_view_status (priv->event_page, visible); } @@ -492,7 +488,7 @@ event_editor_show_time_zone (CompEditor *editor, { EventEditorPrivate *priv; - priv = EVENT_EDITOR_GET_PRIVATE (editor); + priv = EVENT_EDITOR (editor)->priv; event_page_set_show_timezone (priv->event_page, visible); } @@ -503,7 +499,7 @@ event_editor_show_type (CompEditor *editor, { EventEditorPrivate *priv; - priv = EVENT_EDITOR_GET_PRIVATE (editor); + priv = EVENT_EDITOR (editor)->priv; event_page_set_view_type (priv->event_page, visible); } @@ -543,7 +539,7 @@ event_editor_init (EventEditor *ee) const gchar *id; GError *error = NULL; - ee->priv = EVENT_EDITOR_GET_PRIVATE (ee); + ee->priv = G_TYPE_INSTANCE_GET_PRIVATE (ee, TYPE_EVENT_EDITOR, EventEditorPrivate); ee->priv->model = E_MEETING_STORE (e_meeting_store_new ()); ee->priv->meeting_shown = TRUE; ee->priv->updating = FALSE; @@ -609,7 +605,7 @@ event_editor_edit_comp (CompEditor *editor, ECalComponent *comp) ECal *client; GSList *attendees = NULL; - priv = EVENT_EDITOR_GET_PRIVATE (editor); + priv = EVENT_EDITOR (editor)->priv; priv->updating = TRUE; delegate = (comp_editor_get_flags (COMP_EDITOR (editor)) & COMP_EDITOR_DELEGATE); @@ -722,7 +718,7 @@ event_editor_send_comp (CompEditor *editor, EventEditorPrivate *priv; ECalComponent *comp = NULL; - priv = EVENT_EDITOR_GET_PRIVATE (editor); + priv = EVENT_EDITOR (editor)->priv; /* Don't cancel more than once or when just publishing */ if (method == E_CAL_COMPONENT_METHOD_PUBLISH || diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c index 7d7e1d4859..e4459a4779 100644 --- a/calendar/gui/dialogs/event-page.c +++ b/calendar/gui/dialogs/event-page.c @@ -58,10 +58,6 @@ #include "event-page.h" #include "e-send-options-utils.h" -#define EVENT_PAGE_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), TYPE_EVENT_PAGE, EventPagePrivate)) - enum { ALARM_NONE, ALARM_15_MINUTES, @@ -215,7 +211,7 @@ event_page_dispose (GObject *object) { EventPagePrivate *priv; - priv = EVENT_PAGE_GET_PRIVATE (object); + priv = EVENT_PAGE (object)->priv; if (priv->comp != NULL) { g_object_unref (priv->comp); @@ -251,7 +247,7 @@ event_page_finalize (GObject *object) { EventPagePrivate *priv; - priv = EVENT_PAGE_GET_PRIVATE (object); + priv = EVENT_PAGE (object)->priv; g_list_foreach (priv->address_strings, (GFunc) g_free, NULL); g_list_free (priv->address_strings); @@ -293,7 +289,7 @@ event_page_class_init (EventPageClass *class) static void event_page_init (EventPage *epage) { - epage->priv = EVENT_PAGE_GET_PRIVATE (epage); + epage->priv = G_TYPE_INSTANCE_GET_PRIVATE (epage, TYPE_EVENT_PAGE, EventPagePrivate); epage->priv->deleted_attendees = g_ptr_array_new (); epage->priv->alarm_interval = -1; epage->priv->alarm_map = alarm_map_with_user_time; @@ -338,7 +334,7 @@ event_page_get_widget (CompEditorPage *page) { EventPagePrivate *priv; - priv = EVENT_PAGE_GET_PRIVATE (page); + priv = EVENT_PAGE (page)->priv; return priv->main; } @@ -349,7 +345,7 @@ event_page_focus_main_widget (CompEditorPage *page) { EventPagePrivate *priv; - priv = EVENT_PAGE_GET_PRIVATE (page); + priv = EVENT_PAGE (page)->priv; gtk_widget_grab_focus (priv->summary); } diff --git a/calendar/gui/dialogs/memo-editor.c b/calendar/gui/dialogs/memo-editor.c index 0e3cfc5dcf..50f862aa7a 100644 --- a/calendar/gui/dialogs/memo-editor.c +++ b/calendar/gui/dialogs/memo-editor.c @@ -38,10 +38,6 @@ #include "cancel-comp.h" #include "memo-editor.h" -#define MEMO_EDITOR_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), TYPE_MEMO_EDITOR, MemoEditorPrivate)) - struct _MemoEditorPrivate { MemoPage *memo_page; @@ -73,7 +69,7 @@ memo_editor_show_categories (CompEditor *editor, { MemoEditorPrivate *priv; - priv = MEMO_EDITOR_GET_PRIVATE (editor); + priv = MEMO_EDITOR (editor)->priv; memo_page_set_show_categories (priv->memo_page, visible); } @@ -83,7 +79,7 @@ memo_editor_dispose (GObject *object) { MemoEditorPrivate *priv; - priv = MEMO_EDITOR_GET_PRIVATE (object); + priv = MEMO_EDITOR (object)->priv; if (priv->memo_page) { g_object_unref (priv->memo_page); @@ -100,7 +96,7 @@ memo_editor_constructed (GObject *object) MemoEditorPrivate *priv; CompEditor *editor; - priv = MEMO_EDITOR_GET_PRIVATE (object); + priv = MEMO_EDITOR (object)->priv; editor = COMP_EDITOR (object); priv->memo_page = memo_page_new (editor); @@ -140,7 +136,7 @@ memo_editor_init (MemoEditor *me) const gchar *id; GError *error = NULL; - me->priv = MEMO_EDITOR_GET_PRIVATE (me); + me->priv = G_TYPE_INSTANCE_GET_PRIVATE (me, TYPE_MEMO_EDITOR, MemoEditorPrivate); me->priv->updating = FALSE; ui_manager = comp_editor_get_ui_manager (editor); diff --git a/calendar/gui/dialogs/memo-page.c b/calendar/gui/dialogs/memo-page.c index 03cf7e7b95..45b18a5982 100644 --- a/calendar/gui/dialogs/memo-page.c +++ b/calendar/gui/dialogs/memo-page.c @@ -54,10 +54,6 @@ #include "e-send-options-utils.h" #include "memo-page.h" -#define MEMO_PAGE_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), TYPE_MEMO_PAGE, MemoPagePrivate)) - /* Private part of the MemoPage structure */ struct _MemoPagePrivate { GtkBuilder *builder; @@ -140,7 +136,7 @@ memo_page_dispose (GObject *object) { MemoPagePrivate *priv; - priv = MEMO_PAGE_GET_PRIVATE (object); + priv = MEMO_PAGE (object)->priv; g_list_foreach (priv->address_strings, (GFunc) g_free, NULL); g_list_free (priv->address_strings); @@ -154,7 +150,7 @@ memo_page_finalize (GObject *object) { MemoPagePrivate *priv; - priv = MEMO_PAGE_GET_PRIVATE (object); + priv = MEMO_PAGE (object)->priv; if (priv->main != NULL) { g_object_unref (priv->main); @@ -175,7 +171,7 @@ memo_page_finalize (GObject *object) static GtkWidget * memo_page_get_widget (CompEditorPage *page) { - MemoPagePrivate *priv = MEMO_PAGE_GET_PRIVATE (page); + MemoPagePrivate *priv = MEMO_PAGE (page)->priv; return priv->main; } @@ -183,7 +179,7 @@ memo_page_get_widget (CompEditorPage *page) static void memo_page_focus_main_widget (CompEditorPage *page) { - MemoPagePrivate *priv = MEMO_PAGE_GET_PRIVATE (page); + MemoPagePrivate *priv = MEMO_PAGE (page)->priv; gtk_widget_grab_focus (priv->summary_entry); } @@ -319,7 +315,7 @@ memo_page_class_init (MemoPageClass *class) static void memo_page_init (MemoPage *mpage) { - mpage->priv = MEMO_PAGE_GET_PRIVATE (mpage); + mpage->priv = G_TYPE_INSTANCE_GET_PRIVATE (mpage, TYPE_MEMO_PAGE, MemoPagePrivate); } /* returns whether changed info text */ diff --git a/calendar/gui/dialogs/recurrence-page.c b/calendar/gui/dialogs/recurrence-page.c index e8deefae36..3fd4811b16 100644 --- a/calendar/gui/dialogs/recurrence-page.c +++ b/calendar/gui/dialogs/recurrence-page.c @@ -46,10 +46,6 @@ #include "e-util/e-dialog-widgets.h" #include "e-util/e-util-private.h" -#define RECURRENCE_PAGE_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), TYPE_RECURRENCE_PAGE, RecurrencePagePrivate)) - enum month_num_options { MONTH_NUM_FIRST, MONTH_NUM_SECOND, @@ -301,7 +297,7 @@ recurrence_page_dispose (GObject *object) { RecurrencePagePrivate *priv; - priv = RECURRENCE_PAGE_GET_PRIVATE (object); + priv = RECURRENCE_PAGE (object)->priv; if (priv->main != NULL) { g_object_unref (priv->main); @@ -337,7 +333,7 @@ recurrence_page_finalize (GObject *object) { RecurrencePagePrivate *priv; - priv = RECURRENCE_PAGE_GET_PRIVATE (object); + priv = RECURRENCE_PAGE (object)->priv; g_signal_handlers_disconnect_matched ( E_CALENDAR (priv->preview_calendar)->calitem, @@ -381,7 +377,7 @@ recurrence_page_class_init (RecurrencePageClass *class) static void recurrence_page_init (RecurrencePage *rpage) { - rpage->priv = RECURRENCE_PAGE_GET_PRIVATE (rpage); + rpage->priv = G_TYPE_INSTANCE_GET_PRIVATE (rpage, TYPE_RECURRENCE_PAGE, RecurrencePagePrivate); } /* get_widget handler for the recurrence page */ @@ -390,7 +386,7 @@ recurrence_page_get_widget (CompEditorPage *page) { RecurrencePagePrivate *priv; - priv = RECURRENCE_PAGE_GET_PRIVATE (page); + priv = RECURRENCE_PAGE (page)->priv; return priv->main; } @@ -401,7 +397,7 @@ recurrence_page_focus_main_widget (CompEditorPage *page) { RecurrencePagePrivate *priv; - priv = RECURRENCE_PAGE_GET_PRIVATE (page); + priv = RECURRENCE_PAGE (page)->priv; gtk_widget_grab_focus (priv->recurs); } diff --git a/calendar/gui/dialogs/schedule-page.c b/calendar/gui/dialogs/schedule-page.c index 4d234880b4..50fc7d1865 100644 --- a/calendar/gui/dialogs/schedule-page.c +++ b/calendar/gui/dialogs/schedule-page.c @@ -40,10 +40,6 @@ #include "e-delegate-dialog.h" #include "schedule-page.h" -#define SCHEDULE_PAGE_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), TYPE_SCHEDULE_PAGE, SchedulePagePrivate)) - /* Private part of the SchedulePage structure */ struct _SchedulePagePrivate { GtkBuilder *builder; @@ -163,7 +159,7 @@ schedule_page_dispose (GObject *object) { SchedulePagePrivate *priv; - priv = SCHEDULE_PAGE_GET_PRIVATE (object); + priv = SCHEDULE_PAGE (object)->priv; if (priv->main != NULL) { g_object_unref (priv->main); @@ -275,7 +271,7 @@ schedule_page_class_init (SchedulePageClass *class) static void schedule_page_init (SchedulePage *spage) { - spage->priv = SCHEDULE_PAGE_GET_PRIVATE (spage); + spage->priv = G_TYPE_INSTANCE_GET_PRIVATE (spage, TYPE_SCHEDULE_PAGE, SchedulePagePrivate); } /* Gets the widgets from the XML file and returns if they are all available. */ diff --git a/calendar/gui/dialogs/task-details-page.c b/calendar/gui/dialogs/task-details-page.c index 43f38a20a5..16f986c5aa 100644 --- a/calendar/gui/dialogs/task-details-page.c +++ b/calendar/gui/dialogs/task-details-page.c @@ -41,10 +41,6 @@ #include "e-util/e-dialog-widgets.h" #include "e-util/e-util-private.h" -#define TASK_DETAILS_PAGE_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), TYPE_TASK_DETAILS_PAGE, TaskDetailsPagePrivate)) - struct _TaskDetailsPagePrivate { GtkBuilder *builder; @@ -177,7 +173,7 @@ task_details_page_dispose (GObject *object) { TaskDetailsPagePrivate *priv; - priv = TASK_DETAILS_PAGE_GET_PRIVATE (object); + priv = TASK_DETAILS_PAGE (object)->priv; if (priv->main != NULL) { g_object_unref (priv->main); @@ -440,7 +436,7 @@ task_details_page_class_init (TaskDetailsPageClass *class) static void task_details_page_init (TaskDetailsPage *tdpage) { - tdpage->priv = TASK_DETAILS_PAGE_GET_PRIVATE (tdpage); + tdpage->priv = G_TYPE_INSTANCE_GET_PRIVATE (tdpage, TYPE_TASK_DETAILS_PAGE, TaskDetailsPagePrivate); } /* Gets the widgets from the XML file and returns if they are all available. */ diff --git a/calendar/gui/dialogs/task-editor.c b/calendar/gui/dialogs/task-editor.c index 933299feb0..1d8bec3ea7 100644 --- a/calendar/gui/dialogs/task-editor.c +++ b/calendar/gui/dialogs/task-editor.c @@ -40,10 +40,6 @@ #include "cancel-comp.h" #include "task-editor.h" -#define TASK_EDITOR_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), TYPE_TASK_EDITOR, TaskEditorPrivate)) - struct _TaskEditorPrivate { TaskPage *task_page; TaskDetailsPage *task_details_page; @@ -156,7 +152,7 @@ task_editor_constructor (GType type, type, n_construct_properties, construct_properties); editor = COMP_EDITOR (object); - priv = TASK_EDITOR_GET_PRIVATE (object); + priv = TASK_EDITOR (object)->priv; client = comp_editor_get_client (editor); flags = comp_editor_get_flags (editor); @@ -181,7 +177,7 @@ task_editor_dispose (GObject *object) { TaskEditorPrivate *priv; - priv = TASK_EDITOR_GET_PRIVATE (object); + priv = TASK_EDITOR (object)->priv; if (priv->task_page) { g_object_unref (priv->task_page); @@ -207,7 +203,7 @@ task_editor_constructed (GObject *object) { TaskEditorPrivate *priv; - priv = TASK_EDITOR_GET_PRIVATE (object); + priv = TASK_EDITOR (object)->priv; g_object_bind_property ( object, "client", @@ -224,7 +220,7 @@ task_editor_show_categories (CompEditor *editor, { TaskEditorPrivate *priv; - priv = TASK_EDITOR_GET_PRIVATE (editor); + priv = TASK_EDITOR (editor)->priv; task_page_set_show_categories (priv->task_page, visible); } @@ -235,7 +231,7 @@ task_editor_show_role (CompEditor *editor, { TaskEditorPrivate *priv; - priv = TASK_EDITOR_GET_PRIVATE (editor); + priv = TASK_EDITOR (editor)->priv; task_page_set_view_role (priv->task_page, visible); } @@ -246,7 +242,7 @@ task_editor_show_rsvp (CompEditor *editor, { TaskEditorPrivate *priv; - priv = TASK_EDITOR_GET_PRIVATE (editor); + priv = TASK_EDITOR (editor)->priv; task_page_set_view_rsvp (priv->task_page, visible); } @@ -257,7 +253,7 @@ task_editor_show_status (CompEditor *editor, { TaskEditorPrivate *priv; - priv = TASK_EDITOR_GET_PRIVATE (editor); + priv = TASK_EDITOR (editor)->priv; task_page_set_view_status (priv->task_page, visible); } @@ -268,7 +264,7 @@ task_editor_show_time_zone (CompEditor *editor, { TaskEditorPrivate *priv; - priv = TASK_EDITOR_GET_PRIVATE (editor); + priv = TASK_EDITOR (editor)->priv; task_page_set_show_timezone (priv->task_page, visible); } @@ -279,7 +275,7 @@ task_editor_show_type (CompEditor *editor, { TaskEditorPrivate *priv; - priv = TASK_EDITOR_GET_PRIVATE (editor); + priv = TASK_EDITOR (editor)->priv; task_page_set_view_type (priv->task_page, visible); } @@ -320,7 +316,7 @@ task_editor_init (TaskEditor *te) const gchar *id; GError *error = NULL; - te->priv = TASK_EDITOR_GET_PRIVATE (te); + te->priv = G_TYPE_INSTANCE_GET_PRIVATE (te, TYPE_TASK_EDITOR, TaskEditorPrivate); te->priv->model = E_MEETING_STORE (e_meeting_store_new ()); te->priv->assignment_shown = TRUE; te->priv->updating = FALSE; @@ -394,7 +390,7 @@ task_editor_edit_comp (CompEditor *editor, ECalComponent *comp) ECal *client; GSList *attendees = NULL; - priv = TASK_EDITOR_GET_PRIVATE (editor); + priv = TASK_EDITOR (editor)->priv; priv->updating = TRUE; @@ -477,7 +473,7 @@ task_editor_send_comp (CompEditor *editor, TaskEditorPrivate *priv; ECalComponent *comp = NULL; - priv = TASK_EDITOR_GET_PRIVATE (editor); + priv = TASK_EDITOR (editor)->priv; /* Don't cancel more than once or when just publishing */ if (method == E_CAL_COMPONENT_METHOD_PUBLISH || diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c index 6df7afc9aa..8555afdcc9 100644 --- a/calendar/gui/dialogs/task-page.c +++ b/calendar/gui/dialogs/task-page.c @@ -54,10 +54,6 @@ #include "../e-meeting-store.h" #include "../e-meeting-list-view.h" -#define TASK_PAGE_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), TYPE_TASK_PAGE, TaskPagePrivate)) - /* Private part of the TaskPage structure */ struct _TaskPagePrivate { GtkBuilder *builder; @@ -152,7 +148,7 @@ task_page_dispose (GObject *object) { TaskPagePrivate *priv; - priv = TASK_PAGE_GET_PRIVATE (object); + priv = TASK_PAGE (object)->priv; if (priv->main != NULL) { g_object_unref (priv->main); @@ -183,7 +179,7 @@ task_page_finalize (GObject *object) { TaskPagePrivate *priv; - priv = TASK_PAGE_GET_PRIVATE (object); + priv = TASK_PAGE (object)->priv; g_list_foreach (priv->address_strings, (GFunc) g_free, NULL); g_list_free (priv->address_strings); @@ -221,7 +217,7 @@ task_page_class_init (TaskPageClass *class) static void task_page_init (TaskPage *tpage) { - tpage->priv = TASK_PAGE_GET_PRIVATE (tpage); + tpage->priv = G_TYPE_INSTANCE_GET_PRIVATE (tpage, TYPE_TASK_PAGE, TaskPagePrivate); tpage->priv->deleted_attendees = g_ptr_array_new (); } -- cgit