timer: Improve duration api

- rename duration setter
- add duration getter
This commit is contained in:
Florian Brosch
2017-12-11 21:34:23 -02:00
committed by Georges Basile Stavracas Neto
parent 5475df20c6
commit 50e675da05
3 changed files with 21 additions and 4 deletions
+17 -2
View File
@@ -262,8 +262,8 @@ gcal_timer_is_running (GcalTimer *self)
* Changes the duration between two events.
*/
void
gcal_timer_set_duration (GcalTimer *self,
gint64 duration)
gcal_timer_set_default_duration (GcalTimer *self,
gint64 duration)
{
gint64 now;
@@ -283,6 +283,21 @@ gcal_timer_set_duration (GcalTimer *self,
/**
* gcal_timer_get_default_duration:
* @self: The #GcalTimer.
*
* Returns the default duration.
*/
gint64
gcal_timer_get_default_duration (GcalTimer *self)
{
g_return_val_if_fail (self != NULL, -1);
return self->default_duration;
}
/**
* gcal_timer_set_callback:
* @self: The #GcalTimer.