diff options
author | Milan Crha <mcrha@redhat.com> | 2011-02-25 23:20:41 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-06-30 00:41:39 +0800 |
commit | c003c99a75587ba39a45d164272760c33f9666b5 (patch) | |
tree | ad6d0583fa9e8f078fb1c118f994371d2f1f79d8 /modules/addressbook | |
parent | f55aaa5e00a40a137f403a8d5c68dd508059b0b4 (diff) | |
download | gsoc2013-evolution-c003c99a75587ba39a45d164272760c33f9666b5.tar.gz gsoc2013-evolution-c003c99a75587ba39a45d164272760c33f9666b5.tar.zst gsoc2013-evolution-c003c99a75587ba39a45d164272760c33f9666b5.zip |
Bug #614480 - Avoid using G_TYPE_INSTANCE_GET_PRIVATE repeatedly
Diffstat (limited to 'modules/addressbook')
-rw-r--r-- | modules/addressbook/e-book-shell-backend.c | 11 | ||||
-rw-r--r-- | modules/addressbook/e-book-shell-content.c | 13 | ||||
-rw-r--r-- | modules/addressbook/e-book-shell-sidebar.c | 11 | ||||
-rw-r--r-- | modules/addressbook/e-book-shell-view-private.h | 4 | ||||
-rw-r--r-- | modules/addressbook/e-book-shell-view.c | 9 |
5 files changed, 14 insertions, 34 deletions
diff --git a/modules/addressbook/e-book-shell-backend.c b/modules/addressbook/e-book-shell-backend.c index 02d16d640b..b76764c81d 100644 --- a/modules/addressbook/e-book-shell-backend.c +++ b/modules/addressbook/e-book-shell-backend.c @@ -54,10 +54,6 @@ #include "smime/gui/certificate-manager.h" #endif -#define E_BOOK_SHELL_BACKEND_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_BOOK_SHELL_BACKEND, EBookShellBackendPrivate)) - struct _EBookShellBackendPrivate { ESourceList *source_list; }; @@ -85,7 +81,7 @@ book_shell_backend_ensure_sources (EShellBackend *shell_backend) on_this_computer = NULL; personal = NULL; - priv = E_BOOK_SHELL_BACKEND_GET_PRIVATE (shell_backend); + priv = E_BOOK_SHELL_BACKEND (shell_backend)->priv; if (!e_book_get_addressbooks (&priv->source_list, NULL)) { g_warning ("Could not get addressbook sources from GConf!"); @@ -458,7 +454,7 @@ book_shell_backend_dispose (GObject *object) { EBookShellBackendPrivate *priv; - priv = E_BOOK_SHELL_BACKEND_GET_PRIVATE (object); + priv = E_BOOK_SHELL_BACKEND (object)->priv; if (priv->source_list != NULL) { g_object_unref (priv->source_list); @@ -553,8 +549,7 @@ book_shell_backend_class_init (EBookShellBackendClass *class) static void book_shell_backend_init (EBookShellBackend *book_shell_backend) { - book_shell_backend->priv = - E_BOOK_SHELL_BACKEND_GET_PRIVATE (book_shell_backend); + book_shell_backend->priv = G_TYPE_INSTANCE_GET_PRIVATE (book_shell_backend, E_TYPE_BOOK_SHELL_BACKEND, EBookShellBackendPrivate); } GType diff --git a/modules/addressbook/e-book-shell-content.c b/modules/addressbook/e-book-shell-content.c index b4bd8d2ac3..2077510056 100644 --- a/modules/addressbook/e-book-shell-content.c +++ b/modules/addressbook/e-book-shell-content.c @@ -30,10 +30,6 @@ #include "widgets/misc/e-preview-pane.h" #include "e-book-shell-view.h" -#define E_BOOK_SHELL_CONTENT_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_BOOK_SHELL_CONTENT, EBookShellContentPrivate)) - struct _EBookShellContentPrivate { GtkWidget *paned; GtkWidget *notebook; @@ -84,7 +80,7 @@ book_shell_content_restore_state_cb (EShellWindow *shell_window, GObject *object; const gchar *key; - priv = E_BOOK_SHELL_CONTENT_GET_PRIVATE (shell_content); + priv = E_BOOK_SHELL_CONTENT (shell_content)->priv; /* Bind GObject properties to GConf keys. */ @@ -193,7 +189,7 @@ book_shell_content_dispose (GObject *object) { EBookShellContentPrivate *priv; - priv = E_BOOK_SHELL_CONTENT_GET_PRIVATE (object); + priv = E_BOOK_SHELL_CONTENT (object)->priv; if (priv->paned != NULL) { g_object_unref (priv->paned); @@ -226,7 +222,7 @@ book_shell_content_constructed (GObject *object) GtkWidget *container; GtkWidget *widget; - priv = E_BOOK_SHELL_CONTENT_GET_PRIVATE (object); + priv = E_BOOK_SHELL_CONTENT (object)->priv; /* Chain up to parent's constructed() method. */ G_OBJECT_CLASS (parent_class)->constructed (object); @@ -456,8 +452,7 @@ book_shell_content_class_init (EBookShellContentClass *class) static void book_shell_content_init (EBookShellContent *book_shell_content) { - book_shell_content->priv = - E_BOOK_SHELL_CONTENT_GET_PRIVATE (book_shell_content); + book_shell_content->priv = G_TYPE_INSTANCE_GET_PRIVATE (book_shell_content, E_TYPE_BOOK_SHELL_CONTENT, EBookShellContentPrivate); /* Postpone widget construction until we have a shell view. */ } diff --git a/modules/addressbook/e-book-shell-sidebar.c b/modules/addressbook/e-book-shell-sidebar.c index 3c61f5e55d..57f3b288df 100644 --- a/modules/addressbook/e-book-shell-sidebar.c +++ b/modules/addressbook/e-book-shell-sidebar.c @@ -30,10 +30,6 @@ #include "e-book-shell-backend.h" #include "e-addressbook-selector.h" -#define E_BOOK_SHELL_SIDEBAR_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_BOOK_SHELL_SIDEBAR, EBookShellSidebarPrivate)) - struct _EBookShellSidebarPrivate { GtkWidget *selector; }; @@ -68,7 +64,7 @@ book_shell_sidebar_dispose (GObject *object) { EBookShellSidebarPrivate *priv; - priv = E_BOOK_SHELL_SIDEBAR_GET_PRIVATE (object); + priv = E_BOOK_SHELL_SIDEBAR (object)->priv; if (priv->selector != NULL) { g_object_unref (priv->selector); @@ -92,7 +88,7 @@ book_shell_sidebar_constructed (GObject *object) GtkContainer *container; GtkWidget *widget; - priv = E_BOOK_SHELL_SIDEBAR_GET_PRIVATE (object); + priv = E_BOOK_SHELL_SIDEBAR (object)->priv; /* Chain up to parent's constructed() method. */ G_OBJECT_CLASS (parent_class)->constructed (object); @@ -204,8 +200,7 @@ book_shell_sidebar_class_init (EBookShellSidebarClass *class) static void book_shell_sidebar_init (EBookShellSidebar *book_shell_sidebar) { - book_shell_sidebar->priv = - E_BOOK_SHELL_SIDEBAR_GET_PRIVATE (book_shell_sidebar); + book_shell_sidebar->priv = G_TYPE_INSTANCE_GET_PRIVATE (book_shell_sidebar, E_TYPE_BOOK_SHELL_SIDEBAR, EBookShellSidebarPrivate); /* Postpone widget construction until we have a shell view. */ } diff --git a/modules/addressbook/e-book-shell-view-private.h b/modules/addressbook/e-book-shell-view-private.h index 7c2a2721f1..528a34d282 100644 --- a/modules/addressbook/e-book-shell-view-private.h +++ b/modules/addressbook/e-book-shell-view-private.h @@ -55,10 +55,6 @@ #include "e-book-shell-sidebar.h" #include "e-book-shell-view-actions.h" -#define E_BOOK_SHELL_VIEW_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_BOOK_SHELL_VIEW, EBookShellViewPrivate)) - /* Shorthand, requires a variable named "shell_window". */ #define ACTION(name) \ (E_SHELL_WINDOW_ACTION_##name (shell_window)) diff --git a/modules/addressbook/e-book-shell-view.c b/modules/addressbook/e-book-shell-view.c index 8b5d816eaa..777793ad45 100644 --- a/modules/addressbook/e-book-shell-view.c +++ b/modules/addressbook/e-book-shell-view.c @@ -141,7 +141,7 @@ book_shell_view_execute_search (EShellView *shell_view) gchar *search_text = NULL; EFilterRule *advanced_search = NULL; - priv = E_BOOK_SHELL_VIEW_GET_PRIVATE (shell_view); + priv = E_BOOK_SHELL_VIEW (shell_view)->priv; if (priv->search_locked) return; @@ -414,8 +414,7 @@ static void book_shell_view_init (EBookShellView *book_shell_view, EShellViewClass *shell_view_class) { - book_shell_view->priv = - E_BOOK_SHELL_VIEW_GET_PRIVATE (book_shell_view); + book_shell_view->priv = G_TYPE_INSTANCE_GET_PRIVATE (book_shell_view, E_TYPE_BOOK_SHELL_VIEW, EBookShellViewPrivate); e_book_shell_view_private_init (book_shell_view, shell_view_class); } @@ -455,7 +454,7 @@ e_book_shell_view_disable_searching (EBookShellView *book_shell_view) g_return_if_fail (book_shell_view != NULL); g_return_if_fail (E_IS_BOOK_SHELL_VIEW (book_shell_view)); - priv = E_BOOK_SHELL_VIEW_GET_PRIVATE (book_shell_view); + priv = book_shell_view->priv; priv->search_locked++; } @@ -467,7 +466,7 @@ e_book_shell_view_enable_searching (EBookShellView *book_shell_view) g_return_if_fail (book_shell_view != NULL); g_return_if_fail (E_IS_BOOK_SHELL_VIEW (book_shell_view)); - priv = E_BOOK_SHELL_VIEW_GET_PRIVATE (book_shell_view); + priv = book_shell_view->priv; g_return_if_fail (priv->search_locked > 0); priv->search_locked--; |