[gnome-keyring/wip/cosimoc/gdbus-fixes: 4/4] dbus: simplify code



commit 9c8b1f107c8dd1d6f6589129fb60b3f29f4afb8c
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Sat Aug 15 12:58:35 2015 -0700

    dbus: simplify code
    
    We can use g_variant_new_bytestring() here and save some manual
    wrapping.

 daemon/dbus/gkd-secret-session.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
---
diff --git a/daemon/dbus/gkd-secret-session.c b/daemon/dbus/gkd-secret-session.c
index 0108ac0..230b1b9 100644
--- a/daemon/dbus/gkd-secret-session.c
+++ b/daemon/dbus/gkd-secret-session.c
@@ -226,11 +226,7 @@ aes_negotiate (GkdSecretSession *self,
        take_session_key (self, key, CKM_AES_CBC_PAD);
 
        if (output_variant != NULL) {
-               GVariantBuilder builder;
-
-               g_variant_builder_init (&builder, G_VARIANT_TYPE ("ay"));
-               g_variant_builder_add (&builder, "y", (const gchar *) output);
-               *output_variant = g_variant_new_variant (g_variant_builder_end (&builder));
+               *output_variant = g_variant_new_variant (g_variant_new_bytestring (output));
        }
 
        if (result != NULL) {


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