From d7b4aff0d8d7acbed1f29f34fa5153d967cd0701 Mon Sep 17 00:00:00 2001 From: Evangelos Ribeiro Tzaras Date: Wed, 15 Dec 2021 13:19:44 +0100 Subject: [PATCH] in-app-notification: Use DEFAULT_TIMEOUT_SECONDS as the default timeout By setting the G_PARAM_CONSTRUCT flag for the timeout property we make sure that the default value is set if it has not been given explicitly in g_object_new(). --- src/calls-in-app-notification.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/calls-in-app-notification.c b/src/calls-in-app-notification.c index 411f1d5..2a5c04f 100644 --- a/src/calls-in-app-notification.c +++ b/src/calls-in-app-notification.c @@ -122,8 +122,10 @@ calls_in_app_notification_class_init (CallsInAppNotificationClass *klass) "The time the in-app notifaction should be shown", -1, G_MAXINT, - 3, - G_PARAM_READWRITE); + DEFAULT_TIMEOUT_SECONDS, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + G_PARAM_STATIC_STRINGS); g_object_class_install_properties (object_class, PROP_LAST_PROP, props); @@ -137,7 +139,6 @@ static void calls_in_app_notification_init (CallsInAppNotification *self) { gtk_widget_init_template (GTK_WIDGET (self)); - self->timeout = DEFAULT_TIMEOUT_SECONDS; }