summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2012-04-26 10:00:41 +0200
committerQt by Nokia <qt-info@nokia.com>2012-05-02 09:33:35 +0200
commitd0c01c581a69649d189a4febea90be050100322f (patch)
treef2642c9d032718d4f8befcbe2afe5b435bc82b64 /src
parent951f97722792fee9601425120f0b64408ec18a4a (diff)
QtQuick1: Fix deprecation warnings.
Introduced by qtbase:0df1c9f1fa04c06d6105de3f312c6c752a58ad70 Change-Id: I61e330707a49efd09bad0efda386712fba207c8a Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextlayout.cpp8
-rw-r--r--src/declarative/qml/parser/qdeclarativejsmemorypool_p.h10
-rw-r--r--src/declarative/qml/parser/qdeclarativejsparser.cpp14
-rw-r--r--src/declarative/qml/qdeclarativeboundsignal.cpp4
-rw-r--r--src/declarative/qml/qdeclarativeengine.cpp6
-rw-r--r--src/declarative/util/qdeclarativeopenmetaobject.cpp4
-rw-r--r--src/imports/shaders/scenegraph/qsggeometry.cpp8
7 files changed, 33 insertions, 21 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetextlayout.cpp b/src/declarative/graphicsitems/qdeclarativetextlayout.cpp
index 3f061376..d74a00d6 100644
--- a/src/declarative/graphicsitems/qdeclarativetextlayout.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextlayout.cpp
@@ -46,6 +46,8 @@
#include <private/qpainter_p.h>
#include <private/qpaintengineex_p.h>
+#include <string.h>
+
QT_BEGIN_NAMESPACE
class QDeclarativeTextLayoutPrivate
@@ -138,13 +140,13 @@ class DrawTextItemRecorder: public QPaintEngine
m_inertText->chars.resize(m_inertText->chars.size() + ti.num_chars);
glyph_t *glyphsDestination = m_inertText->glyphs.data() + glyphOffset;
- qMemCopy(glyphsDestination, glyphs.constData(), sizeof(glyph_t) * size);
+ memcpy(glyphsDestination, glyphs.constData(), sizeof(glyph_t) * size);
QFixedPoint *positionsDestination = m_inertText->positions.data() + positionOffset;
- qMemCopy(positionsDestination, positions.constData(), sizeof(QFixedPoint) * size);
+ memcpy(positionsDestination, positions.constData(), sizeof(QFixedPoint) * size);
QChar *charsDestination = m_inertText->chars.data() + charOffset;
- qMemCopy(charsDestination, ti.chars, sizeof(QChar) * ti.num_chars);
+ memcpy(charsDestination, ti.chars, sizeof(QChar) * ti.num_chars);
}
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
diff --git a/src/declarative/util/qdeclarativeopenmetaobject.cpp b/src/declarative/util/qdeclarativeopenmetaobject.cpp
index 85f1022c..85f5d50e 100644
--- a/src/declarative/util/qdeclarativeopenmetaobject.cpp
+++ b/src/declarative/util/qdeclarativeopenmetaobject.cpp
@@ -75,7 +75,7 @@ QDeclarativeOpenMetaObjectType::QDeclarativeOpenMetaObjectType(const QMetaObject
QDeclarativeOpenMetaObjectType::~QDeclarativeOpenMetaObjectType()
{
if (d->mem)
- qFree(d->mem);
+ free(d->mem);
if (d->cache)
d->cache->release();
delete d;
@@ -98,7 +98,7 @@ int QDeclarativeOpenMetaObjectType::createProperty(const QByteArray &name)
d->mob.addSignal("__" + QByteArray::number(id) + "()");
QMetaPropertyBuilder build = d->mob.addProperty(name, "QVariant", id);
propertyCreated(id, build);
- qFree(d->mem);
+ free(d->mem);
d->mem = d->mob.toMetaObject();
d->names.insert(name, id);
QSet<QDeclarativeOpenMetaObject*>::iterator it = d->referers.begin();
diff --git a/src/imports/shaders/scenegraph/qsggeometry.cpp b/src/imports/shaders/scenegraph/qsggeometry.cpp
index 7c8b876c..48f48374 100644
--- a/src/imports/shaders/scenegraph/qsggeometry.cpp
+++ b/src/imports/shaders/scenegraph/qsggeometry.cpp
@@ -41,6 +41,8 @@
#include "qsggeometry.h"
+#include <stdlib.h>
+
QT_BEGIN_NAMESPACE
@@ -101,7 +103,7 @@ QSGGeometry::QSGGeometry(const QSGGeometry::AttributeSet &attributes,
QSGGeometry::~QSGGeometry()
{
if (m_owns_data)
- qFree(m_data);
+ free(m_data);
}
void *QSGGeometry::indexData()
@@ -135,7 +137,7 @@ void QSGGeometry::allocate(int vertexCount, int indexCount)
int vertexByteSize = m_attributes.stride * m_vertex_count;
if (m_owns_data)
- qFree(m_data);
+ free(m_data);
if (canUsePrealloc && vertexByteSize <= (int) sizeof(m_prealloc)) {
m_data = (void *) &m_prealloc[0];
@@ -144,7 +146,7 @@ void QSGGeometry::allocate(int vertexCount, int indexCount)
} else {
Q_ASSERT(m_index_type == GL_UNSIGNED_INT || m_index_type == GL_UNSIGNED_SHORT);
int indexByteSize = indexCount * (m_index_type == GL_UNSIGNED_SHORT ? sizeof(quint16) : sizeof(quint32));
- m_data = (void *) qMalloc(vertexByteSize + indexByteSize);
+ m_data = malloc(vertexByteSize + indexByteSize);
m_index_data_offset = vertexByteSize;
m_owns_data = true;
}