diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2012-06-24 19:31:28 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2012-06-25 08:31:42 +0800 |
commit | f960fd2dff5358f0e13eba7041d35855bf48c22e (patch) | |
tree | 92859c8ba093fa15a3bd7b888332d6e61a704a51 /mail | |
parent | 88db20f3e9ff38296c031671de963ae665fd8143 (diff) | |
download | gsoc2013-evolution-f960fd2dff5358f0e13eba7041d35855bf48c22e.tar gsoc2013-evolution-f960fd2dff5358f0e13eba7041d35855bf48c22e.tar.gz gsoc2013-evolution-f960fd2dff5358f0e13eba7041d35855bf48c22e.tar.bz2 gsoc2013-evolution-f960fd2dff5358f0e13eba7041d35855bf48c22e.tar.lz gsoc2013-evolution-f960fd2dff5358f0e13eba7041d35855bf48c22e.tar.xz gsoc2013-evolution-f960fd2dff5358f0e13eba7041d35855bf48c22e.tar.zst gsoc2013-evolution-f960fd2dff5358f0e13eba7041d35855bf48c22e.zip |
Reduce usage of g_type_class_peek_parent().
G_DEFINE_TYPE macros define a static "parent_class" variable.
Diffstat (limited to 'mail')
-rw-r--r-- | mail/e-mail-browser.c | 9 | ||||
-rw-r--r-- | mail/e-mail-display.c | 13 | ||||
-rw-r--r-- | mail/e-mail-printer.c | 5 | ||||
-rw-r--r-- | mail/em-folder-tree-model.c | 9 |
4 files changed, 14 insertions, 22 deletions
diff --git a/mail/e-mail-browser.c b/mail/e-mail-browser.c index 936b3b520f..f337c5cc71 100644 --- a/mail/e-mail-browser.c +++ b/mail/e-mail-browser.c @@ -76,8 +76,6 @@ enum { PROP_DISPLAY_MODE, }; -static gpointer parent_class; - /* This is too trivial to put in a file. * It gets merged with the EMailReader UI. */ static const gchar *ui = @@ -527,7 +525,7 @@ mail_browser_dispose (GObject *object) } /* Chain up to parent's dispose() method. */ - G_OBJECT_CLASS (parent_class)->dispose (object); + G_OBJECT_CLASS (e_mail_browser_parent_class)->dispose (object); } static void @@ -553,7 +551,7 @@ mail_browser_constructed (GObject *object) guint merge_id; /* Chain up to parent's constructed() method. */ - G_OBJECT_CLASS (parent_class)->constructed (object); + G_OBJECT_CLASS (e_mail_browser_parent_class)->constructed (object); browser = E_MAIL_BROWSER (object); reader = E_MAIL_READER (object); @@ -713,7 +711,7 @@ mail_browser_key_press_event (GtkWidget *widget, } /* Chain up to parent's key_press_event() method. */ - return GTK_WIDGET_CLASS (parent_class)-> + return GTK_WIDGET_CLASS (e_mail_browser_parent_class)-> key_press_event (widget, event); } @@ -842,7 +840,6 @@ e_mail_browser_class_init (EMailBrowserClass *class) GObjectClass *object_class; GtkWidgetClass *widget_class; - parent_class = g_type_class_peek_parent (class); g_type_class_add_private (class, sizeof (EMailBrowserPrivate)); object_class = G_OBJECT_CLASS (class); diff --git a/mail/e-mail-display.c b/mail/e-mail-display.c index aafdcf49ec..3a06deacd5 100644 --- a/mail/e-mail-display.c +++ b/mail/e-mail-display.c @@ -83,8 +83,6 @@ enum { PROP_HEADERS_COLLAPSED, }; -static gpointer parent_class; - static CamelDataCache *emd_global_http_cache = 0; static const gchar *ui = @@ -174,7 +172,8 @@ mail_display_update_actions (EWebView *web_view, GtkAction *action; /* Chain up first! */ - E_WEB_VIEW_CLASS (parent_class)->update_actions (web_view, event); + E_WEB_VIEW_CLASS (e_mail_display_parent_class)-> + update_actions (web_view, event); hit_test = webkit_web_view_get_hit_test_result ( WEBKIT_WEB_VIEW (web_view), event); @@ -318,14 +317,14 @@ mail_display_dispose (GObject *object) } /* Chain up to parent's dispose() method. */ - G_OBJECT_CLASS (parent_class)->dispose (object); + G_OBJECT_CLASS (e_mail_display_parent_class)->dispose (object); } static void mail_display_realize (GtkWidget *widget) { /* Chain up to parent's realize() method. */ - GTK_WIDGET_CLASS (parent_class)->realize (widget); + GTK_WIDGET_CLASS (e_mail_display_parent_class)->realize (widget); mail_display_update_formatter_colors (E_MAIL_DISPLAY (widget)); } @@ -339,7 +338,8 @@ mail_display_style_set (GtkWidget *widget, mail_display_update_formatter_colors (display); /* Chain up to parent's style_set() method. */ - GTK_WIDGET_CLASS (parent_class)->style_set (widget, previous_style); + GTK_WIDGET_CLASS (e_mail_display_parent_class)-> + style_set (widget, previous_style); } static gboolean @@ -1355,7 +1355,6 @@ e_mail_display_class_init (EMailDisplayClass *class) EWebViewClass *web_view_class; GtkWidgetClass *widget_class; - parent_class = g_type_class_peek_parent (class); g_type_class_add_private (class, sizeof (EMailDisplayPrivate)); object_class = G_OBJECT_CLASS (class); diff --git a/mail/e-mail-printer.c b/mail/e-mail-printer.c index f90414f02d..309e2bdeef 100644 --- a/mail/e-mail-printer.c +++ b/mail/e-mail-printer.c @@ -35,8 +35,6 @@ #include "e-mail-printer.h" #include "e-mail-display.h" -static gpointer parent_class = NULL; - enum { BUTTON_SELECT_ALL, BUTTON_SELECT_NONE, @@ -727,7 +725,7 @@ emp_finalize (GObject *object) } /* Chain up to parent's finalize() method. */ - G_OBJECT_CLASS (parent_class)->finalize (object); + G_OBJECT_CLASS (e_mail_printer_parent_class)->finalize (object); } static void @@ -735,7 +733,6 @@ e_mail_printer_class_init (EMailPrinterClass *klass) { GObjectClass *object_class; - parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (klass, sizeof (EMailPrinterPrivate)); object_class = G_OBJECT_CLASS (klass); diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c index f6a16d842a..9e6616dd1e 100644 --- a/mail/em-folder-tree-model.c +++ b/mail/em-folder-tree-model.c @@ -87,7 +87,6 @@ enum { LAST_SIGNAL }; -static gpointer parent_class; static guint signals[LAST_SIGNAL]; G_DEFINE_TYPE (EMFolderTreeModel, em_folder_tree_model, GTK_TYPE_TREE_STORE) @@ -306,7 +305,7 @@ folder_tree_model_dispose (GObject *object) } /* Chain up to parent's dispose() method. */ - G_OBJECT_CLASS (parent_class)->dispose (object); + G_OBJECT_CLASS (em_folder_tree_model_parent_class)->dispose (object); } static void @@ -319,7 +318,7 @@ folder_tree_model_finalize (GObject *object) g_hash_table_destroy (priv->store_index); /* Chain up to parent's finalize() method. */ - G_OBJECT_CLASS (parent_class)->finalize (object); + G_OBJECT_CLASS (em_folder_tree_model_parent_class)->finalize (object); } static void @@ -351,7 +350,8 @@ folder_tree_model_constructed (GObject *object) GTK_SORT_ASCENDING); /* Chain up to parent's constructed() method. */ - G_OBJECT_CLASS (parent_class)->constructed (object); + G_OBJECT_CLASS (em_folder_tree_model_parent_class)-> + constructed (object); } static void @@ -359,7 +359,6 @@ em_folder_tree_model_class_init (EMFolderTreeModelClass *class) { GObjectClass *object_class; - parent_class = g_type_class_peek_parent (class); g_type_class_add_private (class, sizeof (EMFolderTreeModelPrivate)); object_class = G_OBJECT_CLASS (class); |