summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorDavid Boddie <dboddie@trolltech.com>2010-07-16 15:46:21 (GMT)
committerDavid Boddie <dboddie@trolltech.com>2010-07-16 15:46:21 (GMT)
commit6b1b666574d6e27efdd3b243de8815a5278c3666 (patch)
tree7a5ac02fe569b3fc497ca8d0a333d10587eb3567 /src/corelib
parenteef1d13743baddf41bd135d98fc2ad12944b8477 (diff)
parentab4dde176cfa314522964e5e5fbf9f2d388f8fdf (diff)
downloadQt-6b1b666574d6e27efdd3b243de8815a5278c3666.zip
Qt-6b1b666574d6e27efdd3b243de8815a5278c3666.tar.gz
Qt-6b1b666574d6e27efdd3b243de8815a5278c3666.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7
Conflicts: tools/qdoc3/test/qt.qdocconf
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/global/qnamespace.qdoc5
-rw-r--r--src/corelib/io/qiodevice_p.h2
-rw-r--r--src/corelib/io/qprocess.cpp4
-rw-r--r--src/corelib/kernel/qabstractitemmodel.cpp4
-rw-r--r--src/corelib/kernel/qeventdispatcher_symbian.cpp36
-rw-r--r--src/corelib/thread/qthread_unix.cpp8
-rw-r--r--src/corelib/tools/qlocale.cpp1
-rw-r--r--src/corelib/tools/qsimd_p.h5
-rw-r--r--src/corelib/tools/qstring.cpp2
9 files changed, 39 insertions, 28 deletions
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index ed2ae6e..5cd7f0e 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -470,6 +470,7 @@
\value TextIncludeTrailingSpaces Same as IncludeTrailingSpaces
\value TextJustificationForced Ensures that text lines are justified.
+ \omitvalue TextBypassShaping
\omitvalue BreakAnywhere
\omitvalue DontClip
\omitvalue DontPrint
@@ -1730,7 +1731,7 @@
\value Key_MediaLast
\value Key_unknown
- \value Key_Call A key to answer or initiate a call (see \l Key_ToggleCallHangup for a key to toggle current call state)
+ \value Key_Call A key to answer or initiate a call (see Qt::Key_ToggleCallHangup for a key to toggle current call state)
\value Key_Camera A key to activate the camera shutter
\value Key_CameraFocus A key to focus the camera
\value Key_Context1
@@ -1738,7 +1739,7 @@
\value Key_Context3
\value Key_Context4
\value Key_Flip
- \value Key_Hangup A key to end an ongoing call (see \l Key_ToggleCallHangup for a key to toggle current call state)
+ \value Key_Hangup A key to end an ongoing call (see Qt::Key_ToggleCallHangup for a key to toggle current call state)
\value Key_No
\value Key_Select
\value Key_Yes
diff --git a/src/corelib/io/qiodevice_p.h b/src/corelib/io/qiodevice_p.h
index 4a25562..1dd51ea 100644
--- a/src/corelib/io/qiodevice_p.h
+++ b/src/corelib/io/qiodevice_p.h
@@ -155,10 +155,10 @@ public:
if ((first - buf) < size) {
// underflow, the existing valid data needs to move to the end of the (potentially bigger) buffer
makeSpace(len + size, freeSpaceAtStart);
- memcpy(first - size, block, size);
}
first -= size;
len += size;
+ memcpy(first, block, size);
}
private:
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index 9bc4063..739ac4d 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -1399,10 +1399,10 @@ QString QProcess::nativeArguments() const
\since 4.7
\overload
- Sets additional native command line arguments for the program.
+ Sets additional native command line \a arguments for the program.
On operating systems where the system API for passing command line
- arguments to a subprocess natively uses a single string, one can
+ \a arguments to a subprocess natively uses a single string, one can
conceive command lines which cannot be passed via QProcess's portable
list-based API. In such cases this function must be used to set a
string which is \e appended to the string composed from the usual
diff --git a/src/corelib/kernel/qabstractitemmodel.cpp b/src/corelib/kernel/qabstractitemmodel.cpp
index 464a91c..e3fce18 100644
--- a/src/corelib/kernel/qabstractitemmodel.cpp
+++ b/src/corelib/kernel/qabstractitemmodel.cpp
@@ -2547,7 +2547,7 @@ bool QAbstractItemModelPrivate::allowMove(const QModelIndex &srcParent, int star
For example, as shown in the diagram, we move three rows from
row 2 to 4 in the source, so \a sourceFirst is 2 and \a sourceLast is 4.
- We move those items to above row 2 in the destination, so \a destinationRow is 2.
+ We move those items to above row 2 in the destination, so \a destinationChild is 2.
\snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 6
@@ -2558,7 +2558,7 @@ bool QAbstractItemModelPrivate::allowMove(const QModelIndex &srcParent, int star
\o To append rows to another parent, move them to after the last row.
For example, as shown in the diagram, we move three rows to a
- collection of 6 existing rows (ending in row 5), so \a destinationStart is 6:
+ collection of 6 existing rows (ending in row 5), so \a destinationChild is 6:
\snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 7
diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp
index e86efb2..2a52044 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian.cpp
+++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp
@@ -47,8 +47,6 @@
#include <unistd.h>
#include <errno.h>
-#include <net/if.h>
-
QT_BEGIN_NAMESPACE
#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
@@ -100,16 +98,19 @@ static inline int qt_socket_select(int nfds, fd_set *readfds, fd_set *writefds,
class QSelectMutexGrabber
{
public:
- QSelectMutexGrabber(int fd, QMutex *mutex)
+ QSelectMutexGrabber(int writeFd, int readFd, QMutex *mutex)
: m_mutex(mutex)
{
if (m_mutex->tryLock())
return;
char dummy = 0;
- qt_pipe_write(fd, &dummy, 1);
+ qt_pipe_write(writeFd, &dummy, 1);
m_mutex->lock();
+
+ char buffer;
+ while (::read(readFd, &buffer, 1) > 0) {}
}
~QSelectMutexGrabber()
@@ -403,10 +404,6 @@ void QSelectThread::run()
ret = qt_socket_select(maxfd, &readfds, &writefds, &exceptionfds, 0);
savedSelectErrno = errno;
- char buffer;
-
- while (::read(m_pipeEnds[0], &buffer, 1) > 0) {}
-
if(ret == 0) {
// do nothing
} else if (ret < 0) {
@@ -481,7 +478,8 @@ void QSelectThread::run()
updateActivatedNotifiers(QSocketNotifier::Write, &writefds);
}
- m_waitCond.wait(&m_mutex);
+ if (FD_ISSET(m_pipeEnds[0], &readfds))
+ m_waitCond.wait(&m_mutex);
}
m_mutex.unlock();
@@ -495,7 +493,9 @@ void QSelectThread::requestSocketEvents ( QSocketNotifier *notifier, TRequestSta
start();
}
- QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex);
+ Q_ASSERT(QThread::currentThread() == this->thread());
+
+ QSelectMutexGrabber lock(m_pipeEnds[1], m_pipeEnds[0], &m_mutex);
Q_ASSERT(!m_AOStatuses.contains(notifier));
@@ -506,7 +506,9 @@ void QSelectThread::requestSocketEvents ( QSocketNotifier *notifier, TRequestSta
void QSelectThread::cancelSocketEvents ( QSocketNotifier *notifier )
{
- QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex);
+ Q_ASSERT(QThread::currentThread() == this->thread());
+
+ QSelectMutexGrabber lock(m_pipeEnds[1], m_pipeEnds[0], &m_mutex);
m_AOStatuses.remove(notifier);
@@ -515,7 +517,9 @@ void QSelectThread::cancelSocketEvents ( QSocketNotifier *notifier )
void QSelectThread::restart()
{
- QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex);
+ Q_ASSERT(QThread::currentThread() == this->thread());
+
+ QSelectMutexGrabber lock(m_pipeEnds[1], m_pipeEnds[0], &m_mutex);
m_waitCond.wakeAll();
}
@@ -571,17 +575,13 @@ void QSelectThread::updateActivatedNotifiers(QSocketNotifier::Type type, fd_set
* check if socket is in exception set
* then signal RequestComplete for it
*/
- qWarning("exception on %d [will do setdefaultif(0) - hack]", i.key()->socket());
+ qWarning("exception on %d [will close the socket handle - hack]", i.key()->socket());
// quick fix; there is a bug
// when doing read on socket
// errors not preoperly mapped
// after offline-ing the device
// on some devices we do get exception
- // close all exiting sockets
- // and reset default IAP
- if(::setdefaultif(0) != KErrNone) // well we can't do much about it
- qWarning("setdefaultif(0) failed");
-
+ ::close(i.key()->socket());
toRemove.append(i.key());
TRequestStatus *status = i.value();
QEventDispatcherSymbian::RequestComplete(d->threadData->symbian_thread_handle, status, KErrNone);
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp
index 6b34b5f..d193b2e 100644
--- a/src/corelib/thread/qthread_unix.cpp
+++ b/src/corelib/thread/qthread_unix.cpp
@@ -247,6 +247,14 @@ void *QThreadPrivate::start(void *arg)
data->symbian_thread_handle = RThread();
TThreadId threadId = data->symbian_thread_handle.Id();
data->symbian_thread_handle.Open(threadId);
+ // On symbian, threads other than the main thread are non critical by default
+ // This means a worker thread can crash without crashing the application - to
+ // use this feature, we would need to use RThread::Logon in the main thread
+ // to catch abnormal thread exit and emit the finished signal.
+ // For the sake of cross platform consistency, we set the thread as process critical
+ // - advanced users who want the symbian behaviour can change the critical
+ // attribute of the thread again once the app gains control in run()
+ User::SetCritical(User::EProcessCritical);
#endif
pthread_once(&current_thread_data_once, create_current_thread_data_key);
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index a51ee81..6b1de5e 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -2096,6 +2096,7 @@ QDataStream &operator>>(QDataStream &ds, QLocale &l)
\value Serbia
\value SaintBarthelemy
\value SaintMartin
+ \value LatinAmericaAndTheCaribbean
\omitvalue LastCountry
\sa country()
diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h
index 58d2dcb..0ed9d5d 100644
--- a/src/corelib/tools/qsimd_p.h
+++ b/src/corelib/tools/qsimd_p.h
@@ -58,8 +58,7 @@ QT_BEGIN_HEADER
#endif
// SSE intrinsics
-#if defined(QT_HAVE_SSE2) && !defined(QT_BOOTSTRAPPED) && (defined(__SSE2__) \
- || (defined(Q_CC_MSVC) && (defined(_M_X64) || _M_IX86_FP == 2)))
+#if defined(QT_HAVE_SSE2) && (defined(__SSE2__) || defined(Q_CC_MSVC))
#if defined(QT_LINUXBASE)
/// this is an evil hack - the posix_memalign declaration in LSB
/// is wrong - see http://bugs.linuxbase.org/show_bug.cgi?id=2431
@@ -73,8 +72,10 @@ QT_BEGIN_HEADER
# include <emmintrin.h>
#endif
+#if !defined(QT_BOOTSTRAPPED) && (!defined(Q_CC_MSVC) || (defined(_M_X64) || _M_IX86_FP == 2))
#define QT_ALWAYS_HAVE_SSE2
#endif
+#endif // defined(QT_HAVE_SSE2) && (defined(__SSE2__) || defined(Q_CC_MSVC))
// NEON intrinsics
#if defined(QT_HAVE_NEON)
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 57f79a0..b2cf49b 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -6954,7 +6954,7 @@ bool QString::isRightToLeft() const
/*! \fn bool QString::isRightToLeft() const
- \internal
+ Returns true if the string is read right to left.
*/