diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-08-20 16:14:05 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-08-20 16:14:05 (GMT) |
commit | 284165a06de1e6c140db51b3dde6ad055b93c21e (patch) | |
tree | f44653698150c910f471de7d874faabfd9388c86 /src/script/api | |
parent | ae0a1979c309be110ee65a1ca82b94f48848b11e (diff) | |
download | Qt-284165a06de1e6c140db51b3dde6ad055b93c21e.zip Qt-284165a06de1e6c140db51b3dde6ad055b93c21e.tar.gz Qt-284165a06de1e6c140db51b3dde6ad055b93c21e.tar.bz2 |
remove redundant variable
Diffstat (limited to 'src/script/api')
-rw-r--r-- | src/script/api/qscriptvalue.cpp | 7 | ||||
-rw-r--r-- | src/script/api/qscriptvalue_p.h | 6 |
2 files changed, 3 insertions, 10 deletions
diff --git a/src/script/api/qscriptvalue.cpp b/src/script/api/qscriptvalue.cpp index edcb6ac..559d532 100644 --- a/src/script/api/qscriptvalue.cpp +++ b/src/script/api/qscriptvalue.cpp @@ -275,7 +275,7 @@ qsreal ToInteger(qsreal n) } // namespace QScript -QScriptValuePrivate::QScriptValuePrivate() : engine(this), valid(true) +QScriptValuePrivate::QScriptValuePrivate() : engine(this) { ref = 0; } @@ -2430,10 +2430,7 @@ bool QScriptValue::isQMetaObject() const bool QScriptValue::isValid() const { Q_D(const QScriptValue); - if (d) - return d->isValid(); - else - return false; + return d && (!d->isJSC() || !!d->jscValue); } /*! diff --git a/src/script/api/qscriptvalue_p.h b/src/script/api/qscriptvalue_p.h index 71bff07..9456ace 100644 --- a/src/script/api/qscriptvalue_p.h +++ b/src/script/api/qscriptvalue_p.h @@ -139,13 +139,11 @@ public: QScriptValue property(quint32 index, int resolveMode) const; QScriptValue property(const QString &, int resolveMode) const; - bool isValid() const {return valid;} void detachEngine() { // if type is not developed in js engine there is no // need to invalidate the object if (isJSC()) { - valid = false; jscValue = JSC::JSValue(); } engine = 0; @@ -153,7 +151,7 @@ public: qint64 objectId() { - if ( (type == JSC) && (valid) && (engine) ) + if ( (type == JSC) && (engine) ) return (qint64)jscValue.asCell(); else return -1; @@ -169,8 +167,6 @@ public: QString stringValue; QBasicAtomicInt ref; - bool valid; //object is valid ? - }; |