aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-08-10 07:56:21 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-09-14 20:08:47 +0800
commitf0f1b9c4bb8ea1d2bfb3ca54aa9494c2f38c8820 (patch)
tree6529f87d3b46b4e8939b8b2b10132f907f4fb868
parente453b16ff171f73a4021f9ac760bc8ae5a9cfd4c (diff)
downloadgsoc2013-evolution-f0f1b9c4bb8ea1d2bfb3ca54aa9494c2f38c8820.tar
gsoc2013-evolution-f0f1b9c4bb8ea1d2bfb3ca54aa9494c2f38c8820.tar.gz
gsoc2013-evolution-f0f1b9c4bb8ea1d2bfb3ca54aa9494c2f38c8820.tar.bz2
gsoc2013-evolution-f0f1b9c4bb8ea1d2bfb3ca54aa9494c2f38c8820.tar.lz
gsoc2013-evolution-f0f1b9c4bb8ea1d2bfb3ca54aa9494c2f38c8820.tar.xz
gsoc2013-evolution-f0f1b9c4bb8ea1d2bfb3ca54aa9494c2f38c8820.tar.zst
gsoc2013-evolution-f0f1b9c4bb8ea1d2bfb3ca54aa9494c2f38c8820.zip
EMailSidebar: Miscellaneous cleanups.
-rw-r--r--mail/e-mail-sidebar.c46
1 files changed, 13 insertions, 33 deletions
diff --git a/mail/e-mail-sidebar.c b/mail/e-mail-sidebar.c
index 32edd0e4eb..36136619e5 100644
--- a/mail/e-mail-sidebar.c
+++ b/mail/e-mail-sidebar.c
@@ -31,6 +31,10 @@
#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 */
};
@@ -45,9 +49,13 @@ enum {
LAST_SIGNAL
};
-static gpointer parent_class;
static guint signals[LAST_SIGNAL];
+G_DEFINE_TYPE (
+ EMailSidebar,
+ e_mail_sidebar,
+ EM_TYPE_FOLDER_TREE)
+
static void
mail_sidebar_restore_state (EMailSidebar *sidebar)
{
@@ -206,7 +214,7 @@ mail_sidebar_row_expanded (GtkTreeView *tree_view,
/* Chain up to parent's row_expanded() method. Do this first
* because we stomp on the path argument a few lines down. */
- tree_view_class = GTK_TREE_VIEW_CLASS (parent_class);
+ tree_view_class = GTK_TREE_VIEW_CLASS (e_mail_sidebar_parent_class);
tree_view_class->row_expanded (tree_view, unused, path);
sidebar = E_MAIL_SIDEBAR (tree_view);
@@ -379,12 +387,11 @@ mail_sidebar_check_state (EMailSidebar *sidebar)
}
static void
-mail_sidebar_class_init (EMailSidebarClass *class)
+e_mail_sidebar_class_init (EMailSidebarClass *class)
{
GObjectClass *object_class;
GtkTreeViewClass *tree_view_class;
- parent_class = g_type_class_peek_parent (class);
g_type_class_add_private (class, sizeof (EMailSidebarPrivate));
object_class = G_OBJECT_CLASS (class);
@@ -417,15 +424,14 @@ mail_sidebar_class_init (EMailSidebarClass *class)
}
static void
-mail_sidebar_init (EMailSidebar *sidebar)
+e_mail_sidebar_init (EMailSidebar *sidebar)
{
GtkTreeModel *model;
GtkTreeView *tree_view;
GtkTreeSelection *selection;
EMFolderTree *folder_tree;
- sidebar->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- sidebar, E_TYPE_MAIL_SIDEBAR, EMailSidebarPrivate);
+ sidebar->priv = E_MAIL_SIDEBAR_GET_PRIVATE (sidebar);
folder_tree = EM_FOLDER_TREE (sidebar);
em_folder_tree_set_excluded (folder_tree, 0);
@@ -447,32 +453,6 @@ mail_sidebar_init (EMailSidebar *sidebar)
G_CALLBACK (mail_sidebar_selection_changed_cb), sidebar);
}
-GType
-e_mail_sidebar_get_type (void)
-{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0)) {
- static const GTypeInfo type_info = {
- sizeof (EMailSidebarClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) mail_sidebar_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (EMailSidebar),
- 0, /* n_preallocs */
- (GInstanceInitFunc) mail_sidebar_init,
- NULL /* value_table */
- };
-
- type = g_type_register_static (
- EM_TYPE_FOLDER_TREE, "EMailSidebar", &type_info, 0);
- }
-
- return type;
-}
-
GtkWidget *
e_mail_sidebar_new (EMailBackend *backend,
EAlertSink *alert_sink)