[gnome-calendar] year-view: makes a descendant of GcalSubscriber
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] year-view: makes a descendant of GcalSubscriber
- Date: Thu, 4 Dec 2014 22:39:10 +0000 (UTC)
commit c7e27c7ef4861264b6d7b5bcd6eabeb3fc4a2cd9
Author: Erick Pérez Castellanos <erick red gmail com>
Date: Tue Oct 21 00:33:19 2014 -0400
year-view: makes a descendant of GcalSubscriber
src/gcal-year-view.c | 41 +++++++++++++++++++++++++++++++----------
src/gcal-year-view.h | 6 +++---
2 files changed, 34 insertions(+), 13 deletions(-)
---
diff --git a/src/gcal-year-view.c b/src/gcal-year-view.c
index 880b5a0..7acc044 100644
--- a/src/gcal-year-view.c
+++ b/src/gcal-year-view.c
@@ -25,8 +25,6 @@
#include <glib/gi18n.h>
-#include <libecal/libecal.h>
-
typedef struct
{
/**
@@ -138,7 +136,7 @@ static gboolean gcal_year_view_will_add_event (GcalView
G_DEFINE_TYPE_WITH_CODE (GcalYearView,
gcal_year_view,
- GTK_TYPE_CONTAINER,
+ GCAL_TYPE_SUBSCRIBER,
G_ADD_PRIVATE (GcalYearView)
G_IMPLEMENT_INTERFACE (GCAL_TYPE_VIEW,
gcal_view_interface_init));
@@ -234,14 +232,37 @@ gcal_year_view_set_property (GObject *object,
switch (property_id)
{
case PROP_DATE:
- if (priv->date != NULL)
- g_free (priv->date);
-
- priv->date = g_value_dup_boxed (value);
- break;
+ {
+ time_t range_start, range_end;
+ icaltimetype *date;
+ icaltimezone* default_zone;
+
+ if (priv->date != NULL)
+ g_free (priv->date);
+
+ priv->date = g_value_dup_boxed (value);
+
+ default_zone =
+ gcal_manager_get_system_timezone (priv->manager);
+ date = gcal_view_get_initial_date (GCAL_VIEW (object));
+ range_start = icaltime_as_timet_with_zone (*date,
+ default_zone);
+ g_free (date);
+ date = gcal_view_get_final_date (GCAL_VIEW (object));
+ range_end = icaltime_as_timet_with_zone (*date,
+ default_zone);
+ g_free (date);
+ gcal_manager_set_subscriber (priv->manager,
+ E_CAL_DATA_MODEL_SUBSCRIBER (object),
+ range_start,
+ range_end);
+ break;
+ }
case PROP_MANAGER:
- priv->manager = g_value_get_pointer (value);
- break;
+ {
+ priv->manager = g_value_get_pointer (value);
+ break;
+ }
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
diff --git a/src/gcal-year-view.h b/src/gcal-year-view.h
index ddc12a8..aba9127 100644
--- a/src/gcal-year-view.h
+++ b/src/gcal-year-view.h
@@ -22,7 +22,7 @@
#include "gcal-manager.h"
-#include <gtk/gtk.h>
+#include "gcal-subscriber.h"
G_BEGIN_DECLS
@@ -38,12 +38,12 @@ typedef struct _GcalYearViewClass GcalYearViewClass;
struct _GcalYearView
{
- GtkContainer parent;
+ GcalSubscriber parent;
};
struct _GcalYearViewClass
{
- GtkContainerClass parent_class;
+ GcalSubscriberClass parent_class;
/* signals */
void (*new_event) (gint new_day);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]