various cleanups

Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
Ivailo Monev 2019-06-10 01:37:38 +00:00
parent 264cd223d8
commit a84bc37219
5 changed files with 34 additions and 36 deletions

View file

@ -61,7 +61,8 @@ class QLibraryPrivate
public:
void *pHnd;
QString fileName, qualifiedFileName;
QString fileName;
QString qualifiedFileName;
QString fullVersion;
bool load();
@ -94,7 +95,11 @@ private:
QAtomicInt libraryRefCount;
QAtomicInt libraryUnloadCount;
enum {IsAPlugin, IsNotAPlugin, MightBeAPlugin } pluginState;
enum {
IsAPlugin,
IsNotAPlugin,
MightBeAPlugin
} pluginState;
};
QT_END_NAMESPACE

View file

@ -1022,9 +1022,8 @@ class QPixmapColorizeFilterPrivate : public QPixmapFilterPrivate
public:
QColor color;
qreal strength;
quint32 opaque : 1;
quint32 alphaBlend : 1;
quint32 padding : 30;
quint32 opaque;
quint32 alphaBlend ;
};
/*!

View file

@ -404,7 +404,7 @@ Q_GUI_EXPORT int qSmartSpacing(const QLayout *layout, QStyle::PixelMetric pm)
return -1;
} else if (parent->isWidgetType()) {
QWidget *pw = static_cast<QWidget *>(parent);
return pw->style()->pixelMetric(pm, 0, pw);
return pw->style()->pixelMetric(pm, Q_NULLPTR, pw);
} else {
return static_cast<QLayout *>(parent)->spacing();
}

View file

@ -251,12 +251,12 @@ QScriptValue QScriptDeclarativeClass::function(const QScriptValue &v, const Iden
QScript::APIShim shim(d->engine);
JSC::ExecState *exec = d->engine->currentFrame;
JSC::JSObject *object = d->jscValue.getObject();
JSC::PropertySlot slot(const_cast<JSC::JSObject*>(object));
JSC::PropertySlot slot(object);
JSC::JSValue result;
JSC::Identifier id(exec, (JSC::UString::Rep *)name);
if (const_cast<JSC::JSObject*>(object)->getOwnPropertySlot(exec, id, slot)) {
if (object->getOwnPropertySlot(exec, id, slot)) {
result = slot.getValue(exec, id);
if (QScript::isFunction(result))
return d->engine->scriptValueFromJSCValue(result);
@ -275,12 +275,12 @@ QScriptValue QScriptDeclarativeClass::property(const QScriptValue &v, const Iden
QScript::APIShim shim(d->engine);
JSC::ExecState *exec = d->engine->currentFrame;
JSC::JSObject *object = d->jscValue.getObject();
JSC::PropertySlot slot(const_cast<JSC::JSObject*>(object));
JSC::PropertySlot slot(object);
JSC::JSValue result;
JSC::Identifier id(exec, (JSC::UString::Rep *)name);
if (const_cast<JSC::JSObject*>(object)->getOwnPropertySlot(exec, id, slot)) {
if (object->getOwnPropertySlot(exec, id, slot)) {
result = slot.getValue(exec, id);
return d->engine->scriptValueFromJSCValue(result);
}
@ -299,12 +299,12 @@ QScriptDeclarativeClass::functionValue(const QScriptValue &v, const Identifier &
QScript::APIShim shim(d->engine);
JSC::ExecState *exec = d->engine->currentFrame;
JSC::JSObject *object = d->jscValue.getObject();
JSC::PropertySlot slot(const_cast<JSC::JSObject*>(object));
JSC::PropertySlot slot(object);
JSC::JSValue result;
JSC::Identifier id(exec, (JSC::UString::Rep *)name);
if (const_cast<JSC::JSObject*>(object)->getOwnPropertySlot(exec, id, slot)) {
if (object->getOwnPropertySlot(exec, id, slot)) {
result = slot.getValue(exec, id);
if (QScript::isFunction(result))
return jscToValue(result);
@ -324,12 +324,12 @@ QScriptDeclarativeClass::propertyValue(const QScriptValue &v, const Identifier &
QScript::APIShim shim(d->engine);
JSC::ExecState *exec = d->engine->currentFrame;
JSC::JSObject *object = d->jscValue.getObject();
JSC::PropertySlot slot(const_cast<JSC::JSObject*>(object));
JSC::PropertySlot slot(object);
JSC::JSValue result;
JSC::Identifier id(exec, (JSC::UString::Rep *)name);
if (const_cast<JSC::JSObject*>(object)->getOwnPropertySlot(exec, id, slot)) {
if (object->getOwnPropertySlot(exec, id, slot)) {
result = slot.getValue(exec, id);
return jscToValue(result);
}

View file

@ -79,28 +79,22 @@ static JSC::JSValue QT_FASTCALL variantProtoFuncValueOf(JSC::ExecState *exec, JS
return throwError(exec, JSC::TypeError);
const QVariant &v = static_cast<QVariantDelegate*>(delegate)->value();
switch (v.type()) {
case QVariant::Invalid:
return JSC::jsUndefined();
case QVariant::String:
return JSC::jsString(exec, v.toString());
case QVariant::Int:
return JSC::jsNumber(exec, v.toInt());
case QVariant::Bool:
return JSC::jsBoolean(v.toBool());
case QVariant::Double:
return JSC::jsNumber(exec, v.toDouble());
// case QVariant::Char:
// return JSC::jsNumber(exec, v.toChar().unicode());
case QVariant::UInt:
return JSC::jsNumber(exec, v.toUInt());
default:
;
case QVariant::Invalid:
return JSC::jsUndefined();
case QVariant::String:
return JSC::jsString(exec, v.toString());
case QVariant::Int:
return JSC::jsNumber(exec, v.toInt());
case QVariant::Bool:
return JSC::jsBoolean(v.toBool());
case QVariant::Double:
return JSC::jsNumber(exec, v.toDouble());
// case QVariant::Char:
// return JSC::jsNumber(exec, v.toChar().unicode());
case QVariant::UInt:
return JSC::jsNumber(exec, v.toUInt());
default:
;
}
return thisValue;
}