diff options
author | Milan Crha <mcrha@redhat.com> | 2011-02-25 23:20:41 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2011-02-25 23:20:41 +0800 |
commit | 1301cf02efdacd20fb5ce3e2554ae15b8f146e8a (patch) | |
tree | 8d5f3985a82ec7d330af27ee0a29a79a2f0ecfa3 /mail | |
parent | 1a4be6c521d674c4a60e54203521e2721b81b921 (diff) | |
download | gsoc2013-evolution-1301cf02efdacd20fb5ce3e2554ae15b8f146e8a.tar.gz gsoc2013-evolution-1301cf02efdacd20fb5ce3e2554ae15b8f146e8a.tar.zst gsoc2013-evolution-1301cf02efdacd20fb5ce3e2554ae15b8f146e8a.zip |
Bug #614480 - Avoid using G_TYPE_INSTANCE_GET_PRIVATE repeatedly
Diffstat (limited to 'mail')
32 files changed, 121 insertions, 247 deletions
diff --git a/mail/e-mail-attachment-bar.c b/mail/e-mail-attachment-bar.c index 88cf81a51a..22f27fac20 100644 --- a/mail/e-mail-attachment-bar.c +++ b/mail/e-mail-attachment-bar.c @@ -29,10 +29,6 @@ #include "e-attachment-icon-view.h" #include "e-attachment-tree-view.h" -#define E_MAIL_ATTACHMENT_BAR_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_MAIL_ATTACHMENT_BAR, EMailAttachmentBarPrivate)) - #define NUM_VIEWS 2 struct _EMailAttachmentBarPrivate { @@ -186,7 +182,7 @@ mail_attachment_bar_dispose (GObject *object) { EMailAttachmentBarPrivate *priv; - priv = E_MAIL_ATTACHMENT_BAR_GET_PRIVATE (object); + priv = E_MAIL_ATTACHMENT_BAR (object)->priv; if (priv->model != NULL) { g_object_unref (priv->model); @@ -259,7 +255,7 @@ mail_attachment_bar_constructed (GObject *object) GConfBridge *bridge; const gchar *key; - priv = E_MAIL_ATTACHMENT_BAR_GET_PRIVATE (object); + priv = E_MAIL_ATTACHMENT_BAR (object)->priv; bridge = gconf_bridge_get (); @@ -327,7 +323,7 @@ mail_attachment_bar_get_private (EAttachmentView *view) { EMailAttachmentBarPrivate *priv; - priv = E_MAIL_ATTACHMENT_BAR_GET_PRIVATE (view); + priv = E_MAIL_ATTACHMENT_BAR (view)->priv; view = E_ATTACHMENT_VIEW (priv->icon_view); return e_attachment_view_get_private (view); @@ -338,7 +334,7 @@ mail_attachment_bar_get_store (EAttachmentView *view) { EMailAttachmentBarPrivate *priv; - priv = E_MAIL_ATTACHMENT_BAR_GET_PRIVATE (view); + priv = E_MAIL_ATTACHMENT_BAR (view)->priv; view = E_ATTACHMENT_VIEW (priv->icon_view); return e_attachment_view_get_store (view); @@ -351,7 +347,7 @@ mail_attachment_bar_get_path_at_pos (EAttachmentView *view, { EMailAttachmentBarPrivate *priv; - priv = E_MAIL_ATTACHMENT_BAR_GET_PRIVATE (view); + priv = E_MAIL_ATTACHMENT_BAR (view)->priv; view = E_ATTACHMENT_VIEW (priv->icon_view); return e_attachment_view_get_path_at_pos (view, x, y); @@ -362,7 +358,7 @@ mail_attachment_bar_get_selected_paths (EAttachmentView *view) { EMailAttachmentBarPrivate *priv; - priv = E_MAIL_ATTACHMENT_BAR_GET_PRIVATE (view); + priv = E_MAIL_ATTACHMENT_BAR (view)->priv; view = E_ATTACHMENT_VIEW (priv->icon_view); return e_attachment_view_get_selected_paths (view); @@ -374,7 +370,7 @@ mail_attachment_bar_path_is_selected (EAttachmentView *view, { EMailAttachmentBarPrivate *priv; - priv = E_MAIL_ATTACHMENT_BAR_GET_PRIVATE (view); + priv = E_MAIL_ATTACHMENT_BAR (view)->priv; view = E_ATTACHMENT_VIEW (priv->icon_view); return e_attachment_view_path_is_selected (view, path); @@ -386,7 +382,7 @@ mail_attachment_bar_select_path (EAttachmentView *view, { EMailAttachmentBarPrivate *priv; - priv = E_MAIL_ATTACHMENT_BAR_GET_PRIVATE (view); + priv = E_MAIL_ATTACHMENT_BAR (view)->priv; view = E_ATTACHMENT_VIEW (priv->icon_view); e_attachment_view_select_path (view, path); @@ -398,7 +394,7 @@ mail_attachment_bar_unselect_path (EAttachmentView *view, { EMailAttachmentBarPrivate *priv; - priv = E_MAIL_ATTACHMENT_BAR_GET_PRIVATE (view); + priv = E_MAIL_ATTACHMENT_BAR (view)->priv; view = E_ATTACHMENT_VIEW (priv->icon_view); e_attachment_view_unselect_path (view, path); @@ -409,7 +405,7 @@ mail_attachment_bar_select_all (EAttachmentView *view) { EMailAttachmentBarPrivate *priv; - priv = E_MAIL_ATTACHMENT_BAR_GET_PRIVATE (view); + priv = E_MAIL_ATTACHMENT_BAR (view)->priv; view = E_ATTACHMENT_VIEW (priv->icon_view); e_attachment_view_select_all (view); @@ -420,7 +416,7 @@ mail_attachment_bar_unselect_all (EAttachmentView *view) { EMailAttachmentBarPrivate *priv; - priv = E_MAIL_ATTACHMENT_BAR_GET_PRIVATE (view); + priv = E_MAIL_ATTACHMENT_BAR (view)->priv; view = E_ATTACHMENT_VIEW (priv->icon_view); e_attachment_view_unselect_all (view); @@ -431,7 +427,7 @@ mail_attachment_bar_update_actions (EAttachmentView *view) { EMailAttachmentBarPrivate *priv; - priv = E_MAIL_ATTACHMENT_BAR_GET_PRIVATE (view); + priv = E_MAIL_ATTACHMENT_BAR (view)->priv; view = E_ATTACHMENT_VIEW (priv->icon_view); e_attachment_view_update_actions (view); @@ -506,7 +502,7 @@ mail_attachment_bar_init (EMailAttachmentBar *bar) GtkWidget *widget; GtkAction *action; - bar->priv = E_MAIL_ATTACHMENT_BAR_GET_PRIVATE (bar); + bar->priv = G_TYPE_INSTANCE_GET_PRIVATE (bar, E_TYPE_MAIL_ATTACHMENT_BAR, EMailAttachmentBarPrivate); bar->priv->model = e_attachment_store_new (); gtk_box_set_spacing (GTK_BOX (bar), 6); diff --git a/mail/e-mail-backend.c b/mail/e-mail-backend.c index 804000367c..d0631b13dd 100644 --- a/mail/e-mail-backend.c +++ b/mail/e-mail-backend.c @@ -49,10 +49,6 @@ #include "mail/mail-ops.h" #include "mail/mail-vfolder.h" -#define E_MAIL_BACKEND_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_MAIL_BACKEND, EMailBackendPrivate)) - #define QUIT_POLL_INTERVAL 1 /* seconds */ struct _EMailBackendPrivate { @@ -418,7 +414,7 @@ mail_backend_dispose (GObject *object) { EMailBackendPrivate *priv; - priv = E_MAIL_BACKEND_GET_PRIVATE (object); + priv = E_MAIL_BACKEND (object)->priv; if (priv->session != NULL) { g_object_unref (priv->session); @@ -447,7 +443,7 @@ mail_backend_constructed (GObject *object) EMFolderTreeModel *folder_tree_model; MailFolderCache *folder_cache; - priv = E_MAIL_BACKEND_GET_PRIVATE (object); + priv = E_MAIL_BACKEND (object)->priv; shell_backend = E_SHELL_BACKEND (object); shell = e_shell_backend_get_shell (shell_backend); @@ -547,7 +543,7 @@ e_mail_backend_class_init (EMailBackendClass *class) static void e_mail_backend_init (EMailBackend *backend) { - backend->priv = E_MAIL_BACKEND_GET_PRIVATE (backend); + backend->priv = G_TYPE_INSTANCE_GET_PRIVATE (backend, E_TYPE_MAIL_BACKEND, EMailBackendPrivate); } EMailSession * diff --git a/mail/e-mail-browser.c b/mail/e-mail-browser.c index 750e84afd8..b1186aa945 100644 --- a/mail/e-mail-browser.c +++ b/mail/e-mail-browser.c @@ -40,10 +40,6 @@ #include "mail/em-format-html-display.h" #include "mail/message-list.h" -#define E_MAIL_BROWSER_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_MAIL_BROWSER, EMailBrowserPrivate)) - #define MAIL_BROWSER_GCONF_PREFIX "/apps/evolution/mail/mail_browser" struct _EMailBrowserPrivate { @@ -465,7 +461,7 @@ mail_browser_dispose (GObject *object) { EMailBrowserPrivate *priv; - priv = E_MAIL_BROWSER_GET_PRIVATE (object); + priv = E_MAIL_BROWSER (object)->priv; if (priv->backend != NULL) { g_object_unref (priv->backend); @@ -554,7 +550,7 @@ mail_browser_constructed (GObject *object) /* Chain up to parent's constructed() method. */ G_OBJECT_CLASS (parent_class)->constructed (object); - priv = E_MAIL_BROWSER_GET_PRIVATE (object); + priv = E_MAIL_BROWSER (object)->priv; reader = E_MAIL_READER (object); backend = e_mail_reader_get_backend (reader); @@ -715,7 +711,7 @@ mail_browser_submit_alert (EAlertSink *alert_sink, GtkWidget *dialog; GtkWindow *parent; - priv = E_MAIL_BROWSER_GET_PRIVATE (alert_sink); + priv = E_MAIL_BROWSER (alert_sink)->priv; switch (e_alert_get_message_type (alert)) { case GTK_MESSAGE_INFO: @@ -739,7 +735,7 @@ mail_browser_get_action_group (EMailReader *reader) { EMailBrowserPrivate *priv; - priv = E_MAIL_BROWSER_GET_PRIVATE (reader); + priv = E_MAIL_BROWSER (reader)->priv; return priv->action_group; } @@ -755,7 +751,7 @@ mail_browser_get_backend (EMailReader *reader) { EMailBrowserPrivate *priv; - priv = E_MAIL_BROWSER_GET_PRIVATE (reader); + priv = E_MAIL_BROWSER (reader)->priv; return priv->backend; } @@ -775,7 +771,7 @@ mail_browser_get_formatter (EMailReader *reader) { EMailBrowserPrivate *priv; - priv = E_MAIL_BROWSER_GET_PRIVATE (reader); + priv = E_MAIL_BROWSER (reader)->priv; return EM_FORMAT_HTML (priv->formatter); } @@ -785,7 +781,7 @@ mail_browser_get_message_list (EMailReader *reader) { EMailBrowserPrivate *priv; - priv = E_MAIL_BROWSER_GET_PRIVATE (reader); + priv = E_MAIL_BROWSER (reader)->priv; return priv->message_list; } @@ -843,7 +839,7 @@ mail_browser_show_search_bar (EMailReader *reader) { EMailBrowserPrivate *priv; - priv = E_MAIL_BROWSER_GET_PRIVATE (reader); + priv = E_MAIL_BROWSER (reader)->priv; gtk_widget_show (priv->search_bar); } @@ -943,7 +939,7 @@ e_mail_browser_init (EMailBrowser *browser) GConfBridge *bridge; const gchar *prefix; - browser->priv = E_MAIL_BROWSER_GET_PRIVATE (browser); + browser->priv = G_TYPE_INSTANCE_GET_PRIVATE (browser, E_TYPE_MAIL_BROWSER, EMailBrowserPrivate); browser->priv->action_group = gtk_action_group_new ("mail-browser"); browser->priv->formatter = em_format_html_display_new (); diff --git a/mail/e-mail-display.c b/mail/e-mail-display.c index ae340d9571..d13eca3bcf 100644 --- a/mail/e-mail-display.c +++ b/mail/e-mail-display.c @@ -29,10 +29,6 @@ #include "mail/em-composer-utils.h" #include "mail/em-utils.h" -#define E_MAIL_DISPLAY_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_MAIL_DISPLAY, EMailDisplayPrivate)) - struct _EMailDisplayPrivate { EMFormatHTML *formatter; }; @@ -172,7 +168,7 @@ mail_display_dispose (GObject *object) { EMailDisplayPrivate *priv; - priv = E_MAIL_DISPLAY_GET_PRIVATE (object); + priv = E_MAIL_DISPLAY (object)->priv; if (priv->formatter) { g_object_unref (priv->formatter); @@ -198,7 +194,7 @@ mail_display_style_set (GtkWidget *widget, { EMailDisplayPrivate *priv; - priv = E_MAIL_DISPLAY_GET_PRIVATE (widget); + priv = E_MAIL_DISPLAY (widget)->priv; /* Chain up to parent's style_set() method. */ GTK_WIDGET_CLASS (parent_class)->style_set (widget, previous_style); @@ -213,7 +209,7 @@ mail_display_load_string (EWebView *web_view, { EMailDisplayPrivate *priv; - priv = E_MAIL_DISPLAY_GET_PRIVATE (web_view); + priv = E_MAIL_DISPLAY (web_view)->priv; g_return_if_fail (priv->formatter != NULL); if (em_format_busy (EM_FORMAT (priv->formatter))) @@ -238,7 +234,7 @@ mail_display_link_clicked (GtkHTML *html, { EMailDisplayPrivate *priv; - priv = E_MAIL_DISPLAY_GET_PRIVATE (html); + priv = E_MAIL_DISPLAY (html)->priv; g_return_if_fail (priv->formatter != NULL); if (g_str_has_prefix (uri, "##")) { @@ -345,7 +341,7 @@ mail_display_init (EMailDisplay *display) web_view = E_WEB_VIEW (display); - display->priv = E_MAIL_DISPLAY_GET_PRIVATE (display); + display->priv = G_TYPE_INSTANCE_GET_PRIVATE (display, E_TYPE_MAIL_DISPLAY, EMailDisplayPrivate); /* EWebView's action groups are added during its instance * initialization function (like what we're in now), so it diff --git a/mail/e-mail-folder-pane.c b/mail/e-mail-folder-pane.c index 54d5cc4c65..beac9cc1ef 100644 --- a/mail/e-mail-folder-pane.c +++ b/mail/e-mail-folder-pane.c @@ -41,10 +41,6 @@ #include "mail/mail-tools.h" #include "mail/message-list.h" -#define E_MAIL_FOLDER_PANE_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_MAIL_FOLDER_PANE, EMailFolderPanePrivate)) - struct _EMailFolderPanePrivate { gint placeholder; }; @@ -171,7 +167,7 @@ e_mail_folder_pane_class_init (EMailFolderPaneClass *class) static void e_mail_folder_pane_init (EMailFolderPane *browser) { - browser->priv = E_MAIL_FOLDER_PANE_GET_PRIVATE (browser); + browser->priv = G_TYPE_INSTANCE_GET_PRIVATE (browser, E_TYPE_MAIL_FOLDER_PANE, EMailFolderPanePrivate); } EMailView * diff --git a/mail/e-mail-label-action.c b/mail/e-mail-label-action.c index b7487fc047..c7cf71a655 100644 --- a/mail/e-mail-label-action.c +++ b/mail/e-mail-label-action.c @@ -21,10 +21,6 @@ #include "e-mail-label-action.h" -#define E_MAIL_LABEL_ACTION_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_MAIL_LABEL_ACTION, EMailLabelActionPrivate)) - struct _EMailLabelActionPrivate { gint placeholder; }; @@ -106,7 +102,7 @@ mail_label_action_class_init (EMailLabelActionClass *class) static void mail_label_action_init (EMailLabelAction *action) { - action->priv = E_MAIL_LABEL_ACTION_GET_PRIVATE (action); + action->priv = G_TYPE_INSTANCE_GET_PRIVATE (action, E_TYPE_MAIL_LABEL_ACTION, EMailLabelActionPrivate); } GType diff --git a/mail/e-mail-label-dialog.c b/mail/e-mail-label-dialog.c index 1170854ea8..4a4728a433 100644 --- a/mail/e-mail-label-dialog.c +++ b/mail/e-mail-label-dialog.c @@ -23,10 +23,6 @@ #include <glib/gi18n.h> -#define E_MAIL_LABEL_DIALOG_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_MAIL_LABEL_DIALOG, EMailLabelDialogPrivate)) - struct _EMailLabelDialogPrivate { GtkWidget *entry; GtkWidget *colorsel; @@ -106,7 +102,7 @@ mail_label_dialog_dispose (GObject *object) { EMailLabelDialogPrivate *priv; - priv = E_MAIL_LABEL_DIALOG_GET_PRIVATE (object); + priv = E_MAIL_LABEL_DIALOG (object)->priv; if (priv->entry != NULL) { g_object_unref (priv->entry); @@ -185,7 +181,7 @@ mail_label_dialog_init (EMailLabelDialog *dialog) GtkWidget *container; GtkWidget *widget; - dialog->priv = E_MAIL_LABEL_DIALOG_GET_PRIVATE (dialog); + dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE (dialog, E_TYPE_MAIL_LABEL_DIALOG, EMailLabelDialogPrivate); content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); diff --git a/mail/e-mail-label-list-store.c b/mail/e-mail-label-list-store.c index e6f4a6a6ea..104e392a28 100644 --- a/mail/e-mail-label-list-store.c +++ b/mail/e-mail-label-list-store.c @@ -25,10 +25,6 @@ #include <camel/camel.h> #include "e-util/gconf-bridge.h" -#define E_MAIL_LABEL_LIST_STORE_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_MAIL_LABEL_LIST_STORE, EMailLabelListStorePrivate)) - struct _EMailLabelListStorePrivate { GHashTable *tag_index; }; @@ -157,7 +153,7 @@ mail_label_list_store_finalize (GObject *object) { EMailLabelListStorePrivate *priv; - priv = E_MAIL_LABEL_LIST_STORE_GET_PRIVATE (object); + priv = E_MAIL_LABEL_LIST_STORE (object)->priv; g_hash_table_destroy (priv->tag_index); @@ -238,7 +234,7 @@ mail_label_list_store_init (EMailLabelListStore *store) (GDestroyNotify) g_free, (GDestroyNotify) gtk_tree_row_reference_free); - store->priv = E_MAIL_LABEL_LIST_STORE_GET_PRIVATE (store); + store->priv = G_TYPE_INSTANCE_GET_PRIVATE (store, E_TYPE_MAIL_LABEL_LIST_STORE, EMailLabelListStorePrivate); store->priv->tag_index = tag_index; /* XXX While it may seem awkward to cram the label name and color diff --git a/mail/e-mail-label-manager.c b/mail/e-mail-label-manager.c index c5448ea0a8..54b2b7fd90 100644 --- a/mail/e-mail-label-manager.c +++ b/mail/e-mail-label-manager.c @@ -25,10 +25,6 @@ #include "e-mail-label-dialog.h" #include "e-mail-label-tree-view.h" -#define E_MAIL_LABEL_MANAGER_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_MAIL_LABEL_MANAGER, EMailLabelManagerPrivate)) - struct _EMailLabelManagerPrivate { GtkWidget *tree_view; GtkWidget *add_button; @@ -121,7 +117,7 @@ mail_label_manager_dispose (GObject *object) { EMailLabelManagerPrivate *priv; - priv = E_MAIL_LABEL_MANAGER_GET_PRIVATE (object); + priv = E_MAIL_LABEL_MANAGER (object)->priv; if (priv->tree_view != NULL) { g_object_unref (priv->tree_view); @@ -309,7 +305,7 @@ mail_label_manager_init (EMailLabelManager *manager) GtkWidget *container; GtkWidget *widget; - manager->priv = E_MAIL_LABEL_MANAGER_GET_PRIVATE (manager); + manager->priv = G_TYPE_INSTANCE_GET_PRIVATE (manager, E_TYPE_MAIL_LABEL_MANAGER, EMailLabelManagerPrivate); gtk_table_resize (GTK_TABLE (manager), 2, 2); gtk_table_set_col_spacings (GTK_TABLE (manager), 6); diff --git a/mail/e-mail-label-tree-view.c b/mail/e-mail-label-tree-view.c index 808d8d060a..3d53108a6e 100644 --- a/mail/e-mail-label-tree-view.c +++ b/mail/e-mail-label-tree-view.c @@ -24,10 +24,6 @@ #include <glib/gi18n.h> #include "e-mail-label-list-store.h" -#define E_MAIL_LABEL_TREE_VIEW_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_MAIL_LABEL_TREE_VIEW, EMailLabelTreeViewPrivate)) - struct _EMailLabelTreeViewPrivate { gint placeholder; }; @@ -79,7 +75,7 @@ mail_label_tree_view_init (EMailLabelTreeView *tree_view) GtkTreeViewColumn *column; GtkCellRenderer *renderer; - tree_view->priv = E_MAIL_LABEL_TREE_VIEW_GET_PRIVATE (tree_view); + tree_view->priv = G_TYPE_INSTANCE_GET_PRIVATE (tree_view, E_TYPE_MAIL_LABEL_TREE_VIEW, EMailLabelTreeViewPrivate); column = gtk_tree_view_column_new (); renderer = gtk_cell_renderer_pixbuf_new (); diff --git a/mail/e-mail-message-pane.c b/mail/e-mail-message-pane.c index 0b5b99a60e..75fd4597ee 100644 --- a/mail/e-mail-message-pane.c +++ b/mail/e-mail-message-pane.c @@ -28,10 +28,6 @@ #include "mail/e-mail-reader.h" -#define E_MAIL_MESSAGE_PANE_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_MAIL_MESSAGE_PANE, EMailMessagePanePrivate)) - struct _EMailMessagePanePrivate { gint placeholder; }; @@ -80,7 +76,7 @@ e_mail_message_pane_class_init (EMailMessagePaneClass *class) static void e_mail_message_pane_init (EMailMessagePane *browser) { - browser->priv = E_MAIL_MESSAGE_PANE_GET_PRIVATE (browser); + browser->priv = G_TYPE_INSTANCE_GET_PRIVATE (browser, E_TYPE_MAIL_MESSAGE_PANE, EMailMessagePanePrivate); } EMailView * diff --git a/mail/e-mail-notebook-view.c b/mail/e-mail-notebook-view.c index 8dc5730941..1ff0a014f0 100644 --- a/mail/e-mail-notebook-view.c +++ b/mail/e-mail-notebook-view.c @@ -45,10 +45,6 @@ #include "e-mail-tab-picker.h" #endif -#define E_MAIL_NOTEBOOK_VIEW_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_MAIL_NOTEBOOK_VIEW, EMailNotebookViewPrivate)) - struct _EMailNotebookViewPrivate { GtkNotebook *book; EMailView *current_view; @@ -128,7 +124,7 @@ mnv_page_changed (GtkNotebook *book, EMailView *mview; const gchar *uri; - priv = E_MAIL_NOTEBOOK_VIEW_GET_PRIVATE (view); + priv = E_MAIL_NOTEBOOK_VIEW (view)->priv; shell_view = e_mail_view_get_shell_view (view); shell_sidebar = e_shell_view_get_shell_sidebar (shell_view); @@ -189,7 +185,7 @@ chooser_clicked_cb (EMailTabPicker *picker, gboolean preview_mode; - priv = E_MAIL_NOTEBOOK_VIEW_GET_PRIVATE (view); + priv = view->priv; preview_mode = !e_mail_tab_picker_get_preview_mode (priv->tab_picker); e_mail_tab_picker_set_preview_mode (priv->tab_picker , preview_mode); @@ -581,7 +577,7 @@ mail_notebook_view_set_property (GObject *object, { EMailNotebookViewPrivate *priv; - priv = E_MAIL_NOTEBOOK_VIEW_GET_PRIVATE (object); + priv = E_MAIL_NOTEBOOK_VIEW (object)->priv; switch (property_id) { case PROP_FORWARD_STYLE: @@ -614,7 +610,7 @@ mail_notebook_view_get_property (GObject *object, { EMailNotebookViewPrivate *priv; - priv = E_MAIL_NOTEBOOK_VIEW_GET_PRIVATE (object); + priv = E_MAIL_NOTEBOOK_VIEW (object)->priv; switch (property_id) { case PROP_FORWARD_STYLE: @@ -648,7 +644,7 @@ mail_notebook_view_set_search_strings (EMailView *view, { EMailNotebookViewPrivate *priv; - priv = E_MAIL_NOTEBOOK_VIEW_GET_PRIVATE (view); + priv = E_MAIL_NOTEBOOK_VIEW (view)->priv; e_mail_view_set_search_strings (priv->current_view, search_strings); } @@ -658,7 +654,7 @@ mail_notebook_view_get_view_instance (EMailView *view) { EMailNotebookViewPrivate *priv; - priv = E_MAIL_NOTEBOOK_VIEW_GET_PRIVATE (view); + priv = E_MAIL_NOTEBOOK_VIEW (view)->priv; if (priv->current_view == NULL) return NULL; @@ -671,7 +667,7 @@ mail_notebook_view_update_view_instance (EMailView *view) { EMailNotebookViewPrivate *priv; - priv = E_MAIL_NOTEBOOK_VIEW_GET_PRIVATE (view); + priv = E_MAIL_NOTEBOOK_VIEW (view)->priv; if (priv->current_view == NULL) return; @@ -685,7 +681,7 @@ mail_notebook_view_set_orientation (EMailView *view, { EMailNotebookViewPrivate *priv; - priv = E_MAIL_NOTEBOOK_VIEW_GET_PRIVATE (view); + priv = E_MAIL_NOTEBOOK_VIEW (view)->priv; if (priv->current_view == NULL) return; @@ -698,7 +694,7 @@ mail_notebook_view_get_orientation (EMailView *view) { EMailNotebookViewPrivate *priv; - priv = E_MAIL_NOTEBOOK_VIEW_GET_PRIVATE (view); + priv = E_MAIL_NOTEBOOK_VIEW (view)->priv; if (priv->current_view == NULL) return GTK_ORIENTATION_VERTICAL; @@ -711,7 +707,7 @@ mail_notebook_view_get_show_deleted (EMailView *view) { EMailNotebookViewPrivate *priv; - priv = E_MAIL_NOTEBOOK_VIEW_GET_PRIVATE (view); + priv = E_MAIL_NOTEBOOK_VIEW (view)->priv; if (priv->current_view == NULL) return FALSE; @@ -725,7 +721,7 @@ mail_notebook_view_set_show_deleted (EMailView *view, { EMailNotebookViewPrivate *priv; - priv = E_MAIL_NOTEBOOK_VIEW_GET_PRIVATE (view); + priv = E_MAIL_NOTEBOOK_VIEW (view)->priv; if (priv->current_view == NULL) return; @@ -738,7 +734,7 @@ mail_notebook_view_get_preview_visible (EMailView *view) { EMailNotebookViewPrivate *priv; - priv = E_MAIL_NOTEBOOK_VIEW_GET_PRIVATE (view); + priv = E_MAIL_NOTEBOOK_VIEW (view)->priv; if (priv->current_view == NULL) return FALSE; @@ -752,7 +748,7 @@ mail_notebook_view_set_preview_visible (EMailView *view, { EMailNotebookViewPrivate *priv; - priv = E_MAIL_NOTEBOOK_VIEW_GET_PRIVATE (view); + priv = E_MAIL_NOTEBOOK_VIEW (view)->priv; if (priv->current_view == NULL) return; @@ -807,7 +803,7 @@ mail_notebook_view_get_formatter (EMailReader *reader) { EMailNotebookViewPrivate *priv; - priv = E_MAIL_NOTEBOOK_VIEW_GET_PRIVATE (reader); + priv = E_MAIL_NOTEBOOK_VIEW (reader)->priv; if (priv->current_view == NULL) return NULL; @@ -820,7 +816,7 @@ mail_notebook_view_get_hide_deleted (EMailReader *reader) { EMailNotebookViewPrivate *priv; - priv = E_MAIL_NOTEBOOK_VIEW_GET_PRIVATE (reader); + priv = E_MAIL_NOTEBOOK_VIEW (reader)->priv; if (priv->current_view == NULL) return FALSE; @@ -835,7 +831,7 @@ mail_notebook_view_get_message_list (EMailReader *reader) { EMailNotebookViewPrivate *priv; - priv = E_MAIL_NOTEBOOK_VIEW_GET_PRIVATE (reader); + priv = E_MAIL_NOTEBOOK_VIEW (reader)->priv; if (priv->current_view == NULL) return NULL; @@ -850,7 +846,7 @@ mail_notebook_view_get_popup_menu (EMailReader *reader) { EMailNotebookViewPrivate *priv; - priv = E_MAIL_NOTEBOOK_VIEW_GET_PRIVATE (reader); + priv = E_MAIL_NOTEBOOK_VIEW (reader)->priv; if (priv->current_view == NULL) return NULL; @@ -908,7 +904,7 @@ mail_netbook_view_open_mail (EMailView *view, GtkWidget *mlist; #endif - priv = E_MAIL_NOTEBOOK_VIEW_GET_PRIVATE (nview); + priv = nview->priv; #if HAVE_CLUTTER e_mail_tab_set_active ( @@ -1096,7 +1092,7 @@ mail_notebook_view_set_folder (EMailReader *reader, if (!folder_uri) return; - priv = E_MAIL_NOTEBOOK_VIEW_GET_PRIVATE (reader); + priv = E_MAIL_NOTEBOOK_VIEW (reader)->priv; new_view = g_hash_table_lookup (priv->views, folder_uri); if (new_view) { @@ -1244,7 +1240,7 @@ mail_notebook_view_show_search_bar (EMailReader *reader) { EMailNotebookViewPrivate *priv; - priv = E_MAIL_NOTEBOOK_VIEW_GET_PRIVATE (reader); + priv = E_MAIL_NOTEBOOK_VIEW (reader)->priv; if (priv->current_view == NULL) return; @@ -1270,7 +1266,7 @@ mail_notebook_view_open_selected_mail (EMailReader *reader) { EMailNotebookViewPrivate *priv; - priv = E_MAIL_NOTEBOOK_VIEW_GET_PRIVATE (reader); + priv = E_MAIL_NOTEBOOK_VIEW (reader)->priv; if (priv->current_view == NULL) return 0; @@ -1343,7 +1339,7 @@ e_mail_notebook_view_reader_init (EMailReaderInterface *interface) static void e_mail_notebook_view_init (EMailNotebookView *view) { - view->priv = E_MAIL_NOTEBOOK_VIEW_GET_PRIVATE (view); + view->priv = G_TYPE_INSTANCE_GET_PRIVATE (view, E_TYPE_MAIL_NOTEBOOK_VIEW, EMailNotebookViewPrivate); view->priv->inited = FALSE; view->priv->views = g_hash_table_new (g_str_hash, g_str_equal); diff --git a/mail/e-mail-paned-view.c b/mail/e-mail-paned-view.c index b8fd00312d..05777d254e 100644 --- a/mail/e-mail-paned-view.c +++ b/mail/e-mail-paned-view.c @@ -46,10 +46,6 @@ #include "message-list.h" #include "e-mail-reader-utils.h" -#define E_MAIL_PANED_VIEW_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_MAIL_PANED_VIEW, EMailPanedViewPrivate)) - #define E_SHELL_WINDOW_ACTION_GROUP_MAIL(window) \ E_SHELL_WINDOW_ACTION_GROUP ((window), "mail") @@ -128,7 +124,7 @@ mail_paned_view_message_list_built_cb (EMailView *view, EShellWindow *shell_window; GKeyFile *key_file; - priv = E_MAIL_PANED_VIEW_GET_PRIVATE (view); + priv = E_MAIL_PANED_VIEW (view)->priv; g_signal_handler_disconnect ( message_list, priv->message_list_built_id); @@ -212,7 +208,7 @@ mail_paned_view_restore_state_cb (EShellWindow *shell_window, GObject *object; const gchar *key; - priv = E_MAIL_PANED_VIEW_GET_PRIVATE (view); + priv = E_MAIL_PANED_VIEW (view)->priv; /* Bind GObject properties to GConf keys. */ @@ -321,7 +317,7 @@ mail_paned_view_dispose (GObject *object) { EMailPanedViewPrivate *priv; - priv = E_MAIL_PANED_VIEW_GET_PRIVATE (object); + priv = E_MAIL_PANED_VIEW (object)->priv; if (priv->paned != NULL) { g_object_unref (priv->paned); @@ -404,7 +400,7 @@ mail_paned_view_get_formatter (EMailReader *reader) { EMailPanedViewPrivate *priv; - priv = E_MAIL_PANED_VIEW_GET_PRIVATE (reader); + priv = E_MAIL_PANED_VIEW (reader)->priv; return EM_FORMAT_HTML (priv->formatter); } @@ -420,7 +416,7 @@ mail_paned_view_get_message_list (EMailReader *reader) { EMailPanedViewPrivate *priv; - priv = E_MAIL_PANED_VIEW_GET_PRIVATE (reader); + priv = E_MAIL_PANED_VIEW (reader)->priv; return priv->message_list; } @@ -477,7 +473,7 @@ mail_paned_view_set_folder (EMailReader *reader, gboolean value; GError *error = NULL; - priv = E_MAIL_PANED_VIEW_GET_PRIVATE (reader); + priv = E_MAIL_PANED_VIEW (reader)->priv; view = E_MAIL_VIEW (reader); shell_view = e_mail_view_get_shell_view (view); @@ -552,7 +548,7 @@ mail_paned_view_show_search_bar (EMailReader *reader) { EMailPanedViewPrivate *priv; - priv = E_MAIL_PANED_VIEW_GET_PRIVATE (reader); + priv = E_MAIL_PANED_VIEW (reader)->priv; gtk_widget_show (priv->search_bar); } @@ -589,7 +585,7 @@ mail_paned_view_constructed (GObject *object) GtkWidget *widget; EWebView *web_view; - priv = E_MAIL_PANED_VIEW_GET_PRIVATE (object); + priv = E_MAIL_PANED_VIEW (object)->priv; priv->formatter = em_format_html_display_new (); view = E_MAIL_VIEW (object); @@ -695,7 +691,7 @@ mail_paned_view_set_search_strings (EMailView *view, ESearchBar *search_bar; ESearchingTokenizer *tokenizer; - priv = E_MAIL_PANED_VIEW_GET_PRIVATE (view); + priv = E_MAIL_PANED_VIEW (view)->priv; search_bar = E_SEARCH_BAR (priv->search_bar); tokenizer = e_search_bar_get_tokenizer (search_bar); @@ -717,7 +713,7 @@ mail_paned_view_get_view_instance (EMailView *view) { EMailPanedViewPrivate *priv; - priv = E_MAIL_PANED_VIEW_GET_PRIVATE (view); + priv = E_MAIL_PANED_VIEW (view)->priv; return priv->view_instance; } @@ -742,7 +738,7 @@ mail_paned_view_update_view_instance (EMailView *view) const gchar *folder_uri; gchar *view_id; - priv = E_MAIL_PANED_VIEW_GET_PRIVATE (view); + priv = E_MAIL_PANED_VIEW (view)->priv; shell_view = e_mail_view_get_shell_view (view); shell_view_class = E_SHELL_VIEW_GET_CLASS (shell_view); @@ -979,7 +975,7 @@ e_mail_paned_view_reader_init (EMailReaderInterface *interface) static void e_mail_paned_view_init (EMailPanedView *view) { - view->priv = E_MAIL_PANED_VIEW_GET_PRIVATE (view); + view->priv = G_TYPE_INSTANCE_GET_PRIVATE (view, E_TYPE_MAIL_PANED_VIEW, EMailPanedViewPrivate); view->priv->enable_show_folder = FALSE; g_signal_connect ( diff --git a/mail/e-mail-session.c b/mail/e-mail-session.c index a9b12b02ce..4f78be0d90 100644 --- a/mail/e-mail-session.c +++ b/mail/e-mail-session.c @@ -64,10 +64,6 @@ #include "mail-send-recv.h" #include "mail-tools.h" -#define E_MAIL_SESSION_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_MAIL_SESSION, EMailSessionPrivate)) - static guint session_check_junk_notify_id; static guint session_gconf_proxy_id; @@ -556,7 +552,7 @@ mail_session_dispose (GObject *object) { EMailSessionPrivate *priv; - priv = E_MAIL_SESSION_GET_PRIVATE (object); + priv = E_MAIL_SESSION (object)->priv; if (priv->folder_cache != NULL) { g_object_unref (priv->folder_cache); @@ -1001,7 +997,7 @@ e_mail_session_init (EMailSession *session) { GConfClient *client; - session->priv = E_MAIL_SESSION_GET_PRIVATE (session); + session->priv = G_TYPE_INSTANCE_GET_PRIVATE (session, E_TYPE_MAIL_SESSION, EMailSessionPrivate); session->priv->folder_cache = mail_folder_cache_new (); /* Initialize the EAccount setup. */ diff --git a/mail/e-mail-sidebar.c b/mail/e-mail-sidebar.c index a418dc133c..19f38f7d30 100644 --- a/mail/e-mail-sidebar.c +++ b/mail/e-mail-sidebar.c @@ -27,10 +27,6 @@ #include "mail/e-mail-local.h" #include "mail/em-utils.h" -#define E_MAIL_SIDEBAR_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_MAIL_SIDEBAR, EMailSidebarPrivate)) - struct _EMailSidebarPrivate { GKeyFile *key_file; /* not owned */ }; @@ -425,7 +421,7 @@ mail_sidebar_init (EMailSidebar *sidebar) GtkTreeSelection *selection; EMFolderTree *folder_tree; - sidebar->priv = E_MAIL_SIDEBAR_GET_PRIVATE (sidebar); + sidebar->priv = G_TYPE_INSTANCE_GET_PRIVATE (sidebar, E_TYPE_MAIL_SIDEBAR, EMailSidebarPrivate); folder_tree = EM_FOLDER_TREE (sidebar); em_folder_tree_set_excluded (folder_tree, 0); diff --git a/mail/e-mail-tab-picker.c b/mail/e-mail-tab-picker.c index e97bc742df..89b672e782 100644 --- a/mail/e-mail-tab-picker.c +++ b/mail/e-mail-tab-picker.c @@ -31,9 +31,6 @@ G_DEFINE_TYPE_WITH_CODE (EMailTabPicker, G_IMPLEMENT_INTERFACE (MX_TYPE_DROPPABLE, mx_droppable_iface_init)) -#define TAB_PICKER_PRIVATE(o) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((o), E_MAIL_TYPE_TAB_PICKER, EMailTabPickerPrivate)) - enum { PROP_0, @@ -899,7 +896,7 @@ e_mail_tab_picker_scroll_value_cb (MxAdjustment *adjustment, static void e_mail_tab_picker_init (EMailTabPicker *self) { - EMailTabPickerPrivate *priv = self->priv = TAB_PICKER_PRIVATE (self); + EMailTabPickerPrivate *priv = self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, E_MAIL_TYPE_TAB_PICKER, EMailTabPickerPrivate); clutter_actor_set_reactive (CLUTTER_ACTOR (self), TRUE); diff --git a/mail/e-mail-tab.c b/mail/e-mail-tab.c index cbbe8a83f6..aefe49f1df 100644 --- a/mail/e-mail-tab.c +++ b/mail/e-mail-tab.c @@ -35,9 +35,6 @@ G_DEFINE_TYPE_WITH_CODE (EMailTab, G_IMPLEMENT_INTERFACE (MX_TYPE_DRAGGABLE, mx_draggable_iface_init)) -#define TAB_PRIVATE(o) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((o), E_MAIL_TYPE_TAB, EMailTabPrivate)) - enum { PROP_0, @@ -1310,7 +1307,7 @@ e_mail_tab_init (EMailTab *self) ClutterActor *text; GtkSettings *settings; - EMailTabPrivate *priv = self->priv = TAB_PRIVATE (self); + EMailTabPrivate *priv = self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, E_MAIL_TYPE_TAB, EMailTabPrivate); priv->width = -1; priv->anim_length = 200; diff --git a/mail/e-mail-tag-editor.c b/mail/e-mail-tag-editor.c index 0b1e20cef0..5cc29b5bde 100644 --- a/mail/e-mail-tag-editor.c +++ b/mail/e-mail-tag-editor.c @@ -33,10 +33,6 @@ #include "e-util/e-util.h" #include "widgets/misc/e-dateedit.h" -#define E_MAIL_TAG_EDITOR_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_MAIL_TAG_EDITOR, EMailTagEditorPrivate)) - #define DEFAULT_FLAG 2 /* "Follow-Up" */ struct _EMailTagEditorPrivate { @@ -285,7 +281,7 @@ mail_tag_editor_init (EMailTagEditor *editor) GtkCellRenderer *renderer; GtkListStore *store; - editor->priv = E_MAIL_TAG_EDITOR_GET_PRIVATE (editor); + editor->priv = G_TYPE_INSTANCE_GET_PRIVATE (editor, E_TYPE_MAIL_TAG_EDITOR, EMailTagEditorPrivate); dialog = GTK_DIALOG (editor); window = GTK_WINDOW (editor); diff --git a/mail/e-mail-view.c b/mail/e-mail-view.c index 62e0b0c733..0db537bd02 100644 --- a/mail/e-mail-view.c +++ b/mail/e-mail-view.c @@ -28,10 +28,6 @@ #include <glib/gi18n-lib.h> -#define E_MAIL_VIEW_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_MAIL_VIEW, EMailViewPrivate)) - struct _EMailViewPrivate { EShellView *shell_view; GtkOrientation orientation; @@ -158,7 +154,7 @@ mail_view_dispose (GObject *object) { EMailViewPrivate *priv; - priv = E_MAIL_VIEW_GET_PRIVATE (object); + priv = E_MAIL_VIEW (object)->priv; if (priv->shell_view != NULL) { g_object_unref (priv->shell_view); @@ -323,7 +319,7 @@ e_mail_view_class_init (EMailViewClass *class) static void e_mail_view_init (EMailView *view) { - view->priv = E_MAIL_VIEW_GET_PRIVATE (view); + view->priv = G_TYPE_INSTANCE_GET_PRIVATE (view, E_TYPE_MAIL_VIEW, EMailViewPrivate); } EShellView * diff --git a/mail/em-account-editor.c b/mail/em-account-editor.c index 0228d2e50d..e7973cd774 100644 --- a/mail/em-account-editor.c +++ b/mail/em-account-editor.c @@ -72,10 +72,6 @@ #include "smime/gui/e-cert-selector.h" #endif -#define EM_ACCOUNT_EDITOR_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), EM_TYPE_ACCOUNT_EDITOR, EMAccountEditorPrivate)) - #define d(x) static ServerData mail_servers[] = { @@ -338,7 +334,7 @@ emae_dispose (GObject *object) { EMAccountEditorPrivate *priv; - priv = EM_ACCOUNT_EDITOR_GET_PRIVATE (object); + priv = EM_ACCOUNT_EDITOR (object)->priv; if (priv->session != NULL) { g_object_unref (priv->session); @@ -433,7 +429,7 @@ emae_class_init (GObjectClass *class) static void emae_init (EMAccountEditor *emae) { - emae->priv = EM_ACCOUNT_EDITOR_GET_PRIVATE (emae); + emae->priv = G_TYPE_INSTANCE_GET_PRIVATE (emae, EM_TYPE_ACCOUNT_EDITOR, EMAccountEditorPrivate); emae->priv->selected_server = NULL; emae->emae_check_servers = emae_check_servers; diff --git a/mail/em-filter-context.c b/mail/em-filter-context.c index 52039d9aa8..f7756960ec 100644 --- a/mail/em-filter-context.c +++ b/mail/em-filter-context.c @@ -36,10 +36,6 @@ /* For poking into filter-folder guts */ #include "em-filter-folder-element.h" -#define EM_FILTER_CONTEXT_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), EM_TYPE_FILTER_CONTEXT, EMFilterContextPrivate)) - struct _EMFilterContextPrivate { EMailSession *session; GList *actions; @@ -105,7 +101,7 @@ filter_context_dispose (GObject *object) { EMFilterContextPrivate *priv; - priv = EM_FILTER_CONTEXT_GET_PRIVATE (object); + priv = EM_FILTER_CONTEXT (object)->priv; if (priv->session != NULL) { g_object_unref (priv->session); @@ -233,7 +229,7 @@ filter_context_new_element (ERuleContext *context, { EMFilterContextPrivate *priv; - priv = EM_FILTER_CONTEXT_GET_PRIVATE (context); + priv = EM_FILTER_CONTEXT (context)->priv; if (strcmp (type, "folder") == 0) return em_filter_folder_element_new (priv->session); @@ -284,7 +280,7 @@ em_filter_context_class_init (EMFilterContextClass *class) static void em_filter_context_init (EMFilterContext *context) { - context->priv = EM_FILTER_CONTEXT_GET_PRIVATE (context); + context->priv = G_TYPE_INSTANCE_GET_PRIVATE (context, EM_TYPE_FILTER_CONTEXT, EMFilterContextPrivate); e_rule_context_add_part_set ( E_RULE_CONTEXT (context), diff --git a/mail/em-filter-folder-element.c b/mail/em-filter-folder-element.c index 4daf441ead..70c9da6aa6 100644 --- a/mail/em-filter-folder-element.c +++ b/mail/em-filter-folder-element.c @@ -39,10 +39,6 @@ #include "libedataserver/e-sexp.h" #include "e-util/e-alert.h" -#define EM_FILTER_FOLDER_ELEMENT_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), EM_TYPE_FILTER_FOLDER_ELEMENT, EMFilterFolderElementPrivate)) - struct _EMFilterFolderElementPrivate { EMailSession *session; gchar *uri; @@ -122,7 +118,7 @@ filter_folder_element_dispose (GObject *object) { EMFilterFolderElementPrivate *priv; - priv = EM_FILTER_FOLDER_ELEMENT_GET_PRIVATE (object); + priv = EM_FILTER_FOLDER_ELEMENT (object)->priv; if (priv->session != NULL) { g_object_unref (priv->session); @@ -138,7 +134,7 @@ filter_folder_element_finalize (GObject *object) { EMFilterFolderElementPrivate *priv; - priv = EM_FILTER_FOLDER_ELEMENT_GET_PRIVATE (object); + priv = EM_FILTER_FOLDER_ELEMENT (object)->priv; g_free (priv->uri); @@ -185,7 +181,7 @@ em_filter_folder_element_class_init (EMFilterFolderElementClass *class) static void em_filter_folder_element_init (EMFilterFolderElement *element) { - element->priv = EM_FILTER_FOLDER_ELEMENT_GET_PRIVATE (element); + element->priv = G_TYPE_INSTANCE_GET_PRIVATE (element, EM_TYPE_FILTER_FOLDER_ELEMENT, EMFilterFolderElementPrivate); } EFilterElement * diff --git a/mail/em-folder-selection-button.c b/mail/em-folder-selection-button.c index 7feed625d1..e6b11c278f 100644 --- a/mail/em-folder-selection-button.c +++ b/mail/em-folder-selection-button.c @@ -35,10 +35,6 @@ #include "em-folder-selection-button.h" -#define EM_FOLDER_SELECTION_BUTTON_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), EM_TYPE_FOLDER_SELECTION_BUTTON, EMFolderSelectionButtonPrivate)) - struct _EMFolderSelectionButtonPrivate { EMailSession *session; GtkWidget *icon; @@ -195,7 +191,7 @@ folder_selection_button_dispose (GObject *object) { EMFolderSelectionButtonPrivate *priv; - priv = EM_FOLDER_SELECTION_BUTTON_GET_PRIVATE (object); + priv = EM_FOLDER_SELECTION_BUTTON (object)->priv; if (priv->session != NULL) { g_object_unref (priv->session); @@ -211,7 +207,7 @@ folder_selection_button_finalize (GObject *object) { EMFolderSelectionButtonPrivate *priv; - priv = EM_FOLDER_SELECTION_BUTTON_GET_PRIVATE (object); + priv = EM_FOLDER_SELECTION_BUTTON (object)->priv; g_list_foreach (priv->uris, (GFunc) g_free, NULL); g_list_free (priv->uris); @@ -234,7 +230,7 @@ folder_selection_button_clicked (GtkButton *button) GtkSelectionMode mode; gpointer parent; - priv = EM_FOLDER_SELECTION_BUTTON_GET_PRIVATE (button); + priv = EM_FOLDER_SELECTION_BUTTON (button)->priv; parent = gtk_widget_get_toplevel (GTK_WIDGET (button)); parent = gtk_widget_is_toplevel (parent) ? parent : NULL; @@ -365,7 +361,7 @@ em_folder_selection_button_init (EMFolderSelectionButton *emfsb) { GtkWidget *box; - emfsb->priv = EM_FOLDER_SELECTION_BUTTON_GET_PRIVATE (emfsb); + emfsb->priv = G_TYPE_INSTANCE_GET_PRIVATE (emfsb, EM_TYPE_FOLDER_SELECTION_BUTTON, EMFolderSelectionButtonPrivate); emfsb->priv->multiple_select = FALSE; diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c index c217d63ebb..6668eae77d 100644 --- a/mail/em-folder-tree-model.c +++ b/mail/em-folder-tree-model.c @@ -52,10 +52,6 @@ #define d(x) -#define EM_FOLDER_TREE_MODEL_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), EM_TYPE_FOLDER_TREE_MODEL, EMFolderTreeModelPrivate)) - struct _EMFolderTreeModelPrivate { /* This is set by EMailShellSidebar. It allows new EMFolderTree * instances to initialize their selection and expanded states to @@ -339,7 +335,7 @@ folder_tree_model_dispose (GObject *object) { EMFolderTreeModelPrivate *priv; - priv = EM_FOLDER_TREE_MODEL_GET_PRIVATE (object); + priv = EM_FOLDER_TREE_MODEL (object)->priv; if (priv->selection != NULL) { g_object_weak_unref ( @@ -362,7 +358,7 @@ folder_tree_model_finalize (GObject *object) { EMFolderTreeModelPrivate *priv; - priv = EM_FOLDER_TREE_MODEL_GET_PRIVATE (object); + priv = EM_FOLDER_TREE_MODEL (object)->priv; g_hash_table_destroy (priv->account_index); g_hash_table_destroy (priv->store_index); @@ -533,7 +529,7 @@ em_folder_tree_model_init (EMFolderTreeModel *model) (GDestroyNotify) g_free, (GDestroyNotify) gtk_tree_row_reference_free); - model->priv = EM_FOLDER_TREE_MODEL_GET_PRIVATE (model); + model->priv = G_TYPE_INSTANCE_GET_PRIVATE (model, EM_TYPE_FOLDER_TREE_MODEL, EMFolderTreeModelPrivate); model->priv->store_index = store_index; model->priv->uri_index = uri_index; diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c index 94d5061866..ee853331bf 100644 --- a/mail/em-folder-tree.c +++ b/mail/em-folder-tree.c @@ -68,10 +68,6 @@ #define d(x) -#define EM_FOLDER_TREE_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), EM_TYPE_FOLDER_TREE, EMFolderTreePrivate)) - struct _selected_uri { gchar *key; /* store:path or account/path */ gchar *uri; @@ -395,7 +391,7 @@ folder_tree_select_func (GtkTreeSelection *selection, tree_view = gtk_tree_selection_get_tree_view (selection); - priv = EM_FOLDER_TREE_GET_PRIVATE (tree_view); + priv = EM_FOLDER_TREE (tree_view)->priv; if (selected) return TRUE; @@ -822,7 +818,7 @@ folder_tree_dispose (GObject *object) EMFolderTreePrivate *priv; GtkTreeModel *model; - priv = EM_FOLDER_TREE_GET_PRIVATE (object); + priv = EM_FOLDER_TREE (object)->priv; model = gtk_tree_view_get_model (GTK_TREE_VIEW (object)); if (priv->loaded_row_id != 0) { @@ -862,7 +858,7 @@ folder_tree_finalize (GObject *object) { EMFolderTreePrivate *priv; - priv = EM_FOLDER_TREE_GET_PRIVATE (object); + priv = EM_FOLDER_TREE (object)->priv; if (priv->select_uris != NULL) { g_slist_foreach ( @@ -888,7 +884,7 @@ folder_tree_button_press_event (GtkWidget *widget, GtkTreePath *path; gulong handler_id; - priv = EM_FOLDER_TREE_GET_PRIVATE (widget); + priv = EM_FOLDER_TREE (widget)->priv; tree_view = GTK_TREE_VIEW (widget); selection = gtk_tree_view_get_selection (tree_view); @@ -947,7 +943,7 @@ folder_tree_key_press_event (GtkWidget *widget, return TRUE; } - priv = EM_FOLDER_TREE_GET_PRIVATE (widget); + priv = EM_FOLDER_TREE (widget)->priv; tree_view = GTK_TREE_VIEW (widget); selection = gtk_tree_view_get_selection (tree_view); @@ -981,7 +977,7 @@ folder_tree_row_activated (GtkTreeView *tree_view, GtkTreeIter iter; guint32 flags; - priv = EM_FOLDER_TREE_GET_PRIVATE (tree_view); + priv = EM_FOLDER_TREE (tree_view)->priv; model = gtk_tree_view_get_model (tree_view); @@ -1457,7 +1453,7 @@ folder_tree_init (EMFolderTree *folder_tree) select_uris_table = g_hash_table_new (g_str_hash, g_str_equal); - folder_tree->priv = EM_FOLDER_TREE_GET_PRIVATE (folder_tree); + folder_tree->priv = G_TYPE_INSTANCE_GET_PRIVATE (folder_tree, EM_TYPE_FOLDER_TREE, EMFolderTreePrivate); folder_tree->priv->select_uris_table = select_uris_table; tree_view = GTK_TREE_VIEW (folder_tree); diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c index 24f8aa5638..fc1281cfc8 100644 --- a/mail/em-format-html-display.c +++ b/mail/em-format-html-display.c @@ -64,10 +64,6 @@ #define d(x) -#define EM_FORMAT_HTML_DISPLAY_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), EM_TYPE_FORMAT_HTML_DISPLAY, EMFormatHTMLDisplayPrivate)) - struct _EMFormatHTMLDisplayPrivate { GtkWidget *attachment_view; /* weak reference */ }; @@ -626,7 +622,7 @@ efhd_init (EMFormatHTMLDisplay *efhd) web_view = em_format_html_get_web_view (EM_FORMAT_HTML (efhd)); - efhd->priv = EM_FORMAT_HTML_DISPLAY_GET_PRIVATE (efhd); + efhd->priv = G_TYPE_INSTANCE_GET_PRIVATE (efhd, EM_TYPE_FORMAT_HTML_DISPLAY, EMFormatHTMLDisplayPrivate); e_mail_display_set_formatter ( E_MAIL_DISPLAY (web_view), EM_FORMAT_HTML (efhd)); @@ -907,7 +903,7 @@ efhd_bar_resize (EMFormatHTML *efh, GtkWidget *widget; gint width; - priv = EM_FORMAT_HTML_DISPLAY_GET_PRIVATE (efh); + priv = EM_FORMAT_HTML_DISPLAY (efh)->priv; web_view = em_format_html_get_web_view (efh); @@ -933,7 +929,7 @@ efhd_add_bar (EMFormatHTML *efh, if (!EM_IS_FORMAT_HTML_DISPLAY (efh)) return FALSE; - priv = EM_FORMAT_HTML_DISPLAY_GET_PRIVATE (efh); + priv = EM_FORMAT_HTML_DISPLAY (efh)->priv; widget = e_mail_attachment_bar_new (); gtk_container_add (GTK_CONTAINER (eb), widget); diff --git a/mail/em-format-html.c b/mail/em-format-html.c index fb7ad59568..15c3e5e2df 100644 --- a/mail/em-format-html.c +++ b/mail/em-format-html.c @@ -66,10 +66,6 @@ #define d(x) -#define EM_FORMAT_HTML_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), EM_TYPE_FORMAT_HTML, EMFormatHTMLPrivate)) - #define EFM_MESSAGE_START_ANAME "evolution#message#start" #define EFH_MESSAGE_START "<A name=\"" EFM_MESSAGE_START_ANAME "\"></A>" @@ -766,7 +762,7 @@ efh_busy (EMFormat *emf) { EMFormatHTMLPrivate *priv; - priv = EM_FORMAT_HTML_GET_PRIVATE (emf); + priv = EM_FORMAT_HTML (emf)->priv; return (priv->format_id != -1); } @@ -937,12 +933,12 @@ efh_class_init (EMFormatHTMLClass *class) static void efh_init (EMFormatHTML *efh, - EMFormatHTMLClass *class) + EMFormatHTMLClass *class) { EWebView *web_view; GdkColor *color; - efh->priv = EM_FORMAT_HTML_GET_PRIVATE (efh); + efh->priv = G_TYPE_INSTANCE_GET_PRIVATE (efh, EM_TYPE_FORMAT_HTML, EMFormatHTMLPrivate); g_queue_init (&efh->pending_object_list); g_queue_init (&efh->priv->pending_jobs); diff --git a/mail/em-subscription-editor.c b/mail/em-subscription-editor.c index 3a94e66a23..8b0400ffe0 100644 --- a/mail/em-subscription-editor.c +++ b/mail/em-subscription-editor.c @@ -33,10 +33,6 @@ #include "em-folder-utils.h" -#define EM_SUBSCRIPTION_EDITOR_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), EM_TYPE_SUBSCRIPTION_EDITOR, EMSubscriptionEditorPrivate)) - #define FOLDER_CAN_SELECT(folder_info) \ ((folder_info) != NULL && \ ((folder_info)->flags & CAMEL_FOLDER_NOSELECT) == 0) @@ -980,7 +976,7 @@ subscription_editor_dispose (GObject *object) { EMSubscriptionEditorPrivate *priv; - priv = EM_SUBSCRIPTION_EDITOR_GET_PRIVATE (object); + priv = EM_SUBSCRIPTION_EDITOR (object)->priv; if (priv->session != NULL) { g_object_unref (priv->session); @@ -1008,7 +1004,7 @@ subscription_editor_finalize (GObject *object) { EMSubscriptionEditorPrivate *priv; - priv = EM_SUBSCRIPTION_EDITOR_GET_PRIVATE (object); + priv = EM_SUBSCRIPTION_EDITOR (object)->priv; g_ptr_array_free (priv->stores, TRUE); @@ -1099,7 +1095,7 @@ em_subscription_editor_init (EMSubscriptionEditor *editor) GtkWidget *box; const gchar *tooltip; - editor->priv = EM_SUBSCRIPTION_EDITOR_GET_PRIVATE (editor); + editor->priv = G_TYPE_INSTANCE_GET_PRIVATE (editor, EM_TYPE_SUBSCRIPTION_EDITOR, EMSubscriptionEditorPrivate); editor->priv->stores = g_ptr_array_new_with_free_func ( (GDestroyNotify) store_data_free); diff --git a/mail/em-vfolder-context.c b/mail/em-vfolder-context.c index 4e7d4018d4..d59715b78d 100644 --- a/mail/em-vfolder-context.c +++ b/mail/em-vfolder-context.c @@ -35,10 +35,6 @@ #include "em-filter-folder-element.h" -#define EM_VFOLDER_CONTEXT_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), EM_TYPE_VFOLDER_CONTEXT, EMVFolderContextPrivate)) - struct _EMVFolderContextPrivate { EMailSession *session; }; @@ -103,7 +99,7 @@ vfolder_context_dispose (GObject *object) { EMVFolderContextPrivate *priv; - priv = EM_VFOLDER_CONTEXT_GET_PRIVATE (object); + priv = EM_VFOLDER_CONTEXT (object)->priv; if (priv->session != NULL) { g_object_unref (priv->session); @@ -120,7 +116,7 @@ vfolder_context_new_element (ERuleContext *context, { EMVFolderContextPrivate *priv; - priv = EM_VFOLDER_CONTEXT_GET_PRIVATE (context); + priv = EM_VFOLDER_CONTEXT (context)->priv; if (strcmp (type, "system-flag") == 0) return e_filter_option_new (); @@ -175,7 +171,7 @@ em_vfolder_context_class_init (EMVFolderContextClass *class) static void em_vfolder_context_init (EMVFolderContext *context) { - context->priv = EM_VFOLDER_CONTEXT_GET_PRIVATE (context); + context->priv = G_TYPE_INSTANCE_GET_PRIVATE (context, EM_TYPE_VFOLDER_CONTEXT, EMVFolderContextPrivate); e_rule_context_add_part_set ( E_RULE_CONTEXT (context), "partset", E_TYPE_FILTER_PART, diff --git a/mail/em-vfolder-rule.c b/mail/em-vfolder-rule.c index 1d11a72c2d..a1b7f53be7 100644 --- a/mail/em-vfolder-rule.c +++ b/mail/em-vfolder-rule.c @@ -42,10 +42,6 @@ #include "e-util/e-alert.h" #include "e-util/e-util-private.h" -#define EM_VFOLDER_RULE_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), EM_TYPE_VFOLDER_RULE, EMVFolderRulePrivate)) - struct _EMVFolderRulePrivate { EMailSession *session; }; @@ -137,7 +133,7 @@ vfolder_rule_dispose (GObject *object) { EMVFolderRulePrivate *priv; - priv = EM_VFOLDER_RULE_GET_PRIVATE (object); + priv = EM_VFOLDER_RULE (object)->priv; if (priv->session != NULL) { g_object_unref (priv->session); @@ -197,7 +193,7 @@ em_vfolder_rule_class_init (EMVFolderRuleClass *class) static void em_vfolder_rule_init (EMVFolderRule *rule) { - rule->priv = EM_VFOLDER_RULE_GET_PRIVATE (rule); + rule->priv = G_TYPE_INSTANCE_GET_PRIVATE (rule, EM_TYPE_VFOLDER_RULE, EMVFolderRulePrivate); rule->with = EM_VFOLDER_RULE_WITH_SPECIFIC; rule->rule.source = g_strdup ("incoming"); diff --git a/mail/mail-folder-cache.c b/mail/mail-folder-cache.c index 876cbb3103..e7563ced8b 100644 --- a/mail/mail-folder-cache.c +++ b/mail/mail-folder-cache.c @@ -59,10 +59,6 @@ /* This code is a mess, there is no reason it should be so complicated. */ -#define MAIL_FOLDER_CACHE_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), MAIL_TYPE_FOLDER_CACHE, MailFolderCachePrivate)) - struct _MailFolderCachePrivate { /* source id for the ping timeout callback */ guint ping_id; @@ -1054,7 +1050,7 @@ mail_folder_cache_init (MailFolderCache *self) const gchar *buf; guint timeout; - self->priv = MAIL_FOLDER_CACHE_GET_PRIVATE (self); + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MAIL_TYPE_FOLDER_CACHE, MailFolderCachePrivate); /* initialize values */ self->priv->stores = g_hash_table_new (NULL, NULL); diff --git a/mail/message-list.c b/mail/message-list.c index 8f38fac7bf..148bd616ae 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -97,10 +97,6 @@ #define d(x) #define t(x) -#define MESSAGE_LIST_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), MESSAGE_LIST_TYPE, MessageListPrivate)) - struct _MLSelection { GPtrArray *uids; CamelFolder *folder; @@ -2468,7 +2464,7 @@ message_list_init (MessageList *message_list) GtkTargetList *target_list; GdkAtom matom; - message_list->priv = MESSAGE_LIST_GET_PRIVATE (message_list); + message_list->priv = G_TYPE_INSTANCE_GET_PRIVATE (message_list, MESSAGE_LIST_TYPE, MessageListPrivate); #if HAVE_CLUTTER message_list->priv->timeline = NULL; @@ -2566,7 +2562,7 @@ message_list_dispose (GObject *object) MessageList *message_list = MESSAGE_LIST (object); MessageListPrivate *priv; - priv = MESSAGE_LIST_GET_PRIVATE (message_list); + priv = message_list->priv; if (priv->backend != NULL) { g_object_unref (priv->backend); |