summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2010-02-01 01:41:07 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2010-02-01 01:41:07 (GMT)
commit7e85c6dc7ba0aaa6dfcad40dc0e9df0e2adb3741 (patch)
tree07e839b8dd88c381471b96917ef5aafa484233b1 /src/corelib
parent6e8feab83fa9303b1345f4a27478ba3ee0316e86 (diff)
parent5cf8677758e6fbfa5bf360c73519c14630db808c (diff)
downloadQt-7e85c6dc7ba0aaa6dfcad40dc0e9df0e2adb3741.zip
Qt-7e85c6dc7ba0aaa6dfcad40dc0e9df0e2adb3741.tar.gz
Qt-7e85c6dc7ba0aaa6dfcad40dc0e9df0e2adb3741.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Conflicts: src/declarative/util/qmlpixmapcache.cpp
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/animation/qabstractanimation.cpp2
-rw-r--r--src/corelib/animation/qpropertyanimation.cpp17
-rw-r--r--src/corelib/arch/qatomic_ia64.h2
-rw-r--r--src/corelib/global/qglobal.h8
-rw-r--r--src/corelib/io/qfile.cpp104
-rw-r--r--src/corelib/io/qurl.cpp2
-rw-r--r--src/corelib/io/qurl.h1
-rw-r--r--src/corelib/kernel/qcoreevent.cpp2
-rw-r--r--src/corelib/kernel/qobject.cpp4
-rw-r--r--src/corelib/tools/qbytearray.cpp5
-rw-r--r--src/corelib/tools/qeasingcurve.cpp6
11 files changed, 82 insertions, 71 deletions
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp
index 2b4ab47..cedb43f 100644
--- a/src/corelib/animation/qabstractanimation.cpp
+++ b/src/corelib/animation/qabstractanimation.cpp
@@ -299,8 +299,6 @@ void QUnifiedTimer::registerRunningAnimation(QAbstractAnimation *animation)
return;
if (QAbstractAnimationPrivate::get(animation)->isPause) {
- if (animation->duration() == -1)
- qDebug() << "toto";
runningPauseAnimations << animation;
} else
runningLeafAnimations++;
diff --git a/src/corelib/animation/qpropertyanimation.cpp b/src/corelib/animation/qpropertyanimation.cpp
index eec5b30..cfd7cc2 100644
--- a/src/corelib/animation/qpropertyanimation.cpp
+++ b/src/corelib/animation/qpropertyanimation.cpp
@@ -256,7 +256,8 @@ void QPropertyAnimation::updateState(QAbstractAnimation::State newState,
Q_D(QPropertyAnimation);
if (!d->target && oldState == Stopped) {
- qWarning("QPropertyAnimation::updateState: Changing state of an animation without target");
+ qWarning("QPropertyAnimation::updateState (%s): Changing state of an animation without target",
+ d->propertyName.constData());
return;
}
@@ -279,10 +280,16 @@ void QPropertyAnimation::updateState(QAbstractAnimation::State newState,
if (oldState == Stopped) {
d->setDefaultStartEndValue(d->targetValue->property(d->propertyName.constData()));
//let's check if we have a start value and an end value
- if (!startValue().isValid() && (d->direction == Backward || !d->defaultStartEndValue.isValid()))
- qWarning("QPropertyAnimation::updateState: starting an animation without start value");
- if (!endValue().isValid() && (d->direction == Forward || !d->defaultStartEndValue.isValid()))
- qWarning("QPropertyAnimation::updateState: starting an animation without end value");
+ if (!startValue().isValid() && (d->direction == Backward || !d->defaultStartEndValue.isValid())) {
+ qWarning("QPropertyAnimation::updateState (%s, %s, %s): starting an animation without start value",
+ d->propertyName.constData(), d->target.data()->metaObject()->className(),
+ qPrintable(d->target.data()->objectName()));
+ }
+ if (!endValue().isValid() && (d->direction == Forward || !d->defaultStartEndValue.isValid())) {
+ qWarning("QPropertyAnimation::updateState (%s, %s, %s): starting an animation without end value",
+ d->propertyName.constData(), d->target.data()->metaObject()->className(),
+ qPrintable(d->target.data()->objectName()));
+ }
}
} else if (hash.value(key) == this) {
hash.remove(key);
diff --git a/src/corelib/arch/qatomic_ia64.h b/src/corelib/arch/qatomic_ia64.h
index e015863..8c824f3 100644
--- a/src/corelib/arch/qatomic_ia64.h
+++ b/src/corelib/arch/qatomic_ia64.h
@@ -205,7 +205,7 @@ inline bool QBasicAtomicInt::deref()
template <typename T>
Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreAcquire(T *newValue)
{
- return (T *)_InterlockedExchangePointer(&_q_value, newValue);
+ return (T *)_InterlockedExchangePointer(reinterpret_cast<void * volatile*>(&_q_value), newValue);
}
template <typename T>
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 52e9845..abdafc3 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -44,11 +44,11 @@
#include <stddef.h>
-#define QT_VERSION_STR "4.6.1"
+#define QT_VERSION_STR "4.6.2"
/*
QT_VERSION is (major << 16) + (minor << 8) + patch.
*/
-#define QT_VERSION 0x040601
+#define QT_VERSION 0x040602
/*
can be used like #if (QT_VERSION >= QT_VERSION_CHECK(4, 4, 0))
*/
@@ -2419,6 +2419,10 @@ QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathSysconf();
//enabling new graphics resources
#define QT_SYMBIAN_SUPPORTS_SGIMAGE
#define QT_SYMBIAN_SUPPORTS_ADVANCED_POINTER
+
+#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
+#define Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE
+#endif
#endif
diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp
index 6395cc7..728c316 100644
--- a/src/corelib/io/qfile.cpp
+++ b/src/corelib/io/qfile.cpp
@@ -643,13 +643,14 @@ QFile::remove()
qWarning("QFile::remove: Empty or null file name");
return false;
}
+ unsetError();
close();
if(error() == QFile::NoError) {
if(fileEngine()->remove()) {
unsetError();
return true;
}
- d->setError(QFile::RemoveError, fileEngine()->errorString());
+ d->setError(QFile::RemoveError, d->fileEngine->errorString());
}
return false;
}
@@ -703,7 +704,7 @@ QFile::rename(const QString &newName)
if (fileEngine()->rename(newName)) {
unsetError();
// engine was able to handle the new name so we just reset it
- fileEngine()->setFileName(newName);
+ d->fileEngine->setFileName(newName);
d->fileName = newName;
return true;
}
@@ -739,7 +740,7 @@ QFile::rename(const QString &newName)
if (error) {
out.remove();
} else {
- fileEngine()->setFileName(newName);
+ d->fileEngine->setFileName(newName);
setPermissions(permissions());
unsetError();
setFileName(newName);
@@ -804,7 +805,7 @@ QFile::link(const QString &linkName)
unsetError();
return true;
}
- d->setError(QFile::RenameError, fileEngine()->errorString());
+ d->setError(QFile::RenameError, d->fileEngine->errorString());
return false;
}
@@ -993,10 +994,10 @@ bool QFile::open(OpenMode mode)
seek(size());
return true;
}
- QFile::FileError err = fileEngine()->error();
+ QFile::FileError err = d->fileEngine->error();
if(err == QFile::UnspecifiedError)
err = QFile::OpenError;
- d->setError(err, fileEngine()->errorString());
+ d->setError(err, d->fileEngine->errorString());
return false;
}
@@ -1151,12 +1152,11 @@ bool QFile::open(int fd, OpenMode mode)
int
QFile::handle() const
{
- if (!isOpen())
+ Q_D(const QFile);
+ if (!isOpen() || !d->fileEngine)
return -1;
- if (QAbstractFileEngine *engine = fileEngine())
- return engine->handle();
- return -1;
+ return d->fileEngine->handle();
}
/*!
@@ -1188,13 +1188,12 @@ QFile::handle() const
uchar *QFile::map(qint64 offset, qint64 size, MemoryMapFlags flags)
{
Q_D(QFile);
- QAbstractFileEngine *engine = fileEngine();
- if (engine
- && engine->supportsExtension(QAbstractFileEngine::MapExtension)) {
+ if (fileEngine()
+ && d->fileEngine->supportsExtension(QAbstractFileEngine::MapExtension)) {
unsetError();
- uchar *address = engine->map(offset, size, flags);
+ uchar *address = d->fileEngine->map(offset, size, flags);
if (address == 0)
- d->setError(engine->error(), engine->errorString());
+ d->setError(d->fileEngine->error(), d->fileEngine->errorString());
return address;
}
return 0;
@@ -1211,13 +1210,12 @@ uchar *QFile::map(qint64 offset, qint64 size, MemoryMapFlags flags)
bool QFile::unmap(uchar *address)
{
Q_D(QFile);
- QAbstractFileEngine *engine = fileEngine();
- if (engine
- && engine->supportsExtension(QAbstractFileEngine::UnMapExtension)) {
+ if (fileEngine()
+ && d->fileEngine->supportsExtension(QAbstractFileEngine::UnMapExtension)) {
unsetError();
- bool success = engine->unmap(address);
+ bool success = d->fileEngine->unmap(address);
if (!success)
- d->setError(engine->error(), engine->errorString());
+ d->setError(d->fileEngine->error(), d->fileEngine->errorString());
return success;
}
return false;
@@ -1250,13 +1248,14 @@ QFile::resize(qint64 sz)
Q_D(QFile);
if (!d->ensureFlushed())
return false;
- if (isOpen() && fileEngine()->pos() > sz)
+ fileEngine();
+ if (isOpen() && d->fileEngine->pos() > sz)
seek(sz);
- if(fileEngine()->setSize(sz)) {
+ if(d->fileEngine->setSize(sz)) {
unsetError();
return true;
}
- d->setError(QFile::ResizeError, fileEngine()->errorString());
+ d->setError(QFile::ResizeError, d->fileEngine->errorString());
return false;
}
@@ -1320,7 +1319,7 @@ QFile::setPermissions(Permissions permissions)
unsetError();
return true;
}
- d->setError(QFile::PermissionsError, fileEngine()->errorString());
+ d->setError(QFile::PermissionsError, d->fileEngine->errorString());
return false;
}
@@ -1353,23 +1352,27 @@ bool
QFile::flush()
{
Q_D(QFile);
+ if (!d->fileEngine) {
+ qWarning("QFile::flush: No file engine. Is IODevice open?");
+ return false;
+ }
+
if (!d->writeBuffer.isEmpty()) {
qint64 size = d->writeBuffer.size();
- if (_qfile_writeData(d->fileEngine ? d->fileEngine : fileEngine(),
- &d->writeBuffer) != size) {
- QFile::FileError err = fileEngine()->error();
+ if (_qfile_writeData(d->fileEngine, &d->writeBuffer) != size) {
+ QFile::FileError err = d->fileEngine->error();
if(err == QFile::UnspecifiedError)
err = QFile::WriteError;
- d->setError(err, fileEngine()->errorString());
+ d->setError(err, d->fileEngine->errorString());
return false;
}
}
- if (!fileEngine()->flush()) {
- QFile::FileError err = fileEngine()->error();
+ if (!d->fileEngine->flush()) {
+ QFile::FileError err = d->fileEngine->error();
if(err == QFile::UnspecifiedError)
err = QFile::WriteError;
- d->setError(err, fileEngine()->errorString());
+ d->setError(err, d->fileEngine->errorString());
return false;
}
return true;
@@ -1394,10 +1397,10 @@ QFile::close()
d->writeBuffer.clear();
// keep earlier error from flush
- if (fileEngine()->close() && flushed)
+ if (d->fileEngine->close() && flushed)
unsetError();
else if (flushed)
- d->setError(fileEngine()->error(), fileEngine()->errorString());
+ d->setError(d->fileEngine->error(), d->fileEngine->errorString());
}
/*!
@@ -1450,10 +1453,10 @@ bool QFile::atEnd() const
return false;
// If the file engine knows best, say what it says.
- if (fileEngine()->supportsExtension(QAbstractFileEngine::AtEndExtension)) {
+ if (d->fileEngine->supportsExtension(QAbstractFileEngine::AtEndExtension)) {
// Check if the file engine supports AtEndExtension, and if it does,
// check if the file engine claims to be at the end.
- return fileEngine()->atEnd();
+ return d->fileEngine->atEnd();
}
// Fall back to checking how much is available (will stat files).
@@ -1475,11 +1478,11 @@ bool QFile::seek(qint64 off)
if (!d->ensureFlushed())
return false;
- if (!fileEngine()->seek(off) || !QIODevice::seek(off)) {
- QFile::FileError err = fileEngine()->error();
+ if (!d->fileEngine->seek(off) || !QIODevice::seek(off)) {
+ QFile::FileError err = d->fileEngine->error();
if(err == QFile::UnspecifiedError)
err = QFile::PositionError;
- d->setError(err, fileEngine()->errorString());
+ d->setError(err, d->fileEngine->errorString());
return false;
}
unsetError();
@@ -1495,8 +1498,8 @@ qint64 QFile::readLineData(char *data, qint64 maxlen)
if (!d->ensureFlushed())
return -1;
- if (fileEngine()->supportsExtension(QAbstractFileEngine::FastReadLineExtension))
- return fileEngine()->readLine(data, maxlen);
+ if (d->fileEngine->supportsExtension(QAbstractFileEngine::FastReadLineExtension))
+ return d->fileEngine->readLine(data, maxlen);
// Fall back to QIODevice's readLine implementation if the engine
// cannot do it faster.
@@ -1514,18 +1517,14 @@ qint64 QFile::readData(char *data, qint64 len)
if (!d->ensureFlushed())
return -1;
- qint64 ret = -1;
- qint64 read = fileEngine()->read(data, len);
- if (read != -1)
- ret = read;
-
- if(ret < 0) {
- QFile::FileError err = fileEngine()->error();
+ qint64 read = d->fileEngine->read(data, len);
+ if(read < 0) {
+ QFile::FileError err = d->fileEngine->error();
if(err == QFile::UnspecifiedError)
err = QFile::ReadError;
- d->setError(err, fileEngine()->errorString());
+ d->setError(err, d->fileEngine->errorString());
}
- return ret;
+ return read;
}
/*!
@@ -1605,13 +1604,12 @@ QFile::writeData(const char *data, qint64 len)
// Write directly to the engine if the block size is larger than
// the write buffer size.
if (!buffered || len > QFILE_WRITEBUFFER_SIZE) {
- QAbstractFileEngine *fe = d->fileEngine ? d->fileEngine : fileEngine();
- qint64 ret = fe->write(data, len);
+ qint64 ret = d->fileEngine->write(data, len);
if(ret < 0) {
- QFile::FileError err = fileEngine()->error();
+ QFile::FileError err = d->fileEngine->error();
if(err == QFile::UnspecifiedError)
err = QFile::WriteError;
- d->setError(err, fileEngine()->errorString());
+ d->setError(err, d->fileEngine->errorString());
}
return ret;
}
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index 74e5f74..a131d6c 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -5932,7 +5932,7 @@ void QUrl::detach()
*/
bool QUrl::isDetached() const
{
- return d && d->ref == 1;
+ return !d || d->ref == 1;
}
diff --git a/src/corelib/io/qurl.h b/src/corelib/io/qurl.h
index 9dff06a..0aa534a 100644
--- a/src/corelib/io/qurl.h
+++ b/src/corelib/io/qurl.h
@@ -75,7 +75,6 @@ public:
RemovePath = 0x20,
RemoveQuery = 0x40,
RemoveFragment = 0x80,
- // 0x100: private: normalized
StripTrailingSlash = 0x10000
};
diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp
index 1b167e2..3f69b4f 100644
--- a/src/corelib/kernel/qcoreevent.cpp
+++ b/src/corelib/kernel/qcoreevent.cpp
@@ -107,13 +107,13 @@ QT_BEGIN_NAMESPACE
\value ApplicationLayoutDirectionChange The default application layout direction has changed.
\value ApplicationPaletteChange The default application palette has changed.
\value ApplicationWindowIconChange The application's icon has changed.
- \value CloseSoftwareInputPanel A widget wants to close the software input panel (SIP).
\value ChildAdded An object gets a child (QChildEvent).
\value ChildInserted An object gets a child (QChildEvent). Qt3Support only, use ChildAdded instead.
\value ChildPolished A widget child gets polished (QChildEvent).
\value ChildRemoved An object loses a child (QChildEvent).
\value Clipboard The clipboard contents have changed (QClipboardEvent).
\value Close Widget was closed (QCloseEvent).
+ \value CloseSoftwareInputPanel A widget wants to close the software input panel (SIP).
\value ContentsRectChange The margins of the widget's content rect changed.
\value ContextMenu Context popup menu (QContextMenuEvent).
\value CursorChange The widget's cursor has changed.
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index f09047e..5298fff 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -2956,6 +2956,10 @@ bool QMetaObject::disconnect(const QObject *sender, int signal_index,
}
/*!\internal
+
+Disconnect a single signal connection. If QMetaObject::connect() has been called
+multiple times for the same sender, signal_index, receiver and method_index only
+one of these connections will be removed.
*/
bool QMetaObject::disconnectOne(const QObject *sender, int signal_index,
const QObject *receiver, int method_index)
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index d2fbf5a..556093f 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -538,7 +538,7 @@ QByteArray qUncompress(const uchar* data, int nbytes)
forever {
ulong alloc = len;
- d.reset(q_check_ptr(static_cast<QByteArray::Data *>(qRealloc(d.data(), sizeof(QByteArray::Data) + alloc))));
+ d.reset(q_check_ptr(static_cast<QByteArray::Data *>(qRealloc(d.take(), sizeof(QByteArray::Data) + alloc))));
if (!d) {
// we are not allowed to crash here when compiling with QT_NO_EXCEPTIONS
qWarning("qUncompress: could not allocate enough memory to uncompress data");
@@ -551,7 +551,7 @@ QByteArray qUncompress(const uchar* data, int nbytes)
switch (res) {
case Z_OK:
if (len != alloc) {
- d.reset(q_check_ptr(static_cast<QByteArray::Data *>(qRealloc(d.data(), sizeof(QByteArray::Data) + len))));
+ d.reset(q_check_ptr(static_cast<QByteArray::Data *>(qRealloc(d.take(), sizeof(QByteArray::Data) + len))));
if (!d) {
// we are not allowed to crash here when compiling with QT_NO_EXCEPTIONS
qWarning("qUncompress: could not allocate enough memory to uncompress data");
@@ -561,6 +561,7 @@ QByteArray qUncompress(const uchar* data, int nbytes)
d->ref = 1;
d->alloc = d->size = len;
d->data = d->array;
+ d->array[len] = 0;
return QByteArray(d.take(), 0, 0);
diff --git a/src/corelib/tools/qeasingcurve.cpp b/src/corelib/tools/qeasingcurve.cpp
index 0ef92d9..b6a2df4 100644
--- a/src/corelib/tools/qeasingcurve.cpp
+++ b/src/corelib/tools/qeasingcurve.cpp
@@ -125,7 +125,7 @@
\value OutCubic \inlineimage qeasingcurve-outcubic.png
\br
Easing curve for a cubic (t^3) function:
- decelerating from zero velocity.
+ decelerating to zero velocity.
\value InOutCubic \inlineimage qeasingcurve-inoutcubic.png
\br
Easing curve for a cubic (t^3) function:
@@ -141,7 +141,7 @@
\value OutQuart \inlineimage qeasingcurve-outquart.png
\br
Easing curve for a cubic (t^4) function:
- decelerating from zero velocity.
+ decelerating to zero velocity.
\value InOutQuart \inlineimage qeasingcurve-inoutquart.png
\br
Easing curve for a cubic (t^4) function:
@@ -157,7 +157,7 @@
\value OutQuint \inlineimage qeasingcurve-outquint.png
\br
Easing curve for a cubic (t^5) function:
- decelerating from zero velocity.
+ decelerating to zero velocity.
\value InOutQuint \inlineimage qeasingcurve-inoutquint.png
\br
Easing curve for a cubic (t^5) function: