Merge branch 'master' into testing

This commit is contained in:
Gergely Polonkai 2014-11-17 13:20:47 +01:00
commit a8844a3ed8

View File

@ -79,6 +79,7 @@ enum {
PROP_GREGORIAN_SECOND, PROP_GREGORIAN_SECOND,
PROP_GREGORIAN_MICROSECOND, PROP_GREGORIAN_MICROSECOND,
PROP_GREGORIAN_TIMEZONE_OFFSET, PROP_GREGORIAN_TIMEZONE_OFFSET,
PROP_JULIAN_DAY,
PROP_JULIAN_DAY_VALID, PROP_JULIAN_DAY_VALID,
PROP_COUNT PROP_COUNT
}; };
@ -329,6 +330,24 @@ gswe_timestamp_class_init(GsweTimestampClass *klass)
gswe_timestamp_props[PROP_GREGORIAN_TIMEZONE_OFFSET] gswe_timestamp_props[PROP_GREGORIAN_TIMEZONE_OFFSET]
); );
/**
* GsweTimestamp:julian-day:
*
* The Julian Day represented by #GsweTimestamp
*/
gswe_timestamp_props[PROP_JULIAN_DAY] = g_param_spec_double(
"julian-day",
"Julian Day",
"The Julian Day represented by this object",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE
);
g_object_class_install_property(
gobject_class,
PROP_JULIAN_DAY,
gswe_timestamp_props[PROP_JULIAN_DAY]
);
/** /**
* GsweTimestamp:julian-day-valid: * GsweTimestamp:julian-day-valid:
* *
@ -385,7 +404,11 @@ gswe_timestamp_set_property(GObject *object,
switch (prop_id) { switch (prop_id) {
case PROP_INSTANT_RECALC: case PROP_INSTANT_RECALC:
gswe_timestamp_calculate_all(timestamp, NULL); timestamp->priv->instant_recalc = g_value_get_boolean(value);
if (timestamp->priv->instant_recalc) {
gswe_timestamp_calculate_all(timestamp, NULL);
}
break; break;
@ -461,6 +484,15 @@ gswe_timestamp_set_property(GObject *object,
break; break;
case PROP_JULIAN_DAY:
gswe_timestamp_set_julian_day_et(
timestamp,
g_value_get_double(value),
NULL
);
break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
@ -541,6 +573,14 @@ gswe_timestamp_get_property(
break; break;
case PROP_JULIAN_DAY:
g_value_set_double(
value,
timestamp->priv->julian_day
);
break;
case PROP_JULIAN_DAY_VALID: case PROP_JULIAN_DAY_VALID:
g_value_set_boolean( g_value_set_boolean(
value, value,
@ -1647,14 +1687,6 @@ gswe_timestamp_new_from_gregorian_full(
NULL)); NULL));
timestamp->priv->valid_dates = VALID_GREGORIAN; timestamp->priv->valid_dates = VALID_GREGORIAN;
g_object_notify_by_pspec(
G_OBJECT(timestamp),
gswe_timestamp_props[PROP_GREGORIAN_VALID]
);
g_object_notify_by_pspec(
G_OBJECT(timestamp),
gswe_timestamp_props[PROP_JULIAN_DAY_VALID]
);
return timestamp; return timestamp;
} }