Synchronise weather on application.sync.
This commit is contained in:
committed by
Georges Basile Stavracas Neto
parent
75fc1f41e6
commit
eb3e4a4078
@@ -445,6 +445,7 @@ gcal_application_sync (GSimpleAction *sync,
|
|||||||
{
|
{
|
||||||
GcalApplication *self = GCAL_APPLICATION (app);
|
GcalApplication *self = GCAL_APPLICATION (app);
|
||||||
gcal_manager_refresh (self->manager);
|
gcal_manager_refresh (self->manager);
|
||||||
|
gcal_weather_service_update (self->weather_service);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|||||||
@@ -1246,8 +1246,7 @@ on_timer_timeout (GcalWeatherService *self)
|
|||||||
{
|
{
|
||||||
g_return_val_if_fail (GCAL_IS_WEATHER_SERVICE (self), G_SOURCE_REMOVE);
|
g_return_val_if_fail (GCAL_IS_WEATHER_SERVICE (self), G_SOURCE_REMOVE);
|
||||||
|
|
||||||
if (self->gweather_info != NULL)
|
gcal_weather_service_update (self);
|
||||||
gweather_info_update (self->gweather_info);
|
|
||||||
|
|
||||||
return G_SOURCE_CONTINUE;
|
return G_SOURCE_CONTINUE;
|
||||||
}
|
}
|
||||||
@@ -1471,6 +1470,7 @@ gcal_weather_service_get_weather_infos (GcalWeatherService *self)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* gcal_weather_service_get_attribution:
|
* gcal_weather_service_get_attribution:
|
||||||
|
* @self: The #GcalWeatherService instance.
|
||||||
*
|
*
|
||||||
* Returns weather service attribution.
|
* Returns weather service attribution.
|
||||||
*
|
*
|
||||||
@@ -1486,3 +1486,20 @@ gcal_weather_service_get_attribution (GcalWeatherService *self)
|
|||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gcal_weather_service_update:
|
||||||
|
* @self: The #GcalWeatherService instance.
|
||||||
|
*
|
||||||
|
* Tries to update weather reports.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
gcal_weather_service_update (GcalWeatherService *self)
|
||||||
|
{
|
||||||
|
g_return_if_fail (GCAL_IS_WEATHER_SERVICE (self));
|
||||||
|
|
||||||
|
if (self->gweather_info != NULL)
|
||||||
|
gweather_info_update (self->gweather_info);
|
||||||
|
}
|
||||||
|
|||||||
@@ -54,6 +54,8 @@ GSList* gcal_weather_service_get_weather_infos (GcalWeatherService
|
|||||||
|
|
||||||
const gchar* gcal_weather_service_get_attribution (GcalWeatherService *self);
|
const gchar* gcal_weather_service_get_attribution (GcalWeatherService *self);
|
||||||
|
|
||||||
|
void gcal_weather_service_update (GcalWeatherService *self);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* GCAL_WEATHER_SERVICE_H */
|
#endif /* GCAL_WEATHER_SERVICE_H */
|
||||||
|
|||||||
Reference in New Issue
Block a user