summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/src/development/qtestlib.qdoc2
-rw-r--r--doc/src/getting-started/installation.qdoc1
-rw-r--r--src/dbus/qdbusintegrator.cpp4
-rw-r--r--src/gui/math3d/qgenericmatrix.h68
-rw-r--r--src/gui/text/qtextengine.cpp14
-rw-r--r--src/gui/widgets/qstatusbar.cpp2
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp20
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel_p.h1
-rw-r--r--src/script/script.pro10
-rw-r--r--src/sql/models/qsqltablemodel.cpp2
-rw-r--r--src/testlib/qtestcase.cpp6
-rw-r--r--tests/auto/headers/tst_headers.cpp6
-rw-r--r--tests/auto/qnetworkreply/tst_qnetworkreply.cpp22
13 files changed, 103 insertions, 55 deletions
diff --git a/doc/src/development/qtestlib.qdoc b/doc/src/development/qtestlib.qdoc
index 08fdfc6..afe6e34 100644
--- a/doc/src/development/qtestlib.qdoc
+++ b/doc/src/development/qtestlib.qdoc
@@ -370,7 +370,7 @@
\title QTestLib Tutorial
This tutorial gives a short introduction to how to use some of the
- features of the QTestLib framework. It is divided into four
+ features of the QTestLib framework. It is divided into five
chapters:
\list 1
diff --git a/doc/src/getting-started/installation.qdoc b/doc/src/getting-started/installation.qdoc
index aa10aaf..4941325 100644
--- a/doc/src/getting-started/installation.qdoc
+++ b/doc/src/getting-started/installation.qdoc
@@ -963,6 +963,7 @@ We hope you will enjoy using Qt.
first install the Visual Studio Service Pack 1 available
\l{http://www.microsoft.com/downloads/details.aspx?FamilyId=BB4A75AB-E2D4-4C96-B39D-37BAF6B5B1DC&displaylang=en}{here}
to avoid runtime conflicts.
+ Additionally, you must use the Check for Updates feature in the Help menu of the Visual Studio 2005 IDE to apply at least the following security updates: KB937061, KB971023, KB971090, KB973673.
If you are using a source edition of Qt, you must first install Perl so
that the syncqt script invoked by configure can be executed. You can download
diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp
index 1842e5a..f64b7ca 100644
--- a/src/dbus/qdbusintegrator.cpp
+++ b/src/dbus/qdbusintegrator.cpp
@@ -565,10 +565,8 @@ bool QDBusConnectionPrivate::handleMessage(const QDBusMessage &amsg)
return true;
case QDBusMessage::ReplyMessage:
case QDBusMessage::ErrorMessage:
- return false; // we don't handle those here
case QDBusMessage::InvalidMessage:
- Q_ASSERT_X(false, "QDBusConnection", "Invalid message found when processing");
- break;
+ return false; // we don't handle those here
}
return false;
diff --git a/src/gui/math3d/qgenericmatrix.h b/src/gui/math3d/qgenericmatrix.h
index 3224ae2..f91bce7 100644
--- a/src/gui/math3d/qgenericmatrix.h
+++ b/src/gui/math3d/qgenericmatrix.h
@@ -198,52 +198,58 @@ Q_OUTOFLINE_TEMPLATE QGenericMatrix<M, N, T> QGenericMatrix<N, M, T>::transposed
template <int N, int M, typename T>
Q_OUTOFLINE_TEMPLATE QGenericMatrix<N, M, T>& QGenericMatrix<N, M, T>::operator+=(const QGenericMatrix<N, M, T>& other)
{
- for (int index = 0; index < N * M; ++index)
- m[0][index] += other.m[0][index];
+ for (int row = 0; row < M; ++row)
+ for (int col = 0; col < N; ++col)
+ m[col][row] += other.m[col][row];
return *this;
}
template <int N, int M, typename T>
Q_OUTOFLINE_TEMPLATE QGenericMatrix<N, M, T>& QGenericMatrix<N, M, T>::operator-=(const QGenericMatrix<N, M, T>& other)
{
- for (int index = 0; index < N * M; ++index)
- m[0][index] -= other.m[0][index];
+ for (int row = 0; row < M; ++row)
+ for (int col = 0; col < N; ++col)
+ m[col][row] -= other.m[col][row];
return *this;
}
template <int N, int M, typename T>
Q_OUTOFLINE_TEMPLATE QGenericMatrix<N, M, T>& QGenericMatrix<N, M, T>::operator*=(T factor)
{
- for (int index = 0; index < N * M; ++index)
- m[0][index] *= factor;
+ for (int row = 0; row < M; ++row)
+ for (int col = 0; col < N; ++col)
+ m[col][row] *= factor;
return *this;
}
template <int N, int M, typename T>
Q_OUTOFLINE_TEMPLATE bool QGenericMatrix<N, M, T>::operator==(const QGenericMatrix<N, M, T>& other) const
{
- for (int index = 0; index < N * M; ++index) {
- if (m[0][index] != other.m[0][index])
- return false;
- }
+ for (int row = 0; row < M; ++row)
+ for (int col = 0; col < N; ++col) {
+ if (m[col][row] != other.m[col][row])
+ return false;
+ }
return true;
}
template <int N, int M, typename T>
Q_OUTOFLINE_TEMPLATE bool QGenericMatrix<N, M, T>::operator!=(const QGenericMatrix<N, M, T>& other) const
{
- for (int index = 0; index < N * M; ++index) {
- if (m[0][index] != other.m[0][index])
- return true;
- }
+ for (int row = 0; row < M; ++row)
+ for (int col = 0; col < N; ++col) {
+ if (m[col][row] != other.m[col][row])
+ return true;
+ }
return false;
}
template <int N, int M, typename T>
Q_OUTOFLINE_TEMPLATE QGenericMatrix<N, M, T>& QGenericMatrix<N, M, T>::operator/=(T divisor)
{
- for (int index = 0; index < N * M; ++index)
- m[0][index] /= divisor;
+ for (int row = 0; row < M; ++row)
+ for (int col = 0; col < N; ++col)
+ m[col][row] /= divisor;
return *this;
}
@@ -251,8 +257,9 @@ template <int N, int M, typename T>
Q_OUTOFLINE_TEMPLATE QGenericMatrix<N, M, T> operator+(const QGenericMatrix<N, M, T>& m1, const QGenericMatrix<N, M, T>& m2)
{
QGenericMatrix<N, M, T> result(1);
- for (int index = 0; index < N * M; ++index)
- result.m[0][index] = m1.m[0][index] + m2.m[0][index];
+ for (int row = 0; row < M; ++row)
+ for (int col = 0; col < N; ++col)
+ result.m[col][row] = m1.m[col][row] + m2.m[col][row];
return result;
}
@@ -260,8 +267,9 @@ template <int N, int M, typename T>
Q_OUTOFLINE_TEMPLATE QGenericMatrix<N, M, T> operator-(const QGenericMatrix<N, M, T>& m1, const QGenericMatrix<N, M, T>& m2)
{
QGenericMatrix<N, M, T> result(1);
- for (int index = 0; index < N * M; ++index)
- result.m[0][index] = m1.m[0][index] - m2.m[0][index];
+ for (int row = 0; row < M; ++row)
+ for (int col = 0; col < N; ++col)
+ result.m[col][row] = m1.m[col][row] - m2.m[col][row];
return result;
}
@@ -284,8 +292,9 @@ template <int N, int M, typename T>
Q_OUTOFLINE_TEMPLATE QGenericMatrix<N, M, T> operator-(const QGenericMatrix<N, M, T>& matrix)
{
QGenericMatrix<N, M, T> result(1);
- for (int index = 0; index < N * M; ++index)
- result.m[0][index] = -matrix.m[0][index];
+ for (int row = 0; row < M; ++row)
+ for (int col = 0; col < N; ++col)
+ result.m[col][row] = -matrix.m[col][row];
return result;
}
@@ -293,8 +302,9 @@ template <int N, int M, typename T>
Q_OUTOFLINE_TEMPLATE QGenericMatrix<N, M, T> operator*(T factor, const QGenericMatrix<N, M, T>& matrix)
{
QGenericMatrix<N, M, T> result(1);
- for (int index = 0; index < N * M; ++index)
- result.m[0][index] = matrix.m[0][index] * factor;
+ for (int row = 0; row < M; ++row)
+ for (int col = 0; col < N; ++col)
+ result.m[col][row] = matrix.m[col][row] * factor;
return result;
}
@@ -302,8 +312,9 @@ template <int N, int M, typename T>
Q_OUTOFLINE_TEMPLATE QGenericMatrix<N, M, T> operator*(const QGenericMatrix<N, M, T>& matrix, T factor)
{
QGenericMatrix<N, M, T> result(1);
- for (int index = 0; index < N * M; ++index)
- result.m[0][index] = matrix.m[0][index] * factor;
+ for (int row = 0; row < M; ++row)
+ for (int col = 0; col < N; ++col)
+ result.m[col][row] = matrix.m[col][row] * factor;
return result;
}
@@ -311,8 +322,9 @@ template <int N, int M, typename T>
Q_OUTOFLINE_TEMPLATE QGenericMatrix<N, M, T> operator/(const QGenericMatrix<N, M, T>& matrix, T divisor)
{
QGenericMatrix<N, M, T> result(1);
- for (int index = 0; index < N * M; ++index)
- result.m[0][index] = matrix.m[0][index] / divisor;
+ for (int row = 0; row < M; ++row)
+ for (int col = 0; col < N; ++col)
+ result.m[col][row] = matrix.m[col][row] / divisor;
return result;
}
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 3bd6122..17d5fc1 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -894,16 +894,16 @@ void QTextEngine::shapeText(int item) const
if (letterSpacingIsAbsolute)
glyphs.advances_x[i-1] += letterSpacing;
else {
- const QFixed advance = glyphs.advances_x[i-1];
- glyphs.advances_x[i-1] += (letterSpacing - 100) * advance / 100;
+ QFixed &advance = glyphs.advances_x[i-1];
+ advance += (letterSpacing - 100) * advance / 100;
}
}
}
if (letterSpacingIsAbsolute)
glyphs.advances_x[si.num_glyphs-1] += letterSpacing;
else {
- const QFixed advance = glyphs.advances_x[si.num_glyphs-1];
- glyphs.advances_x[si.num_glyphs-1] += (letterSpacing - 100) * advance / 100;
+ QFixed &advance = glyphs.advances_x[si.num_glyphs-1];
+ advance += (letterSpacing - 100) * advance / 100;
}
}
if (wordSpacing != 0) {
@@ -2521,14 +2521,14 @@ void QTextEngine::setBoundary(int strPos) const
return;
int itemToSplit = 0;
- while (itemToSplit < layoutData->items.size() && layoutData->items[itemToSplit].position <= strPos)
+ while (itemToSplit < layoutData->items.size() && layoutData->items.at(itemToSplit).position <= strPos)
itemToSplit++;
itemToSplit--;
- if (layoutData->items[itemToSplit].position == strPos) {
+ if (layoutData->items.at(itemToSplit).position == strPos) {
// already a split at the requested position
return;
}
- splitItem(itemToSplit, strPos - layoutData->items[itemToSplit].position);
+ splitItem(itemToSplit, strPos - layoutData->items.at(itemToSplit).position);
}
void QTextEngine::splitItem(int item, int pos) const
diff --git a/src/gui/widgets/qstatusbar.cpp b/src/gui/widgets/qstatusbar.cpp
index c88d2a1..c60913e 100644
--- a/src/gui/widgets/qstatusbar.cpp
+++ b/src/gui/widgets/qstatusbar.cpp
@@ -575,7 +575,7 @@ void QStatusBar::reformat()
d->savedStrut = maxH;
vbox->addSpacing(2);
d->box->activate();
- repaint();
+ update();
}
/*!
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
index c8caad4..c4471eb 100644
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
@@ -66,6 +66,7 @@ QHttpNetworkConnectionChannel::QHttpNetworkConnectionChannel()
, bytesTotal(0)
, resendCurrent(false)
, lastStatus(0)
+ , unhandledError(QNetworkReply::NoError)
, pendingEncrypt(false)
, reconnectAttempts(2)
, authMethod(QAuthenticatorPrivate::None)
@@ -642,7 +643,23 @@ void QHttpNetworkConnectionChannel::allDone()
// slot connected to it. The socket will not fire readyRead signal, if we are already
// in the slot connected to readyRead
if (emitFinished)
- QMetaObject::invokeMethod(reply, "finished", Qt::QueuedConnection);
+ {
+ // Check whether _q_error was invoked previously and if it left a socket
+ // error unhandled AND that there are no http errors.
+ // In case there are both socket errors and http errors, the socket error is suppressed.
+ // Http errors are handled in the QNetworkAccessHttpBackend.
+ if(unhandledError != QNetworkReply::NoError && reply->statusCode() == 200) {
+ QString errorString = connection->d_func()->errorDetail(unhandledError, socket, socket->errorString());
+ qRegisterMetaType<QNetworkReply::NetworkError>("QNetworkReply::NetworkError");
+ QMetaObject::invokeMethod(reply, "finishedWithError",
+ Qt::QueuedConnection,
+ Q_ARG(QNetworkReply::NetworkError, unhandledError),
+ Q_ARG(QString, errorString));
+ } else {
+ QMetaObject::invokeMethod(reply, "finished", Qt::QueuedConnection);
+ }
+ unhandledError = QNetworkReply::NoError; // Reset the value
+ }
// reset the reconnection attempts after we receive a complete reply.
// in case of failures, each channel will attempt two reconnects before emitting error.
reconnectAttempts = 2;
@@ -964,6 +981,7 @@ void QHttpNetworkConnectionChannel::_q_error(QAbstractSocket::SocketError socket
errorCode = QNetworkReply::RemoteHostClosedError;
}
} else {
+ unhandledError = QNetworkReply::RemoteHostClosedError;
return;
}
break;
diff --git a/src/network/access/qhttpnetworkconnectionchannel_p.h b/src/network/access/qhttpnetworkconnectionchannel_p.h
index fd18042..e1d42fb 100644
--- a/src/network/access/qhttpnetworkconnectionchannel_p.h
+++ b/src/network/access/qhttpnetworkconnectionchannel_p.h
@@ -105,6 +105,7 @@ public:
qint64 bytesTotal;
bool resendCurrent;
int lastStatus; // last status received on this channel
+ QNetworkReply::NetworkError unhandledError; // Stored code of an unhandled error.
bool pendingEncrypt; // for https (send after encrypted)
int reconnectAttempts; // maximum 2 reconnection attempts
QAuthenticatorPrivate::Method authMethod;
diff --git a/src/script/script.pro b/src/script/script.pro
index 4ee86d7..d1633d8 100644
--- a/src/script/script.pro
+++ b/src/script/script.pro
@@ -84,5 +84,15 @@ symbian {
LIBS += -lhal
}
+symbian {
+ symbian-abld|symbian-sbsv2 {
+ MMP_RULES += ALWAYS_BUILD_AS_ARM
+ } else {
+ QMAKE_CFLAGS -= --thumb
+ QMAKE_CXXFLAGS -= --thumb
+ }
+ QMAKE_CXXFLAGS.ARMCC += -OTime -O3
+}
+
# WebKit doesn't compile in C++0x mode
*-g++*:QMAKE_CXXFLAGS -= -std=c++0x -std=gnu++0x
diff --git a/src/sql/models/qsqltablemodel.cpp b/src/sql/models/qsqltablemodel.cpp
index 8589163..974cf7b 100644
--- a/src/sql/models/qsqltablemodel.cpp
+++ b/src/sql/models/qsqltablemodel.cpp
@@ -265,7 +265,7 @@ QSqlRecord QSqlTableModelPrivate::primaryValues(int row)
QSqlTableModel can also be used to access a database
programmatically, without binding it to a view:
- \snippet doc/src/snippets/sqldatabase/sqldatabase.cpp 25
+ \snippet doc/src/snippets/sqldatabase/sqldatabase.cpp 21
The code snippet above extracts the \c salary field from record 4 in
the result set of the query \c{SELECT * from employee}.
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index e3a8726..207873e 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -298,10 +298,14 @@ QT_BEGIN_NAMESPACE
\relates QTest
- Implements a main() function that instantiates a QApplication object and
+ Implements a main() function that instantiates an application object and
the \a TestClass, and executes all tests in the order they were defined.
Use this macro to build stand-alone executables.
+ If \c QT_GUI_LIB is defined, the application object will be a QApplication,
+ otherwise it will be a QCoreApplication. If qmake is used and the configuration
+ includes \c{QT += gui}, then \c QT_GUI_LIB will be defined automatically.
+
\bold {Note:} On platforms that have keypad navigation enabled by default (eg: Symbian),
this macro will forcfully disable it to simplify the usage of key events when writing
autotests. If you wish to write a test case that uses keypad navigation, you should
diff --git a/tests/auto/headers/tst_headers.cpp b/tests/auto/headers/tst_headers.cpp
index 7ccf058..8c8bc2c 100644
--- a/tests/auto/headers/tst_headers.cpp
+++ b/tests/auto/headers/tst_headers.cpp
@@ -203,7 +203,7 @@ void tst_Headers::licenseCheck()
QFETCH(QString, sourceFile);
QFile f(sourceFile);
- QVERIFY(f.open(QIODevice::ReadOnly));
+ QVERIFY2(f.open(QIODevice::ReadOnly), qPrintable(f.errorString()));
QByteArray data = f.readAll();
data.replace("\r\n", "\n"); // Windows
data.replace('\r', '\n'); // Mac OS9
@@ -264,7 +264,7 @@ void tst_Headers::privateSlots()
return;
QFile f(header);
- QVERIFY(f.open(QIODevice::ReadOnly));
+ QVERIFY2(f.open(QIODevice::ReadOnly), qPrintable(f.errorString()));
QStringList content = QString::fromLocal8Bit(f.readAll()).split("\n");
foreach (QString line, content) {
@@ -286,7 +286,7 @@ void tst_Headers::macros()
return;
QFile f(header);
- QVERIFY(f.open(QIODevice::ReadOnly));
+ QVERIFY2(f.open(QIODevice::ReadOnly), qPrintable(f.errorString()));
QByteArray data = f.readAll();
QStringList content = QString::fromLocal8Bit(data.replace('\r', "")).split("\n");
diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
index cff0ae9..6cd9d3c 100644
--- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
@@ -2585,17 +2585,19 @@ void tst_QNetworkReply::ioGetFromHttpBrokenServer()
void tst_QNetworkReply::ioGetFromHttpStatus100_data()
{
QTest::addColumn<QByteArray>("dataToSend");
- QTest::newRow("normal") << QByteArray("HTTP/1.1 100 Continue\r\n\r\nHTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
- QTest::newRow("minimal") << QByteArray("HTTP/1.1 100 Continue\n\nHTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
- QTest::newRow("minimal2") << QByteArray("HTTP/1.1 100 Continue\n\nHTTP/1.0 200 OK\r\n\r\n");
- QTest::newRow("minimal3") << QByteArray("HTTP/1.1 100 Continue\n\nHTTP/1.0 200 OK\n\n");
- QTest::newRow("with_headers") << QByteArray("HTTP/1.1 100 Continue\r\nBla: x\r\n\r\nHTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
- QTest::newRow("with_headers2") << QByteArray("HTTP/1.1 100 Continue\nBla: x\n\nHTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
+ QTest::addColumn<QNetworkReply::NetworkError>("expectedError");
+ QTest::newRow("normal") << QByteArray("HTTP/1.1 100 Continue\r\n\r\nHTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n") << QNetworkReply::NoError;
+ QTest::newRow("minimal") << QByteArray("HTTP/1.1 100 Continue\n\nHTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n") << QNetworkReply::NoError;
+ QTest::newRow("minimal2") << QByteArray("HTTP/1.1 100 Continue\n\nHTTP/1.0 200 OK\r\n\r\n") << QNetworkReply::RemoteHostClosedError;
+ QTest::newRow("minimal3") << QByteArray("HTTP/1.1 100 Continue\n\nHTTP/1.0 200 OK\n\n") << QNetworkReply::RemoteHostClosedError;
+ QTest::newRow("with_headers") << QByteArray("HTTP/1.1 100 Continue\r\nBla: x\r\n\r\nHTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n") << QNetworkReply::NoError;
+ QTest::newRow("with_headers2") << QByteArray("HTTP/1.1 100 Continue\nBla: x\n\nHTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n") << QNetworkReply::NoError;
}
void tst_QNetworkReply::ioGetFromHttpStatus100()
{
QFETCH(QByteArray, dataToSend);
+ QFETCH(QNetworkReply::NetworkError, expectedError);
MiniHttpServer server(dataToSend);
server.doClose = true;
@@ -2607,7 +2609,7 @@ void tst_QNetworkReply::ioGetFromHttpStatus100()
QVERIFY(!QTestEventLoop::instance().timeout());
QCOMPARE(reply->url(), request.url());
- QCOMPARE(reply->error(), QNetworkReply::NoError);
+ QCOMPARE(reply->error(), expectedError);
QCOMPARE(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), 200);
QVERIFY(reply->rawHeader("bla").isNull());
}
@@ -2615,12 +2617,14 @@ void tst_QNetworkReply::ioGetFromHttpStatus100()
void tst_QNetworkReply::ioGetFromHttpNoHeaders_data()
{
QTest::addColumn<QByteArray>("dataToSend");
- QTest::newRow("justStatus+noheaders+disconnect") << QByteArray("HTTP/1.0 200 OK\r\n\r\n");
+ QTest::addColumn<QNetworkReply::NetworkError>("expectedError");
+ QTest::newRow("justStatus+noheaders+disconnect") << QByteArray("HTTP/1.0 200 OK\r\n\r\n") << QNetworkReply::RemoteHostClosedError;
}
void tst_QNetworkReply::ioGetFromHttpNoHeaders()
{
QFETCH(QByteArray, dataToSend);
+ QFETCH(QNetworkReply::NetworkError, expectedError);
MiniHttpServer server(dataToSend);
server.doClose = true;
@@ -2632,7 +2636,7 @@ void tst_QNetworkReply::ioGetFromHttpNoHeaders()
QVERIFY(!QTestEventLoop::instance().timeout());
QCOMPARE(reply->url(), request.url());
- QCOMPARE(reply->error(), QNetworkReply::NoError);
+ QCOMPARE(reply->error(), expectedError);
QCOMPARE(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), 200);
}