aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/calendar-view.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.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.c')
-rw-r--r--calendar/gui/calendar-view.c29
1 files changed, 9 insertions, 20 deletions
diff --git a/calendar/gui/calendar-view.c b/calendar/gui/calendar-view.c
index 6f9f2951f3..344f4c3856 100644
--- a/calendar/gui/calendar-view.c
+++ b/calendar/gui/calendar-view.c
@@ -28,7 +28,10 @@
#include "calendar-view.h"
-/* Private part of the CalendarView structure */
+#define CALENDAR_VIEW_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), TYPE_CALENDAR_VIEW, CalendarViewPrivate))
+
struct _CalendarViewPrivate {
/* Type of the view */
GnomeCalendarViewType view_type;
@@ -55,6 +58,8 @@ calendar_view_class_init (CalendarViewClass *class)
GalViewClass *gal_view_class;
GObjectClass *object_class;
+ g_type_class_add_private (class, sizeof (CalendarViewPrivate));
+
gal_view_class = (GalViewClass *) class;
object_class = (GObjectClass *) class;
@@ -73,34 +78,18 @@ calendar_view_class_init (CalendarViewClass *class)
static void
calendar_view_init (CalendarView *cal_view)
{
- CalendarViewPrivate *priv;
-
- priv = g_new0 (CalendarViewPrivate, 1);
- cal_view->priv = priv;
-
- priv->title = NULL;
+ cal_view->priv = CALENDAR_VIEW_GET_PRIVATE (cal_view);
}
/* Destroy method for the calendar view */
static void
calendar_view_finalize (GObject *object)
{
- CalendarView *cal_view;
CalendarViewPrivate *priv;
- g_return_if_fail (object != NULL);
- g_return_if_fail (IS_CALENDAR_VIEW (object));
-
- cal_view = CALENDAR_VIEW (object);
- priv = cal_view->priv;
-
- if (priv->title) {
- g_free (priv->title);
- priv->title = NULL;
- }
+ priv = CALENDAR_VIEW_GET_PRIVATE (object);
- g_free (priv);
- cal_view->priv = NULL;
+ g_free (priv->title);
/* Chain up to parent's finalize() method. */
G_OBJECT_CLASS (calendar_view_parent_class)->finalize (object);