[xpcom] Add support for receiving variants (returned as the contained value)
authorKalle Vahlman <kalle.vahlman@movial.com>
Tue, 21 Apr 2009 11:58:27 +0000 (14:58 +0300)
committerKalle Vahlman <kalle.vahlman@movial.com>
Tue, 21 Apr 2009 12:00:08 +0000 (15:00 +0300)
xpcom-dbusservice/DBusMarshaling.cpp

index ae0f13313b66b3f5ecc8f0abccb349b479966d2f..5f901fa0d0a3d5106f08f05ad6f41a4f3f8fd9ec 100644 (file)
@@ -1192,6 +1192,18 @@ already_AddRefed<nsIWritableVariant> getVariantFromIter(JSContext* cx, DBusMessa
             }
             break;
         }
+        case DBUS_TYPE_VARIANT:
+        {
+            BDBLOG(("    arg type VARIANT\n"));
+
+            DBusMessageIter variant_iter;
+            dbus_message_iter_recurse(aIter, &variant_iter);
+
+            int childType = dbus_message_iter_get_arg_type(&variant_iter);
+            variant = getVariantFromIter(cx, &variant_iter, childType);
+
+            break;
+        }
         default:
         {
             BDBLOG(("    arg type '%c' (%d)\n", aDBusType, aDBusType));