summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-05-27 23:05:41 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2010-05-27 23:06:01 (GMT)
commit85fa83ac89367bf4f3a85d038ef64a362aa8377e (patch)
tree706bc6aa64be436480d0d6a0c5603ff31186bfbb /src
parent103e1e8ea5e8879f2bb97e008840a212b3004a51 (diff)
parent8f011df08139bea59c12ae0804969334a9374dc8 (diff)
downloadQt-85fa83ac89367bf4f3a85d038ef64a362aa8377e.zip
Qt-85fa83ac89367bf4f3a85d038ef64a362aa8377e.tar.gz
Qt-85fa83ac89367bf4f3a85d038ef64a362aa8377e.tar.bz2
Merge remote branch 'origin/4.6' into qt-4.7-from-4.6
Conflicts: demos/spectrum/app/engine.h demos/spectrum/app/mainwidget.h demos/spectrum/app/settingsdialog.h demos/spectrum/app/spectrograph.h demos/spectrum/app/spectrumanalyser.h demos/spectrum/app/tonegenerator.h demos/spectrum/app/tonegeneratordialog.h demos/spectrum/app/utils.h demos/spectrum/app/waveform.h tests/auto/qtextcodec/tst_qtextcodec.cpp
Diffstat (limited to 'src')
-rw-r--r--src/corelib/arch/qatomic_alpha.h12
-rw-r--r--src/corelib/tools/qvarlengtharray.h15
-rw-r--r--src/gui/egl/qegl.cpp8
-rw-r--r--src/gui/s60framework/qs60mainappui.cpp8
4 files changed, 25 insertions, 18 deletions
diff --git a/src/corelib/arch/qatomic_alpha.h b/src/corelib/arch/qatomic_alpha.h
index 5d0b2b6..6989c25 100644
--- a/src/corelib/arch/qatomic_alpha.h
+++ b/src/corelib/arch/qatomic_alpha.h
@@ -367,7 +367,7 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetRelease(T *expectedValu
template <typename T>
Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreRelaxed(T *newValue)
{
- register void *old, *tmp;
+ register T *old, *tmp;
asm volatile("1:\n"
"ldq_l %0,%2\n" /* old=*ptr; */
"mov %3,%1\n" /* tmp=newval; */
@@ -385,7 +385,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreRelaxed(T *newValue)
template <typename T>
Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreAcquire(T *newValue)
{
- register void *old, *tmp;
+ register T *old, *tmp;
asm volatile("1:\n"
"ldq_l %0,%2\n" /* old=*ptr; */
"mov %3,%1\n" /* tmp=newval; */
@@ -404,7 +404,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreAcquire(T *newValue)
template <typename T>
Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreRelease(T *newValue)
{
- register void *old, *tmp;
+ register T *old, *tmp;
asm volatile("mb\n"
"1:\n"
"ldq_l %0,%2\n" /* old=*ptr; */
@@ -423,7 +423,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreRelease(T *newValue)
template <typename T>
Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddRelaxed(qptrdiff valueToAdd)
{
- register void *old, *tmp;
+ register T *old, *tmp;
asm volatile("1:\n"
"ldq_l %0,%2\n" /* old=*ptr; */
"addq %0,%3,%1\n"/* tmp=old+value; */
@@ -441,7 +441,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddRelaxed(qptrdiff valueTo
template <typename T>
Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddAcquire(qptrdiff valueToAdd)
{
- register void *old, *tmp;
+ register T *old, *tmp;
asm volatile("1:\n"
"ldq_l %0,%2\n" /* old=*ptr; */
"addq %0,%3,%1\n"/* tmp=old+value; */
@@ -460,7 +460,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddAcquire(qptrdiff valueTo
template <typename T>
Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddRelease(qptrdiff valueToAdd)
{
- register void *old, *tmp;
+ register T *old, *tmp;
asm volatile("mb\n"
"1:\n"
"ldq_l %0,%2\n" /* old=*ptr; */
diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h
index 9773d4b..bfede94 100644
--- a/src/corelib/tools/qvarlengtharray.h
+++ b/src/corelib/tools/qvarlengtharray.h
@@ -132,9 +132,9 @@ private:
friend class QPodList<T, Prealloc>;
void realloc(int size, int alloc);
- int a;
- int s;
- T *ptr;
+ int a; // capacity
+ int s; // size
+ T *ptr; // data
union {
// ### Qt 5: Use 'Prealloc * sizeof(T)' as array size
char array[sizeof(qint64) * (((Prealloc * sizeof(T)) / sizeof(qint64)) + 1)];
@@ -197,8 +197,8 @@ Q_OUTOFLINE_TEMPLATE void QVarLengthArray<T, Prealloc>::realloc(int asize, int a
Q_ASSERT(aalloc >= asize);
T *oldPtr = ptr;
int osize = s;
- // s = asize;
+ const int copySize = qMin(asize, osize);
if (aalloc != a) {
ptr = reinterpret_cast<T *>(qMalloc(aalloc * sizeof(T)));
Q_CHECK_PTR(ptr);
@@ -209,7 +209,6 @@ Q_OUTOFLINE_TEMPLATE void QVarLengthArray<T, Prealloc>::realloc(int asize, int a
if (QTypeInfo<T>::isStatic) {
QT_TRY {
// copy all the old elements
- const int copySize = qMin(asize, osize);
while (s < copySize) {
new (ptr+s) T(*(oldPtr+s));
(oldPtr+s)->~T();
@@ -225,19 +224,19 @@ Q_OUTOFLINE_TEMPLATE void QVarLengthArray<T, Prealloc>::realloc(int asize, int a
QT_RETHROW;
}
} else {
- qMemCopy(ptr, oldPtr, qMin(asize, osize) * sizeof(T));
+ qMemCopy(ptr, oldPtr, copySize * sizeof(T));
}
} else {
ptr = oldPtr;
return;
}
}
+ s = copySize;
if (QTypeInfo<T>::isComplex) {
+ // destroy remaining old objects
while (osize > asize)
(oldPtr+(--osize))->~T();
- if (!QTypeInfo<T>::isStatic)
- s = osize;
}
if (oldPtr != reinterpret_cast<T *>(array) && oldPtr != ptr)
diff --git a/src/gui/egl/qegl.cpp b/src/gui/egl/qegl.cpp
index 671a568..e6ea198 100644
--- a/src/gui/egl/qegl.cpp
+++ b/src/gui/egl/qegl.cpp
@@ -72,12 +72,12 @@ public:
static bool displayOpened() { return displayOpen; }
private:
- static QAtomicInt contexts;
- static QAtomicInt displayOpen;
+ static QBasicAtomicInt contexts;
+ static QBasicAtomicInt displayOpen;
};
-QAtomicInt QEglContextTracker::contexts = 0;
-QAtomicInt QEglContextTracker::displayOpen = 0;
+QBasicAtomicInt QEglContextTracker::contexts = Q_BASIC_ATOMIC_INITIALIZER(0);
+QBasicAtomicInt QEglContextTracker::displayOpen = Q_BASIC_ATOMIC_INITIALIZER(0);
// Current GL and VG contexts. These are used to determine if
// we can avoid an eglMakeCurrent() after a call to lazyDoneCurrent().
diff --git a/src/gui/s60framework/qs60mainappui.cpp b/src/gui/s60framework/qs60mainappui.cpp
index feffc9f..ce13de8 100644
--- a/src/gui/s60framework/qs60mainappui.cpp
+++ b/src/gui/s60framework/qs60mainappui.cpp
@@ -64,6 +64,9 @@
#include <private/qt_s60_p.h>
#include <qdebug.h>
+//Animated wallpapers in Qt applications are not supported.
+const TInt KAknDisableAnimationBackground = 0x02000000;
+
QT_BEGIN_NAMESPACE
/*!
@@ -115,6 +118,11 @@ void QS60MainAppUi::ConstructL()
TInt flags = CAknAppUi::EAknEnableSkin
| CAknAppUi::ENoScreenFurniture
| CAknAppUi::ENonStandardResourceFile;
+ // After 5th Edition S60, native side supports animated wallpapers.
+ // However, there is no support for that feature on Qt side, so indicate to
+ // native UI framework that this application will not support background animations.
+ if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0)
+ flags |= KAknDisableAnimationBackground;
BaseConstructL(flags);
}