From be784e3b15068c0677115ca9500531212584cc7d Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Tue, 17 Jan 2012 09:25:53 +0100 Subject: Remove QJSEngine::newDate() functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Jędrzej Nowacki --- src/declarative/qml/v8/qjsengine.cpp | 37 +----------------------------------- 1 file changed, 1 insertion(+), 36 deletions(-) (limited to 'src/declarative/qml/v8/qjsengine.cpp') 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) 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::Date::New(date))); -} - -#endif // QT_DEPRECATED - /*! * \internal * used by QJSEngine::toScriptValue -- cgit v1.2.3