Showing the changes to libraries/script-engine/src/ArrayBufferViewClass.cpp (1 of 13 files). Show all
Unified · Split
| @@ -14,8 +14,8 @@ · 13 unmodified lines | ||
| 14 | 14 | Q_DECLARE_METATYPE(QByteArray*) |
| 15 | 15 | |
| 16 | 16 | ArrayBufferViewClass::ArrayBufferViewClass(ScriptEngine* scriptEngine) : |
| 17 | −QObject(scriptEngine->getScriptEngine()), | |
| 18 | −QScriptClass(scriptEngine->getScriptEngine()), | |
| 17 | +QObject(scriptEngine->getEngine()), | |
| 18 | +QScriptClass(scriptEngine->getEngine()), | |
| 19 | 19 | _scriptEngine(scriptEngine) { |
| 20 | 20 | // Save string handles for quick lookup |
| 21 | 21 | _bufferName = engine()->toStringHandle(BUFFER_PROPERTY_NAME.toLatin1()); |
| @@ -32,8 +32,8 @@ QScriptClass::QueryFlags ArrayBufferViewClass::queryProperty(const QScriptValue& · 10 unmodified lines | ||
| 32 | 32 | return 0; // No access |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | −QScriptValue ArrayBufferViewClass::property(const QScriptValue &object, | |
| 36 | − const QScriptString &name, uint id) { | |
| 35 | +QScriptValue ArrayBufferViewClass::property(const QScriptValue& object, | |
| 36 | + const QScriptString& name, uint id) { | |
| 37 | 37 | if (name == _bufferName) { |
| 38 | 38 | return object.data().property(_bufferName); |
| 39 | 39 | } |
| @@ -50,55 +50,3 @@ QScriptValue::PropertyFlags ArrayBufferViewClass::propertyFlags(const QScriptVal · 10 unmodified lines | ||
| 50 | 50 | const QScriptString& name, uint id) { |
| 51 | 51 | return QScriptValue::Undeletable; |
| 52 | 52 | } |
| 53 | − | |
| 54 | −//QScriptClass::QueryFlags DataViewClass::queryProperty(const QScriptValue& object, | |
| 55 | −// const QScriptString& name, | |
| 56 | −// QueryFlags flags, uint* id) { | |
| 57 | −// QByteArray* arrayBuffer = qscriptvalue_cast<QByteArray*>(object.property(_bufferName).data()); | |
| 58 | −// bool ok = false; | |
| 59 | −// int pos = name.toArrayIndex(&ok); | |
| 60 | −// | |
| 61 | −// // Check that name is a valid index and arrayBuffer exists | |
| 62 | −// if (ok && arrayBuffer && pos > 0 && pos < arrayBuffer->size()) { | |
| 63 | −// *id = pos; // save pos to avoid recomputation | |
| 64 | −// return HandlesReadAccess | HandlesWriteAccess; // Read/Write access | |
| 65 | −// } | |
| 66 | −// | |
| 67 | −// return ArrayBufferViewClass::queryProperty(object, name, flags, id); | |
| 68 | −//} | |
| 69 | −// | |
| 70 | −//QScriptValue DataViewClass::property(const QScriptValue &object, | |
| 71 | −// const QScriptString &name, uint id) { | |
| 72 | −// QByteArray* arrayBuffer = qscriptvalue_cast<QByteArray*>(object.property(_bufferName).data()); | |
| 73 | −// bool ok = false; | |
| 74 | −// name.toArrayIndex(&ok); | |
| 75 | −// | |
| 76 | −// if (ok && arrayBuffer) { | |
| 77 | −// return (*arrayBuffer)[id]; | |
| 78 | −// } | |
| 79 | −// | |
| 80 | −// return ArrayBufferViewClass::queryProperty(object, name, flags, id); | |
| 81 | −//} | |
| 82 | −// | |
| 83 | −//void DataViewClass::setProperty(QScriptValue &object, | |
| 84 | −// const QScriptString &name, | |
| 85 | −// uint id, const QScriptValue &value) { | |
| 86 | −// QByteArray *ba = qscriptvalue_cast<QByteArray*>(object.data()); | |
| 87 | −// if (!ba) | |
| 88 | −// return; | |
| 89 | −// if (name == length) { | |
| 90 | −// resize(*ba, value.toInt32()); | |
| 91 | −// } else { | |
| 92 | −// qint32 pos = id; | |
| 93 | −// if (pos < 0) | |
| 94 | −// return; | |
| 95 | −// if (ba->size() <= pos) | |
| 96 | −// resize(*ba, pos + 1); | |
| 97 | −// (*ba)[pos] = char(value.toInt32()); | |
| 98 | −// } | |
| 99 | −//} | |
| 100 | −// | |
| 101 | −//QScriptValue::PropertyFlags DataViewClass::propertyFlags(const QScriptValue& object, | |
| 102 | −// const QScriptString& name, uint id) { | |
| 103 | −// return QScriptValue::Undeletable; | |
| 104 | −//} | |