summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/animation/qabstractanimation.cpp11
-rw-r--r--src/corelib/animation/qabstractanimation.h6
-rw-r--r--src/corelib/animation/qvariantanimation.cpp13
-rw-r--r--src/corelib/arch/arch.pri2
-rw-r--r--src/corelib/arch/integrity/arch.pri3
-rw-r--r--src/corelib/arch/qatomic_arch.h4
-rw-r--r--src/corelib/arch/qatomic_armv5.h2
-rw-r--r--src/corelib/arch/qatomic_integrity.h289
-rw-r--r--src/corelib/arch/symbian/qt_hybridheap_symbian_p.h3
-rw-r--r--src/corelib/codecs/qtextcodec.cpp11
-rw-r--r--src/corelib/concurrent/qfutureinterface.cpp9
-rw-r--r--src/corelib/concurrent/qfutureinterface_p.h5
-rw-r--r--src/corelib/corelib.pro22
-rw-r--r--src/corelib/global/global.pri6
-rw-r--r--src/corelib/global/qconfig-nacl.h (renamed from src/corelib/global/qconfig-minimal-system-dependencies.h)0
-rw-r--r--src/corelib/global/qfeatures.h5
-rw-r--r--src/corelib/global/qfeatures.txt10
-rw-r--r--src/corelib/global/qglobal.cpp20
-rw-r--r--src/corelib/global/qglobal.h197
-rw-r--r--src/corelib/global/qnamespace.h20
-rw-r--r--src/corelib/global/qnamespace.qdoc48
-rw-r--r--src/corelib/io/io.pri4
-rw-r--r--src/corelib/io/qdiriterator.cpp10
-rw-r--r--src/corelib/io/qfilesystemengine.cpp2
-rw-r--r--src/corelib/io/qfilesystemengine_unix.cpp12
-rw-r--r--src/corelib/io/qfilesystemiterator_p.h5
-rw-r--r--src/corelib/io/qfilesystemiterator_unix.cpp4
-rw-r--r--src/corelib/io/qfsfileengine_unix.cpp8
-rw-r--r--src/corelib/io/qnoncontiguousbytedevice.cpp14
-rw-r--r--src/corelib/io/qnoncontiguousbytedevice_p.h10
-rw-r--r--src/corelib/io/qprocess.cpp19
-rw-r--r--src/corelib/io/qprocess_unix.cpp55
-rw-r--r--src/corelib/io/qresource.cpp2
-rw-r--r--src/corelib/io/qsettings.cpp2
-rw-r--r--src/corelib/io/qtextstream.cpp1
-rw-r--r--src/corelib/kernel/kernel.pri23
-rw-r--r--src/corelib/kernel/qcore_symbian_p.h16
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp90
-rw-r--r--src/corelib/kernel/qcoreapplication.h1
-rw-r--r--src/corelib/kernel/qcoreapplication_p.h12
-rw-r--r--src/corelib/kernel/qcorecmdlineargs_p.h13
-rw-r--r--src/corelib/kernel/qcrashhandler.cpp3
-rw-r--r--src/corelib/kernel/qeventdispatcher_symbian.cpp11
-rw-r--r--src/corelib/kernel/qeventdispatcher_symbian_p.h3
-rw-r--r--src/corelib/kernel/qeventdispatcher_unix.cpp5
-rw-r--r--src/corelib/kernel/qeventdispatcher_win.cpp5
-rw-r--r--src/corelib/kernel/qeventloop.cpp5
-rw-r--r--src/corelib/kernel/qfunctions_nacl.cpp (renamed from src/corelib/global/qnaclunimplemented.cpp)2
-rw-r--r--src/corelib/kernel/qfunctions_nacl.h (renamed from src/corelib/global/qnaclunimplemented.h)2
-rw-r--r--src/corelib/kernel/qfunctions_p.h2
-rw-r--r--src/corelib/kernel/qmetaobject.cpp48
-rw-r--r--src/corelib/kernel/qmetaobject.h3
-rw-r--r--src/corelib/kernel/qmetaobject_p.h6
-rw-r--r--src/corelib/kernel/qmetatype.h2
-rw-r--r--src/corelib/kernel/qobject.cpp22
-rw-r--r--src/corelib/kernel/qobject.h8
-rw-r--r--src/corelib/kernel/qobjectdefs.h2
-rw-r--r--src/corelib/kernel/qsharedmemory.cpp6
-rw-r--r--src/corelib/kernel/qsharedmemory_unix.cpp14
-rw-r--r--src/corelib/kernel/qsharedmemory_win.cpp3
-rw-r--r--src/corelib/kernel/qsystemsemaphore_symbian.cpp24
-rw-r--r--src/corelib/kernel/qsystemsemaphore_unix.cpp9
-rw-r--r--src/corelib/kernel/qsystemsemaphore_win.cpp3
-rw-r--r--src/corelib/kernel/qtranslator.cpp2
-rw-r--r--src/corelib/plugin/plugin.pri4
-rw-r--r--src/corelib/plugin/qfactoryloader.cpp4
-rw-r--r--src/corelib/plugin/qlibrary_unix.cpp18
-rw-r--r--src/corelib/statemachine/qstatemachine.cpp7
-rw-r--r--src/corelib/thread/qmutex.h9
-rw-r--r--src/corelib/thread/qmutex_unix.cpp5
-rw-r--r--src/corelib/thread/qthread.cpp10
-rw-r--r--src/corelib/thread/qthread_p.h2
-rw-r--r--src/corelib/thread/qthread_unix.cpp55
-rw-r--r--src/corelib/thread/qthread_win.cpp5
-rw-r--r--src/corelib/thread/thread.pri4
-rw-r--r--src/corelib/tools/qbytearray.cpp45
-rw-r--r--src/corelib/tools/qchar.cpp4
-rw-r--r--src/corelib/tools/qdatetime.cpp6
-rw-r--r--src/corelib/tools/qeasingcurve.cpp20
-rw-r--r--src/corelib/tools/qlocale.cpp2
-rw-r--r--src/corelib/tools/qscopedvaluerollback.cpp84
-rw-r--r--src/corelib/tools/qscopedvaluerollback.h81
-rw-r--r--src/corelib/tools/qset.h2
-rw-r--r--src/corelib/tools/qshareddata.h4
-rw-r--r--src/corelib/tools/qsharedpointer_impl.h10
-rw-r--r--src/corelib/tools/qstring.cpp8
-rw-r--r--src/corelib/tools/qstringbuilder.cpp4
-rw-r--r--src/corelib/tools/qstringbuilder.h5
-rw-r--r--src/corelib/tools/tools.pri8
89 files changed, 1224 insertions, 361 deletions
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp
index 7c16f7e..2d5cfab 100644
--- a/src/corelib/animation/qabstractanimation.cpp
+++ b/src/corelib/animation/qabstractanimation.cpp
@@ -404,6 +404,8 @@ void QUnifiedTimer::installAnimationDriver(QAnimationDriver *d)
The default animation system is driven by a timer that fires at regular intervals.
In some scenarios, it is better to drive the animation based on other synchronization
mechanisms, such as the vertical refresh rate of the screen.
+
+ \internal
*/
QAnimationDriver::QAnimationDriver(QObject *parent)
@@ -420,6 +422,8 @@ QAnimationDriver::QAnimationDriver(QAnimationDriverPrivate &dd, QObject *parent)
/*!
Advances the animation based on the current time. This function should
be continuously called by the driver while the animation is running.
+
+ \internal
*/
void QAnimationDriver::advance()
{
@@ -434,6 +438,8 @@ void QAnimationDriver::advance()
/*!
Installs this animation driver. The animation driver is thread local and
will only apply for the thread its installed in.
+
+ \internal
*/
void QAnimationDriver::install()
{
@@ -471,6 +477,8 @@ void QAnimationDriver::stop()
This function is called by the animation framework to notify the driver
that it should start running.
+
+ \internal
*/
/*!
@@ -478,6 +486,8 @@ void QAnimationDriver::stop()
This function is called by the animation framework to notify the driver
that it should stop running.
+
+ \internal
*/
/*!
@@ -491,6 +501,7 @@ QDefaultAnimationDriver::QDefaultAnimationDriver(QUnifiedTimer *timer)
void QDefaultAnimationDriver::timerEvent(QTimerEvent *e)
{
Q_ASSERT(e->timerId() == m_timer.timerId());
+ Q_UNUSED(e); // if the assertions are disabled
advance();
}
diff --git a/src/corelib/animation/qabstractanimation.h b/src/corelib/animation/qabstractanimation.h
index 957b9d5..0900870 100644
--- a/src/corelib/animation/qabstractanimation.h
+++ b/src/corelib/animation/qabstractanimation.h
@@ -140,7 +140,7 @@ class Q_CORE_EXPORT QAnimationDriver : public QObject
Q_DECLARE_PRIVATE(QAnimationDriver)
public:
- QAnimationDriver(QObject *parent);
+ QAnimationDriver(QObject *parent = 0);
void advance();
void install();
@@ -148,8 +148,8 @@ public:
bool isRunning() const;
protected:
- virtual void started() = 0;
- virtual void stopped() = 0;
+ virtual void started() {};
+ virtual void stopped() {};
QAnimationDriver(QAnimationDriverPrivate &dd, QObject *parent = 0);
diff --git a/src/corelib/animation/qvariantanimation.cpp b/src/corelib/animation/qvariantanimation.cpp
index 212e85d..c76cb89 100644
--- a/src/corelib/animation/qvariantanimation.cpp
+++ b/src/corelib/animation/qvariantanimation.cpp
@@ -431,12 +431,17 @@ void QVariantAnimation::registerInterpolator(QVariantAnimation::Interpolator fun
{
// will override any existing interpolators
QInterpolatorVector *interpolators = registeredInterpolators();
+ // When built on solaris with GCC, the destructors can be called
+ // in such an order that we get here with interpolators == NULL,
+ // to continue causes the app to crash on exit with a SEGV
+ if (interpolators) {
#ifndef QT_NO_THREAD
- QMutexLocker locker(QMutexPool::globalInstanceGet(interpolators));
+ QMutexLocker locker(QMutexPool::globalInstanceGet(interpolators));
#endif
- if (int(interpolationType) >= interpolators->count())
- interpolators->resize(int(interpolationType) + 1);
- interpolators->replace(interpolationType, func);
+ if (int(interpolationType) >= interpolators->count())
+ interpolators->resize(int(interpolationType) + 1);
+ interpolators->replace(interpolationType, func);
+ }
}
diff --git a/src/corelib/arch/arch.pri b/src/corelib/arch/arch.pri
index 971069f..cd23e5e 100644
--- a/src/corelib/arch/arch.pri
+++ b/src/corelib/arch/arch.pri
@@ -12,6 +12,8 @@ symbian:HEADERS += arch/qatomic_symbian.h \
vxworks:HEADERS += arch/qatomic_vxworks.h
+integrity:HEADERS += arch/qatomic_integrity.h
+
!wince*:!win32:!mac:!symbian:HEADERS += arch/qatomic_alpha.h \
arch/qatomic_avr32.h \
arch/qatomic_ia64.h \
diff --git a/src/corelib/arch/integrity/arch.pri b/src/corelib/arch/integrity/arch.pri
new file mode 100644
index 0000000..2c4196e
--- /dev/null
+++ b/src/corelib/arch/integrity/arch.pri
@@ -0,0 +1,3 @@
+#
+# INTEGRITY RTOS architecture
+#
diff --git a/src/corelib/arch/qatomic_arch.h b/src/corelib/arch/qatomic_arch.h
index f32aec7..3da833a 100644
--- a/src/corelib/arch/qatomic_arch.h
+++ b/src/corelib/arch/qatomic_arch.h
@@ -46,7 +46,9 @@ QT_BEGIN_HEADER
#include "QtCore/qglobal.h"
-#if defined(QT_ARCH_VXWORKS)
+#if defined(QT_ARCH_INTEGRITY)
+# include "QtCore/qatomic_integrity.h"
+#elif defined(QT_ARCH_VXWORKS)
# include "QtCore/qatomic_vxworks.h"
#elif defined(QT_ARCH_ALPHA)
# include "QtCore/qatomic_alpha.h"
diff --git a/src/corelib/arch/qatomic_armv5.h b/src/corelib/arch/qatomic_armv5.h
index f564439..ac8fe96 100644
--- a/src/corelib/arch/qatomic_armv5.h
+++ b/src/corelib/arch/qatomic_armv5.h
@@ -107,7 +107,7 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::isFetchAndAddWaitFree()
// kernel places a restartable cmpxchg implementation at a fixed address
extern "C" typedef int (qt_atomic_eabi_cmpxchg_int_t)(int oldval, int newval, volatile int *ptr);
-extern "C" typedef int (qt_atomic_eabi_cmpxchg_ptr_t)(const void *oldval, void *newval, volatile void *ptr);
+extern "C" typedef int (qt_atomic_eabi_cmpxchg_ptr_t)(const void *oldval, const void *newval, volatile void *ptr);
#define qt_atomic_eabi_cmpxchg_int (*reinterpret_cast<qt_atomic_eabi_cmpxchg_int_t *>(0xffff0fc0))
#define qt_atomic_eabi_cmpxchg_ptr (*reinterpret_cast<qt_atomic_eabi_cmpxchg_ptr_t *>(0xffff0fc0))
diff --git a/src/corelib/arch/qatomic_integrity.h b/src/corelib/arch/qatomic_integrity.h
new file mode 100644
index 0000000..6563903
--- /dev/null
+++ b/src/corelib/arch/qatomic_integrity.h
@@ -0,0 +1,289 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QATOMIC_INTEGRITY_H
+#define QATOMIC_INTEGRITY_H
+
+#include <INTEGRITY.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+#define qt_i2addr(a) reinterpret_cast<Address *>(const_cast<int *>(a))
+#define qt_p2addr(a) reinterpret_cast<Address *>(const_cast<void *>(a))
+#define qt_addr(a) reinterpret_cast<Address>(a)
+
+
+#define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_NOT_NATIVE
+
+inline bool QBasicAtomicInt::isReferenceCountingNative()
+{ return false; }
+inline bool QBasicAtomicInt::isReferenceCountingWaitFree()
+{ return false; }
+
+#define Q_ATOMIC_INT_TEST_AND_SET_IS_NOT_NATIVE
+
+inline bool QBasicAtomicInt::isTestAndSetNative()
+{ return true; }
+inline bool QBasicAtomicInt::isTestAndSetWaitFree()
+{ return true; }
+
+#define Q_ATOMIC_INT_FETCH_AND_STORE_IS_NOT_NATIVE
+
+inline bool QBasicAtomicInt::isFetchAndStoreNative()
+{ return true; }
+inline bool QBasicAtomicInt::isFetchAndStoreWaitFree()
+{ return true; }
+
+#define Q_ATOMIC_INT_FETCH_AND_ADD_IS_NOT_NATIVE
+
+inline bool QBasicAtomicInt::isFetchAndAddNative()
+{ return true; }
+inline bool QBasicAtomicInt::isFetchAndAddWaitFree()
+{ return true; }
+
+#define Q_ATOMIC_POINTER_TEST_AND_SET_IS_NOT_NATIVE
+
+template <typename T>
+Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::isTestAndSetNative()
+{ return true; }
+template <typename T>
+Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::isTestAndSetWaitFree()
+{ return true; }
+
+#define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_NOT_NATIVE
+
+template <typename T>
+Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::isFetchAndStoreNative()
+{ return true; }
+template <typename T>
+Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::isFetchAndStoreWaitFree()
+{ return true; }
+
+#define Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_NOT_NATIVE
+
+template <typename T>
+Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::isFetchAndAddNative()
+{ return true; }
+template <typename T>
+Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::isFetchAndAddWaitFree()
+{ return true; }
+
+// Reference counting
+
+inline bool QBasicAtomicInt::ref()
+{
+ int oldval;
+ AtomicModify(qt_i2addr(&_q_value), qt_i2addr(&oldval), 0, 1);
+ return _q_value != -1;
+}
+
+inline bool QBasicAtomicInt::deref()
+{
+ int oldval;
+ AtomicModify(qt_i2addr(&_q_value), qt_i2addr(&oldval), 0, -1U);
+ return _q_value != 0;
+}
+
+// Test and set for integers
+
+inline bool QBasicAtomicInt::testAndSetOrdered(int expectedValue, int newValue)
+{
+ return TestAndSet(qt_i2addr(&_q_value), expectedValue, newValue) == Success;
+}
+
+inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue)
+{
+ return testAndSetOrdered(expectedValue, newValue);
+}
+
+inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue)
+{
+ return testAndSetOrdered(expectedValue, newValue);
+}
+
+inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue)
+{
+ return testAndSetOrdered(expectedValue, newValue);
+}
+
+// Fetch and store for integers
+
+inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue)
+{
+ int old_val;
+ do {
+ old_val = _q_value;
+ } while (TestAndSet(qt_i2addr(&_q_value), old_val, newValue) != Success);
+ return old_val;
+}
+
+inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue)
+{
+ return fetchAndStoreOrdered(newValue);
+}
+
+inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue)
+{
+ return fetchAndStoreOrdered(newValue);
+}
+
+inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue)
+{
+ return fetchAndStoreOrdered(newValue);
+}
+
+// Fetch and add for integers
+
+inline int QBasicAtomicInt::fetchAndAddOrdered(int valueToAdd)
+{
+ int old_val;
+ do {
+ old_val = _q_value;
+ } while (TestAndSet(qt_i2addr(&_q_value), old_val, old_val + valueToAdd) != Success);
+ return old_val;
+}
+
+inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd)
+{
+ return fetchAndAddOrdered(valueToAdd);
+}
+
+inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd)
+{
+ return fetchAndAddOrdered(valueToAdd);
+}
+
+inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd)
+{
+ return fetchAndAddOrdered(valueToAdd);
+}
+
+// Test and set for pointers
+
+template <typename T>
+Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetOrdered(T *expectedValue, T *newValue)
+{
+ return TestAndSet((Address*)&_q_value, qt_addr(expectedValue), qt_addr(newValue)) == Success;
+}
+
+template <typename T>
+Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetRelaxed(T *expectedValue, T *newValue)
+{
+ return testAndSetOrdered(expectedValue, newValue);
+}
+
+template <typename T>
+Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetAcquire(T *expectedValue, T *newValue)
+{
+ return testAndSetOrdered(expectedValue, newValue);
+}
+
+template <typename T>
+Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetRelease(T *expectedValue, T *newValue)
+{
+ return testAndSetOrdered(expectedValue, newValue);
+}
+
+// Fetch and store for pointers
+
+template <typename T>
+Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreOrdered(T *newValue)
+{
+ Address old_val;
+ do {
+ old_val = *reinterpret_cast<Address *>(const_cast<T *>(newValue));
+ } while (TestAndSet(reinterpret_cast<Address *>(const_cast<T **>(&_q_value)), old_val, qt_addr(newValue)) != Success);
+ return reinterpret_cast<T *>(old_val);
+}
+
+template <typename T>
+Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreRelaxed(T *newValue)
+{
+ return fetchAndStoreOrdered(newValue);
+}
+
+template <typename T>
+Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreAcquire(T *newValue)
+{
+ return fetchAndStoreOrdered(newValue);
+}
+
+template <typename T>
+Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreRelease(T *newValue)
+{
+ return fetchAndStoreOrdered(newValue);
+}
+
+// Fetch and add for pointers
+
+template <typename T>
+Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddOrdered(qptrdiff valueToAdd)
+{
+ AtomicModify(qt_p2addr(&_q_value), qt_addr(_q_value), qt_addr(_q_value) + valueToAdd * sizeof(T));
+ return _q_value;
+}
+
+template <typename T>
+Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddRelaxed(qptrdiff valueToAdd)
+{
+ return fetchAndAddOrdered(valueToAdd);
+}
+
+template <typename T>
+Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddAcquire(qptrdiff valueToAdd)
+{
+ return fetchAndAddOrdered(valueToAdd);
+}
+
+template <typename T>
+Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddRelease(qptrdiff valueToAdd)
+{
+ return fetchAndAddOrdered(valueToAdd);
+}
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QATOMIC_INTEGRITY_H
+
diff --git a/src/corelib/arch/symbian/qt_hybridheap_symbian_p.h b/src/corelib/arch/symbian/qt_hybridheap_symbian_p.h
index 4eff0f3..d1ce705 100644
--- a/src/corelib/arch/symbian/qt_hybridheap_symbian_p.h
+++ b/src/corelib/arch/symbian/qt_hybridheap_symbian_p.h
@@ -43,8 +43,9 @@
#define QT_HYBRIDHEAP_SYMBIAN_H
#include <qglobal.h>
+#include <e32cmn.h>
-#if !defined(SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS) && !defined(__WINS__)
+#if !defined(__SYMBIAN_KERNEL_HYBRID_HEAP__) && !defined(__WINS__)
//Enable the (backported) new allocator. When it is available in OS,
//this flag should be disabled for that OS version onward
#define QT_USE_NEW_SYMBIAN_ALLOCATOR
diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp
index 2ae2924..3c3d39e 100644
--- a/src/corelib/codecs/qtextcodec.cpp
+++ b/src/corelib/codecs/qtextcodec.cpp
@@ -64,7 +64,7 @@
#ifndef QT_NO_CODECS
# include "qtsciicodec_p.h"
# include "qisciicodec_p.h"
-#ifndef Q_OS_SYMBIAN
+#if !defined(Q_OS_SYMBIAN) && !defined(Q_OS_INTEGRITY)
# if defined(QT_NO_ICONV) && !defined(QT_BOOTSTRAPPED)
// no iconv(3) support, must build all codecs into the library
# include "../../plugins/codecs/cn/qgb18030codec.h"
@@ -772,7 +772,7 @@ static void setup()
# endif // Q_WS_X11
-#ifndef Q_OS_SYMBIAN
+#if !defined(Q_OS_SYMBIAN) && !defined(Q_OS_INTEGRITY)
# if defined(QT_NO_ICONV) && !defined(QT_BOOTSTRAPPED)
// no asian codecs when bootstrapping, sorry
(void)new QGb18030Codec;
@@ -805,7 +805,7 @@ static void setup()
(void)new QLatin1Codec;
(void)new QUtf8Codec;
-#ifndef Q_OS_SYMBIAN
+#if !defined(Q_OS_SYMBIAN) && !defined(Q_OS_INTEGRITY)
#if defined(Q_OS_UNIX) && !defined(QT_NO_ICONV) && !defined(QT_BOOTSTRAPPED)
// QIconvCodec depends on the UTF-16 codec, so it needs to be created last
(void) new QIconvCodec();
@@ -1090,8 +1090,11 @@ QTextCodec* QTextCodec::codecForMib(int mib)
QByteArray key = "MIB: " + QByteArray::number(mib);
QTextCodecCache *cache = qTextCodecCache();
QTextCodec *codec;
- if (cache)
+ if (cache) {
codec = cache->value(key);
+ if (codec)
+ return codec;
+ }
QList<QTextCodec*>::ConstIterator i;
for (int i = 0; i < all->size(); ++i) {
diff --git a/src/corelib/concurrent/qfutureinterface.cpp b/src/corelib/concurrent/qfutureinterface.cpp
index 6256944..627d0c7 100644
--- a/src/corelib/concurrent/qfutureinterface.cpp
+++ b/src/corelib/concurrent/qfutureinterface.cpp
@@ -421,9 +421,11 @@ bool QFutureInterfaceBase::referenceCountIsOne() const
QFutureInterfaceBasePrivate::QFutureInterfaceBasePrivate(QFutureInterfaceBase::State initialState)
: refCount(1), m_progressValue(0), m_progressMinimum(0), m_progressMaximum(0),
- state(initialState), progressTimeStarted(false), pendingResults(0),
+ state(initialState), pendingResults(0),
manualProgress(false), m_expectedResultCount(0), runnable(0)
-{ }
+{
+ progressTime.invalidate();
+}
int QFutureInterfaceBasePrivate::internal_resultCount() const
{
@@ -455,12 +457,11 @@ bool QFutureInterfaceBasePrivate::internal_updateProgress(int progress,
m_progressValue = progress;
m_progressText = progressText;
- if (progressTimeStarted == true && m_progressValue != m_progressMaximum) // make sure the first and last steps are emitted.
+ if (progressTime.isValid() && m_progressValue != m_progressMaximum) // make sure the first and last steps are emitted.
if (progressTime.elapsed() < (1000 / MaxProgressEmitsPerSecond))
return false;
progressTime.start();
- progressTimeStarted = true;
return true;
}
diff --git a/src/corelib/concurrent/qfutureinterface_p.h b/src/corelib/concurrent/qfutureinterface_p.h
index 7f93c75..538947e 100644
--- a/src/corelib/concurrent/qfutureinterface_p.h
+++ b/src/corelib/concurrent/qfutureinterface_p.h
@@ -53,7 +53,7 @@
// We mean it.
//
-#include <QtCore/qdatetime.h>
+#include <QtCore/qelapsedtimer.h>
#include <QtCore/qcoreevent.h>
#include <QtCore/qlist.h>
#include <QtCore/qwaitcondition.h>
@@ -137,8 +137,7 @@ public:
int m_progressMinimum;
int m_progressMaximum;
QFutureInterfaceBase::State state;
- QTime progressTime;
- bool progressTimeStarted;
+ QElapsedTimer progressTime;
QWaitCondition pausedWaitCondition;
int pendingResults;
QtConcurrent::ResultStoreBase m_results;
diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro
index e946d5d..58d2c7b 100644
--- a/src/corelib/corelib.pro
+++ b/src/corelib/corelib.pro
@@ -20,14 +20,13 @@ include(statemachine/statemachine.pri)
include(xml/xml.pri)
!qpa:mac|darwin:LIBS_PRIVATE += -framework ApplicationServices
-qpa:mac|darwin {
- contains(QT_CONFIG, coreservices) {
- LIBS_PRIVATE += -framework CoreServices
- } else {
- LIBS_PRIVATE += -framework CoreFoundation
- }
+qpa {
+ contains(QT_CONFIG, coreservices) {
+ LIBS_PRIVATE += -framework CoreServices
+ }
+} else:mac|darwin {
+ LIBS_PRIVATE += -framework CoreFoundation
}
-
mac:lib_bundle:DEFINES += QT_NO_DEBUG_PLUGIN_CHECK
win32:DEFINES-=QT_NO_CAST_TO_ASCII
@@ -40,7 +39,10 @@ contains(DEFINES,QT_EVAL):include(eval.pri)
symbian: {
TARGET.UID3=0x2001B2DC
- # Workaroud for problems with paging this dll
- MMP_RULES -= PAGED
- MMP_RULES *= UNPAGED
+ # Problems using data exports from this DLL mean that we can't page it on releases that don't support
+ # data exports (currently that's any release before Symbian^3)
+ pagingBlock = "$${LITERAL_HASH}ifndef SYMBIAN_DLL_DATA_EXPORTS_SUPPORTED" \
+ "UNPAGED" \
+ "$${LITERAL_HASH}endif"
+ MMP_RULES += pagingBlock
}
diff --git a/src/corelib/global/global.pri b/src/corelib/global/global.pri
index 8eae391..d80706a 100644
--- a/src/corelib/global/global.pri
+++ b/src/corelib/global/global.pri
@@ -13,17 +13,13 @@ SOURCES += \
global/qmalloc.cpp \
global/qnumeric.cpp
-nacl {
- SOURCES += global/qnaclunimplemented.cpp
-}
-
# qlibraryinfo.cpp includes qconfig.cpp
INCLUDEPATH += $$QT_BUILD_TREE/src/corelib/global
# Only used on platforms with CONFIG += precompile_header
PRECOMPILED_HEADER = global/qt_pch.h
-linux*:!static:!symbian-armcc:!symbian-gcce {
+linux*:!static:!symbian-gcce:!*-armcc* {
QMAKE_LFLAGS += -Wl,-e,qt_core_boilerplate
prog=$$quote(if (/program interpreter: (.*)]/) { print $1; })
DEFINES += ELF_INTERPRETER=\\\"$$system(readelf -l /bin/ls | perl -n -e \'$$prog\')\\\"
diff --git a/src/corelib/global/qconfig-minimal-system-dependencies.h b/src/corelib/global/qconfig-nacl.h
index a44391c..a44391c 100644
--- a/src/corelib/global/qconfig-minimal-system-dependencies.h
+++ b/src/corelib/global/qconfig-nacl.h
diff --git a/src/corelib/global/qfeatures.h b/src/corelib/global/qfeatures.h
index b26563a..604d08a 100644
--- a/src/corelib/global/qfeatures.h
+++ b/src/corelib/global/qfeatures.h
@@ -79,6 +79,9 @@
// Effects
//#define QT_NO_EFFECTS
+// QFileSystemIterator
+//#define QT_NO_FILESYSTEMITERATOR
+
// QFileSystemWatcher
//#define QT_NO_FILESYSTEMWATCHER
@@ -579,7 +582,7 @@
#endif
// Hyper Text Transfer Protocol
-#if !defined(QT_NO_HTTP) && (defined(QT_NO_HOSTINFO) || defined(QT_NO_NETWORKPROXY))
+#if !defined(QT_NO_HTTP) && defined(QT_NO_HOSTINFO)
#define QT_NO_HTTP
#endif
diff --git a/src/corelib/global/qfeatures.txt b/src/corelib/global/qfeatures.txt
index f07fbd5..6b861d4 100644
--- a/src/corelib/global/qfeatures.txt
+++ b/src/corelib/global/qfeatures.txt
@@ -242,6 +242,14 @@ Requires:
Name: QFileSystemWatcher
SeeAlso: ???
+Feature: FILESYSTEMITERATOR
+Description: Provides fast file-system iteration.
+for modications.
+Section: File I/O
+Requires:
+Name: QFileSystemIterator
+SeeAlso: ???
+
# Widgets
Feature: TREEWIDGET
@@ -1050,7 +1058,7 @@ SeeAlso: ???
Feature: HTTP
Description: Supports HTTP file access.
Section: Networking
-Requires: HOSTINFO NETWORKPROXY
+Requires: HOSTINFO
Name: Hyper Text Transfer Protocol
SeeAlso: ???
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 4110fd4..54b9d89 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -1174,6 +1174,7 @@ bool qSharedBuild()
\value MV_10_4 Mac OS X 10.4
\value MV_10_5 Mac OS X 10.5
\value MV_10_6 Mac OS X 10.6
+ \value MV_10_7 Mac OS X 10.7
\value MV_Unknown An unknown and currently unsupported platform
\value MV_CHEETAH Apple codename for MV_10_0
@@ -1183,6 +1184,7 @@ bool qSharedBuild()
\value MV_TIGER Apple codename for MV_10_4
\value MV_LEOPARD Apple codename for MV_10_5
\value MV_SNOWLEOPARD Apple codename for MV_10_6
+ \value MV_LION Apple codename for MV_10_7
\sa WinVersion, SymbianVersion
*/
@@ -1738,7 +1740,7 @@ QSysInfo::WinVersion QSysInfo::windowsVersion()
if (winver)
return winver;
winver = QSysInfo::WV_NT;
- OSVERSIONINFOW osver;
+ OSVERSIONINFO osver;
osver.dwOSVersionInfoSize = sizeof(osver);
GetVersionEx(&osver);
#ifdef Q_OS_WINCE
@@ -1874,7 +1876,7 @@ QSysInfo::SymbianVersion QSysInfo::symbianVersion()
else if (minor == 1) {
return cachedSymbianVersion = SV_SF_2;
}
- else if (minor == 2) {
+ else if (minor >= 2) {
return cachedSymbianVersion = SV_SF_3;
}
}
@@ -2589,7 +2591,7 @@ bool qputenv(const char *varName, const QByteArray& value)
#endif
}
-#if (defined(Q_OS_UNIX) || defined(Q_OS_WIN)) && !defined(QT_NO_THREAD)
+#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) && !defined(QT_NO_THREAD)
# if defined(Q_OS_INTEGRITY) && defined(__GHS_VERSION_NUMBER) && (__GHS_VERSION_NUMBER < 500)
// older versions of INTEGRITY used a long instead of a uint for the seed.
@@ -2620,7 +2622,7 @@ Q_GLOBAL_STATIC(SeedStorage, randTLS) // Thread Local Storage for seed value
*/
void qsrand(uint seed)
{
-#if defined(Q_OS_UNIX) && !defined(QT_NO_THREAD) && !defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) && !defined(QT_NO_THREAD)
SeedStorage *seedStorage = randTLS();
if (seedStorage) {
SeedStorageType *pseed = seedStorage->localData();
@@ -2628,10 +2630,10 @@ void qsrand(uint seed)
seedStorage->setLocalData(pseed = new SeedStorageType);
*pseed = seed;
} else {
- //golbal static seed storage should always exist,
+ //global static seed storage should always exist,
//except after being deleted by QGlobalStaticDeleter.
//But since it still can be called from destructor of another
- //global static object, fallback to sqrand(seed)
+ //global static object, fallback to srand(seed)
srand(seed);
}
#else
@@ -2659,7 +2661,7 @@ void qsrand(uint seed)
*/
int qrand()
{
-#if defined(Q_OS_UNIX) && !defined(QT_NO_THREAD) && !defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) && !defined(QT_NO_THREAD)
SeedStorage *seedStorage = randTLS();
if (seedStorage) {
SeedStorageType *pseed = seedStorage->localData();
@@ -2669,10 +2671,10 @@ int qrand()
}
return rand_r(pseed);
} else {
- //golbal static seed storage should always exist,
+ //global static seed storage should always exist,
//except after being deleted by QGlobalStaticDeleter.
//But since it still can be called from destructor of another
- //global static object, fallback to qrand()
+ //global static object, fallback to rand()
return rand();
}
#else
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 945e45c..06e19dc 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -322,7 +322,10 @@ namespace QT_NAMESPACE {}
# if !defined(MAC_OS_X_VERSION_10_6)
# define MAC_OS_X_VERSION_10_6 MAC_OS_X_VERSION_10_5 + 1
# endif
-# if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_6)
+# if !defined(MAC_OS_X_VERSION_10_7)
+# define MAC_OS_X_VERSION_10_7 MAC_OS_X_VERSION_10_6 + 1
+# endif
+# if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_7)
# warning "This version of Mac OS X is unsupported"
# endif
#endif
@@ -369,7 +372,20 @@ namespace QT_NAMESPACE {}
*/
#if defined(__ghs)
-# define Q_OUTOFLINE_TEMPLATE inline
+# define Q_OUTOFLINE_TEMPLATE inline
+
+/* the following are necessary because the GHS C++ name mangling relies on __*/
+# define Q_CONSTRUCTOR_FUNCTION0(AFUNC) \
+ static const int AFUNC ## _init_variable_ = AFUNC();
+# define Q_CONSTRUCTOR_FUNCTION(AFUNC) Q_CONSTRUCTOR_FUNCTION0(AFUNC)
+# define Q_DESTRUCTOR_FUNCTION0(AFUNC) \
+ class AFUNC ## _dest_class_ { \
+ public: \
+ inline AFUNC ## _dest_class_() { } \
+ inline ~ AFUNC ## _dest_class_() { AFUNC(); } \
+ } AFUNC ## _dest_instance_;
+# define Q_DESTRUCTOR_FUNCTION(AFUNC) Q_DESTRUCTOR_FUNCTION0(AFUNC)
+
#endif
/* Symantec C++ is now Digital Mars */
@@ -448,6 +464,9 @@ namespace QT_NAMESPACE {}
# if __TARGET_ARCH_ARM >= 6
# define QT_HAVE_ARMV6
# endif
+/* work-around for missing compiler intrinsics */
+# define __is_empty(X) false
+# define __is_pod(X) false
#elif defined(__GNUC__)
# define Q_CC_GNU
# define Q_C_CALLBACKS
@@ -457,7 +476,6 @@ namespace QT_NAMESPACE {}
# if defined(__INTEL_COMPILER)
/* Intel C++ also masquerades as GCC 3.2.0 */
# define Q_CC_INTEL
-# define Q_NO_TEMPLATE_FRIENDS
# endif
# if defined(__clang__)
/* Clang also masquerades as GCC 4.2.1 */
@@ -760,6 +778,24 @@ namespace QT_NAMESPACE {}
# error "Qt has not been tested with this compiler - talk to qt-bugs@trolltech.com"
#endif
+#ifdef Q_CC_INTEL
+# if __INTEL_COMPILER < 1200
+# define Q_NO_TEMPLATE_FRIENDS
+# endif
+# if defined(__GXX_EXPERIMENTAL_CXX0X__) || defined(__GXX_EXPERIMENTAL_CPP0X__)
+# if __INTEL_COMPILER >= 1100
+# define Q_COMPILER_RVALUE_REFS
+# define Q_COMPILER_EXTERN_TEMPLATES
+# elif __INTEL_COMPILER >= 1200
+# define Q_COMPILER_VARIADIC_TEMPLATES
+# define Q_COMPILER_AUTO_TYPE
+# define Q_COMPILER_DEFAULT_DELETE_MEMBERS
+# define Q_COMPILER_CLASS_ENUM
+# define Q_COMPILER_LAMBDA
+# endif
+# endif
+#endif
+
#ifndef Q_PACKED
# define Q_PACKED
# undef Q_NO_PACKED_REFERENCE
@@ -1123,14 +1159,14 @@ template <typename T>
inline T qAbs(const T &t) { return t >= 0 ? t : -t; }
inline int qRound(qreal d)
-{ return d >= 0.0 ? int(d + 0.5) : int(d - int(d-1) + 0.5) + int(d-1); }
+{ return d >= qreal(0.0) ? int(d + qreal(0.5)) : int(d - int(d-1) + qreal(0.5)) + int(d-1); }
#if defined(QT_NO_FPU) || defined(QT_ARCH_ARM) || defined(QT_ARCH_WINDOWSCE) || defined(QT_ARCH_SYMBIAN)
inline qint64 qRound64(double d)
{ return d >= 0.0 ? qint64(d + 0.5) : qint64(d - qreal(qint64(d-1)) + 0.5) + qint64(d-1); }
#else
inline qint64 qRound64(qreal d)
-{ return d >= 0.0 ? qint64(d + 0.5) : qint64(d - qreal(qint64(d-1)) + 0.5) + qint64(d-1); }
+{ return d >= qreal(0.0) ? qint64(d + qreal(0.5)) : qint64(d - qreal(qint64(d-1)) + qreal(0.5)) + qint64(d-1); }
#endif
template <typename T>
@@ -1199,6 +1235,11 @@ class QDataStream;
#define QT_SUPPORTS(FEATURE) (!defined(QT_NO_##FEATURE))
+#if defined(Q_OS_LINUX) && defined(Q_CC_RVCT)
+# define Q_DECL_EXPORT __attribute__((visibility("default")))
+# define Q_DECL_IMPORT __attribute__((visibility("default")))
+#endif
+
#ifndef Q_DECL_EXPORT
# if defined(Q_OS_WIN) || defined(Q_CC_NOKIAX86) || defined(Q_CC_RVCT)
# define Q_DECL_EXPORT __declspec(dllexport)
@@ -1420,7 +1461,7 @@ class QDataStream;
# define Q_AUTOTEST_EXPORT
#endif
-inline void qt_noop() {}
+inline void qt_noop(void) {}
/* These wrap try/catch so we can switch off exceptions later.
@@ -1533,6 +1574,7 @@ public:
MV_10_4 = 0x0006,
MV_10_5 = 0x0007,
MV_10_6 = 0x0008,
+ MV_10_7 = 0x0009,
/* codenames */
MV_CHEETAH = MV_10_0,
@@ -1541,7 +1583,8 @@ public:
MV_PANTHER = MV_10_3,
MV_TIGER = MV_10_4,
MV_LEOPARD = MV_10_5,
- MV_SNOWLEOPARD = MV_10_6
+ MV_SNOWLEOPARD = MV_10_6,
+ MV_LION = MV_10_7
};
static const MacVersion MacintoshVersion;
#endif
@@ -1642,7 +1685,7 @@ inline void qUnused(T &x) { (void)x; }
#endif
#ifndef qPrintable
-# define qPrintable(string) (string).toLocal8Bit().constData()
+# define qPrintable(string) QString(string).toLocal8Bit().constData()
#endif
Q_CORE_EXPORT void qDebug(const char *, ...) /* print debug message */
@@ -1790,32 +1833,32 @@ public:
inline ~QGlobalStatic() { pointer = 0; }
};
-#define Q_GLOBAL_STATIC(TYPE, NAME) \
- static TYPE *NAME() \
- { \
- static TYPE this_##NAME; \
- static QGlobalStatic<TYPE > global_##NAME(&this_##NAME); \
- return global_##NAME.pointer; \
+#define Q_GLOBAL_STATIC(TYPE, NAME) \
+ static TYPE *NAME() \
+ { \
+ static TYPE thisVariable; \
+ static QGlobalStatic<TYPE > thisGlobalStatic(&thisVariable); \
+ return thisGlobalStatic.pointer; \
}
-#define Q_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ARGS) \
- static TYPE *NAME() \
- { \
- static TYPE this_##NAME ARGS; \
- static QGlobalStatic<TYPE > global_##NAME(&this_##NAME); \
- return global_##NAME.pointer; \
+#define Q_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ARGS) \
+ static TYPE *NAME() \
+ { \
+ static TYPE thisVariable ARGS; \
+ static QGlobalStatic<TYPE > thisGlobalStatic(&thisVariable); \
+ return thisGlobalStatic.pointer; \
}
-#define Q_GLOBAL_STATIC_WITH_INITIALIZER(TYPE, NAME, INITIALIZER) \
- static TYPE *NAME() \
- { \
- static TYPE this_##NAME; \
- static QGlobalStatic<TYPE > global_##NAME(0); \
- if (!global_##NAME.pointer) { \
- TYPE *x = global_##NAME.pointer = &this_##NAME; \
- INITIALIZER; \
- } \
- return global_##NAME.pointer; \
+#define Q_GLOBAL_STATIC_WITH_INITIALIZER(TYPE, NAME, INITIALIZER) \
+ static TYPE *NAME() \
+ { \
+ static TYPE thisVariable; \
+ static QGlobalStatic<TYPE > thisGlobalStatic(0); \
+ if (!thisGlobalStatic.pointer) { \
+ TYPE *x = thisGlobalStatic.pointer = &thisVariable; \
+ INITIALIZER; \
+ } \
+ return thisGlobalStatic.pointer; \
}
#else
@@ -1850,50 +1893,50 @@ public:
}
};
-#define Q_GLOBAL_STATIC_INIT(TYPE, NAME) \
- static QGlobalStatic<TYPE > this_##NAME = { Q_BASIC_ATOMIC_INITIALIZER(0), false }
-
-#define Q_GLOBAL_STATIC(TYPE, NAME) \
- Q_GLOBAL_STATIC_INIT(TYPE, NAME); \
- static TYPE *NAME() \
- { \
- if (!this_##NAME.pointer && !this_##NAME.destroyed) { \
- TYPE *x = new TYPE; \
- if (!this_##NAME.pointer.testAndSetOrdered(0, x)) \
- delete x; \
- else \
- static QGlobalStaticDeleter<TYPE > cleanup(this_##NAME); \
- } \
- return this_##NAME.pointer; \
+#define Q_GLOBAL_STATIC(TYPE, NAME) \
+ static TYPE *NAME() \
+ { \
+ static QGlobalStatic<TYPE > thisGlobalStatic \
+ = { Q_BASIC_ATOMIC_INITIALIZER(0), false }; \
+ if (!thisGlobalStatic.pointer && !thisGlobalStatic.destroyed) { \
+ TYPE *x = new TYPE; \
+ if (!thisGlobalStatic.pointer.testAndSetOrdered(0, x)) \
+ delete x; \
+ else \
+ static QGlobalStaticDeleter<TYPE > cleanup(thisGlobalStatic); \
+ } \
+ return thisGlobalStatic.pointer; \
}
-#define Q_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ARGS) \
- Q_GLOBAL_STATIC_INIT(TYPE, NAME); \
- static TYPE *NAME() \
- { \
- if (!this_##NAME.pointer && !this_##NAME.destroyed) { \
- TYPE *x = new TYPE ARGS; \
- if (!this_##NAME.pointer.testAndSetOrdered(0, x)) \
- delete x; \
- else \
- static QGlobalStaticDeleter<TYPE > cleanup(this_##NAME); \
- } \
- return this_##NAME.pointer; \
+#define Q_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ARGS) \
+ static TYPE *NAME() \
+ { \
+ static QGlobalStatic<TYPE > thisGlobalStatic \
+ = { Q_BASIC_ATOMIC_INITIALIZER(0), false }; \
+ if (!thisGlobalStatic.pointer && !thisGlobalStatic.destroyed) { \
+ TYPE *x = new TYPE ARGS; \
+ if (!thisGlobalStatic.pointer.testAndSetOrdered(0, x)) \
+ delete x; \
+ else \
+ static QGlobalStaticDeleter<TYPE > cleanup(thisGlobalStatic); \
+ } \
+ return thisGlobalStatic.pointer; \
}
-#define Q_GLOBAL_STATIC_WITH_INITIALIZER(TYPE, NAME, INITIALIZER) \
- Q_GLOBAL_STATIC_INIT(TYPE, NAME); \
- static TYPE *NAME() \
- { \
- if (!this_##NAME.pointer && !this_##NAME.destroyed) { \
- QScopedPointer<TYPE > x(new TYPE); \
- INITIALIZER; \
- if (this_##NAME.pointer.testAndSetOrdered(0, x.data())) { \
- static QGlobalStaticDeleter<TYPE > cleanup(this_##NAME); \
- x.take(); \
- } \
- } \
- return this_##NAME.pointer; \
+#define Q_GLOBAL_STATIC_WITH_INITIALIZER(TYPE, NAME, INITIALIZER) \
+ static TYPE *NAME() \
+ { \
+ static QGlobalStatic<TYPE > thisGlobalStatic \
+ = { Q_BASIC_ATOMIC_INITIALIZER(0), false }; \
+ if (!thisGlobalStatic.pointer && !thisGlobalStatic.destroyed) { \
+ QScopedPointer<TYPE > x(new TYPE); \
+ INITIALIZER; \
+ if (thisGlobalStatic.pointer.testAndSetOrdered(0, x.data())) { \
+ static QGlobalStaticDeleter<TYPE > cleanup(thisGlobalStatic); \
+ x.take(); \
+ } \
+ } \
+ return thisGlobalStatic.pointer; \
}
#endif
@@ -2461,9 +2504,17 @@ QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathSysconf();
# define QT_SYMBIAN_SUPPORTS_SGIMAGE
#endif
-#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
+#ifdef SYMBIAN_GRAPHICS_SET_SURFACE_TRANSPARENCY_AVAILABLE
# define Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE
#endif
+
+#ifdef SYMBIAN_GRAPHICS_TRANSITION_EFFECTS_SIGNALING_AVAILABLE
+# define Q_SYMBIAN_TRANSITION_EFFECTS
+#endif
+#endif
+
+#ifdef SYMBIAN_WSERV_AND_CONE_MULTIPLE_SCREENS
+#define Q_SYMBIAN_SUPPORTS_MULTIPLE_SCREENS
#endif
//Symbian does not support data imports from a DLL
@@ -2671,10 +2722,6 @@ QT_LICENSED_MODULE(DBus)
# define QT_NO_PROCESS
#endif
-#ifdef Q_OS_NACL
-#include <QtCore/qnaclunimplemented.h>
-#endif
-
#if defined (__ELF__)
# if defined (Q_OS_LINUX) || defined (Q_OS_SOLARIS) || defined (Q_OS_FREEBSD) || defined (Q_OS_OPENBSD) || defined (Q_OS_IRIX)
# define Q_OF_ELF
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index 7a6ab36..f015ed0 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -511,9 +511,16 @@ public:
#if 0 // these values are reserved for Maemo5 - do not re-use them
WA_Maemo5NonComposited = 126,
WA_Maemo5StackedWindow = 127,
- WA_Maemo5PortraitOrientation = 128,
- WA_Maemo5LandscapeOrientation = 129,
- WA_Maemo5AutoOrientation = 130,
+#endif
+
+ WA_LockPortraitOrientation = 128,
+ WA_LockLandscapeOrientation = 129,
+ WA_AutoOrientation = 130,
+
+#if 0 // these values are reserved for Maemo5 - do not re-use them
+ WA_Maemo5PortraitOrientation = WA_LockPortraitOrientation,
+ WA_Maemo5LandscapeOrientation = WA_LockLandscapeOrientation,
+ WA_Maemo5AutoOrientation = WA_AutoOrientation,
WA_Maemo5ShowProgressIndicator = 131,
#endif
@@ -536,7 +543,8 @@ public:
AA_DontUseNativeMenuBar = 6,
AA_MacDontSwapCtrlAndMeta = 7,
AA_S60DontConstructApplicationPanes = 8,
- AA_X11InitThreads = 9,
+ AA_S60DisablePartialScreenInputMode = 9,
+ AA_X11InitThreads = 10,
// Add new attributes before this line
AA_AttributeCount
@@ -570,7 +578,8 @@ public:
PreferDither = 0x00000040,
AvoidDither = 0x00000080,
- NoOpaqueDetection = 0x00000100
+ NoOpaqueDetection = 0x00000100,
+ NoFormatConversion = 0x00000200
};
Q_DECLARE_FLAGS(ImageConversionFlags, ImageConversionFlag)
@@ -1619,6 +1628,7 @@ public:
AccessibleDescriptionRole = 12,
// More general purpose
SizeHintRole = 13,
+ InitialSortOrderRole = 14,
// Internal UiLib roles. Start worrying when public roles go that high.
DisplayPropertyRole = 27,
DecorationPropertyRole = 28,
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 9facad7..bc15514 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -156,11 +156,17 @@
whole lifetime. This attribute must be set before QApplication is
constructed.
+ \omitvalue AA_S60DisablePartialScreenInputMode By default in Symbian^3,
+ a separate editing window is opened on top of an application. This is exactly
+ like editing on previous versions of Symbian behave. When this attribute
+ is true, a virtual keyboard window is shown on top of application and it
+ is ensured that the focused text widget is visible. This is only supported in
+ Symbian^3. (internal)
+
\value AA_X11InitThreads Calls XInitThreads() as part of the QApplication
construction in order to make Xlib calls thread-safe. This
attribute must be set before QApplication is constructed.
-
\omitvalue AA_AttributeCount
*/
@@ -737,6 +743,10 @@
until a non-opaque pixel is found, or if you want the pixmap to
retain an alpha channel for some other reason. If the image has no
alpha channel this flag has no effect.
+
+ \omitvalue NoFormatConversion Don't do any format conversions on the image.
+ Can be useful when converting a QImage to a QPixmap for a one-time
+ rendering operation for example.
*/
/*! \enum Qt::GUIStyle
@@ -1257,6 +1267,13 @@
to this top level window. This attribute has no effect on non-X11
platforms.
+ \value WA_LockPortraitOrientation Locks the widget to a portrait orientation,
+ ignoring changes to the display's orientation with respect to the user.
+ \value WA_LockLandscapeOrientation Locks the widget to a landscape orientation,
+ ignoring changes to the display's orientation with respect to the user.
+ \value WA_AutoOrientation Causes the widget to change orientation whenever the
+ display changes orientation with respect to the user.
+
\value WA_MacNoShadow Since Qt 4.8, this attribute disables drop shadows
for this top level window. Only affects Cocoa builds of Qt for Mac OS X.
@@ -2682,19 +2699,22 @@
Roles describing appearance and meta data (with associated types):
- \value FontRole The font used for items rendered with the default
- delegate. (QFont)
- \value TextAlignmentRole The alignment of the text for items rendered with the
- default delegate. (Qt::AlignmentFlag)
- \value BackgroundRole The background brush used for items rendered with
- the default delegate. (QBrush)
- \value BackgroundColorRole This role is obsolete. Use BackgroundRole instead.
- \value ForegroundRole The foreground brush (text color, typically)
- used for items rendered with the default delegate.
- (QBrush)
- \value TextColorRole This role is obsolete. Use ForegroundRole instead.
- \value CheckStateRole This role is used to obtain the checked state of
- an item. (Qt::CheckState)
+ \value FontRole The font used for items rendered with the default
+ delegate. (QFont)
+ \value TextAlignmentRole The alignment of the text for items rendered with the
+ default delegate. (Qt::AlignmentFlag)
+ \value BackgroundRole The background brush used for items rendered with
+ the default delegate. (QBrush)
+ \value BackgroundColorRole This role is obsolete. Use BackgroundRole instead.
+ \value ForegroundRole The foreground brush (text color, typically)
+ used for items rendered with the default delegate.
+ (QBrush)
+ \value TextColorRole This role is obsolete. Use ForegroundRole instead.
+ \value CheckStateRole This role is used to obtain the checked state of
+ an item. (Qt::CheckState)
+ \value InitialSortOrderRole This role is used to obtain the initial sort order
+ of a header view section. (Qt::SortOrder). This
+ role was introduced in Qt 4.8.
Accessibility roles (with associated types):
diff --git a/src/corelib/io/io.pri b/src/corelib/io/io.pri
index 4d4ae21..2b61192 100644
--- a/src/corelib/io/io.pri
+++ b/src/corelib/io/io.pri
@@ -113,3 +113,7 @@ win32 {
LIBS += -lplatformenv
}
}
+integrity {
+ SOURCES += io/qfsfileengine_unix.cpp \
+ io/qfsfileengine_iterator_unix.cpp
+}
diff --git a/src/corelib/io/qdiriterator.cpp b/src/corelib/io/qdiriterator.cpp
index d293791..c7e56bd 100644
--- a/src/corelib/io/qdiriterator.cpp
+++ b/src/corelib/io/qdiriterator.cpp
@@ -142,7 +142,9 @@ public:
#endif
QDirIteratorPrivateIteratorStack<QAbstractFileEngineIterator> fileEngineIterators;
+#ifndef QT_NO_FILESYSTEMITERATOR
QDirIteratorPrivateIteratorStack<QFileSystemIterator> nativeIterators;
+#endif
QFileInfo currentFileInfo;
QFileInfo nextFileInfo;
@@ -204,9 +206,11 @@ void QDirIteratorPrivate::pushDirectory(const QFileInfo &fileInfo)
// No iterator; no entry list.
}
} else {
+#ifndef QT_NO_FILESYSTEMITERATOR
QFileSystemIterator *it = new QFileSystemIterator(fileInfo.d_ptr->fileEntry,
filters, nameFilters, iteratorFlags);
nativeIterators << it;
+#endif
}
}
@@ -244,6 +248,7 @@ void QDirIteratorPrivate::advance()
delete it;
}
} else {
+#ifndef QT_NO_FILESYSTEMITERATOR
QFileSystemEntry nextEntry;
QFileSystemMetaData nextMetaData;
@@ -260,6 +265,7 @@ void QDirIteratorPrivate::advance()
nativeIterators.pop();
delete it;
}
+#endif
}
currentFileInfo = nextFileInfo;
@@ -500,7 +506,11 @@ bool QDirIterator::hasNext() const
if (d->engine)
return !d->fileEngineIterators.isEmpty();
else
+#ifndef QT_NO_FILESYSTEMITERATOR
return !d->nativeIterators.isEmpty();
+#else
+ return false;
+#endif
}
/*!
diff --git a/src/corelib/io/qfilesystemengine.cpp b/src/corelib/io/qfilesystemengine.cpp
index 07b19fb..00c33bd 100644
--- a/src/corelib/io/qfilesystemengine.cpp
+++ b/src/corelib/io/qfilesystemengine.cpp
@@ -168,7 +168,7 @@ static bool _q_resolveEntryAndCreateLegacyEngine_recursive(QFileSystemEntry &ent
const QStringList &paths = QDir::searchPaths(filePath.left(prefixSeparator));
for (int i = 0; i < paths.count(); i++) {
- entry = QFileSystemEntry(paths.at(i) % QLatin1Char('/') % filePath.mid(prefixSeparator + 1));
+ entry = QFileSystemEntry(QDir::cleanPath(paths.at(i) % QLatin1Char('/') % filePath.mid(prefixSeparator + 1)));
// Recurse!
if (_q_resolveEntryAndCreateLegacyEngine_recursive(entry, data, engine, true))
return true;
diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp
index d705abb..1becea5 100644
--- a/src/corelib/io/qfilesystemengine_unix.cpp
+++ b/src/corelib/io/qfilesystemengine_unix.cpp
@@ -174,8 +174,9 @@ QFileSystemEntry QFileSystemEngine::canonicalName(const QFileSystemEntry &entry,
if (entry.isEmpty() || entry.isRoot())
return entry;
-#ifdef __UCLIBC__
- return QFileSystemEntry::slowCanonicalName(entry);
+#if !defined(Q_OS_MAC) && _POSIX_VERSION < 200809L
+ // realpath(X,0) is not supported
+ return QFileSystemEntry(slowCanonicalized(absoluteName(entry).filePath()));
#else
char *ret = 0;
# if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES)
@@ -533,8 +534,7 @@ bool QFileSystemEngine::copyFile(const QFileSystemEntry &source, const QFileSyst
{
Q_UNUSED(source);
Q_UNUSED(target);
- // # we can implement this using sendfile(2)
- //when this function returns false, block copy is used in QFile which sets the error code.
+ error = QSystemError(ENOSYS, QSystemError::StandardLibraryError); //Function not implemented
return false;
}
@@ -612,10 +612,14 @@ QString QFileSystemEngine::rootPath()
QString QFileSystemEngine::tempPath()
{
+#ifdef QT_UNIX_TEMP_PATH_OVERRIDE
+ return QLatin1String(QT_UNIX_TEMP_PATH_OVERRIDE);
+#else
QString temp = QFile::decodeName(qgetenv("TMPDIR"));
if (temp.isEmpty())
temp = QLatin1String("/tmp/");
return QDir::cleanPath(temp);
+#endif
}
bool QFileSystemEngine::setCurrentPath(const QFileSystemEntry &path)
diff --git a/src/corelib/io/qfilesystemiterator_p.h b/src/corelib/io/qfilesystemiterator_p.h
index 2dc4a9f..fb8bfe6 100644
--- a/src/corelib/io/qfilesystemiterator_p.h
+++ b/src/corelib/io/qfilesystemiterator_p.h
@@ -54,6 +54,9 @@
//
#include <QtCore/qglobal.h>
+
+#ifndef QT_NO_FILESYSTEMITERATOR
+
#include <QtCore/qdir.h>
#include <QtCore/qdiriterator.h>
#include <QtCore/qstringlist.h>
@@ -112,4 +115,6 @@ private:
QT_END_NAMESPACE
+#endif // QT_NO_FILESYSTEMITERATOR
+
#endif // include guard
diff --git a/src/corelib/io/qfilesystemiterator_unix.cpp b/src/corelib/io/qfilesystemiterator_unix.cpp
index 3efdd9e..3d6012b 100644
--- a/src/corelib/io/qfilesystemiterator_unix.cpp
+++ b/src/corelib/io/qfilesystemiterator_unix.cpp
@@ -42,6 +42,8 @@
#include "qplatformdefs.h"
#include "qfilesystemiterator_p.h"
+#ifndef QT_NO_FILESYSTEMITERATOR
+
#include <stdlib.h>
#include <errno.h>
@@ -111,3 +113,5 @@ bool QFileSystemIterator::advance(QFileSystemEntry &fileEntry, QFileSystemMetaDa
}
QT_END_NAMESPACE
+
+#endif // QT_NO_FILESYSTEMITERATOR
diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp
index 62e7c9f..6c03b32 100644
--- a/src/corelib/io/qfsfileengine_unix.cpp
+++ b/src/corelib/io/qfsfileengine_unix.cpp
@@ -1029,7 +1029,11 @@ uchar *QFSFileEnginePrivate::map(qint64 offset, qint64 size, QFile::MemoryMapFla
if (openMode & QIODevice::ReadOnly) access |= PROT_READ;
if (openMode & QIODevice::WriteOnly) access |= PROT_WRITE;
+#if defined(Q_OS_INTEGRITY)
+ int pageSize = sysconf(_SC_PAGESIZE);
+#else
int pageSize = getpagesize();
+#endif
int extra = offset % pageSize;
if (quint64(size + extra) > quint64((size_t)-1)) {
@@ -1079,6 +1083,7 @@ uchar *QFSFileEnginePrivate::map(qint64 offset, qint64 size, QFile::MemoryMapFla
bool QFSFileEnginePrivate::unmap(uchar *ptr)
{
+#if !defined(Q_OS_INTEGRITY)
Q_Q(QFSFileEngine);
if (!maps.contains(ptr)) {
q->setError(QFile::PermissionsError, qt_error_string(EACCES));
@@ -1093,6 +1098,9 @@ bool QFSFileEnginePrivate::unmap(uchar *ptr)
}
maps.remove(ptr);
return true;
+#else
+ return false;
+#endif
}
QT_END_NAMESPACE
diff --git a/src/corelib/io/qnoncontiguousbytedevice.cpp b/src/corelib/io/qnoncontiguousbytedevice.cpp
index 235f671..71cf92d 100644
--- a/src/corelib/io/qnoncontiguousbytedevice.cpp
+++ b/src/corelib/io/qnoncontiguousbytedevice.cpp
@@ -153,6 +153,7 @@ void QNonContiguousByteDevice::disableReset()
resetDisabled = true;
}
+// FIXME we should scrap this whole implementation and instead change the ByteArrayImpl to be able to cope with sub-arrays?
QNonContiguousByteDeviceBufferImpl::QNonContiguousByteDeviceBufferImpl(QBuffer *b) : QNonContiguousByteDevice()
{
buffer = b;
@@ -244,7 +245,7 @@ qint64 QNonContiguousByteDeviceByteArrayImpl::size()
return byteArray->size();
}
-QNonContiguousByteDeviceRingBufferImpl::QNonContiguousByteDeviceRingBufferImpl(QRingBuffer *rb)
+QNonContiguousByteDeviceRingBufferImpl::QNonContiguousByteDeviceRingBufferImpl(QSharedPointer<QRingBuffer> rb)
: QNonContiguousByteDevice(), currentPosition(0)
{
ringBuffer = rb;
@@ -355,6 +356,11 @@ bool QNonContiguousByteDeviceIoDeviceImpl::advanceReadPointer(qint64 amount)
// normal advancement
currentReadBufferPosition += amount;
+ if (size() == -1)
+ emit readProgress(totalAdvancements, totalAdvancements);
+ else
+ emit readProgress(totalAdvancements, size());
+
// advancing over that what has actually been read before
if (currentReadBufferPosition > currentReadBufferAmount) {
qint64 i = currentReadBufferPosition - currentReadBufferAmount;
@@ -370,10 +376,6 @@ bool QNonContiguousByteDeviceIoDeviceImpl::advanceReadPointer(qint64 amount)
currentReadBufferAmount = 0;
}
- if (size() == -1)
- emit readProgress(totalAdvancements, totalAdvancements);
- else
- emit readProgress(totalAdvancements, size());
return true;
}
@@ -505,7 +507,7 @@ QNonContiguousByteDevice* QNonContiguousByteDeviceFactory::create(QIODevice *dev
\internal
*/
-QNonContiguousByteDevice* QNonContiguousByteDeviceFactory::create(QRingBuffer *ringBuffer)
+QNonContiguousByteDevice* QNonContiguousByteDeviceFactory::create(QSharedPointer<QRingBuffer> ringBuffer)
{
return new QNonContiguousByteDeviceRingBufferImpl(ringBuffer);
}
diff --git a/src/corelib/io/qnoncontiguousbytedevice_p.h b/src/corelib/io/qnoncontiguousbytedevice_p.h
index ff946ed..5e0b1bb 100644
--- a/src/corelib/io/qnoncontiguousbytedevice_p.h
+++ b/src/corelib/io/qnoncontiguousbytedevice_p.h
@@ -57,6 +57,7 @@
#include <QtCore/qbytearray.h>
#include <QtCore/qbuffer.h>
#include <QtCore/qiodevice.h>
+#include <QtCore/QSharedPointer>
#include "private/qringbuffer_p.h"
QT_BEGIN_NAMESPACE
@@ -70,6 +71,7 @@ public:
virtual bool atEnd() = 0;
virtual bool reset() = 0;
void disableReset();
+ bool isResetDisabled() { return resetDisabled; }
virtual qint64 size() = 0;
virtual ~QNonContiguousByteDevice();
@@ -89,7 +91,7 @@ class Q_CORE_EXPORT QNonContiguousByteDeviceFactory
public:
static QNonContiguousByteDevice* create(QIODevice *device);
static QNonContiguousByteDevice* create(QByteArray *byteArray);
- static QNonContiguousByteDevice* create(QRingBuffer *ringBuffer);
+ static QNonContiguousByteDevice* create(QSharedPointer<QRingBuffer> ringBuffer);
static QIODevice* wrap(QNonContiguousByteDevice* byteDevice);
};
@@ -114,7 +116,7 @@ protected:
class QNonContiguousByteDeviceRingBufferImpl : public QNonContiguousByteDevice
{
public:
- QNonContiguousByteDeviceRingBufferImpl(QRingBuffer *rb);
+ QNonContiguousByteDeviceRingBufferImpl(QSharedPointer<QRingBuffer> rb);
~QNonContiguousByteDeviceRingBufferImpl();
const char* readPointer(qint64 maximumLength, qint64 &len);
bool advanceReadPointer(qint64 amount);
@@ -122,13 +124,14 @@ public:
bool reset();
qint64 size();
protected:
- QRingBuffer* ringBuffer;
+ QSharedPointer<QRingBuffer> ringBuffer;
qint64 currentPosition;
};
class QNonContiguousByteDeviceIoDeviceImpl : public QNonContiguousByteDevice
{
+ Q_OBJECT
public:
QNonContiguousByteDeviceIoDeviceImpl(QIODevice *d);
~QNonContiguousByteDeviceIoDeviceImpl();
@@ -150,6 +153,7 @@ protected:
class QNonContiguousByteDeviceBufferImpl : public QNonContiguousByteDevice
{
+ Q_OBJECT
public:
QNonContiguousByteDeviceBufferImpl(QBuffer *b);
~QNonContiguousByteDeviceBufferImpl();
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index 1ce1256..e11cef9 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -963,9 +963,6 @@ bool QProcessPrivate::_q_canWrite()
destroyPipe(stdinChannel.pipe);
processError = QProcess::WriteError;
q->setErrorString(QProcess::tr("Error writing to process"));
-#if defined(QPROCESS_DEBUG) && !defined(Q_OS_WINCE)
- qDebug("QProcessPrivate::canWrite(), failed to write (%s)", strerror(errno));
-#endif
emit q->error(processError);
return false;
}
@@ -974,11 +971,13 @@ bool QProcessPrivate::_q_canWrite()
qDebug("QProcessPrivate::canWrite(), wrote %d bytes to the process input", int(written));
#endif
- writeBuffer.free(written);
- if (!emittedBytesWritten) {
- emittedBytesWritten = true;
- emit q->bytesWritten(written);
- emittedBytesWritten = false;
+ if (written != 0) {
+ writeBuffer.free(written);
+ if (!emittedBytesWritten) {
+ emittedBytesWritten = true;
+ emit q->bytesWritten(written);
+ emittedBytesWritten = false;
+ }
}
if (stdinChannel.notifier && !writeBuffer.isEmpty())
stdinChannel.notifier->setEnabled(true);
@@ -2233,10 +2232,10 @@ bool QProcess::startDetached(const QString &program)
}
QT_BEGIN_INCLUDE_NAMESPACE
-#ifdef Q_OS_MAC
+#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES)
# include <crt_externs.h>
# define environ (*_NSGetEnviron())
-#elif defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
+#elif defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN) || (defined(Q_OS_MAC) && defined(QT_NO_CORESERVICES))
static char *qt_empty_environ[] = { 0 };
#define environ qt_empty_environ
#elif !defined(Q_OS_WIN)
diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp
index 9ead21f..ba61bda 100644
--- a/src/corelib/io/qprocess_unix.cpp
+++ b/src/corelib/io/qprocess_unix.cpp
@@ -95,7 +95,7 @@ QT_END_NAMESPACE
#include <qfile.h>
#include <qfileinfo.h>
#include <qlist.h>
-#include <qmap.h>
+#include <qhash.h>
#include <qmutex.h>
#include <qsemaphore.h>
#include <qsocketnotifier.h>
@@ -163,33 +163,23 @@ public:
private:
QMutex mutex;
- QMap<int, QProcessInfo *> children;
+ QHash<int, QProcessInfo *> children;
};
Q_GLOBAL_STATIC(QMutex, processManagerGlobalMutex)
-static QProcessManager *processManagerInstance = 0;
-
-static QProcessManager *processManager()
-{
+static QProcessManager *processManager() {
// The constructor of QProcessManager should be called only once
// so we cannot use Q_GLOBAL_STATIC directly for QProcessManager
QMutex *mutex = processManagerGlobalMutex();
QMutexLocker locker(mutex);
-
- if (!processManagerInstance)
- QProcessPrivate::initializeProcessManager();
-
- Q_ASSERT(processManagerInstance);
- return processManagerInstance;
+ static QProcessManager processManager;
+ return &processManager;
}
QProcessManager::QProcessManager()
{
- // can only be called from main thread
- Q_ASSERT(!qApp || qApp->thread() == QThread::currentThread());
-
#if defined (QPROCESS_DEBUG)
qDebug() << "QProcessManager::QProcessManager()";
#endif
@@ -208,8 +198,6 @@ QProcessManager::QProcessManager()
::sigaction(SIGCHLD, &action, &oldAction);
if (oldAction.sa_handler != qt_sa_sigchld_handler)
qt_sa_old_sigchld_handler = oldAction.sa_handler;
-
- processManagerInstance = this;
}
QProcessManager::~QProcessManager()
@@ -238,8 +226,6 @@ QProcessManager::~QProcessManager()
if (oldAction.sa_handler != qt_sa_sigchld_handler) {
::sigaction(SIGCHLD, &oldAction, 0);
}
-
- processManagerInstance = 0;
}
void QProcessManager::run()
@@ -281,7 +267,7 @@ void QProcessManager::catchDeadChildren()
// try to catch all children whose pid we have registered, and whose
// deathPipe is still valid (i.e, we have not already notified it).
- QMap<int, QProcessInfo *>::Iterator it = children.begin();
+ QHash<int, QProcessInfo *>::Iterator it = children.begin();
while (it != children.end()) {
// notify all children that they may have died. they need to run
// waitpid() in their own thread.
@@ -320,15 +306,11 @@ void QProcessManager::remove(QProcess *process)
QMutexLocker locker(&mutex);
int serial = process->d_func()->serial;
- QProcessInfo *info = children.value(serial);
- if (!info)
- return;
-
+ QProcessInfo *info = children.take(serial);
#if defined (QPROCESS_DEBUG)
- qDebug() << "QProcessManager::remove() removing pid" << info->pid << "process" << info->process;
+ if (info)
+ qDebug() << "QProcessManager::remove() removing pid" << info->pid << "process" << info->process;
#endif
-
- children.remove(serial);
delete info;
}
@@ -663,7 +645,7 @@ void QProcessPrivate::startProcess()
if (childPid < 0) {
// Cleanup, report error and return
#if defined (QPROCESS_DEBUG)
- qDebug("qt_fork failed: %s", qt_error_string(lastForkErrno));
+ qDebug("qt_fork failed: %s", qPrintable(qt_error_string(lastForkErrno)));
#endif
processManager()->unlock();
q->setProcessState(QProcess::NotRunning);
@@ -866,7 +848,14 @@ qint64 QProcessPrivate::writeToStdin(const char *data, qint64 maxlen)
#if defined QPROCESS_DEBUG
qDebug("QProcessPrivate::writeToStdin(%p \"%s\", %lld) == %lld",
data, qt_prettyDebug(data, maxlen, 16).constData(), maxlen, written);
+ if (written == -1)
+ qDebug("QProcessPrivate::writeToStdin(), failed to write (%s)", qPrintable(qt_error_string(errno)));
#endif
+ // If the O_NONBLOCK flag is set and If some data can be written without blocking
+ // the process, write() will transfer what it can and return the number of bytes written.
+ // Otherwise, it will return -1 and set errno to EAGAIN
+ if (written == -1 && errno == EAGAIN)
+ written = 0;
return written;
}
@@ -1303,15 +1292,7 @@ bool QProcessPrivate::startDetached(const QString &program, const QStringList &a
void QProcessPrivate::initializeProcessManager()
{
- if (qApp && qApp->thread() != QThread::currentThread()) {
- // The process manager must be initialized in the main thread
- // Note: The call below will re-enter this function, but in the right thread,
- // so the else statement below will be executed.
- QMetaObject::invokeMethod(qApp, "_q_initializeProcessManager", Qt::BlockingQueuedConnection);
- } else {
- static QProcessManager processManager;
- Q_UNUSED(processManager);
- }
+ (void) processManager();
}
QT_END_NAMESPACE
diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp
index 2a9d8ee..0435256 100644
--- a/src/corelib/io/qresource.cpp
+++ b/src/corelib/io/qresource.cpp
@@ -928,7 +928,7 @@ public:
}
};
-#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) && ! defined (Q_OS_NACL)
+#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) && !defined (Q_OS_NACL) && !defined(Q_OS_INTEGRITY)
#define QT_USE_MMAP
#endif
diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp
index 92f7636..b084ca5 100644
--- a/src/corelib/io/qsettings.cpp
+++ b/src/corelib/io/qsettings.cpp
@@ -1004,7 +1004,7 @@ void QConfFileSettingsPrivate::initFormat()
readFunc = 0;
writeFunc = 0;
#if defined(Q_OS_MAC)
- caseSensitivity = (format == QSettings::NativeFormat) ? Qt::CaseSensitive : Qt::CaseInsensitive;
+ caseSensitivity = (format == QSettings::NativeFormat) ? Qt::CaseSensitive : IniCaseSensitivity;
#else
caseSensitivity = IniCaseSensitivity;
#endif
diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp
index b630502..a5837cb 100644
--- a/src/corelib/io/qtextstream.cpp
+++ b/src/corelib/io/qtextstream.cpp
@@ -1264,6 +1264,7 @@ qint64 QTextStream::pos() const
return qint64(-1);
}
thatd->readBufferOffset = oldReadBufferOffset;
+ thatd->readConverterSavedStateOffset = 0;
// Return the device position.
return d->device->pos();
diff --git a/src/corelib/kernel/kernel.pri b/src/corelib/kernel/kernel.pri
index 93818d1..a3628b1 100644
--- a/src/corelib/kernel/kernel.pri
+++ b/src/corelib/kernel/kernel.pri
@@ -90,6 +90,13 @@ mac:!nacl {
kernel/qcore_mac.cpp
}
+nacl {
+ SOURCES += \
+ kernel/qfunctions_nacl.cpp
+ HEADERS += \
+ kernel/qfunctions_nacl.h
+}
+
unix:!symbian {
SOURCES += \
kernel/qcore_unix.cpp \
@@ -139,3 +146,19 @@ vxworks {
kernel/qfunctions_vxworks.h
}
+
+integrity {
+ SOURCES += \
+ kernel/qcore_unix.cpp \
+ kernel/qcrashhandler.cpp \
+ kernel/qsharedmemory_unix.cpp \
+ kernel/qsystemsemaphore_unix.cpp \
+ kernel/qeventdispatcher_unix.cpp
+ HEADERS += \
+ kernel/qcore_unix_p.h \
+ kernel/qcrashhandler_p.h \
+ kernel/qeventdispatcher_unix_p.h
+
+ contains(QT_CONFIG, clock-gettime):include($$QT_SOURCE_TREE/config.tests/unix/clock-gettime/clock-gettime.pri)
+}
+
diff --git a/src/corelib/kernel/qcore_symbian_p.h b/src/corelib/kernel/qcore_symbian_p.h
index 3ef71e0..5b48689 100644
--- a/src/corelib/kernel/qcore_symbian_p.h
+++ b/src/corelib/kernel/qcore_symbian_p.h
@@ -158,6 +158,22 @@ Q_CORE_EXPORT RFs& qt_s60GetRFs();
// Defined in qlocale_symbian.cpp.
Q_CORE_EXPORT QByteArray qt_symbianLocaleName(int code);
+template <typename R>
+struct QScopedPointerRCloser
+{
+ static inline void cleanup(R *rPointer)
+ {
+ // Enforce a complete type.
+ // If you get a compile error here, read the section on forward declared
+ // classes in the QScopedPointer documentation.
+ typedef char IsIncompleteType[ sizeof(R) ? 1 : -1 ];
+ (void) sizeof(IsIncompleteType);
+
+ if (rPointer)
+ rPointer->Close();
+ }
+};
+
QT_END_NAMESPACE
QT_END_HEADER
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 5b371c4..be86c58 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -72,6 +72,7 @@
# include "qeventdispatcher_symbian_p.h"
# include "private/qcore_symbian_p.h"
# include "private/qfilesystemengine_p.h"
+# include <apacmdln.h>
#elif defined(Q_OS_UNIX)
# if !defined(QT_NO_GLIB)
# include "qeventdispatcher_glib_p.h"
@@ -116,7 +117,58 @@ private:
#ifdef Q_OS_SYMBIAN
typedef TDriveNumber (*SystemDriveFunc)(RFs&);
-static SystemDriveFunc PtrGetSystemDrive=0;
+static SystemDriveFunc PtrGetSystemDrive = 0;
+static CApaCommandLine* apaCommandLine = 0;
+static char *apaTail = 0;
+static QVector<char *> *apaArgv = 0;
+
+static void qt_cleanup_apa_cmd_line()
+{
+ delete apaCommandLine;
+ apaCommandLine = 0;
+ delete apaArgv;
+ apaArgv = 0;
+ delete apaTail;
+ apaTail = 0;
+}
+
+static inline void qt_init_symbian_apa_arguments(int &argc, char **&argv)
+{
+ // If app is launched via CApaCommandLine::StartApp(), normal arguments only contain
+ // application name.
+ if (argc == 1) {
+ CApaCommandLine* commandLine = QCoreApplicationPrivate::symbianCommandLine();
+ if(commandLine) {
+ TPtrC8 apaCmdLine = commandLine->TailEnd();
+ int tailLen = apaCmdLine.Length();
+ if (tailLen) {
+ apaTail = reinterpret_cast<char *>(qMalloc(tailLen + 1));
+ qMemCopy(apaTail, reinterpret_cast<const char *>(apaCmdLine.Ptr()), tailLen);
+ apaTail[tailLen] = '\0';
+ apaArgv = new QVector<char *>(8);
+ // Reuse windows command line parsing
+ *apaArgv = qWinCmdLine<char>(apaTail, tailLen, argc);
+ apaArgv->insert(0, argv[0]);
+ argc++;
+ argv = apaArgv->data();
+ }
+ }
+ }
+}
+
+CApaCommandLine* QCoreApplicationPrivate::symbianCommandLine()
+{
+ // Getting of Apa command line needs to be static as it can only be called successfully
+ // once per process.
+ if (!apaCommandLine) {
+ TInt err = CApaCommandLine::GetCommandLineFromProcessEnvironment(apaCommandLine);
+ if (err == KErrNone) {
+ qAddPostRoutine(qt_cleanup_apa_cmd_line);
+ }
+ }
+ return apaCommandLine;
+}
+
#endif
#if defined(Q_WS_WIN) || defined(Q_WS_MAC)
@@ -284,6 +336,10 @@ QCoreApplicationPrivate::QCoreApplicationPrivate(int &aargc, char **aargv, uint
}
QCoreApplicationPrivate::is_app_closing = false;
+#ifdef Q_OS_SYMBIAN
+ qt_init_symbian_apa_arguments(argc, argv);
+#endif
+
#ifdef Q_OS_UNIX
qt_application_thread_id = QThread::currentThreadId();
#endif
@@ -336,16 +392,6 @@ void QCoreApplicationPrivate::createEventDispatcher()
#endif
}
-void QCoreApplicationPrivate::_q_initializeProcessManager()
-{
-#ifndef QT_NO_PROCESS
-# ifdef Q_OS_UNIX
- QProcessPrivate::initializeProcessManager();
-# endif
-#endif
-}
-
-
QThread *QCoreApplicationPrivate::theMainThread = 0;
QThread *QCoreApplicationPrivate::mainThread()
{
@@ -426,10 +472,10 @@ QString qAppName()
operations can call processEvents() to keep the application
responsive.
- In general, we recommend that you create a QCoreApplication or
- a QApplication object in your \c main() function as early as
- possible. exit() will not return until the event loop exits;
- e.g., when quit() is called.
+ In general, we recommend that you create a QCoreApplication or a
+ QApplication object in your \c main() function as early as
+ possible. exec() will not return until the event loop exits; e.g.,
+ when quit() is called.
Several static convenience functions are also provided. The
QCoreApplication object is available from instance(). Events can
@@ -610,6 +656,12 @@ void QCoreApplication::init()
}
#endif
+#if defined(Q_OS_UNIX) && !(defined(QT_NO_PROCESS))
+ // Make sure the process manager thread object is created in the main
+ // thread.
+ QProcessPrivate::initializeProcessManager();
+#endif
+
#ifdef QT_EVAL
extern void qt_core_eval_init(uint);
qt_core_eval_init(d->application_type);
@@ -2091,6 +2143,12 @@ char **QCoreApplication::argv()
As a result of this, the string given by arguments().at(0) might not be
the program name on Windows, depending on how the application was started.
+ For Symbian applications started with \c RApaLsSession::StartApp one can specify
+ arguments using \c CApaCommandLine::SetTailEndL function. Such arguments are only
+ available via this method; they will not be passed to \c main function. Also note
+ that only 8-bit string data set with \c CApaCommandLine::SetTailEndL is supported
+ by this function.
+
\sa applicationFilePath()
*/
@@ -2670,5 +2728,3 @@ int QCoreApplication::loopLevel()
*/
QT_END_NAMESPACE
-
-#include "moc_qcoreapplication.cpp"
diff --git a/src/corelib/kernel/qcoreapplication.h b/src/corelib/kernel/qcoreapplication.h
index 024c509..3957158 100644
--- a/src/corelib/kernel/qcoreapplication.h
+++ b/src/corelib/kernel/qcoreapplication.h
@@ -205,7 +205,6 @@ protected:
QCoreApplication(QCoreApplicationPrivate &p);
private:
- Q_PRIVATE_SLOT(d_func(), void _q_initializeProcessManager())
static bool sendSpontaneousEvent(QObject *receiver, QEvent *event);
bool notifyInternal(QObject *receiver, QEvent *event);
diff --git a/src/corelib/kernel/qcoreapplication_p.h b/src/corelib/kernel/qcoreapplication_p.h
index 3115960..add2a35 100644
--- a/src/corelib/kernel/qcoreapplication_p.h
+++ b/src/corelib/kernel/qcoreapplication_p.h
@@ -65,8 +65,11 @@ QT_BEGIN_NAMESPACE
typedef QList<QTranslator*> QTranslatorList;
-#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_SYSTEMLOCALE)
+#if defined(Q_OS_SYMBIAN)
+# if !defined(QT_NO_SYSTEMLOCALE)
class QEnvironmentChangeNotifier;
+# endif
+class CApaCommandLine;
#endif
class QAbstractEventDispatcher;
@@ -82,8 +85,6 @@ public:
bool sendThroughObjectEventFilters(QObject *, QEvent *);
bool notify_helper(QObject *, QEvent *);
- void _q_initializeProcessManager();
-
virtual QString appName() const;
virtual void createEventDispatcher();
static void removePostedEvent(QEvent *);
@@ -118,9 +119,12 @@ public:
bool aboutToQuitEmitted;
QString cachedApplicationDirPath;
QString cachedApplicationFilePath;
-#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_SYSTEMLOCALE)
+#if defined(Q_OS_SYMBIAN)
+# if !defined(QT_NO_SYSTEMLOCALE)
QScopedPointer<QEnvironmentChangeNotifier> environmentChangeNotifier;
void symbianInit();
+# endif
+ static CApaCommandLine* symbianCommandLine();
#endif
static bool isTranslatorInstalled(QTranslator *translator);
diff --git a/src/corelib/kernel/qcorecmdlineargs_p.h b/src/corelib/kernel/qcorecmdlineargs_p.h
index fd1d202..cdde782 100644
--- a/src/corelib/kernel/qcorecmdlineargs_p.h
+++ b/src/corelib/kernel/qcorecmdlineargs_p.h
@@ -58,11 +58,13 @@
QT_BEGIN_NAMESPACE
-#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
QT_BEGIN_INCLUDE_NAMESPACE
#include "QtCore/qvector.h"
-#include "qt_windows.h"
+#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
+# include "qt_windows.h"
+#endif
QT_END_INCLUDE_NAMESPACE
// template implementation of the parsing algorithm
@@ -130,6 +132,7 @@ static QVector<Char*> qWinCmdLine(Char *cmdParam, int length, int &argc)
return argv;
}
+#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
static inline QStringList qWinCmdArgs(QString cmdLine) // not const-ref: this might be modified
{
QStringList args;
@@ -150,8 +153,8 @@ static inline QStringList qCmdLineArgs(int argc, char *argv[])
QString cmdLine = QString::fromWCharArray(GetCommandLine());
return qWinCmdArgs(cmdLine);
}
-
-#else // !Q_OS_WIN
+#endif
+#else // !Q_OS_WIN || !Q_OS_SYMBIAN
static inline QStringList qCmdLineArgs(int argc, char *argv[])
{
@@ -161,7 +164,7 @@ static inline QStringList qCmdLineArgs(int argc, char *argv[])
return args;
}
-#endif // Q_OS_WIN
+#endif // Q_OS_WIN || Q_OS_SYMBIAN
QT_END_NAMESPACE
diff --git a/src/corelib/kernel/qcrashhandler.cpp b/src/corelib/kernel/qcrashhandler.cpp
index 59f3796..fbdbac0 100644
--- a/src/corelib/kernel/qcrashhandler.cpp
+++ b/src/corelib/kernel/qcrashhandler.cpp
@@ -339,6 +339,9 @@ static void print_backtrace(FILE *outb)
"EOF\n",
globalProgName, (int)getpid()))
return;
+#elif defined(Q_OS_INTEGRITY)
+ /* abort */
+ CheckSuccess(Failure);
#else /* All other platforms */
/*
* TODO: SCO/UnixWare 7 must be something like (not tested)
diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp
index a5c7a0f..53796be 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian.cpp
+++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp
@@ -217,13 +217,13 @@ QTimerActiveObject::QTimerActiveObject(QEventDispatcherSymbian *dispatcher, Symb
QTimerActiveObject::~QTimerActiveObject()
{
Cancel();
+ m_rTimer.Close(); //close of null handle is safe
}
void QTimerActiveObject::DoCancel()
{
if (m_timerInfo->interval > 0) {
m_rTimer.Cancel();
- m_rTimer.Close();
} else {
if (iStatus.Int() == KRequestPending) {
TRequestStatus *status = &iStatus;
@@ -302,7 +302,9 @@ void QTimerActiveObject::Start()
CActiveScheduler::Add(this);
m_timerInfo->msLeft = m_timerInfo->interval;
if (m_timerInfo->interval > 0) {
- m_rTimer.CreateLocal();
+ if (!m_rTimer.Handle()) {
+ qt_symbian_throwIfError(m_rTimer.CreateLocal());
+ }
StartTimer();
} else {
iStatus = KRequestPending;
@@ -655,7 +657,7 @@ public:
: m_state(STATE_RUN), m_stop(false)
{
qt_symbian_throwIfError(m_lock.CreateLocal(0));
- TInt err = m_idleDetectorThread.Create(KNullDesC(), &idleDetectorThreadFunc, 1024, NULL, this);
+ TInt err = m_idleDetectorThread.Create(KNullDesC(), &idleDetectorThreadFunc, 1024, &User::Allocator(), this);
if (err != KErrNone)
m_lock.Close();
qt_symbian_throwIfError(err);
@@ -690,6 +692,7 @@ public:
private:
static TInt idleDetectorThreadFunc(TAny* self)
{
+ User::RenameThread(_L("IdleDetectorThread"));
static_cast<QIdleDetectorThread*>(self)->IdleLoop();
return KErrNone;
}
@@ -807,7 +810,7 @@ bool QEventDispatcherSymbian::processEvents ( QEventLoop::ProcessEventsFlags fla
m_interrupt = false;
#ifdef QT_SYMBIAN_PRIORITY_DROP
- QTime eventTimer;
+ QElapsedTimer eventTimer;
#endif
while (1) {
diff --git a/src/corelib/kernel/qeventdispatcher_symbian_p.h b/src/corelib/kernel/qeventdispatcher_symbian_p.h
index b785aea..bdb6dce 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian_p.h
+++ b/src/corelib/kernel/qeventdispatcher_symbian_p.h
@@ -63,6 +63,7 @@
#include <qwaitcondition.h>
#include <qsocketnotifier.h>
#include <qdatetime.h>
+#include <qelapsedtimer.h>
#include <e32base.h>
@@ -284,7 +285,7 @@ private:
int m_delay;
int m_avgEventTime;
- QTime m_lastIdleRequestTimer;
+ QElapsedTimer m_lastIdleRequestTimer;
};
#ifdef QT_DEBUG
diff --git a/src/corelib/kernel/qeventdispatcher_unix.cpp b/src/corelib/kernel/qeventdispatcher_unix.cpp
index 46604b0..dceb51d 100644
--- a/src/corelib/kernel/qeventdispatcher_unix.cpp
+++ b/src/corelib/kernel/qeventdispatcher_unix.cpp
@@ -116,7 +116,7 @@ QEventDispatcherUNIXPrivate::QEventDispatcherUNIXPrivate()
// do nothing.
#elif defined(Q_OS_INTEGRITY)
// INTEGRITY doesn't like a "select" on pipes, so use socketpair instead
- if (socketpair(AF_INET, SOCK_STREAM, PF_INET, thread_pipe) == -1) {
+ if (socketpair(AF_INET, SOCK_STREAM, 0, thread_pipe) == -1) {
perror("QEventDispatcherUNIXPrivate(): Unable to create socket pair");
pipefail = true;
} else {
@@ -343,7 +343,7 @@ timeval QTimerInfoList::updateCurrentTime()
return (currentTime = qt_gettime());
}
-#if ((_POSIX_MONOTONIC_CLOCK-0 <= 0) && !defined(Q_OS_MAC)) || defined(QT_BOOTSTRAPPED)
+#if ((_POSIX_MONOTONIC_CLOCK-0 <= 0) && !defined(Q_OS_MAC) && !defined(Q_OS_INTEGRITY)) || defined(QT_BOOTSTRAPPED)
template <>
timeval qAbs(const timeval &t)
@@ -509,7 +509,6 @@ bool QTimerInfoList::unregisterTimer(int timerId)
}
}
// id not found
- qWarning("Application asked to unregister timer 0x%x which is not registered in this thread. Fix application.", timerId);
return false;
}
diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp
index 3d8352e..6badb6a 100644
--- a/src/corelib/kernel/qeventdispatcher_win.cpp
+++ b/src/corelib/kernel/qeventdispatcher_win.cpp
@@ -532,10 +532,7 @@ LRESULT QT_WIN_CALLBACK qt_GetMessageHook(int code, WPARAM wp, LPARAM lp)
PostMessage(d->internalHwnd, WM_QT_SENDPOSTEDEVENTS, 0, 0);
}
} else if (d->sendPostedEventsWindowsTimerId == 0
- && localSerialNumber != d->lastSerialNumber
- // if this message IS the one that triggers sendPostedEvents(), no need to post it again
- && (msg->hwnd != d->internalHwnd
- || msg->message != WM_QT_SENDPOSTEDEVENTS)) {
+ && localSerialNumber != d->lastSerialNumber) {
// start a special timer to continue delivering posted events while
// there are still input and timer messages in the message queue
d->sendPostedEventsWindowsTimerId = SetTimer(d->internalHwnd,
diff --git a/src/corelib/kernel/qeventloop.cpp b/src/corelib/kernel/qeventloop.cpp
index e78f86a..d213b0e 100644
--- a/src/corelib/kernel/qeventloop.cpp
+++ b/src/corelib/kernel/qeventloop.cpp
@@ -175,6 +175,8 @@ bool QEventLoop::processEvents(ProcessEventsFlags flags)
int QEventLoop::exec(ProcessEventsFlags flags)
{
Q_D(QEventLoop);
+ //we need to protect from race condition with QThread::exit
+ QMutexLocker locker(&static_cast<QThreadPrivate *>(QObjectPrivate::get(d->threadData->thread))->mutex);
if (d->threadData->quitNow)
return -1;
@@ -186,6 +188,7 @@ int QEventLoop::exec(ProcessEventsFlags flags)
d->exit = false;
++d->threadData->loopLevel;
d->threadData->eventLoops.push(this);
+ locker.unlock();
// remove posted quit events when entering a new event loop
QCoreApplication *app = QCoreApplication::instance();
@@ -205,6 +208,7 @@ int QEventLoop::exec(ProcessEventsFlags flags)
"reimplement QApplication::notify() and catch all exceptions there.\n");
// copied from below
+ locker.relock();
QEventLoop *eventLoop = d->threadData->eventLoops.pop();
Q_ASSERT_X(eventLoop == this, "QEventLoop::exec()", "internal error");
Q_UNUSED(eventLoop); // --release warning
@@ -216,6 +220,7 @@ int QEventLoop::exec(ProcessEventsFlags flags)
#endif
// copied above
+ locker.relock();
QEventLoop *eventLoop = d->threadData->eventLoops.pop();
Q_ASSERT_X(eventLoop == this, "QEventLoop::exec()", "internal error");
Q_UNUSED(eventLoop); // --release warning
diff --git a/src/corelib/global/qnaclunimplemented.cpp b/src/corelib/kernel/qfunctions_nacl.cpp
index 5116d80..f3d85ef 100644
--- a/src/corelib/global/qnaclunimplemented.cpp
+++ b/src/corelib/kernel/qfunctions_nacl.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include "qnaclunimplemented.h"
+#include "qfunctions_nacl.h"
#include <pthread.h>
#include <qglobal.h>
diff --git a/src/corelib/global/qnaclunimplemented.h b/src/corelib/kernel/qfunctions_nacl.h
index 09c6c49..db36ad5 100644
--- a/src/corelib/global/qnaclunimplemented.h
+++ b/src/corelib/kernel/qfunctions_nacl.h
@@ -44,6 +44,8 @@
#ifdef Q_OS_NACL
+#include <sys/types.h>
+
// pthread
#include <pthread.h>
#define PTHREAD_CANCEL_DISABLE 1
diff --git a/src/corelib/kernel/qfunctions_p.h b/src/corelib/kernel/qfunctions_p.h
index 3d41c0c..d27fec3 100644
--- a/src/corelib/kernel/qfunctions_p.h
+++ b/src/corelib/kernel/qfunctions_p.h
@@ -59,6 +59,8 @@
# include "QtCore/qfunctions_wince.h"
#elif defined(Q_OS_VXWORKS)
# include "QtCore/qfunctions_vxworks.h"
+#elif defined(Q_OS_NACL)
+# include "QtCore/qfunctions_nacl.h"
#endif
#ifdef Q_CC_RVCT
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp
index 7928f4f..c5775f6 100644
--- a/src/corelib/kernel/qmetaobject.cpp
+++ b/src/corelib/kernel/qmetaobject.cpp
@@ -1387,6 +1387,25 @@ int QMetaMethod::methodIndex() const
}
/*!
+ \internal
+
+ Returns the method revision if one was
+ specified by Q_REVISION, otherwise returns 0.
+ */
+int QMetaMethod::revision() const
+{
+ if (!mobj)
+ return 0;
+ if ((QMetaMethod::Access)(mobj->d.data[handle + 4] & MethodRevisioned)) {
+ int offset = priv(mobj->d.data)->methodData
+ + priv(mobj->d.data)->methodCount * 5
+ + (handle - priv(mobj->d.data)->methodData) / 5;
+ return mobj->d.data[offset];
+ }
+ return 0;
+}
+
+/*!
Returns the access specification of this method (private,
protected, or public).
@@ -2394,6 +2413,35 @@ int QMetaProperty::notifySignalIndex() const
}
/*!
+ \internal
+
+ Returns the property revision if one was
+ specified by REVISION, otherwise returns 0.
+ */
+int QMetaProperty::revision() const
+{
+ if (!mobj)
+ return 0;
+ int flags = mobj->d.data[handle + 2];
+ if (flags & Revisioned) {
+ int offset = priv(mobj->d.data)->propertyData +
+ priv(mobj->d.data)->propertyCount * 3 + idx;
+ // Revision data is placed after NOTIFY data, if present.
+ // Iterate through properties to discover whether we have NOTIFY signals.
+ for (int i = 0; i < priv(mobj->d.data)->propertyCount; ++i) {
+ int handle = priv(mobj->d.data)->propertyData + 3*i;
+ if (mobj->d.data[handle + 2] & Notify) {
+ offset += priv(mobj->d.data)->propertyCount;
+ break;
+ }
+ }
+ return mobj->d.data[offset];
+ } else {
+ return 0;
+ }
+}
+
+/*!
Returns true if this property is writable; otherwise returns
false.
diff --git a/src/corelib/kernel/qmetaobject.h b/src/corelib/kernel/qmetaobject.h
index 4fb353d..e9bba45 100644
--- a/src/corelib/kernel/qmetaobject.h
+++ b/src/corelib/kernel/qmetaobject.h
@@ -70,6 +70,7 @@ public:
enum Attributes { Compatibility = 0x1, Cloned = 0x2, Scriptable = 0x4 };
int attributes() const;
int methodIndex() const;
+ int revision() const;
inline const QMetaObject *enclosingMetaObject() const { return mobj; }
@@ -202,6 +203,8 @@ public:
QMetaMethod notifySignal() const;
int notifySignalIndex() const;
+ int revision() const;
+
QVariant read(const QObject *obj) const;
bool write(QObject *obj, const QVariant &value) const;
bool reset(QObject *obj) const;
diff --git a/src/corelib/kernel/qmetaobject_p.h b/src/corelib/kernel/qmetaobject_p.h
index dd0baf0..210b32c 100644
--- a/src/corelib/kernel/qmetaobject_p.h
+++ b/src/corelib/kernel/qmetaobject_p.h
@@ -78,7 +78,8 @@ enum PropertyFlags {
ResolveEditable = 0x00080000,
User = 0x00100000,
ResolveUser = 0x00200000,
- Notify = 0x00400000
+ Notify = 0x00400000,
+ Revisioned = 0x00800000
};
enum MethodFlags {
@@ -95,7 +96,8 @@ enum MethodFlags {
MethodCompatibility = 0x10,
MethodCloned = 0x20,
- MethodScriptable = 0x40
+ MethodScriptable = 0x40,
+ MethodRevisioned = 0x80
};
enum MetaObjectFlags {
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h
index 47d3a3b..a2bb7d1 100644
--- a/src/corelib/kernel/qmetatype.h
+++ b/src/corelib/kernel/qmetatype.h
@@ -138,7 +138,7 @@ template <typename T>
void *qMetaTypeConstructHelper(const T *t)
{
if (!t)
- return new T;
+ return new T();
return new T(*static_cast<const T*>(t));
}
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 2e9d003..c6153cb 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -161,6 +161,17 @@ QObjectPrivate::QObjectPrivate(int version)
QObjectPrivate::~QObjectPrivate()
{
+ if (pendTimer) {
+ // unregister pending timers
+ if (threadData->eventDispatcher)
+ threadData->eventDispatcher->unregisterTimers(q_ptr);
+ }
+
+ if (postedEvents)
+ QCoreApplication::removePostedEvents(q_ptr, 0);
+
+ threadData->deref();
+
delete static_cast<QAbstractDynamicMetaObject*>(metaObject);
#ifdef QT_JAMBI_BUILD
if (deleteWatch)
@@ -911,25 +922,14 @@ QObject::~QObject()
}
}
- if (d->pendTimer) {
- // unregister pending timers
- if (d->threadData->eventDispatcher)
- d->threadData->eventDispatcher->unregisterTimers(this);
- }
-
if (!d->children.isEmpty())
d->deleteChildren();
qt_removeObject(this);
- if (d->postedEvents)
- QCoreApplication::removePostedEvents(this, 0);
-
if (d->parent) // remove it from parent object
d->setParent_helper(0);
- d->threadData->deref();
-
#ifdef QT_JAMBI_BUILD
if (d->inEventHandler) {
qWarning("QObject: Do not delete object, '%s', during its event handler!",
diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h
index 5a7ee2f..0ad73f5 100644
--- a/src/corelib/kernel/qobject.h
+++ b/src/corelib/kernel/qobject.h
@@ -370,18 +370,18 @@ template <class T>
inline T qobject_cast(QObject *object)
{
#if !defined(QT_NO_QOBJECT_CHECK)
- reinterpret_cast<T>(0)->qt_check_for_QOBJECT_macro(*reinterpret_cast<T>(object));
+ reinterpret_cast<T>(object)->qt_check_for_QOBJECT_macro(*reinterpret_cast<T>(object));
#endif
- return static_cast<T>(reinterpret_cast<T>(0)->staticMetaObject.cast(object));
+ return static_cast<T>(reinterpret_cast<T>(object)->staticMetaObject.cast(object));
}
template <class T>
inline T qobject_cast(const QObject *object)
{
#if !defined(QT_NO_QOBJECT_CHECK)
- reinterpret_cast<T>(0)->qt_check_for_QOBJECT_macro(*reinterpret_cast<T>(const_cast<QObject *>(object)));
+ reinterpret_cast<T>(object)->qt_check_for_QOBJECT_macro(*reinterpret_cast<T>(const_cast<QObject *>(object)));
#endif
- return static_cast<T>(reinterpret_cast<T>(0)->staticMetaObject.cast(object));
+ return static_cast<T>(reinterpret_cast<T>(object)->staticMetaObject.cast(object));
}
diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h
index 94e6241..54b5ab2 100644
--- a/src/corelib/kernel/qobjectdefs.h
+++ b/src/corelib/kernel/qobjectdefs.h
@@ -79,6 +79,7 @@ class QString;
#define Q_INTERFACES(x)
#define Q_PROPERTY(text)
#define Q_PRIVATE_PROPERTY(d, text)
+#define Q_REVISION(v)
#define Q_OVERRIDE(text)
#define Q_ENUMS(x)
#define Q_FLAGS(x)
@@ -180,6 +181,7 @@ private:
#define Q_INTERFACES(x) Q_INTERFACES(x)
#define Q_PROPERTY(text) Q_PROPERTY(text)
#define Q_PRIVATE_PROPERTY(d, text) Q_PRIVATE_PROPERTY(d, text)
+#define Q_REVISION(v) Q_REVISION(v)
#define Q_OVERRIDE(text) Q_OVERRIDE(text)
#define Q_ENUMS(x) Q_ENUMS(x)
#define Q_FLAGS(x) Q_FLAGS(x)
diff --git a/src/corelib/kernel/qsharedmemory.cpp b/src/corelib/kernel/qsharedmemory.cpp
index b61509e..78715a1 100644
--- a/src/corelib/kernel/qsharedmemory.cpp
+++ b/src/corelib/kernel/qsharedmemory.cpp
@@ -458,11 +458,7 @@ bool QSharedMemory::detach()
return false;
#endif
- if (d->detach()) {
- d->size = 0;
- return true;
- }
- return false;
+ return d->detach();
}
/*!
diff --git a/src/corelib/kernel/qsharedmemory_unix.cpp b/src/corelib/kernel/qsharedmemory_unix.cpp
index fc0a438..b30117f 100644
--- a/src/corelib/kernel/qsharedmemory_unix.cpp
+++ b/src/corelib/kernel/qsharedmemory_unix.cpp
@@ -198,7 +198,7 @@ bool QSharedMemoryPrivate::create(int size)
}
// create
- if (-1 == shmget(handle(), size, 0666 | IPC_CREAT | IPC_EXCL)) {
+ if (-1 == shmget(unix_key, size, 0666 | IPC_CREAT | IPC_EXCL)) {
QString function = QLatin1String("QSharedMemory::create");
switch (errno) {
case EINVAL:
@@ -219,10 +219,7 @@ bool QSharedMemoryPrivate::create(int size)
bool QSharedMemoryPrivate::attach(QSharedMemory::AccessMode mode)
{
// grab the shared memory segment id
- if (!handle())
- return false;
-
- int id = shmget(handle(), 0, (mode == QSharedMemory::ReadOnly ? 0444 : 0660));
+ int id = shmget(unix_key, 0, (mode == QSharedMemory::ReadOnly ? 0444 : 0660));
if (-1 == id) {
setErrorString(QLatin1String("QSharedMemory::attach (shmget)"));
return false;
@@ -264,12 +261,11 @@ bool QSharedMemoryPrivate::detach()
return false;
}
memory = 0;
+ size = 0;
// Get the number of current attachments
- if (!handle())
- return false;
- int id = shmget(handle(), 0, 0444);
- unix_key = 0;
+ int id = shmget(unix_key, 0, 0444);
+ cleanHandle();
struct shmid_ds shmid_ds;
if (0 != shmctl(id, IPC_STAT, &shmid_ds)) {
diff --git a/src/corelib/kernel/qsharedmemory_win.cpp b/src/corelib/kernel/qsharedmemory_win.cpp
index 75ab4e8..bc13e33 100644
--- a/src/corelib/kernel/qsharedmemory_win.cpp
+++ b/src/corelib/kernel/qsharedmemory_win.cpp
@@ -123,8 +123,8 @@ bool QSharedMemoryPrivate::cleanHandle()
{
if (hand != 0 && !CloseHandle(hand)) {
hand = 0;
- return false;
setErrorString(QLatin1String("QSharedMemory::cleanHandle"));
+ return false;
}
hand = 0;
return true;
@@ -183,6 +183,7 @@ bool QSharedMemoryPrivate::detach()
return false;
}
memory = 0;
+ size = 0;
// close handle
return cleanHandle();
diff --git a/src/corelib/kernel/qsystemsemaphore_symbian.cpp b/src/corelib/kernel/qsystemsemaphore_symbian.cpp
index a25a119..0d257b8 100644
--- a/src/corelib/kernel/qsystemsemaphore_symbian.cpp
+++ b/src/corelib/kernel/qsystemsemaphore_symbian.cpp
@@ -73,6 +73,10 @@ void QSystemSemaphorePrivate::setErrorString(const QString &function, int err)
case KErrInUse:
errorString = QCoreApplication::tr("%1: out of resources", "QSystemSemaphore").arg(function);
error = QSystemSemaphore::OutOfResources;
+ break;
+ case KErrPermissionDenied:
+ errorString = QCoreApplication::tr("%1: permission denied", "QSystemSemaphore").arg(function);
+ error = QSystemSemaphore::PermissionDenied;
break;
default:
errorString = QCoreApplication::tr("%1: unknown error %2", "QSystemSemaphore").arg(function).arg(err);
@@ -86,15 +90,23 @@ default:
int QSystemSemaphorePrivate::handle(QSystemSemaphore::AccessMode)
{
+ if (semaphore.Handle()) {
+ return semaphore.Handle();
+ }
+
// don't allow making handles on empty keys
if (key.isEmpty())
return 0;
- QString safeName = makeKeyFileName();
- TPtrC name(qt_QString2TPtrC(safeName));
- int err;
- err = semaphore.OpenGlobal(name,EOwnerProcess);
- if (err == KErrNotFound){
- err = semaphore.CreateGlobal(name,initialValue, EOwnerProcess);
+
+ TPtrC name(qt_QString2TPtrC(fileName));
+ int err = KErrAlreadyExists;
+ int tryCount = 10;
+ // Sort out race conditions by retrying several times until existing handle is acquired.
+ // Sometimes opening can fail inexplicably with KErrPermissionDenied many times in a row.
+ while (err != KErrNoMemory && err != KErrNone && tryCount-- >= 0) {
+ err = semaphore.CreateGlobal(name, initialValue, EOwnerProcess);
+ if (err != KErrNoMemory && err != KErrNone)
+ err = semaphore.OpenGlobal(name,EOwnerProcess);
}
if (err){
setErrorString(QLatin1String("QSystemSemaphore::handle"),err);
diff --git a/src/corelib/kernel/qsystemsemaphore_unix.cpp b/src/corelib/kernel/qsystemsemaphore_unix.cpp
index 9a58d32..a68abd3 100644
--- a/src/corelib/kernel/qsystemsemaphore_unix.cpp
+++ b/src/corelib/kernel/qsystemsemaphore_unix.cpp
@@ -50,11 +50,11 @@
#include <sys/types.h>
#include <sys/ipc.h>
+#include <sys/sem.h>
#include <fcntl.h>
#include <errno.h>
-#include <sys/shm.h>
-#include <sys/sem.h>
+#include "private/qcore_unix_p.h"
// OpenBSD 4.2 doesn't define EIDRM, see BUGS section:
// http://www.openbsd.org/cgi-bin/man.cgi?query=semop&manpath=OpenBSD+4.2
@@ -218,7 +218,10 @@ bool QSystemSemaphorePrivate::modifySemaphore(int count)
operation.sem_num = 0;
operation.sem_op = count;
operation.sem_flg = SEM_UNDO;
- if (-1 == semop(semaphore, &operation, 1)) {
+
+ register int res;
+ EINTR_LOOP(res, semop(semaphore, &operation, 1));
+ if (-1 == res) {
// If the semaphore was removed be nice and create it and then modifySemaphore again
if (errno == EINVAL || errno == EIDRM) {
semaphore = -1;
diff --git a/src/corelib/kernel/qsystemsemaphore_win.cpp b/src/corelib/kernel/qsystemsemaphore_win.cpp
index 7f002f8..fad50f2 100644
--- a/src/corelib/kernel/qsystemsemaphore_win.cpp
+++ b/src/corelib/kernel/qsystemsemaphore_win.cpp
@@ -86,8 +86,7 @@ HANDLE QSystemSemaphorePrivate::handle(QSystemSemaphore::AccessMode)
// Create it if it doesn't already exists.
if (semaphore == 0) {
- QString safeName = makeKeyFileName();
- semaphore = CreateSemaphore(0, initialValue, MAXLONG, (wchar_t*)safeName.utf16());
+ semaphore = CreateSemaphore(0, initialValue, MAXLONG, (wchar_t*)fileName.utf16());
if (semaphore == NULL)
setErrorString(QLatin1String("QSystemSemaphore::handle"));
}
diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp
index d72c1ab..daa5dc6 100644
--- a/src/corelib/kernel/qtranslator.cpp
+++ b/src/corelib/kernel/qtranslator.cpp
@@ -56,7 +56,7 @@
#include "qhash.h"
#include "qtranslator_p.h"
-#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) && !defined(Q_OS_INTEGRITY)
#define QT_USE_MMAP
#include "private/qcore_unix_p.h"
#endif
diff --git a/src/corelib/plugin/plugin.pri b/src/corelib/plugin/plugin.pri
index 50b005d..eb7a7f7 100644
--- a/src/corelib/plugin/plugin.pri
+++ b/src/corelib/plugin/plugin.pri
@@ -28,4 +28,8 @@ unix {
SOURCES += plugin/qlibrary_unix.cpp
}
+integrity {
+ SOURCES += plugin/qlibrary_unix.cpp
+}
+
LIBS_PRIVATE += $$QMAKE_LIBS_DYNLOAD
diff --git a/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp
index 1be32ad..c0b947a 100644
--- a/src/corelib/plugin/qfactoryloader.cpp
+++ b/src/corelib/plugin/qfactoryloader.cpp
@@ -155,9 +155,11 @@ void QFactoryLoader::update()
continue;
}
QObject *instance = library->instance();
- if (!instance)
+ if (!instance) {
+ library->release();
// ignore plugins that have a valid signature but cannot be loaded.
continue;
+ }
QFactoryInterface *factory = qobject_cast<QFactoryInterface*>(instance);
if (instance && factory && instance->qt_metacast(d->iid))
keys = factory->keys();
diff --git a/src/corelib/plugin/qlibrary_unix.cpp b/src/corelib/plugin/qlibrary_unix.cpp
index 466350e..e32729a 100644
--- a/src/corelib/plugin/qlibrary_unix.cpp
+++ b/src/corelib/plugin/qlibrary_unix.cpp
@@ -56,9 +56,13 @@
#include <string.h>
#endif
+#if defined(Q_OS_VXWORKS) || defined (Q_OS_NACL)
+#define QT_NO_DYNAMIC_LIBRARY
+#endif
+
QT_BEGIN_NAMESPACE
-#if !defined(QT_HPUX_LD) && !defined(Q_OS_VXWORKS)
+#if !defined(QT_HPUX_LD) && !defined(QT_NO_DYNAMIC_LIBRARY)
QT_BEGIN_INCLUDE_NAMESPACE
#include <dlfcn.h>
QT_END_INCLUDE_NAMESPACE
@@ -66,8 +70,8 @@ QT_END_INCLUDE_NAMESPACE
static QString qdlerror()
{
-#if defined(Q_OS_VXWORKS)
- const char *err = "VxWorks does not support dynamic libraries.";
+#if defined(QT_NO_DYNAMIC_LIBRARY)
+ const char *err = "This platform does not support dynamic libraries.";
#elif !defined(QT_HPUX_LD)
const char *err = dlerror();
#else
@@ -79,7 +83,7 @@ static QString qdlerror()
bool QLibraryPrivate::load_sys()
{
QString attempt;
-#if !defined(Q_OS_VXWORKS)
+#if !defined(QT_NO_DYNAMIC_LIBRARY)
QFileInfo fi(fileName);
#if defined(Q_OS_SYMBIAN)
@@ -235,7 +239,7 @@ bool QLibraryPrivate::load_sys()
}
}
#endif
-#endif // Q_OS_VXWORKS
+#endif // QT_NO_DYNAMIC_LIBRARY
if (!pHnd) {
errorString = QLibrary::tr("Cannot load library %1: %2").arg(fileName).arg(qdlerror());
}
@@ -248,7 +252,7 @@ bool QLibraryPrivate::load_sys()
bool QLibraryPrivate::unload_sys()
{
-#if !defined(Q_OS_VXWORKS)
+#if !defined(QT_NO_DYNAMIC_LIBRARY)
# if defined(QT_HPUX_LD)
if (shl_unload((shl_t)pHnd)) {
# else
@@ -282,7 +286,7 @@ void* QLibraryPrivate::resolve_sys(const char* symbol)
void* address = 0;
if (shl_findsym((shl_t*)&pHnd, symbol, TYPE_UNDEFINED, &address) < 0)
address = 0;
-#elif defined(Q_OS_VXWORKS)
+#elif defined (QT_NO_DYNAMIC_LIBRARY)
void *address = 0;
#else
void* address = dlsym(pHnd, symbol);
diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp
index 392c45d..b2af5ca 100644
--- a/src/corelib/statemachine/qstatemachine.cpp
+++ b/src/corelib/statemachine/qstatemachine.cpp
@@ -1245,9 +1245,7 @@ void QStateMachinePrivate::_q_process()
#endif
while (processing) {
if (stop) {
- stop = false;
processing = false;
- stopProcessingReason = Stopped;
break;
}
QSet<QAbstractTransition*> enabledTransitions;
@@ -1299,6 +1297,11 @@ void QStateMachinePrivate::_q_process()
#ifdef QSTATEMACHINE_DEBUG
qDebug() << q << ": finished the event processing loop";
#endif
+ if (stop) {
+ stop = false;
+ stopProcessingReason = Stopped;
+ }
+
switch (stopProcessingReason) {
case EventQueueEmpty:
break;
diff --git a/src/corelib/thread/qmutex.h b/src/corelib/thread/qmutex.h
index dfe4aae..5f75195 100644
--- a/src/corelib/thread/qmutex.h
+++ b/src/corelib/thread/qmutex.h
@@ -163,6 +163,7 @@ class QMutexData
~QMutexData();
};
+#ifdef QT_NO_DEBUG
inline void QMutex::unlockInline()
{
if (d->recursive) {
@@ -189,7 +190,13 @@ inline void QMutex::lockInline()
lockInternal();
}
}
-
+#else // QT_NO_DEBUG
+//in debug we do not use inline calls in order to allow debugging tools
+// to hook the mutex locking functions.
+inline void QMutex::unlockInline() { unlock(); }
+inline bool QMutex::tryLockInline() { return tryLock(); }
+inline void QMutex::lockInline() { lock(); }
+#endif // QT_NO_DEBUG
#else // QT_NO_THREAD
diff --git a/src/corelib/thread/qmutex_unix.cpp b/src/corelib/thread/qmutex_unix.cpp
index 5321252..11e2060 100644
--- a/src/corelib/thread/qmutex_unix.cpp
+++ b/src/corelib/thread/qmutex_unix.cpp
@@ -180,8 +180,11 @@ bool QMutexPrivate::wait(int timeout)
errorCode = pthread_cond_timedwait(&cond, &mutex, &ti);
}
if (errorCode) {
- if (errorCode == ETIMEDOUT)
+ if (errorCode == ETIMEDOUT) {
+ if (wakeup)
+ errorCode = 0;
break;
+ }
report_error(errorCode, "QMutex::lock()", "cv wait");
}
}
diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp
index 1494745..326f494 100644
--- a/src/corelib/thread/qthread.cpp
+++ b/src/corelib/thread/qthread.cpp
@@ -515,10 +515,12 @@ int QThread::exec()
Note that unlike the C library function of the same name, this
function \e does return to the caller -- it is event processing
- that stops.
-
- This function does nothing if the thread does not have an event
- loop.
+ that stops.
+
+ No QEventLoops will be started anymore in this thread until
+ QThread::exec() has been called again. If the eventloop in QThread::exec()
+ is not running then the next call to QThread::exec() will also return
+ immediately.
\sa quit() QEventLoop
*/
diff --git a/src/corelib/thread/qthread_p.h b/src/corelib/thread/qthread_p.h
index 9a2dbec..36e07c0 100644
--- a/src/corelib/thread/qthread_p.h
+++ b/src/corelib/thread/qthread_p.h
@@ -209,8 +209,6 @@ public:
bool canWait;
QVector<void *> tls;
- QMutex mutex;
-
# ifdef Q_OS_SYMBIAN
RThread symbian_thread_handle;
# endif
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp
index 0766447..811a193 100644
--- a/src/corelib/thread/qthread_unix.cpp
+++ b/src/corelib/thread/qthread_unix.cpp
@@ -54,6 +54,11 @@
#include <private/qeventdispatcher_unix_p.h>
#endif
+#ifdef Q_OS_SYMBIAN
+#include <hal.h>
+#include <hal_data.h>
+#endif
+
#include "qthreadstorage.h"
#include "qthread_p.h"
@@ -63,6 +68,12 @@
#include <sched.h>
#include <errno.h>
+// You only find these enumerations on Symbian^3 onwards, so we need to provide our own
+// to remain compatible with older releases. They won't be called by pre-Sym^3 SDKs.
+
+// HALData::ENumCpus
+#define QT_HALData_ENumCpus 119
+
#ifdef Q_OS_BSD4
#include <sys/sysctl.h>
#endif
@@ -110,6 +121,17 @@ QT_BEGIN_NAMESPACE
enum { ThreadPriorityResetFlag = 0x80000000 };
+#if defined(Q_OS_LINUX) && defined(__GLIBC__) && (defined(Q_CC_GNU) || defined(Q_CC_INTEL))
+#define HAVE_TLS
+#endif
+#if defined(Q_CC_XLC) || defined (Q_CC_SUN)
+#define HAVE_TLS
+#endif
+
+#ifdef HAVE_TLS
+static __thread QThreadData *currentThreadData = 0;
+#endif
+
static pthread_once_t current_thread_data_once = PTHREAD_ONCE_INIT;
static pthread_key_t current_thread_data_key;
@@ -157,7 +179,9 @@ Q_DESTRUCTOR_FUNCTION(destroy_current_thread_data_key)
// that pthread has, so pthread_setspecific is also used.
static QThreadData *get_thread_data()
{
-#ifdef Q_OS_SYMBIAN
+#ifdef HAVE_TLS
+ return currentThreadData;
+#elif defined Q_OS_SYMBIAN
return reinterpret_cast<QThreadData *>(Dll::Tls());
#else
pthread_once(&current_thread_data_once, create_current_thread_data_key);
@@ -167,7 +191,9 @@ static QThreadData *get_thread_data()
static void set_thread_data(QThreadData *data)
{
-#ifdef Q_OS_SYMBIAN
+#ifdef HAVE_TLS
+ currentThreadData = data;
+#elif defined Q_OS_SYMBIAN
qt_symbian_throwIfError(Dll::SetTls(data));
#endif
pthread_once(&current_thread_data_once, create_current_thread_data_key);
@@ -176,7 +202,9 @@ static void set_thread_data(QThreadData *data)
static void clear_thread_data()
{
-#ifdef Q_OS_SYMBIAN
+#ifdef HAVE_TLS
+ currentThreadData = 0;
+#elif defined Q_OS_SYMBIAN
Dll::FreeTls();
#endif
pthread_setspecific(current_thread_data_key, 0);
@@ -310,7 +338,10 @@ void *QThreadPrivate::start(void *arg)
set_thread_data(data);
data->ref();
- data->quitNow = false;
+ {
+ QMutexLocker locker(&thr->d_func()->mutex);
+ data->quitNow = thr->d_func()->exited;
+ }
// ### TODO: allow the user to create a custom event dispatcher
createEventDispatcher(data);
@@ -431,8 +462,20 @@ int QThread::idealThreadCount()
// as of aug 2008 Integrity only supports one single core CPU
cores = 1;
#elif defined(Q_OS_SYMBIAN)
- // ### TODO - Get the number of cores from HAL? when multicore architectures (SMP) are supported
- cores = 1;
+ if (QSysInfo::symbianVersion() >= QSysInfo::SV_SF_3) {
+ TInt inumcpus;
+ TInt err;
+ err = HAL::Get((HALData::TAttribute)QT_HALData_ENumCpus, inumcpus);
+ if (err != KErrNone) {
+ cores = 1;
+ } else if ( inumcpus <= 0 ) {
+ cores = 1;
+ } else {
+ cores = inumcpus;
+ }
+ } else {
+ cores = 1;
+ }
#elif defined(Q_OS_VXWORKS)
// VxWorks
# if defined(QT_VXWORKS_HAS_CPUSET)
diff --git a/src/corelib/thread/qthread_win.cpp b/src/corelib/thread/qthread_win.cpp
index cb2d1a9..6b7932b 100644
--- a/src/corelib/thread/qthread_win.cpp
+++ b/src/corelib/thread/qthread_win.cpp
@@ -298,7 +298,10 @@ unsigned int __stdcall QThreadPrivate::start(void *arg)
QThread::setTerminationEnabled(false);
- data->quitNow = false;
+ {
+ QMutexLocker locker(&thr->d_func()->mutex);
+ data->quitNow = thr->d_func()->exited;
+ }
// ### TODO: allow the user to create a custom event dispatcher
createEventDispatcher(data);
diff --git a/src/corelib/thread/thread.pri b/src/corelib/thread/thread.pri
index 03f661d..90583bb 100644
--- a/src/corelib/thread/thread.pri
+++ b/src/corelib/thread/thread.pri
@@ -31,3 +31,7 @@ unix:SOURCES += thread/qmutex_unix.cpp \
win32:SOURCES += thread/qmutex_win.cpp \
thread/qthread_win.cpp \
thread/qwaitcondition_win.cpp
+
+integrity:SOURCES += thread/qmutex_unix.cpp \
+ thread/qthread_unix.cpp \
+ thread/qwaitcondition_unix.cpp
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index cc81c1b..4799abd 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -492,7 +492,7 @@ QByteArray qCompress(const uchar* data, int nbytes, int compressionLevel)
#endif
/*!
- \fn QByteArray qUncompress(const QByteArray& data)
+ \fn QByteArray qUncompress(const QByteArray &data)
\relates QByteArray
@@ -506,10 +506,10 @@ QByteArray qCompress(const uchar* data, int nbytes, int compressionLevel)
feature was added.
\bold{Note:} If you want to use this function to uncompress external
- data compressed using zlib, you first need to prepend four bytes to the
- byte array that contain the expected length (as an unsigned integer)
- of the uncompressed data encoded in big-endian order (most significant
- byte first).
+ data that was compressed using zlib, you first need to prepend a four
+ byte header to the byte array containing the data. The header must
+ contain the expected length (in bytes) of the uncompressed data,
+ expressed as an unsigned, big-endian, 32-bit integer.
\sa qCompress()
*/
@@ -687,12 +687,12 @@ QByteArray::Data QByteArray::shared_empty = { Q_BASIC_ATOMIC_INITIALIZER(1),
values. To set all the bytes to a particular value, call fill().
To obtain a pointer to the actual character data, call data() or
- constData(). These functions return a pointer to the beginning of
- the data. The pointer is guaranteed to remain valid until a
- non-const function is called on the QByteArray. It is also
- guaranteed that the data ends with a '\\0' byte. This '\\0' byte
- is automatically provided by QByteArray and is not counted in
- size().
+ constData(). These functions return a pointer to the beginning of the data.
+ The pointer is guaranteed to remain valid until a non-const function is
+ called on the QByteArray. It is also guaranteed that the data ends with a
+ '\\0' byte unless the QByteArray was created from a \l{fromRawData()}{raw
+ data}. This '\\0' byte is automatically provided by QByteArray and is not
+ counted in size().
QByteArray provides the following basic functions for modifying
the byte data: append(), prepend(), insert(), replace(), and
@@ -925,11 +925,13 @@ QByteArray &QByteArray::operator=(const char *str)
Returns the number of bytes in this byte array.
- The last byte in the byte array is at position size() - 1. In
- addition, QByteArray ensures that the byte at position size() is
- always '\\0', so that you can use the return value of data() and
- constData() as arguments to functions that expect '\\0'-terminated
- strings.
+ The last byte in the byte array is at position size() - 1. In addition,
+ QByteArray ensures that the byte at position size() is always '\\0', so
+ that you can use the return value of data() and constData() as arguments to
+ functions that expect '\\0'-terminated strings. If the QByteArray object
+ was created from a \l{fromRawData()}{raw data} that didn't include the
+ trailing null-termination character then QByteArray doesn't add it
+ automaticall unless the \l{deep copy} is created.
Example:
\snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 6
@@ -1060,10 +1062,11 @@ QByteArray &QByteArray::operator=(const char *str)
/*! \fn const char *QByteArray::constData() const
- Returns a pointer to the data stored in the byte array. The
- pointer can be used to access the bytes that compose the array.
- The data is '\\0'-terminated. The pointer remains valid as long
- as the byte array isn't reallocated or destroyed.
+ Returns a pointer to the data stored in the byte array. The pointer can be
+ used to access the bytes that compose the array. The data is
+ '\\0'-terminated unless the QByteArray object was created from raw data.
+ The pointer remains valid as long as the byte array isn't reallocated or
+ destroyed.
This function is mostly useful to pass a byte array to a function
that accepts a \c{const char *}.
@@ -1072,7 +1075,7 @@ QByteArray &QByteArray::operator=(const char *str)
but most functions that take \c{char *} arguments assume that the
data ends at the first '\\0' they encounter.
- \sa data(), operator[]()
+ \sa data(), operator[](), fromRawData()
*/
/*! \fn void QByteArray::detach()
diff --git a/src/corelib/tools/qchar.cpp b/src/corelib/tools/qchar.cpp
index c003214..a903007 100644
--- a/src/corelib/tools/qchar.cpp
+++ b/src/corelib/tools/qchar.cpp
@@ -677,7 +677,7 @@ bool QChar::isSymbol() const
\since 4.7
Returns true if the UCS-4-encoded character specified by \a ucs4
- is the high part of a utf16 surrogate
+ is the low part of a utf16 surrogate
(ie. if its code point is between 0xdc00 and 0xdfff, inclusive).
*/
@@ -686,7 +686,7 @@ bool QChar::isSymbol() const
\since 4.7
Returns true if the UCS-4-encoded character specified by \a ucs4
- can be splited to the high and low parts of a utf16 surrogate
+ can be split into the high and low parts of a utf16 surrogate
(ie. if its code point is greater than or equals to 0x10000).
*/
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index 0eaa3ed..a3a8884 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -3426,8 +3426,9 @@ QDateTime QDateTime::fromString(const QString& s, Qt::DateFormat f)
QString tz = parts.at(5);
if (!tz.startsWith(QLatin1String("GMT"), Qt::CaseInsensitive))
return QDateTime();
- int tzoffset = 0;
+ QDateTime dt(date, time, Qt::UTC);
if (tz.length() > 3) {
+ int tzoffset = 0;
QChar sign = tz.at(3);
if ((sign != QLatin1Char('+'))
&& (sign != QLatin1Char('-'))) {
@@ -3442,8 +3443,9 @@ QDateTime QDateTime::fromString(const QString& s, Qt::DateFormat f)
tzoffset = (tzhour*60 + tzminute) * 60;
if (sign == QLatin1Char('-'))
tzoffset = -tzoffset;
+ dt.setUtcOffset(tzoffset);
}
- return QDateTime(date, time, Qt::UTC).addSecs(-tzoffset).toLocalTime();
+ return dt.toLocalTime();
}
#endif //QT_NO_TEXTDATE
}
diff --git a/src/corelib/tools/qeasingcurve.cpp b/src/corelib/tools/qeasingcurve.cpp
index 801600a..7daf95a 100644
--- a/src/corelib/tools/qeasingcurve.cpp
+++ b/src/corelib/tools/qeasingcurve.cpp
@@ -92,14 +92,18 @@
animation.setEasingCurve(QEasingCurve::InOutQuad);
\endcode
- The ability to set an amplitude, overshoot, or period depends on the QEasingCurve type. Amplitude access
- is available to curves that behave as springs such as elastic and bounce curves. Changing the amplitude changes
- the height of the curve. Period access is only available to elastic curves and setting a higher period slows
- the rate of bounce. Only curves that have "boomerang" behaviors such as the InBack, OutBack, InOutBack, and OutInBack
- have overshoot settings. These curves will interpolate beyond the end points and return to the end point,
- acting similar to a boomerang.
-
- The \l{Easing Curves Example} contains samples of QEasingCurve types and lets you change the curve settings.
+ The ability to set an amplitude, overshoot, or period depends on
+ the QEasingCurve type. Amplitude access is available to curves
+ that behave as springs such as elastic and bounce curves. Changing
+ the amplitude changes the height of the curve. Period access is
+ only available to elastic curves and setting a higher period slows
+ the rate of bounce. Only curves that have "boomerang" behaviors
+ such as the InBack, OutBack, InOutBack, and OutInBack have
+ overshoot settings. These curves will interpolate beyond the end
+ points and return to the end point, acting similar to a boomerang.
+
+ The \l{Easing Curves Example} contains samples of QEasingCurve
+ types and lets you change the curve settings.
*/
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index fcfa8f0..6515edb 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -2199,7 +2199,7 @@ static quint16 localePrivateIndex(const QLocalePrivate *p)
/*!
Constructs a QLocale object with the specified \a name,
which has the format
- "language[_country][.codeset][@modifier]" or "C", where:
+ "language[_territory][.codeset][@modifier]" or "C", where:
\list
\i language is a lowercase, two-letter, ISO 639 language code,
diff --git a/src/corelib/tools/qscopedvaluerollback.cpp b/src/corelib/tools/qscopedvaluerollback.cpp
new file mode 100644
index 0000000..8933efc
--- /dev/null
+++ b/src/corelib/tools/qscopedvaluerollback.cpp
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qscopedvaluerollback.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QScopedValueRollback
+ \brief The QScopedValueRollback resets a variable to its previous value on destruction
+ \since 4.8
+ \ingroup misc
+
+ The QScopedAssignment class can be used to revert state when an
+ exception is thrown without needing to write try-catch blocks.
+
+ It can also be used to manage variables that are temporarily set,
+ such as reentrancy guards. By using this class, the variable will
+ be reset whether the function is exited normally, exited early by
+ a return statement, or exited by an exception.
+
+ The template can only be instantiated with a type that supports assignment.
+
+ \sa QScopedPointer
+*/
+
+/*!
+ \fn QScopedValueRollback::QScopedValueRollback(T &var)
+
+ Stores the previous value of var internally, for revert on destruction.
+*/
+
+/*!
+ \fn QScopedValueRollback::~QScopedValueRollback()
+
+ Assigns the previous value to the managed variable.
+ This is the value at construction time, or at the last call to commit()
+*/
+
+/*!
+ \fn void QScopedValueRollback::commit()
+
+ Updates the previous value of the managed variable to its current value.
+*/
+
+QT_END_NAMESPACE
diff --git a/src/corelib/tools/qscopedvaluerollback.h b/src/corelib/tools/qscopedvaluerollback.h
new file mode 100644
index 0000000..e874428
--- /dev/null
+++ b/src/corelib/tools/qscopedvaluerollback.h
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QSCOPEDVALUEROLLBACK_H
+#define QSCOPEDVALUEROLLBACK_H
+
+#include <QtCore/qglobal.h>
+
+QT_BEGIN_HEADER
+QT_BEGIN_NAMESPACE
+QT_MODULE(Core)
+
+template <typename T>
+class QScopedValueRollback
+{
+public:
+ QScopedValueRollback(T &var) :
+ varRef(var)
+ {
+ oldValue = varRef;
+ }
+
+ ~QScopedValueRollback()
+ {
+ varRef = oldValue;
+ }
+
+ void commit()
+ {
+ oldValue = varRef;
+ }
+
+private:
+ T& varRef;
+ T oldValue;
+
+ Q_DISABLE_COPY(QScopedValueRollback)
+};
+
+QT_END_NAMESPACE
+QT_END_HEADER
+
+#endif // QSCOPEDVALUEROLLBACK_H
diff --git a/src/corelib/tools/qset.h b/src/corelib/tools/qset.h
index a8ae40c..a2a8052 100644
--- a/src/corelib/tools/qset.h
+++ b/src/corelib/tools/qset.h
@@ -335,7 +335,7 @@ class QMutableSetIterator
typedef typename QSet<T>::iterator iterator;
QSet<T> *c;
iterator i, n;
- inline bool item_exists() const { return n != c->constEnd(); }
+ inline bool item_exists() const { return c->constEnd() != n; }
public:
inline QMutableSetIterator(QSet<T> &container)
diff --git a/src/corelib/tools/qshareddata.h b/src/corelib/tools/qshareddata.h
index 1bdba2c..1494373 100644
--- a/src/corelib/tools/qshareddata.h
+++ b/src/corelib/tools/qshareddata.h
@@ -114,6 +114,7 @@ public:
return *this;
}
#ifdef Q_COMPILER_RVALUE_REFS
+ QSharedDataPointer(QSharedDataPointer &&o) : d(o.d) { o.d = 0; }
inline QSharedDataPointer<T> &operator=(QSharedDataPointer<T> &&other)
{ qSwap(d, other.d); return *this; }
#endif
@@ -197,7 +198,8 @@ public:
return *this;
}
#ifdef Q_COMPILER_RVALUE_REFS
- inline QSharedDataPointer<T> &operator=(QSharedDataPointer<T> &&other)
+ inline QExplicitlySharedDataPointer(QExplicitlySharedDataPointer &&o) : d(o.d) { o.d = 0; }
+ inline QExplicitlySharedDataPointer<T> &operator=(QExplicitlySharedDataPointer<T> &&other)
{ qSwap(d, other.d); return *this; }
#endif
diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h
index 273c5bd..b29e5b6 100644
--- a/src/corelib/tools/qsharedpointer_impl.h
+++ b/src/corelib/tools/qsharedpointer_impl.h
@@ -44,7 +44,17 @@
#ifndef QSHAREDPOINTER_H
#error Do not include qsharedpointer_impl.h directly
#endif
+
#if 0
+// These macros are duplicated here to make syncqt not complain a about
+// this header, as we have a "qt_sync_stop_processing" below, which in turn
+// is here because this file contains a template mess and duplicates the
+// classes found in qsharedpointer.h
+QT_BEGIN_HEADER
+QT_BEGIN_NAMESPACE
+QT_MODULE(Core)
+QT_END_NAMESPACE
+QT_END_HEADER
#pragma qt_sync_stop_processing
#endif
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 95c80a1..b7272ec 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -658,10 +658,11 @@ const QString::Null QString::null = { };
class.)
\table 100 %
+ \header
+ \o Note for C Programmers
+
\row
\o
- \section1 Note for C Programmers
-
Due to C++'s type system and the fact that QString is
\l{implicitly shared}, QStrings may be treated like \c{int}s or
other basic types. For example:
@@ -3890,8 +3891,7 @@ const char *QString::latin1_helper() const
If \a size is -1 (default), it is taken to be qstrlen(\a
str).
- QTextCodec::codecForLocale() is used to perform the conversion
- from Unicode.
+ QTextCodec::codecForLocale() is used to perform the conversion.
\sa toLocal8Bit(), fromAscii(), fromLatin1(), fromUtf8()
*/
diff --git a/src/corelib/tools/qstringbuilder.cpp b/src/corelib/tools/qstringbuilder.cpp
index 53368eb..7d75de7 100644
--- a/src/corelib/tools/qstringbuilder.cpp
+++ b/src/corelib/tools/qstringbuilder.cpp
@@ -150,8 +150,8 @@ QT_BEGIN_NAMESPACE
void QAbstractConcatenable::convertFromAscii(const char *a, int len, QChar *&out)
{
#ifndef QT_NO_TEXTCODEC
- if (QString::codecForCStrings) {
- QString tmp = QString::fromAscii(a);
+ if (QString::codecForCStrings && len) {
+ QString tmp = QString::fromAscii(a, len > 0 ? len - 1 : -1);
memcpy(out, reinterpret_cast<const char *>(tmp.constData()), sizeof(QChar) * tmp.size());
out += tmp.length();
return;
diff --git a/src/corelib/tools/qstringbuilder.h b/src/corelib/tools/qstringbuilder.h
index 8d9537c..d230d67 100644
--- a/src/corelib/tools/qstringbuilder.h
+++ b/src/corelib/tools/qstringbuilder.h
@@ -270,10 +270,11 @@ template <> struct QConcatenable<QByteArray> : private QAbstractConcatenable
{
typedef QByteArray type;
enum { ExactSize = false };
- static int size(const QByteArray &ba) { return qstrnlen(ba.constData(), ba.size()); }
+ static int size(const QByteArray &ba) { return ba.size(); }
static inline void appendTo(const QByteArray &ba, QChar *&out)
{
- QAbstractConcatenable::convertFromAscii(ba.constData(), -1, out);
+ // adding 1 because convertFromAscii expects the size including the null-termination
+ QAbstractConcatenable::convertFromAscii(ba.constData(), ba.size() + 1, out);
}
};
#endif
diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri
index 03bb32d..fb1b466 100644
--- a/src/corelib/tools/tools.pri
+++ b/src/corelib/tools/tools.pri
@@ -29,6 +29,9 @@ HEADERS += \
tools/qrect.h \
tools/qregexp.h \
tools/qringbuffer_p.h \
+ tools/qscopedpointer.h \
+ tools/qscopedpointer_p.h \
+ tools/qscopedvaluerollback.h \
tools/qshareddata.h \
tools/qsharedpointer.h \
tools/qsharedpointer_impl.h \
@@ -45,9 +48,7 @@ HEADERS += \
tools/qelapsedtimer.h \
tools/qunicodetables_p.h \
tools/qvarlengtharray.h \
- tools/qvector.h \
- tools/qscopedpointer.h \
- tools/qscopedpointer_p.h
+ tools/qvector.h
SOURCES += \
@@ -87,6 +88,7 @@ symbian:SOURCES+=tools/qlocale_symbian.cpp
else:symbian:SOURCES += tools/qelapsedtimer_symbian.cpp
else:unix:SOURCES += tools/qelapsedtimer_unix.cpp
else:win32:SOURCES += tools/qelapsedtimer_win.cpp
+else:integrity:SOURCES += tools/qelapsedtimer_unix.cpp
else:SOURCES += tools/qelapsedtimer_generic.cpp
contains(QT_CONFIG, zlib):include($$PWD/../../3rdparty/zlib.pri)