summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorSami Merila <sami.merila@nokia.com>2010-03-05 09:08:37 (GMT)
committerSami Merila <sami.merila@nokia.com>2010-03-05 09:08:37 (GMT)
commit5dba125fb953718d8282ff317a6ff34b612bcf45 (patch)
treeebdf2ada09d08e9ec6ae5c36f38a81911ec96a89 /src/corelib
parent68eea46d309ff82e45c243a7689013f36454c85b (diff)
parent92c42901344ae654d8bc102e566d47d735cb3954 (diff)
downloadQt-5dba125fb953718d8282ff317a6ff34b612bcf45.zip
Qt-5dba125fb953718d8282ff317a6ff34b612bcf45.tar.gz
Qt-5dba125fb953718d8282ff317a6ff34b612bcf45.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt-s60-public into 4.6
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/global/qnamespace.h4
-rw-r--r--src/corelib/global/qnamespace.qdoc8
-rw-r--r--src/corelib/io/qfsfileengine.cpp3
-rw-r--r--src/corelib/kernel/qeventdispatcher_symbian.cpp2
-rw-r--r--src/corelib/kernel/qmetaobject.cpp2
-rw-r--r--src/corelib/kernel/qobject.cpp17
-rw-r--r--src/corelib/kernel/qvariant.cpp6
-rw-r--r--src/corelib/thread/qmutex.h15
-rw-r--r--src/corelib/thread/qreadwritelock.h30
-rw-r--r--src/corelib/tools/qregexp.cpp4
-rw-r--r--src/corelib/tools/qstring.cpp2
11 files changed, 52 insertions, 41 deletions
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index 177bee4..bc8d452 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -299,7 +299,9 @@ public:
MacWindowToolBarButtonHint = 0x10000000,
BypassGraphicsProxyWidget = 0x20000000,
WindowOkButtonHint = 0x00080000,
- WindowCancelButtonHint = 0x00100000
+ WindowCancelButtonHint = 0x00100000,
+ WindowSoftkeysVisibleHint = 0x40000000,
+ WindowSoftkeysRespondHint = 0x80000000
#ifdef QT3_SUPPORT
,
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 392ece3..6968773 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -2146,6 +2146,14 @@
\value WindowCancelButtonHint Adds a Cancel button to the window decoration of a dialog.
Only supported for Windows CE.
+ \value WindowSoftkeysVisibleHint Makes softkeys visible when widget is fullscreen.
+ Only supported for Symbian.
+
+ \value WindowSoftkeysRespondHint Makes softkeys to receive key events even
+ when invisible. With this hint the softkey actions are triggered
+ even the softkeys are invisible i.e. the window is displayed with
+ \c showFullscreen(). Only supported for Symbian.
+
\value WindowType_Mask A mask for extracting the window type
part of the window flags.
diff --git a/src/corelib/io/qfsfileengine.cpp b/src/corelib/io/qfsfileengine.cpp
index c842e49..eeee970 100644
--- a/src/corelib/io/qfsfileengine.cpp
+++ b/src/corelib/io/qfsfileengine.cpp
@@ -145,6 +145,8 @@ QString QFSFileEnginePrivate::canonicalized(const QString &path)
#endif
// Mac OS X 10.5.x doesn't support the realpath(X,0) extenstion we use here.
#if defined(Q_OS_LINUX) || defined(Q_OS_SYMBIAN)
+ // ... but Linux with uClibc does not have it
+#if !defined(__UCLIBC__)
char *ret = realpath(path.toLocal8Bit().constData(), (char*)0);
if (ret) {
QString canonicalPath = QDir::cleanPath(QString::fromLocal8Bit(ret));
@@ -152,6 +154,7 @@ QString QFSFileEnginePrivate::canonicalized(const QString &path)
return canonicalPath;
}
#endif
+#endif
QFileInfo fi;
const QChar slash(QLatin1Char('/'));
diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp
index 1d7be79..191be6c 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian.cpp
+++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp
@@ -733,7 +733,7 @@ bool QEventDispatcherSymbian::processEvents ( QEventLoop::ProcessEventsFlags fla
}
TInt error;
- handledSymbianEvent = CActiveScheduler::RunIfReady(error, CActive::EPriorityIdle);
+ handledSymbianEvent = CActiveScheduler::RunIfReady(error, KMinTInt);
if (error) {
qWarning("CActiveScheduler::RunIfReady() returned error: %i\n", error);
CActiveScheduler::Current()->Error(error);
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp
index cd7418a..b151040 100644
--- a/src/corelib/kernel/qmetaobject.cpp
+++ b/src/corelib/kernel/qmetaobject.cpp
@@ -943,7 +943,7 @@ QByteArray QMetaObject::normalizedType(const char *type)
if (!type || !*type)
return result;
- QVarLengthArray<char> stackbuf(int(strlen(type)) + 1);
+ QVarLengthArray<char> stackbuf(qstrlen(type) + 1);
qRemoveWhitespace(type, stackbuf.data());
int templdepth = 0;
qNormalizeType(stackbuf.data(), templdepth, result);
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 5298fff..689e44c 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -3264,12 +3264,14 @@ void QMetaObject::activate(QObject *sender, const QMetaObject *m, int local_sign
const int method = c->method;
QObjectPrivate::Sender currentSender;
- currentSender.sender = sender;
- currentSender.signal = signal_absolute_index;
- currentSender.ref = 1;
+ const bool receiverInSameThread = currentThreadData == receiver->d_func()->threadData;
QObjectPrivate::Sender *previousSender = 0;
- if (currentThreadData == receiver->d_func()->threadData)
+ if (receiverInSameThread) {
+ currentSender.sender = sender;
+ currentSender.signal = signal_absolute_index;
+ currentSender.ref = 1;
previousSender = QObjectPrivate::setCurrentSender(receiver, &currentSender);
+ }
locker.unlock();
if (qt_signal_spy_callback_set.slot_begin_callback != 0) {
@@ -3285,8 +3287,8 @@ void QMetaObject::activate(QObject *sender, const QMetaObject *m, int local_sign
metacall(receiver, QMetaObject::InvokeMetaMethod, method, argv ? argv : empty_argv);
} QT_CATCH(...) {
locker.relock();
-
- QObjectPrivate::resetCurrentSender(receiver, &currentSender, previousSender);
+ if (receiverInSameThread)
+ QObjectPrivate::resetCurrentSender(receiver, &currentSender, previousSender);
--connectionLists->inUse;
Q_ASSERT(connectionLists->inUse >= 0);
@@ -3301,7 +3303,8 @@ void QMetaObject::activate(QObject *sender, const QMetaObject *m, int local_sign
locker.relock();
- QObjectPrivate::resetCurrentSender(receiver, &currentSender, previousSender);
+ if (receiverInSameThread)
+ QObjectPrivate::resetCurrentSender(receiver, &currentSender, previousSender);
if (connectionLists->orphaned)
break;
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index e1b5825..9a278bd 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -466,9 +466,13 @@ static bool compare(const QVariant::Private *a, const QVariant::Private *b)
* QMetaType::VoidStar, QMetaType::QObjectStar and so forth, is that it wouldn't include
* user defined pointer types. */
const char *const typeName = QMetaType::typeName(a->type);
- if (typeName[qstrlen(typeName) - 1] == '*')
+ uint typeNameLen = qstrlen(typeName);
+ if (typeNameLen > 0 && typeName[typeNameLen - 1] == '*')
return *static_cast<void *const *>(a_ptr) == *static_cast<void *const *>(b_ptr);
+ if (a->is_null && b->is_null)
+ return true;
+
return a_ptr == b_ptr;
}
diff --git a/src/corelib/thread/qmutex.h b/src/corelib/thread/qmutex.h
index 80b50fc..677412e 100644
--- a/src/corelib/thread/qmutex.h
+++ b/src/corelib/thread/qmutex.h
@@ -95,7 +95,7 @@ class Q_CORE_EXPORT QMutexLocker
{
public:
inline explicit QMutexLocker(QMutex *m)
- : mtx(m)
+ : val(reinterpret_cast<quintptr>(m))
{
Q_ASSERT_X((val & quintptr(1u)) == quintptr(0),
"QMutexLocker", "QMutex pointer is misaligned");
@@ -105,19 +105,19 @@ public:
inline void unlock()
{
- if (mtx) {
+ if (val) {
if ((val & quintptr(1u)) == quintptr(1u)) {
val &= ~quintptr(1u);
- mtx->unlock();
+ mutex()->unlock();
}
}
}
inline void relock()
{
- if (mtx) {
+ if (val) {
if ((val & quintptr(1u)) == quintptr(0u)) {
- mtx->lock();
+ mutex()->lock();
val |= quintptr(1u);
}
}
@@ -140,10 +140,7 @@ public:
private:
Q_DISABLE_COPY(QMutexLocker)
- union {
- QMutex *mtx;
- quintptr val;
- };
+ quintptr val;
};
#else // QT_NO_THREAD
diff --git a/src/corelib/thread/qreadwritelock.h b/src/corelib/thread/qreadwritelock.h
index 278b8d4..9521ac3 100644
--- a/src/corelib/thread/qreadwritelock.h
+++ b/src/corelib/thread/qreadwritelock.h
@@ -96,19 +96,19 @@ public:
inline void unlock()
{
- if (q_lock) {
+ if (q_val) {
if ((q_val & quintptr(1u)) == quintptr(1u)) {
q_val &= ~quintptr(1u);
- q_lock->unlock();
+ readWriteLock()->unlock();
}
}
}
inline void relock()
{
- if (q_lock) {
+ if (q_val) {
if ((q_val & quintptr(1u)) == quintptr(0u)) {
- q_lock->lockForRead();
+ readWriteLock()->lockForRead();
q_val |= quintptr(1u);
}
}
@@ -119,14 +119,11 @@ public:
private:
Q_DISABLE_COPY(QReadLocker)
- union {
- QReadWriteLock *q_lock;
- quintptr q_val;
- };
+ quintptr q_val;
};
inline QReadLocker::QReadLocker(QReadWriteLock *areadWriteLock)
- : q_lock(areadWriteLock)
+ : q_val(reinterpret_cast<quintptr>(areadWriteLock))
{
Q_ASSERT_X((q_val & quintptr(1u)) == quintptr(0),
"QReadLocker", "QReadWriteLock pointer is misaligned");
@@ -143,19 +140,19 @@ public:
inline void unlock()
{
- if (q_lock) {
+ if (q_val) {
if ((q_val & quintptr(1u)) == quintptr(1u)) {
q_val &= ~quintptr(1u);
- q_lock->unlock();
+ readWriteLock()->unlock();
}
}
}
inline void relock()
{
- if (q_lock) {
+ if (q_val) {
if ((q_val & quintptr(1u)) == quintptr(0u)) {
- q_lock->lockForWrite();
+ readWriteLock()->lockForWrite();
q_val |= quintptr(1u);
}
}
@@ -167,14 +164,11 @@ public:
private:
Q_DISABLE_COPY(QWriteLocker)
- union{
- QReadWriteLock *q_lock;
- quintptr q_val;
- };
+ quintptr q_val;
};
inline QWriteLocker::QWriteLocker(QReadWriteLock *areadWriteLock)
- : q_lock(areadWriteLock)
+ : q_val(reinterpret_cast<quintptr>(areadWriteLock))
{
Q_ASSERT_X((q_val & quintptr(1u)) == quintptr(0),
"QWriteLocker", "QReadWriteLock pointer is misaligned");
diff --git a/src/corelib/tools/qregexp.cpp b/src/corelib/tools/qregexp.cpp
index 25255f9..b9e273f 100644
--- a/src/corelib/tools/qregexp.cpp
+++ b/src/corelib/tools/qregexp.cpp
@@ -523,7 +523,7 @@ int qFindString(const QChar *haystack, int haystackLen, int from,
\endtable
In the mode Wildcard, the wildcard characters cannot be
- escaped. In the mode WildcardUnix, the character '\' escapes the
+ escaped. In the mode WildcardUnix, the character '\\' escapes the
wildcard.
For example if we are in wildcard mode and have strings which
@@ -3774,7 +3774,7 @@ static void invalidateEngine(QRegExpPrivate *priv)
\value WildcardUnix This is similar to Wildcard but with the
behavior of a Unix shell. The wildcard characters can be escaped
- with the character "\".
+ with the character "\\".
\value FixedString The pattern is a fixed string. This is
equivalent to using the RegExp pattern on a string in
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 3ef0e66..03bc053 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -3185,7 +3185,7 @@ QString QString::section(const QRegExp &reg, int start, int end, SectionFlags fl
if (!empty || !(flags & SectionSkipEmpty))
x++;
}
- if((flags & SectionIncludeLeadingSep)) {
+ if((flags & SectionIncludeLeadingSep) && first_i < sections.size()) {
const qt_section_chunk &section = sections.at(first_i);
ret.prepend(section.string.left(section.length));
}