diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2012-04-26 10:00:41 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-02 09:33:35 +0200 |
commit | d0c01c581a69649d189a4febea90be050100322f (patch) | |
tree | f2642c9d032718d4f8befcbe2afe5b435bc82b64 /src/declarative/qml | |
parent | 951f97722792fee9601425120f0b64408ec18a4a (diff) |
QtQuick1: Fix deprecation warnings.
Introduced by qtbase:0df1c9f1fa04c06d6105de3f312c6c752a58ad70
Change-Id: I61e330707a49efd09bad0efda386712fba207c8a
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
Diffstat (limited to 'src/declarative/qml')
-rw-r--r-- | src/declarative/qml/parser/qdeclarativejsmemorypool_p.h | 10 | ||||
-rw-r--r-- | src/declarative/qml/parser/qdeclarativejsparser.cpp | 14 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativeboundsignal.cpp | 4 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativeengine.cpp | 6 |
4 files changed, 21 insertions, 13 deletions
diff --git a/src/declarative/qml/parser/qdeclarativejsmemorypool_p.h b/src/declarative/qml/parser/qdeclarativejsmemorypool_p.h index a86134dc..c20c0418 100644 --- a/src/declarative/qml/parser/qdeclarativejsmemorypool_p.h +++ b/src/declarative/qml/parser/qdeclarativejsmemorypool_p.h @@ -80,9 +80,9 @@ public: virtual ~MemoryPool() { for (int index = 0; index < m_blockIndex + 1; ++index) - qFree(m_storage[index]); + free(m_storage[index]); - qFree(m_storage); + free(m_storage); } char *allocate(int bytes) { @@ -91,9 +91,9 @@ public: ++m_blockIndex; m_currentBlockSize = defaultBlockSize << m_blockIndex; - m_storage = reinterpret_cast<char**>(qRealloc(m_storage, sizeof(char*) * (1 + m_blockIndex))); - m_currentBlock = m_storage[m_blockIndex] = reinterpret_cast<char*>(qMalloc(m_currentBlockSize)); - ::memset(m_currentBlock, 0, m_currentBlockSize); + m_storage = reinterpret_cast<char**>(realloc(m_storage, sizeof(char*) * (1 + m_blockIndex))); + m_currentBlock = m_storage[m_blockIndex] = reinterpret_cast<char*>(malloc(m_currentBlockSize)); + memset(m_currentBlock, 0, m_currentBlockSize); m_currentIndex = (8 - quintptr(m_currentBlock)) & 7; // ensure first chunk is 64-bit aligned Q_ASSERT(m_currentIndex + bytes <= m_currentBlockSize); diff --git a/src/declarative/qml/parser/qdeclarativejsparser.cpp b/src/declarative/qml/parser/qdeclarativejsparser.cpp index 958d1c5c..fdd3a0cb 100644 --- a/src/declarative/qml/parser/qdeclarativejsparser.cpp +++ b/src/declarative/qml/parser/qdeclarativejsparser.cpp @@ -54,6 +54,8 @@ #include "private/qdeclarativejsparser_p.h" #include <QVarLengthArray> +#include <stdlib.h> + // // This file is automatically generated from qmljs.g. // Changes will be lost. @@ -70,9 +72,9 @@ void Parser::reallocateStack() else stack_size <<= 1; - sym_stack = reinterpret_cast<Value*> (qRealloc(sym_stack, stack_size * sizeof(Value))); - state_stack = reinterpret_cast<int*> (qRealloc(state_stack, stack_size * sizeof(int))); - location_stack = reinterpret_cast<AST::SourceLocation*> (qRealloc(location_stack, stack_size * sizeof(AST::SourceLocation))); + sym_stack = reinterpret_cast<Value*> (realloc(sym_stack, stack_size * sizeof(Value))); + state_stack = reinterpret_cast<int*> (realloc(state_stack, stack_size * sizeof(int))); + location_stack = reinterpret_cast<AST::SourceLocation*> (realloc(location_stack, stack_size * sizeof(AST::SourceLocation))); } inline static bool automatic(Engine *driver, int token) @@ -98,9 +100,9 @@ Parser::Parser(Engine *engine): Parser::~Parser() { if (stack_size) { - qFree(sym_stack); - qFree(state_stack); - qFree(location_stack); + free(sym_stack); + free(state_stack); + free(location_stack); } } diff --git a/src/declarative/qml/qdeclarativeboundsignal.cpp b/src/declarative/qml/qdeclarativeboundsignal.cpp index 0e24c6e2..772cb05e 100644 --- a/src/declarative/qml/qdeclarativeboundsignal.cpp +++ b/src/declarative/qml/qdeclarativeboundsignal.cpp @@ -54,6 +54,8 @@ #include <QtCore/qstringbuilder.h> #include <QtCore/qdebug.h> +#include <stdlib.h> + QT_BEGIN_NAMESPACE class QDeclarativeBoundSignalParameters : public QObject @@ -271,7 +273,7 @@ QDeclarativeBoundSignalParameters::QDeclarativeBoundSignalParameters(const QMeta QDeclarativeBoundSignalParameters::~QDeclarativeBoundSignalParameters() { delete [] types; - qFree(myMetaObject); + ::free(myMetaObject); } void QDeclarativeBoundSignalParameters::setValues(void **v) diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index 3b77c18b..1d383fb6 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -94,6 +94,7 @@ #include <QtCore/qcoreapplication.h> #include <QtCore/qdir.h> #include <QtCore/qmutex.h> +#include <QtCore/qstandardpaths.h> #include <QtGui/qcolor.h> #include <QtGui/qvector3d.h> #include <QtCore/qcryptographichash.h> @@ -390,7 +391,10 @@ QDeclarativeScriptEngine::QDeclarativeScriptEngine(QDeclarativeEnginePrivate *pr globalObject().setProperty(QLatin1String("Qt"), qtObject); #ifndef QT_NO_DESKTOPSERVICES - offlineStoragePath = QDesktopServices::storageLocation(QDesktopServices::DataLocation).replace(QLatin1Char('/'), QDir::separator()) + const QStringList dataLocations = QStandardPaths::standardLocations(QStandardPaths::DataLocation); + Q_ASSERT(!dataLocations.isEmpty()); + QString dataLocation = dataLocations.first(); + offlineStoragePath = dataLocation.replace(QLatin1Char('/'), QDir::separator()) + QDir::separator() + QLatin1String("QML") + QDir::separator() + QLatin1String("OfflineStorage"); #endif |