diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-08-17 15:49:39 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-08-17 15:49:39 (GMT) |
commit | 6ed436a0bcbba1c04068c1dc48f7c74882bbf62e (patch) | |
tree | 886ac1167027f60afff7af757ca35ad9d1ea3a2f /src | |
parent | a1ed3535882455cd30d46f338d9823452b53434e (diff) | |
download | Qt-6ed436a0bcbba1c04068c1dc48f7c74882bbf62e.zip Qt-6ed436a0bcbba1c04068c1dc48f7c74882bbf62e.tar.gz Qt-6ed436a0bcbba1c04068c1dc48f7c74882bbf62e.tar.bz2 |
adopt variant-to-string conversion of the original qtscript back-end
Diffstat (limited to 'src')
-rw-r--r-- | src/script/bridge/qscriptvariant.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/script/bridge/qscriptvariant.cpp b/src/script/bridge/qscriptvariant.cpp index 7bc1122..d352a98 100644 --- a/src/script/bridge/qscriptvariant.cpp +++ b/src/script/bridge/qscriptvariant.cpp @@ -134,12 +134,15 @@ static JSC::JSValue JSC_HOST_CALL variantProtoFuncToString(JSC::ExecState *exec, const QVariant &v = static_cast<QVariantDelegate*>(delegate)->value(); JSC::UString result; JSC::JSValue value = variantProtoFuncValueOf(exec, callee, thisValue, args); - if (value && !value.isObject()) + if (value.isObject()) { + result = QScript::qtStringToJSCUString(v.toString()); + if (result.isEmpty()) { + result = "QVariant("; + result += v.typeName(); + result += ")"; + } + } else { result = value.toString(exec); - if (result.isEmpty()) { - result = "QVariant("; - result += v.typeName(); - result += ")"; } return JSC::jsString(exec, result); } |