need to return a QIcon otherwise the poor little binding's head gets confused

svn path=/trunk/KDE/kdebase/runtime/; revision=1097598
This commit is contained in:
Aaron J. Seigo 2010-03-01 18:39:03 +00:00
parent 6d184cf6f8
commit 6722dbdd97

View File

@ -34,7 +34,8 @@ static QScriptValue ctor(QScriptContext *ctx, QScriptEngine *eng)
if (ctx->argumentCount() > 0) { if (ctx->argumentCount() > 0) {
QScriptValue v = ctx->argument(0); QScriptValue v = ctx->argument(0);
if (v.isString()) { if (v.isString()) {
return qScriptValueFromValue(eng, KIcon(v.toString())); QIcon icon = KIcon(v.toString());
return qScriptValueFromValue(eng, icon);
} else if (v.isVariant()) { } else if (v.isVariant()) {
QVariant variant = v.toVariant(); QVariant variant = v.toVariant();
QPixmap p = variant.value<QPixmap>(); QPixmap p = variant.value<QPixmap>();