[xpcom] Implement DataCarrier support in variant packing
authorKalle Vahlman <kalle.vahlman@movial.com>
Thu, 30 Apr 2009 05:43:07 +0000 (08:43 +0300)
committerKalle Vahlman <kalle.vahlman@movial.com>
Thu, 30 Apr 2009 05:43:07 +0000 (08:43 +0300)
xpcom-dbusservice/DBusMarshaling.cpp

index 6c8f72dcddee1f3fe64ccf4f7798da82a48c2291..2aaea8d3a0164af640c92ddb5019f8a307f15c19 100644 (file)
@@ -654,8 +654,20 @@ void addBasicTypeToIter(nsIVariant *aVariant, DBusMessageIter *aIter, int aDBusT
             return;
 
         nsCOMPtr<nsIVariant> myVariant = do_QueryInterface(is);
-        if (myVariant)
+        if (myVariant) {
             addBasicTypeToIter(myVariant, aIter, aDBusType);
+            return;
+        }
+
+        nsCOMPtr<DBusDataCarrier> myCarrier = do_QueryInterface(is);
+        if (myCarrier) {
+            nsCOMPtr<nsIVariant> myValue;
+            myCarrier->GetValue(getter_AddRefs(myValue));
+            addBasicTypeToIter(myValue, aIter, aDBusType);
+            return;
+        }
+
+        BDBLOG(("  Got nsISupports, but don't know what to do with it!\n"));
 
         return;
     }