timer: Improve duration api
- rename duration setter - add duration getter
This commit is contained in:
committed by
Georges Basile Stavracas Neto
parent
5475df20c6
commit
50e675da05
+17
-2
@@ -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.
|
||||
|
||||
+3
-1
@@ -38,9 +38,11 @@ void gcal_timer_stop (GcalTimer *self);
|
||||
|
||||
gboolean gcal_timer_is_running (GcalTimer *self);
|
||||
|
||||
void gcal_timer_set_duration (GcalTimer *self,
|
||||
void gcal_timer_set_default_duration (GcalTimer *self,
|
||||
gint64 duration);
|
||||
|
||||
gint64 gcal_timer_get_default_duration (GcalTimer *self);
|
||||
|
||||
void gcal_timer_set_callback (GcalTimer *self,
|
||||
GCalTimerFunc func,
|
||||
gpointer data,
|
||||
|
||||
@@ -1235,7 +1235,7 @@ static void
|
||||
update_timeout_interval (GcalWeatherService *self)
|
||||
{
|
||||
g_return_if_fail (GCAL_IS_WEATHER_SERVICE (self));
|
||||
gcal_timer_set_duration (self->timer, self->check_interval_renew);
|
||||
gcal_timer_set_default_duration (self->timer, self->check_interval_renew);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user