summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFrans Englich <frans.englich@nokia.com>2010-04-12 16:03:34 (GMT)
committerFrans Englich <frans.englich@nokia.com>2010-04-12 16:03:34 (GMT)
commit89cefe224e5d223c4fd6e0cd735f1e5230684251 (patch)
tree8d1f0ab9e227926da2a845e497afd7abe4d9b56c /src
parente0408d9aaa19c16fd78fd9a2bf9edd25abf8bb9e (diff)
parent4049dc98f1437cbbfdde5bd1ac16a7e69d65d254 (diff)
downloadQt-89cefe224e5d223c4fd6e0cd735f1e5230684251.zip
Qt-89cefe224e5d223c4fd6e0cd735f1e5230684251.tar.gz
Qt-89cefe224e5d223c4fd6e0cd735f1e5230684251.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.6
Diffstat (limited to 'src')
-rw-r--r--src/corelib/codecs/qtextcodec.cpp39
-rw-r--r--src/corelib/codecs/qtextcodec.h5
-rw-r--r--src/gui/dialogs/qfiledialog.ui36
-rw-r--r--src/gui/text/qtextcontrol.cpp6
-rw-r--r--src/network/socket/qnativesocketengine_unix.cpp29
-rw-r--r--src/plugins/accessible/widgets/complexwidgets.cpp3
-rw-r--r--src/s60installs/qt.iby1
7 files changed, 104 insertions, 15 deletions
diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp
index c0aa342..18538e3 100644
--- a/src/corelib/codecs/qtextcodec.cpp
+++ b/src/corelib/codecs/qtextcodec.cpp
@@ -103,6 +103,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
(QTextCodecFactoryInterface_iid, QLatin1String("/codecs")))
#endif
+
static char qtolower(register char c)
{ if (c >= 'A' && c <= 'Z') return c + 0x20; return c; }
static bool qisalnum(register char c)
@@ -217,6 +218,19 @@ QTextCodecCleanup::~QTextCodecCleanup()
Q_GLOBAL_STATIC(QTextCodecCleanup, createQTextCodecCleanup)
+bool QTextCodec::validCodecs()
+{
+#ifdef Q_OS_SYMBIAN
+ // If we don't have a trap handler, we're outside of the main() function,
+ // ie. in global constructors or destructors. Don't use codecs in this
+ // case as it would lead to crashes because we don't have a cleanup stack on Symbian
+ return (User::TrapHandler() != NULL);
+#else
+ return true;
+#endif
+}
+
+
#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
class QWindowsLocalCodec: public QTextCodec
{
@@ -671,6 +685,14 @@ static void setup()
if (all)
return;
+#ifdef Q_OS_SYMBIAN
+ // If we don't have a trap handler, we're outside of the main() function,
+ // ie. in global constructors or destructors. Don't create codecs in this
+ // case as it would lead to crashes because of a missing cleanup stack on Symbian
+ if (User::TrapHandler() == NULL)
+ return;
+#endif
+
#ifdef Q_DEBUG_TEXTCODEC
if (destroying_is_ok)
qWarning("QTextCodec: Creating new codec during codec cleanup");
@@ -964,6 +986,9 @@ QTextCodec *QTextCodec::codecForName(const QByteArray &name)
#endif
setup();
+ if (!validCodecs())
+ return 0;
+
static QHash <QByteArray, QTextCodec *> cache;
if (clearCaches & 0x1) {
cache.clear();
@@ -1005,6 +1030,9 @@ QTextCodec* QTextCodec::codecForMib(int mib)
#endif
setup();
+ if (!validCodecs())
+ return 0;
+
static QHash <int, QTextCodec *> cache;
if (clearCaches & 0x2) {
cache.clear();
@@ -1052,6 +1080,10 @@ QList<QByteArray> QTextCodec::availableCodecs()
setup();
QList<QByteArray> codecs;
+
+ if (!validCodecs())
+ return codecs;
+
for (int i = 0; i < all->size(); ++i) {
codecs += all->at(i)->name();
codecs += all->at(i)->aliases();
@@ -1090,6 +1122,10 @@ QList<int> QTextCodec::availableMibs()
setup();
QList<int> codecs;
+
+ if (!validCodecs())
+ return codecs;
+
for (int i = 0; i < all->size(); ++i)
codecs += all->at(i)->mibEnum();
@@ -1140,6 +1176,9 @@ void QTextCodec::setCodecForLocale(QTextCodec *c)
QTextCodec* QTextCodec::codecForLocale()
{
+ if (!validCodecs())
+ return 0;
+
if (localeMapper)
return localeMapper;
diff --git a/src/corelib/codecs/qtextcodec.h b/src/corelib/codecs/qtextcodec.h
index 169fe82..e82f8a4 100644
--- a/src/corelib/codecs/qtextcodec.h
+++ b/src/corelib/codecs/qtextcodec.h
@@ -145,12 +145,13 @@ public:
private:
friend class QTextCodecCleanup;
static QTextCodec *cftr;
+ static bool validCodecs();
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QTextCodec::ConversionFlags)
-inline QTextCodec* QTextCodec::codecForTr() { return cftr; }
+ inline QTextCodec* QTextCodec::codecForTr() { return validCodecs() ? cftr : 0; }
inline void QTextCodec::setCodecForTr(QTextCodec *c) { cftr = c; }
-inline QTextCodec* QTextCodec::codecForCStrings() { return QString::codecForCStrings; }
+inline QTextCodec* QTextCodec::codecForCStrings() { return validCodecs() ? QString::codecForCStrings : 0; }
inline void QTextCodec::setCodecForCStrings(QTextCodec *c) { QString::codecForCStrings = c; }
class Q_CORE_EXPORT QTextEncoder {
diff --git a/src/gui/dialogs/qfiledialog.ui b/src/gui/dialogs/qfiledialog.ui
index b52bd8a..1f35abb 100644
--- a/src/gui/dialogs/qfiledialog.ui
+++ b/src/gui/dialogs/qfiledialog.ui
@@ -83,6 +83,12 @@
<property name="toolTip" >
<string>Back</string>
</property>
+ <property name="accessibleName">
+ <string>Back</string>
+ </property>
+ <property name="accessibleDescription">
+ <string>Go back</string>
+ </property>
</widget>
</item>
<item>
@@ -90,6 +96,12 @@
<property name="toolTip" >
<string>Forward</string>
</property>
+ <property name="accessibleName">
+ <string>Forward</string>
+ </property>
+ <property name="accessibleDescription">
+ <string>Go forward</string>
+ </property>
</widget>
</item>
<item>
@@ -97,6 +109,12 @@
<property name="toolTip" >
<string>Parent Directory</string>
</property>
+ <property name="accessibleName">
+ <string>Parent Directory</string>
+ </property>
+ <property name="accessibleDescription">
+ <string>Go to the parent directory</string>
+ </property>
</widget>
</item>
<item>
@@ -104,6 +122,12 @@
<property name="toolTip" >
<string>Create New Folder</string>
</property>
+ <property name="accessibleName">
+ <string>Create New Folder</string>
+ </property>
+ <property name="accessibleDescription">
+ <string>Create a New Folder</string>
+ </property>
</widget>
</item>
<item>
@@ -111,6 +135,12 @@
<property name="toolTip" >
<string>List View</string>
</property>
+ <property name="accessibleName">
+ <string>List View</string>
+ </property>
+ <property name="accessibleDescription">
+ <string>Change to list view mode</string>
+ </property>
</widget>
</item>
<item>
@@ -118,6 +148,12 @@
<property name="toolTip" >
<string>Detail View</string>
</property>
+ <property name="accessibleName">
+ <string>Detail View</string>
+ </property>
+ <property name="accessibleDescription">
+ <string>Change to detail view mode</string>
+ </property>
</widget>
</item>
</layout>
diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp
index aaaa3ca..2206e5e 100644
--- a/src/gui/text/qtextcontrol.cpp
+++ b/src/gui/text/qtextcontrol.cpp
@@ -1199,7 +1199,8 @@ void QTextControlPrivate::keyPressEvent(QKeyEvent *e)
blockFmt.setIndent(blockFmt.indent() - 1);
cursor.setBlockFormat(blockFmt);
} else {
- cursor.deletePreviousChar();
+ QTextCursor localCursor = cursor;
+ localCursor.deletePreviousChar();
}
goto accept;
}
@@ -1232,7 +1233,8 @@ void QTextControlPrivate::keyPressEvent(QKeyEvent *e)
}
#endif
else if (e == QKeySequence::Delete) {
- cursor.deleteChar();
+ QTextCursor localCursor = cursor;
+ localCursor.deleteChar();
}
else if (e == QKeySequence::DeleteEndOfWord) {
if (!cursor.hasSelection())
diff --git a/src/network/socket/qnativesocketengine_unix.cpp b/src/network/socket/qnativesocketengine_unix.cpp
index 9a2c349..354c944 100644
--- a/src/network/socket/qnativesocketengine_unix.cpp
+++ b/src/network/socket/qnativesocketengine_unix.cpp
@@ -601,10 +601,15 @@ bool QNativeSocketEnginePrivate::nativeHasPendingDatagrams() const
// Peek 0 bytes into the next message. The size of the message may
// well be 0, so we can't check recvfrom's return value.
ssize_t readBytes;
+#ifdef Q_OS_SYMBIAN
+ char c;
+ readBytes = ::recvfrom(socketDescriptor, &c, 1, MSG_PEEK, &storage.a, &storageSize);
+#else
do {
char c;
readBytes = ::recvfrom(socketDescriptor, &c, 1, MSG_PEEK, &storage.a, &storageSize);
} while (readBytes == -1 && errno == EINTR);
+#endif
// If there's no error, or if our buffer was too small, there must be a
// pending datagram.
@@ -661,11 +666,17 @@ qint64 QNativeSocketEnginePrivate::nativeReceiveDatagram(char *data, qint64 maxS
sz = sizeof(aa);
ssize_t recvFromResult = 0;
+#ifdef Q_OS_SYMBIAN
+ char c;
+ recvFromResult = ::recvfrom(socketDescriptor, maxSize ? data : &c, maxSize ? maxSize : 1,
+ 0, &aa.a, &sz);
+#else
do {
char c;
recvFromResult = ::recvfrom(socketDescriptor, maxSize ? data : &c, maxSize ? maxSize : 1,
0, &aa.a, &sz);
} while (recvFromResult == -1 && errno == EINTR);
+#endif
if (recvFromResult == -1) {
setError(QAbstractSocket::NetworkError, ReceiveDatagramErrorString);
@@ -832,17 +843,17 @@ qint64 QNativeSocketEnginePrivate::nativeWrite(const char *data, qint64 len)
// ignore the SIGPIPE signal
qt_ignore_sigpipe();
- // loop while ::write() returns -1 and errno == EINTR, in case
- // of an interrupting signal.
ssize_t writtenBytes;
- do {
#ifdef Q_OS_SYMBIAN
- writtenBytes = ::write(socketDescriptor, data, len);
+ // Symbian does not support signals natively and Open C returns EINTR when moving to offline
+ writtenBytes = ::write(socketDescriptor, data, len);
#else
+ // loop while ::write() returns -1 and errno == EINTR, in case
+ // of an interrupting signal.
+ do {
writtenBytes = qt_safe_write(socketDescriptor, data, len);
-#endif
- // writtenBytes = QT_WRITE(socketDescriptor, data, len); ### TODO S60: Should this line be removed or the one above it?
} while (writtenBytes < 0 && errno == EINTR);
+#endif
if (writtenBytes < 0) {
switch (errno) {
@@ -882,13 +893,13 @@ qint64 QNativeSocketEnginePrivate::nativeRead(char *data, qint64 maxSize)
}
ssize_t r = 0;
- do {
#ifdef Q_OS_SYMBIAN
- r = ::read(socketDescriptor, data, maxSize);
+ r = ::read(socketDescriptor, data, maxSize);
#else
+ do {
r = qt_safe_read(socketDescriptor, data, maxSize);
-#endif
} while (r == -1 && errno == EINTR);
+#endif
if (r < 0) {
r = -1;
diff --git a/src/plugins/accessible/widgets/complexwidgets.cpp b/src/plugins/accessible/widgets/complexwidgets.cpp
index b4ca8f2..8be1560 100644
--- a/src/plugins/accessible/widgets/complexwidgets.cpp
+++ b/src/plugins/accessible/widgets/complexwidgets.cpp
@@ -724,7 +724,8 @@ public:
if (start.isValid()) {
m_current = start;
} else if (m_view && m_view->model()) {
- m_current = view->model()->index(0, 0);
+ m_current = view->rootIndex().isValid() ?
+ view->rootIndex().child(0,0) : view->model()->index(0, 0);
}
}
diff --git a/src/s60installs/qt.iby b/src/s60installs/qt.iby
index ec019e2..595734d 100644
--- a/src/s60installs/qt.iby
+++ b/src/s60installs/qt.iby
@@ -19,7 +19,6 @@ file=ABI_DIR\BUILD_DIR\QtWebKit.dll SHARED_LIB_DIR\QtWebKit.dll
file=ABI_DIR\BUILD_DIR\phonon.dll SHARED_LIB_DIR\phonon.dll
file=ABI_DIR\BUILD_DIR\QtMultimedia.dll SHARED_LIB_DIR\QtMultimedia.dll
file=ABI_DIR\BUILD_DIR\QtXmlPatterns.dll SHARED_LIB_DIR\QtXmlPatterns.dll
-file=ABI_DIR\BUILD_DIR\QtDeclarative.dll SHARED_LIB_DIR\QtDeclarative.dll
// imageformats
file=ABI_DIR\BUILD_DIR\qgif.dll SHARED_LIB_DIR\qgif.dll