aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/calendar-view-factory.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-12-01 10:53:20 +0800
committerMatthew Barnes <mbarnes@redhat.com>2012-02-20 23:04:25 +0800
commit23f5773903d64a554d977ae7d0ebbaca73528f1f (patch)
tree104e1a59da8bf96b004bce204b79f47bbe0a6d13 /calendar/gui/calendar-view-factory.c
parent49bc4c2d765ee1780c23fdc9f42152850dabb220 (diff)
downloadgsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.tar
gsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.tar.gz
gsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.tar.bz2
gsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.tar.lz
gsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.tar.xz
gsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.tar.zst
gsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.zip
Coding style and whitespace cleanup.
Diffstat (limited to 'calendar/gui/calendar-view-factory.c')
-rw-r--r--calendar/gui/calendar-view-factory.c46
1 files changed, 12 insertions, 34 deletions
diff --git a/calendar/gui/calendar-view-factory.c b/calendar/gui/calendar-view-factory.c
index 8342475620..0d1908e79b 100644
--- a/calendar/gui/calendar-view-factory.c
+++ b/calendar/gui/calendar-view-factory.c
@@ -30,13 +30,15 @@
#include "calendar-view-factory.h"
#include "calendar-view.h"
-/* Private part of the CalendarViewFactory structure */
+#define CALENDAR_VIEW_FACTORY_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), TYPE_CALENDAR_VIEW_FACTORY, CalendarViewFactoryPrivate))
+
struct _CalendarViewFactoryPrivate {
/* Type of views created by this factory */
GnomeCalendarViewType view_type;
};
-static void calendar_view_factory_finalize (GObject *object);
static const gchar *
calendar_view_factory_get_title (GalViewFactory *factory);
static const gchar *
@@ -46,53 +48,29 @@ static GalView *
calendar_view_factory_new_view (GalViewFactory *factory,
const gchar *name);
-G_DEFINE_TYPE (CalendarViewFactory, calendar_view_factory, GAL_TYPE_VIEW_FACTORY)
+G_DEFINE_TYPE (
+ CalendarViewFactory,
+ calendar_view_factory,
+ GAL_TYPE_VIEW_FACTORY)
-/* Class initialization function for the calendar view factory */
static void
calendar_view_factory_class_init (CalendarViewFactoryClass *class)
{
GalViewFactoryClass *gal_view_factory_class;
- GObjectClass *gobject_class;
- gal_view_factory_class = (GalViewFactoryClass *) class;
- gobject_class = (GObjectClass *) class;
+ g_type_class_add_private (class, sizeof (CalendarViewFactoryPrivate));
+ gal_view_factory_class = GAL_VIEW_FACTORY_CLASS (class);
gal_view_factory_class->get_title = calendar_view_factory_get_title;
gal_view_factory_class->get_type_code = calendar_view_factory_get_type_code;
gal_view_factory_class->new_view = calendar_view_factory_new_view;
-
- gobject_class->finalize = calendar_view_factory_finalize;
}
-/* Object initialization class for the calendar view factory */
static void
calendar_view_factory_init (CalendarViewFactory *cal_view_factory)
{
- CalendarViewFactoryPrivate *priv;
-
- priv = g_new0 (CalendarViewFactoryPrivate, 1);
- cal_view_factory->priv = priv;
-}
-
-/* Finalize method for the calendar view factory */
-static void
-calendar_view_factory_finalize (GObject *object)
-{
- CalendarViewFactory *cal_view_factory;
- CalendarViewFactoryPrivate *priv;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (IS_CALENDAR_VIEW_FACTORY (object));
-
- cal_view_factory = CALENDAR_VIEW_FACTORY (object);
- priv = cal_view_factory->priv;
-
- g_free (priv);
- cal_view_factory->priv = NULL;
-
- /* Chain up to parent's finalize() method. */
- G_OBJECT_CLASS (calendar_view_factory_parent_class)->finalize (object);
+ cal_view_factory->priv =
+ CALENDAR_VIEW_FACTORY_GET_PRIVATE (cal_view_factory);
}
/* get_title method for the calendar view factory */