weather: Simplify and inline property param flags
This commit is contained in:
committed by
Georges Basile Stavracas Neto
parent
17af30b19c
commit
d7c9e70c31
+17
-11
@@ -148,33 +148,39 @@ gcal_weather_info_class_init (GcalWeatherInfoClass *klass)
|
|||||||
object_class->get_property = gcal_weather_info_get_property;
|
object_class->get_property = gcal_weather_info_get_property;
|
||||||
object_class->set_property = gcal_weather_info_set_property;
|
object_class->set_property = gcal_weather_info_set_property;
|
||||||
|
|
||||||
const gint pflags_rwc = G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB |
|
|
||||||
G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GcalWeatherInfo:date:
|
* GcalWeatherInfo:date:
|
||||||
*
|
*
|
||||||
* The non-nullable date weather information belongs to.
|
* The non-nullable date weather information belongs to.
|
||||||
*/
|
*/
|
||||||
g_object_class_install_property (object_class,
|
g_object_class_install_property
|
||||||
PROP_DATE,
|
(object_class,
|
||||||
g_param_spec_boxed ("date", "date", "date", G_TYPE_DATE, pflags_rwc));
|
PROP_DATE,
|
||||||
|
g_param_spec_boxed ("date", "date", "date", G_TYPE_DATE,
|
||||||
|
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GcalWeatherInfo:icon-name:
|
* GcalWeatherInfo:icon-name:
|
||||||
*
|
*
|
||||||
* Non-nullable Icon name representing the weather.
|
* Non-nullable Icon name representing the weather.
|
||||||
*/
|
*/
|
||||||
g_object_class_install_property (object_class,
|
g_object_class_install_property
|
||||||
PROP_ICON_NAME,
|
(object_class,
|
||||||
g_param_spec_string ("icon-name", "icon-name", "icon-name", NULL, pflags_rwc));
|
PROP_ICON_NAME,
|
||||||
|
g_param_spec_string ("icon-name", "icon-name", "icon-name", NULL,
|
||||||
|
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GcalWeatherInfo:temperature:
|
* GcalWeatherInfo:temperature:
|
||||||
*
|
*
|
||||||
* The temperature as string or %NULL.
|
* The temperature as string or %NULL.
|
||||||
*/
|
*/
|
||||||
g_object_class_install_property (object_class,
|
g_object_class_install_property
|
||||||
PROP_TEMPERATURE,
|
(object_class,
|
||||||
g_param_spec_string ("temperature", "temperature", "temperature", NULL, pflags_rwc));
|
PROP_TEMPERATURE,
|
||||||
|
g_param_spec_string ("temperature", "temperature", "temperature", NULL,
|
||||||
|
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+13
-12
@@ -216,29 +216,30 @@ gcal_weather_service_class_init (GcalWeatherServiceClass *klass)
|
|||||||
object_class->get_property = gcal_weather_service_get_property;
|
object_class->get_property = gcal_weather_service_get_property;
|
||||||
object_class->set_property = gcal_weather_service_set_property;
|
object_class->set_property = gcal_weather_service_set_property;
|
||||||
|
|
||||||
const gint prop_flags = G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK |
|
|
||||||
G_PARAM_STATIC_BLURB | G_PARAM_READABLE |
|
|
||||||
G_PARAM_WRITABLE | G_PARAM_CONSTRUCT;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GcalWeatherServiceClass:max-days:
|
* GcalWeatherServiceClass:max-days:
|
||||||
*
|
*
|
||||||
* Maximal number of days to fetch forecasts for.
|
* Maximal number of days to fetch forecasts for.
|
||||||
*/
|
*/
|
||||||
g_object_class_install_property (G_OBJECT_CLASS (klass),
|
g_object_class_install_property
|
||||||
PROP_MAX_DAYS,
|
(G_OBJECT_CLASS (klass),
|
||||||
g_param_spec_uint ("max-days", "max-days", "max-days",
|
PROP_MAX_DAYS,
|
||||||
1, G_MAXUINT, 3, prop_flags));
|
g_param_spec_uint ("max-days", "max-days", "max-days",
|
||||||
|
1, G_MAXUINT, 3,
|
||||||
|
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GcalWeatherServiceClass:check-interval:
|
* GcalWeatherServiceClass:check-interval:
|
||||||
*
|
*
|
||||||
* Amount of seconds to wait before re-fetching weather infos.
|
* Amount of seconds to wait before re-fetching weather infos.
|
||||||
* Use %0 to disable timers.
|
* Use %0 to disable timers.
|
||||||
*/
|
*/
|
||||||
g_object_class_install_property (G_OBJECT_CLASS (klass),
|
g_object_class_install_property
|
||||||
PROP_CHECK_INTERVAL,
|
(G_OBJECT_CLASS (klass),
|
||||||
g_param_spec_uint ("check-interval", "check-interval", "check-interval",
|
PROP_CHECK_INTERVAL,
|
||||||
0, G_MAXUINT, 0, prop_flags));
|
g_param_spec_uint ("check-interval", "check-interval", "check-interval",
|
||||||
|
0, G_MAXUINT, 0,
|
||||||
|
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GcalWeatherService::weather-changed:
|
* GcalWeatherService::weather-changed:
|
||||||
|
|||||||
Reference in New Issue
Block a user