From 73b2a224db33ec920edd0004aff0916dc29e545b Mon Sep 17 00:00:00 2001 From: Ossama Othman Date: Wed, 13 Nov 2013 16:11:44 -0800 Subject: [PATCH] Incremental commit. Change-Id: I12849a7663c7adf2a70174339b265cadc52b4723 Signed-off-by: Ossama Othman --- plugins/connman/agent.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/plugins/connman/agent.cpp b/plugins/connman/agent.cpp index 61e99cd..c5a0b4e 100644 --- a/plugins/connman/agent.cpp +++ b/plugins/connman/agent.cpp @@ -214,10 +214,25 @@ namespace gchar * fname = nullptr; GVariant * fvalue = nullptr; + /** + * @todo Refactor GVariant dictionary iteration code. + */ while (g_variant_iter_next(vi, "{sv}", &fname, &fvalue)) { + // unique_ptr const name(fname); - unique_ptr const value(fvalue); + unique_ptr const arguments(fvalue); + GVariantIter * ai = nullptr; + g_variant_get(arguments.get(), "(a{sv})", &ai); + unique_ptr const iter(ai); + + gchar * argname = nullptr; + GVariant * argvalue = nullptr; + + while (g_variant_iter_next(ai, "{sv}", &argname, &argvalue)) { + unique_ptr const name(argname); + unique_ptr const value(argvalue); + } } }); -- 2.7.4