[calls] record-row: Fix passing widget instead of string as action target



commit 896af6f8af7d30d9397d4e1ac657151a1cb7cd72
Author: Evangelos Ribeiro Tzaras <devrtz fortysixandtwo eu>
Date:   Tue Feb 1 23:21:59 2022 +0100

    record-row: Fix passing widget instead of string as action target
    
    When introducing the per protocol dial actions we started setting the widget
    self->target as the action target instead of the target property of
    self->record.
    
    Bizzarely we only sometimes got greeted with a critical:
    
    11:30:20.5184                 GLib[887977]:CRITICAL: g_variant_new_string: assertion 'g_utf8_validate 
(string, -1, NULL)' failed
    
    Thread 1 "gnome-calls" received signal SIGTRAP, Trace/breakpoint trap.
    g_logv (log_domain=0x7ffff7ea400e "GLib", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, 
args=<optimized out>) at ../../../glib/gmessages.c:1417
    1417    ../../../glib/gmessages.c: No such file or directory.
    (gdb) bt
        at ../../../glib/gmessages.c:2898
    
    Fixes: 687dd7ff383476523ae0a8a38879a171cb0b9a5a
    Closes #398

 src/calls-call-record-row.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/calls-call-record-row.c b/src/calls-call-record-row.c
index 875a9683..c80e16ea 100644
--- a/src/calls-call-record-row.c
+++ b/src/calls-call-record-row.c
@@ -434,12 +434,14 @@ constructed (GObject *object)
   g_autofree char *target_name = NULL;
   g_autofree char *protocol = NULL;
   g_autofree char *action_name = NULL;
+  g_autofree char *target = NULL;
 
   g_object_get (self->record,
                 "inbound", &inbound,
                 "answered", &answered,
                 "end", &end,
                 "protocol", &protocol,
+                "target", &target,
                 NULL);
 
   /* Fall back to "app.dial-tel" action if no protocol was given */
@@ -452,7 +454,7 @@ constructed (GObject *object)
 
   /* TODO add origin ID to action target */
   gtk_actionable_set_action_target (GTK_ACTIONABLE (self->button),
-                                    "(ss)", self->target, "");
+                                    "(ss)", target, "");
 
   setup_time (self, inbound, answered, end);
   calls_date_time_unref (answered);


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