Try to correctly convert back to ints or floats when the protocol was

purely string based and killed the typing (like SOAP).

svn path=/branches/work/~ervin/qtjolie/; revision=978073
This commit is contained in:
Kevin Ottens 2009-06-05 22:44:43 +00:00
parent 4df21c1b83
commit 3f553aafe3

View File

@ -109,6 +109,8 @@ qint32 Value::toInt() const
{
if (isInt()) {
return d->content.toInt();
} else if (isByteArray()) {
return d->content.toByteArray().toInt();
} else {
return 0;
}
@ -118,6 +120,8 @@ double Value::toDouble() const
{
if (isDouble()) {
return d->content.toDouble();
} else if (isByteArray()) {
return d->content.toByteArray().toInt();
} else {
return 0.0;
}