another class of API warts found and fixed thanks to documenting: isFoo -> foo for properties
svn path=/trunk/KDE/kdebase/runtime/; revision=1081161
This commit is contained in:
parent
3c299a6678
commit
52eacdf240
@ -100,9 +100,9 @@ static QScriptValue alpha(QScriptContext *ctx, QScriptEngine *eng)
|
|||||||
return QScriptValue(eng, self->alpha());
|
return QScriptValue(eng, self->alpha());
|
||||||
}
|
}
|
||||||
|
|
||||||
static QScriptValue isValid(QScriptContext *ctx, QScriptEngine *eng)
|
static QScriptValue valid(QScriptContext *ctx, QScriptEngine *eng)
|
||||||
{
|
{
|
||||||
DECLARE_SELF(QColor, isValid);
|
DECLARE_SELF(QColor, valid);
|
||||||
return QScriptValue(eng, self->isValid());
|
return QScriptValue(eng, self->isValid());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -115,7 +115,7 @@ QScriptValue constructColorClass(QScriptEngine *eng)
|
|||||||
proto.setProperty("green", eng->newFunction(green), getter | setter);
|
proto.setProperty("green", eng->newFunction(green), getter | setter);
|
||||||
proto.setProperty("blue", eng->newFunction(blue), getter | setter);
|
proto.setProperty("blue", eng->newFunction(blue), getter | setter);
|
||||||
proto.setProperty("alpha", eng->newFunction(alpha), getter | setter);
|
proto.setProperty("alpha", eng->newFunction(alpha), getter | setter);
|
||||||
proto.setProperty("isValid", eng->newFunction(isValid), getter);
|
proto.setProperty("valid", eng->newFunction(valid), getter);
|
||||||
|
|
||||||
eng->setDefaultPrototype(qMetaTypeId<QColor>(), proto);
|
eng->setDefaultPrototype(qMetaTypeId<QColor>(), proto);
|
||||||
eng->setDefaultPrototype(qMetaTypeId<QColor*>(), proto);
|
eng->setDefaultPrototype(qMetaTypeId<QColor*>(), proto);
|
||||||
|
@ -585,9 +585,9 @@ static QScriptValue hasClipping(QScriptContext *ctx, QScriptEngine *eng)
|
|||||||
|
|
||||||
/////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
static QScriptValue isActive(QScriptContext *ctx, QScriptEngine *eng)
|
static QScriptValue active(QScriptContext *ctx, QScriptEngine *eng)
|
||||||
{
|
{
|
||||||
DECLARE_SELF(QPainter, isActive);
|
DECLARE_SELF(QPainter, active);
|
||||||
return QScriptValue(eng, self->isActive());
|
return QScriptValue(eng, self->isActive());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1092,7 +1092,7 @@ QScriptValue constructPainterClass(QScriptEngine *eng)
|
|||||||
|
|
||||||
proto.setProperty("combinedMatrix", eng->newFunction(combinedMatrix), getter);
|
proto.setProperty("combinedMatrix", eng->newFunction(combinedMatrix), getter);
|
||||||
proto.setProperty("combinedTransform", eng->newFunction(combinedTransform), getter);
|
proto.setProperty("combinedTransform", eng->newFunction(combinedTransform), getter);
|
||||||
proto.setProperty("isActive", eng->newFunction(isActive), getter);
|
proto.setProperty("active", eng->newFunction(active), getter);
|
||||||
|
|
||||||
ADD_METHOD(proto, begin);
|
ADD_METHOD(proto, begin);
|
||||||
ADD_METHOD(proto, end);
|
ADD_METHOD(proto, end);
|
||||||
|
@ -126,9 +126,9 @@ static QScriptValue width(QScriptContext *ctx, QScriptEngine *eng)
|
|||||||
return QScriptValue(eng, self->width());
|
return QScriptValue(eng, self->width());
|
||||||
}
|
}
|
||||||
|
|
||||||
static QScriptValue isSolid(QScriptContext *ctx, QScriptEngine *eng)
|
static QScriptValue solid(QScriptContext *ctx, QScriptEngine *eng)
|
||||||
{
|
{
|
||||||
DECLARE_SELF(QPen, isSolid);
|
DECLARE_SELF(QPen, solid);
|
||||||
return QScriptValue(eng, self->isSolid());
|
return QScriptValue(eng, self->isSolid());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -145,7 +145,7 @@ QScriptValue constructPenClass(QScriptEngine *eng)
|
|||||||
proto.setProperty("dashOffset", eng->newFunction(dashOffset), getter | setter);
|
proto.setProperty("dashOffset", eng->newFunction(dashOffset), getter | setter);
|
||||||
proto.setProperty("miterLimit", eng->newFunction(miterLimit), getter | setter);
|
proto.setProperty("miterLimit", eng->newFunction(miterLimit), getter | setter);
|
||||||
proto.setProperty("width", eng->newFunction(width), getter | setter);
|
proto.setProperty("width", eng->newFunction(width), getter | setter);
|
||||||
proto.setProperty("isSolid", eng->newFunction(isSolid), getter);
|
proto.setProperty("solid", eng->newFunction(solid), getter);
|
||||||
|
|
||||||
QScriptValue ctorFun = eng->newFunction(ctor, proto);
|
QScriptValue ctorFun = eng->newFunction(ctor, proto);
|
||||||
ADD_ENUM_VALUE(ctorFun, Qt, FlatCap);
|
ADD_ENUM_VALUE(ctorFun, Qt, FlatCap);
|
||||||
|
@ -48,9 +48,9 @@ static QScriptValue rect(QScriptContext *ctx, QScriptEngine *eng)
|
|||||||
return qScriptValueFromValue(eng, QRectF(self->rect()));
|
return qScriptValueFromValue(eng, QRectF(self->rect()));
|
||||||
}
|
}
|
||||||
|
|
||||||
static QScriptValue isNull(QScriptContext *ctx, QScriptEngine *eng)
|
static QScriptValue null(QScriptContext *ctx, QScriptEngine *eng)
|
||||||
{
|
{
|
||||||
DECLARE_SELF(QPixmap, isNull);
|
DECLARE_SELF(QPixmap, null);
|
||||||
return QScriptValue(eng, self->isNull());
|
return QScriptValue(eng, self->isNull());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ QScriptValue constructQPixmapClass(QScriptEngine *eng)
|
|||||||
QScriptValue proto = qScriptValueFromValue(eng, QPixmap());
|
QScriptValue proto = qScriptValueFromValue(eng, QPixmap());
|
||||||
QScriptValue::PropertyFlags getter = QScriptValue::PropertyGetter;
|
QScriptValue::PropertyFlags getter = QScriptValue::PropertyGetter;
|
||||||
QScriptValue::PropertyFlags setter = QScriptValue::PropertySetter;
|
QScriptValue::PropertyFlags setter = QScriptValue::PropertySetter;
|
||||||
proto.setProperty("isNull", eng->newFunction(isNull), getter);
|
proto.setProperty("null", eng->newFunction(null), getter);
|
||||||
proto.setProperty("rect", eng->newFunction(rect), getter);
|
proto.setProperty("rect", eng->newFunction(rect), getter);
|
||||||
proto.setProperty("scaled", eng->newFunction(scaled), getter);
|
proto.setProperty("scaled", eng->newFunction(scaled), getter);
|
||||||
|
|
||||||
|
@ -37,9 +37,9 @@ static QScriptValue ctor(QScriptContext *ctx, QScriptEngine *eng)
|
|||||||
return qScriptValueFromValue(eng, QPoint());
|
return qScriptValueFromValue(eng, QPoint());
|
||||||
}
|
}
|
||||||
|
|
||||||
static QScriptValue isNull(QScriptContext *ctx, QScriptEngine *eng)
|
static QScriptValue null(QScriptContext *ctx, QScriptEngine *eng)
|
||||||
{
|
{
|
||||||
DECLARE_SELF(QPoint, isNull);
|
DECLARE_SELF(QPoint, null);
|
||||||
return QScriptValue(eng, self->isNull());
|
return QScriptValue(eng, self->isNull());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ QScriptValue constructQPointClass(QScriptEngine *eng)
|
|||||||
QScriptValue::PropertyFlags getter = QScriptValue::PropertyGetter;
|
QScriptValue::PropertyFlags getter = QScriptValue::PropertyGetter;
|
||||||
QScriptValue::PropertyFlags setter = QScriptValue::PropertySetter;
|
QScriptValue::PropertyFlags setter = QScriptValue::PropertySetter;
|
||||||
|
|
||||||
proto.setProperty("isNull", eng->newFunction(isNull), getter);
|
proto.setProperty("null", eng->newFunction(null), getter);
|
||||||
proto.setProperty("manhattanLength", eng->newFunction(manhattanLength), getter);
|
proto.setProperty("manhattanLength", eng->newFunction(manhattanLength), getter);
|
||||||
proto.setProperty("x", eng->newFunction(x), getter | setter);
|
proto.setProperty("x", eng->newFunction(x), getter | setter);
|
||||||
proto.setProperty("y", eng->newFunction(y), getter | setter);
|
proto.setProperty("y", eng->newFunction(y), getter | setter);
|
||||||
|
@ -107,21 +107,21 @@ static QScriptValue height(QScriptContext *ctx, QScriptEngine *eng)
|
|||||||
return QScriptValue(eng, self->height());
|
return QScriptValue(eng, self->height());
|
||||||
}
|
}
|
||||||
|
|
||||||
static QScriptValue isEmpty(QScriptContext *ctx, QScriptEngine *eng)
|
static QScriptValue empty(QScriptContext *ctx, QScriptEngine *eng)
|
||||||
{
|
{
|
||||||
DECLARE_SELF(QRectF, isEmpty);
|
DECLARE_SELF(QRectF, empty);
|
||||||
return QScriptValue(eng, self->isEmpty());
|
return QScriptValue(eng, self->isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
static QScriptValue isNull(QScriptContext *ctx, QScriptEngine *eng)
|
static QScriptValue null(QScriptContext *ctx, QScriptEngine *eng)
|
||||||
{
|
{
|
||||||
DECLARE_SELF(QRectF, isNull);
|
DECLARE_SELF(QRectF, null);
|
||||||
return QScriptValue(eng, self->isNull());
|
return QScriptValue(eng, self->isNull());
|
||||||
}
|
}
|
||||||
|
|
||||||
static QScriptValue isValid(QScriptContext *ctx, QScriptEngine *eng)
|
static QScriptValue valid(QScriptContext *ctx, QScriptEngine *eng)
|
||||||
{
|
{
|
||||||
DECLARE_SELF(QRectF, isValid);
|
DECLARE_SELF(QRectF, valid);
|
||||||
return QScriptValue(eng, self->isValid());
|
return QScriptValue(eng, self->isValid());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -310,9 +310,9 @@ QScriptValue constructQRectFClass(QScriptEngine *eng)
|
|||||||
proto.setProperty("moveTo", eng->newFunction(moveTo));
|
proto.setProperty("moveTo", eng->newFunction(moveTo));
|
||||||
proto.setProperty("moveTop", eng->newFunction(moveTop));
|
proto.setProperty("moveTop", eng->newFunction(moveTop));
|
||||||
|
|
||||||
proto.setProperty("isEmpty", eng->newFunction(isEmpty), getter);
|
proto.setProperty("empty", eng->newFunction(empty), getter);
|
||||||
proto.setProperty("isNull", eng->newFunction(isNull), getter);
|
proto.setProperty("null", eng->newFunction(null), getter);
|
||||||
proto.setProperty("isValid", eng->newFunction(isValid), getter);
|
proto.setProperty("valid", eng->newFunction(valid), getter);
|
||||||
|
|
||||||
proto.setProperty("left", eng->newFunction(left), getter | setter);
|
proto.setProperty("left", eng->newFunction(left), getter | setter);
|
||||||
proto.setProperty("top", eng->newFunction(top), getter | setter);
|
proto.setProperty("top", eng->newFunction(top), getter | setter);
|
||||||
|
@ -42,9 +42,9 @@ static QScriptValue toString(QScriptContext *ctx, QScriptEngine *eng)
|
|||||||
.arg(self->interval()));
|
.arg(self->interval()));
|
||||||
}
|
}
|
||||||
|
|
||||||
static QScriptValue isActive(QScriptContext *ctx, QScriptEngine *eng)
|
static QScriptValue active(QScriptContext *ctx, QScriptEngine *eng)
|
||||||
{
|
{
|
||||||
DECLARE_SELF(QTimer, isActive);
|
DECLARE_SELF(QTimer, active);
|
||||||
|
|
||||||
if (ctx->argumentCount()) {
|
if (ctx->argumentCount()) {
|
||||||
if (ctx->argument(0).toBool()) {
|
if (ctx->argument(0).toBool()) {
|
||||||
@ -64,7 +64,7 @@ QScriptValue constructTimerClass(QScriptEngine *eng)
|
|||||||
eng->setDefaultPrototype(qMetaTypeId<QTimer*>(), proto);
|
eng->setDefaultPrototype(qMetaTypeId<QTimer*>(), proto);
|
||||||
QScriptValue::PropertyFlags getter = QScriptValue::PropertyGetter;
|
QScriptValue::PropertyFlags getter = QScriptValue::PropertyGetter;
|
||||||
QScriptValue::PropertyFlags setter = QScriptValue::PropertySetter;
|
QScriptValue::PropertyFlags setter = QScriptValue::PropertySetter;
|
||||||
proto.setProperty("isActive", eng->newFunction(isActive), getter | setter);
|
proto.setProperty("active", eng->newFunction(active), getter | setter);
|
||||||
|
|
||||||
return eng->newFunction(ctor, proto);
|
return eng->newFunction(ctor, proto);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user