From 5d78efa25fd3b720eca536936d45602c8f5b0fa4 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Mon, 16 Jan 2012 12:47:58 +0100 Subject: Mark deprecated functions in QJSEngine and QJSValue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This functionality will be removed or renamed in the final Qt 5 API. From this commit and with deprecated warnings enabled (DEFINES += QT_DEPRECATED_WARNINGS), it's easy to see how existing users of this API (e.g. qtjsondb) are affected. Task-number: QTBUG-23604 Change-Id: I242c43377bb34ddcca84b6ed5b7ef9fbf2017a83 Reviewed-by: Simon Hausmann Reviewed-by: JÄ™drzej Nowacki --- src/declarative/qml/v8/qjsengine.cpp | 40 ++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (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 6bcd3ab134..270d6614f4 100644 --- a/src/declarative/qml/v8/qjsengine.cpp +++ b/src/declarative/qml/v8/qjsengine.cpp @@ -158,6 +158,8 @@ QJSEngine::QJSEngine() { } +#ifdef QT_DEPRECATED + /*! \internal */ @@ -166,6 +168,8 @@ QJSEngine::QJSEngine(QJSEngine::ContextOwnership ownership) { } +#endif // QT_DEPRECATED + /*! Constructs a QJSEngine object with the given \a parent. @@ -198,7 +202,11 @@ QJSEngine::~QJSEngine() \internal */ +#ifdef QT_DEPRECATED + /*! + \obsolete + Returns true if the last script evaluation resulted in an uncaught exception; otherwise returns false. @@ -215,6 +223,8 @@ bool QJSEngine::hasUncaughtException() const } /*! + \obsolete + Returns the current uncaught exception, or an invalid QJSValue if there is no uncaught exception. @@ -233,6 +243,8 @@ QJSValue QJSEngine::uncaughtException() const } /*! + \obsolete + Clears any uncaught exceptions in this engine. \sa hasUncaughtException() @@ -244,6 +256,7 @@ void QJSEngine::clearExceptions() d->clearExceptions(); } +#endif // QT_DEPRECATED /*! Runs the garbage collector. @@ -298,7 +311,11 @@ QJSValue QJSEngine::evaluate(const QString& program, const QString& fileName, in return QJSValuePrivate::get(d->evaluate(program, fileName, lineNumber)); } +#ifdef QT_DEPRECATED + /*! + \obsolete + Returns a QJSValue of the primitive type Null. \sa nullValue() @@ -312,6 +329,8 @@ QJSValue QJSEngine::nullValue() } /*! + \obsolete + Returns a QJSValue of the primitive type Undefined. \sa nullValue() @@ -324,6 +343,8 @@ QJSValue QJSEngine::undefinedValue() return QJSValuePrivate::get(new QJSValuePrivate(d, v8::Undefined())); } +#endif // QT_DEPRECATED + /*! Creates a JavaScript object of class Object. @@ -382,7 +403,11 @@ QJSValue QJSEngine::newQObject(QObject *object) return d->scriptValueFromInternal(d->newQObject(object, QV8Engine::JavaScriptOwnership)); } +#ifdef QT_DEPRECATED + /*! + \obsolete + Creates a JavaScript object holding the given variant \a value. If a default prototype has been registered with the meta type id of @@ -400,6 +425,7 @@ QJSValue QJSEngine::newVariant(const QVariant &value) return d->scriptValueFromInternal(d->newVariant(value)); } +#endif // QT_DEPRECATED /*! Returns this engine's Global Object. @@ -419,7 +445,11 @@ QJSValue QJSEngine::globalObject() const return d->scriptValueFromInternal(d->global()); } +#ifdef QT_DEPRECATED + /*! + \obsolete + Converts the given \a value to an object, if such a conversion is possible; otherwise returns an invalid QJSValue. The conversion is performed according to the following table: @@ -445,6 +475,8 @@ QJSValue QJSEngine::toObject(const QJSValue& value) } /*! + \obsolete + Creates a JavaScript object of class Date from the given \a value. \sa QJSValue::toDateTime() @@ -458,6 +490,8 @@ QJSValue QJSEngine::newDate(const QDateTime &dt) } /*! + \obsolete + Creates a JavaScript object of class Date with the given \a value (the number of milliseconds since 01 January 1970, UTC). @@ -471,6 +505,8 @@ QJSValue QJSEngine::newDate(double date) } /*! + \obsolete + Creates a JavaScript object of class RegExp with the given \a regexp. @@ -485,6 +521,8 @@ QJSValue QJSEngine::newRegExp(const QRegExp ®exp) } /*! + \obsolete + Creates a JavaScript object of class RegExp with the given \a pattern and \a flags. @@ -499,6 +537,8 @@ QJSValue QJSEngine::newRegExp(const QString &pattern, const QString &flags) return QJSValuePrivate::get(d->newRegExp(pattern, flags)); } +#endif // QT_DEPRECATED + /*! * \internal * used by QJSEngine::toScriptValue -- cgit v1.2.3 From e6b224aa2872d7d1030fa98bd30603e16f8f9604 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Fri, 20 Jan 2012 14:04:27 +1000 Subject: Update obsolete contact address. Replace Nokia contact email address with Qt Project website. Change-Id: I6a730abc0c396fb545a48b2d6938abedac2e3f1c Reviewed-by: Rohan McGovern Reviewed-by: Alan Alpert --- src/declarative/qml/v8/qjsengine.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 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 270d6614f4..97e247a6cb 100644 --- a/src/declarative/qml/v8/qjsengine.cpp +++ b/src/declarative/qml/v8/qjsengine.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the QtScript module of the Qt Toolkit. ** @@ -16,7 +16,7 @@ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. +** us via http://www.qt-project.org/. ** $QT_END_LICENSE$ ** ****************************************************************************/ -- cgit v1.2.3