diff options
author | Kent Hansen <kent.hansen@nokia.com> | 2012-01-17 09:25:53 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-01 08:37:49 +0100 |
commit | be784e3b15068c0677115ca9500531212584cc7d (patch) | |
tree | 4f50b2079878c417f1517e58a25b14f2d88d5ff9 /src | |
parent | be46366689eb2ed26c00b516c17b42d12c12070e (diff) |
Remove QJSEngine::newDate() functions
Rationale: Passing a QDateTime to toScriptValue() should be
sufficient, there's no need to have a dedicated factory
function for Date objects.
QDateTime has API for specifying a time in milliseconds, so the
newDate() overload that takes a double argument should be redundant.
Task-number: QTBUG-23604
Change-Id: Iec1d4ce8e1fd0a6ebef58dde3141730d27c2fb8c
Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/qml/v8/qjsengine.cpp | 37 | ||||
-rw-r--r-- | src/declarative/qml/v8/qjsengine.h | 4 |
2 files changed, 1 insertions, 40 deletions
diff --git a/src/declarative/qml/v8/qjsengine.cpp b/src/declarative/qml/v8/qjsengine.cpp index 435749c7ab..5141715749 100644 --- a/src/declarative/qml/v8/qjsengine.cpp +++ b/src/declarative/qml/v8/qjsengine.cpp @@ -126,8 +126,7 @@ Q_DECLARE_METATYPE(QList<int>) C++ equivalent of the script statement \c{new Object()}. You can use the object-specific functionality in QJSValue to manipulate the script object (e.g. QJSValue::setProperty()). Similarly, use - newArray() to create a JavaScript array object. Use newDate() to - create a \c{Date} object. + newArray() to create a JavaScript array object. \section1 QObject Integration @@ -444,40 +443,6 @@ QJSValue QJSEngine::globalObject() const return d->scriptValueFromInternal(d->global()); } -#ifdef QT_DEPRECATED - -/*! - \obsolete - - Creates a JavaScript object of class Date from the given \a value. - - \sa QJSValue::toDateTime() -*/ -QJSValue QJSEngine::newDate(const QDateTime &dt) -{ - Q_D(QJSEngine); - QScriptIsolate api(d, QScriptIsolate::NotNullEngine); - v8::HandleScope handleScope; - return d->scriptValueFromInternal(QJSConverter::toDateTime(dt)); -} - -/*! - \obsolete - - Creates a JavaScript object of class Date with the given - \a value (the number of milliseconds since 01 January 1970, - UTC). -*/ -QJSValue QJSEngine::newDate(double date) -{ - Q_D(QJSEngine); - QScriptIsolate api(d, QScriptIsolate::NotNullEngine); - v8::HandleScope handleScope; - return d->scriptValueFromInternal(v8::Handle<v8::Value>(v8::Date::New(date))); -} - -#endif // QT_DEPRECATED - /*! * \internal * used by QJSEngine::toScriptValue diff --git a/src/declarative/qml/v8/qjsengine.h b/src/declarative/qml/v8/qjsengine.h index 47ee0969ca..35fd4f49ac 100644 --- a/src/declarative/qml/v8/qjsengine.h +++ b/src/declarative/qml/v8/qjsengine.h @@ -36,7 +36,6 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDateTime; class QV8Engine; template <typename T> @@ -93,9 +92,6 @@ public: QT_DEPRECATED QJSValue undefinedValue(); QT_DEPRECATED QJSValue newVariant(const QVariant &value); - - QT_DEPRECATED QJSValue newDate(double value); - QT_DEPRECATED QJSValue newDate(const QDateTime &value); #endif Q_SIGNALS: |