Author: lslezak Date: Wed Jun 17 13:08:51 2009 New Revision: 57603 URL: http://svn.opensuse.org/viewcvs/yast?rev=57603&view=rev Log: - wrap "any" type to a variant container Modified: branches/tmp/lslezak/core/liby2dbus/src/DBusMsg.cc Modified: branches/tmp/lslezak/core/liby2dbus/src/DBusMsg.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/liby2dbus/src/DBusMsg.cc?rev=57603&r1=57602&r2=57603&view=diff ============================================================================== --- branches/tmp/lslezak/core/liby2dbus/src/DBusMsg.cc (original) +++ branches/tmp/lslezak/core/liby2dbus/src/DBusMsg.cc Wed Jun 17 13:08:51 2009 @@ -248,7 +248,7 @@ { if (rtype) { - y2internal("Returning YCP value as type %s", rtype->toString().c_str()); + y2internal("Returning YCP value as type: %s", rtype->toString().c_str()); // the required type does not match the value if (rtype->matchvalue(val) < 0) @@ -265,6 +265,18 @@ int type = typeInt(val); + DBusMessageIter variant_it; + DBusMessageIter *it_backup = i; + if (rtype && rtype->isAny()) + { + // open variant container for "any" type + + y2debug("Opening VARIANT container with type %s", typeStr(val, rtype == NULL).c_str()); + dbus_message_iter_open_container(i, DBUS_TYPE_VARIANT, typeStr(val, rtype == NULL).c_str(), &variant_it); + + i = &variant_it; + } + if (val->isInteger()) { dbus_int64_t i64 = val->asInteger()->value(); @@ -418,6 +430,13 @@ // TODO add as string? } + if (rtype && rtype->isAny()) + { + // close variant container for "any" type + y2debug("Closing VARIANT container"); + dbus_message_iter_close_container(it_backup, &variant_it); + } + return true; } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org