[calls] in-app-notification: Use DEFAULT_TIMEOUT_SECONDS as the default timeout



commit d7b4aff0d8d7acbed1f29f34fa5153d967cd0701
Author: Evangelos Ribeiro Tzaras <devrtz fortysixandtwo eu>
Date:   Wed Dec 15 13:19:44 2021 +0100

    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 411f1d5b..2a5c04f3 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;
 }
 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]