8 years ago[BB10-internal] QSslConfiguration: add API to persist and resume SSL sessions 4.8-bb10
Peter Hartmann [Tue, 30 Apr 2013 12:48:22 +0000 (14:48 +0200)]
[BB10-internal] QSslConfiguration: add API to persist and resume SSL sessions

Session tickets can be cached on the client side for hours (e.g.
graph.facebook.com: ~ 24 hours, api.twitter.com: 4 hours), because the
server does not need to maintain state.
We need public API for it so an application can cache the session (e.g.
to disk) and resume a session already with the 1st handshake, saving
one network round trip.

Task-number: QTBUG-20668
(backport of commit 3be197881f100d1c3c8f3ce00501d7a32eb51119)

Change-Id: I4c7f3a749edf0012b52deeb495706e550d24c42d
Signed-off-by: Peter Hartmann <phartmann@blackberry.com>
8 years ago[BB10-internal] SSL internals: fix memory corruption using QSslConfigurationPrivate
Peter Hartmann [Wed, 17 Apr 2013 15:42:32 +0000 (17:42 +0200)]
[BB10-internal] SSL internals: fix memory corruption using QSslConfigurationPrivate

We are passing a QSslConfigurationPrivate that is allocated on the stack
(in QSslSocketBackendPrivate::initSslContext()) to
QSslConfiguration::QSslConfiguration(QSslConfigurationPrivate *dd).
When the SSL context is destroyed, this object is not there any more.
So now we create a deep copy of the configuration like we do in

Task-number: QTBUG-30648
(backport of commit 3a43aff9deb4af0479914a26d68fb98d313369b6)
Signed-off-by: Peter Hartmann <phartmann@blackberry.com>
Change-Id: I0a39b2bc485ce5a3528b72e6e47c3bd124963b3b

8 years ago[BB10-internal] Workaround for PR 318290
Alan Alpert [Fri, 12 Apr 2013 22:34:11 +0000 (15:34 -0700)]
[BB10-internal] Workaround for PR 318290

Hard to reproduce crashes on application exit are being worked
around by leaking the memory (safe, as this should only occur on
application exit when the memory will be cleaned up at a process
level shortly).

Change-Id: I6525a39edc772277b8d92820f520542fcdc4580a
Signed-off-by: Peter Hartmann <phartmann@blackberry.com>
8 years ago[BB10-internal] Revert "[RIM-internal] QNetworkAccessManager: track online / accesibl...
Peter Hartmann [Mon, 1 Apr 2013 16:31:27 +0000 (18:31 +0200)]
[BB10-internal] Revert "[RIM-internal] QNetworkAccessManager: track online / accesible state without session"

This reverts commit 3a678bfb0d632d227541854a326f50722e2d0c74.

... because it causes crashes. It is probably not the commit that is
erroneous, but it seems there is some deeper lying problem.

Task-number: PR 316429
Change-Id: I355223563059b1a72ddb03b2254c0eccd554986a
Signed-off-by: Peter Hartmann <phartmann@blackberry.com>
8 years ago[BB10-internal] QNetworkAccessManager: track online / accesible state without session
Peter Hartmann [Thu, 28 Feb 2013 16:41:59 +0000 (17:41 +0100)]
[BB10-internal] QNetworkAccessManager: track online / accesible state without session

In particular, set online state right upon construction of the
QNetworkAccessManager instance.
Before, this would only work properly if a network session was created.
Now, networkAccessible() returns the correct status.

Change-Id: I7ff9ccfd18ad376a131fc5977843b55bf185fba0
Signed-off-by: Peter Hartmann <phartmann@rim.com>
8 years ago[BB10-internal] QHttpNetworkConnectionChannel: set bind addresses on the socket
Peter Hartmann [Mon, 25 Feb 2013 09:27:26 +0000 (10:27 +0100)]
[BB10-internal] QHttpNetworkConnectionChannel: set bind addresses on the socket

... and use it in QAbstractSocket. By the time we connect the socket
we do not know yet whether we will need an IPv4 or IPv6 bind address,
so we set both as properties on the socket and decide after host name
lookup and right before connecting.

Change-Id: I2be6ab4ab84e7e799158d7f42443337ad37b4e72
Signed-off-by: Peter Hartmann <phartmann@rim.com>
8 years ago[BB10-internal] HTTP internals: store QNetworkConfiguration to be set on the socket
Peter Hartmann [Wed, 20 Feb 2013 16:01:08 +0000 (17:01 +0100)]
[BB10-internal] HTTP internals: store QNetworkConfiguration to be set on the socket

The QNetworkConfiguration can be set via the QNetworkAccessManager
and needs to be set on the socket, e.g. when preferring cellular
traffic over Wifi.

Change-Id: Ia2d9ed8cdc29db77ca5d01b462aab65c72cca394
Signed-off-by: Peter Hartmann <phartmann@rim.com>
8 years ago[BB10-internal] QNetworkAccessManager: store QNetworkConfiguration instead of identifier
Peter Hartmann [Wed, 20 Feb 2013 16:17:38 +0000 (17:17 +0100)]
[BB10-internal] QNetworkAccessManager: store QNetworkConfiguration instead of identifier

In case a network session is not required, we need access to the
configuration object rather than to the QString. Also, only create a
session if the configuration manager needs one.

Change-Id: I05945525ce8247e343d0bebd7ec15e0e162ed826
Signed-off-by: Peter Hartmann <phartmann@rim.com>
8 years ago[BB10-internal] BB10 bearer plugin: populate list of host addresses
Peter Hartmann [Thu, 21 Feb 2013 13:42:25 +0000 (14:42 +0100)]
[BB10-internal] BB10 bearer plugin: populate list of host addresses

... so the sockets will know which address to bind to in case a non-
default interface should be used.

Change-Id: Ice0f946bf265fda50bd538a1f26d5fdd7a0dbd70
Signed-off-by: Peter Hartmann <phartmann@rim.com>
8 years ago[BB10-internal] QNetworkConfiguration: store list of host addresses
Peter Hartmann [Thu, 21 Feb 2013 13:42:04 +0000 (14:42 +0100)]
[BB10-internal] QNetworkConfiguration: store list of host addresses

... which can be populated by the bearer plugin.

Change-Id: Ibfa92eb7e480ef8c75b90f1dc0751c938d7afda7
Signed-off-by: Peter Hartmann <phartmann@rim.com>
8 years ago[BB10-internal] QAbstractSocket: delay bind for TCP and SSL sockets
Peter Hartmann [Thu, 21 Feb 2013 15:10:29 +0000 (16:10 +0100)]
[BB10-internal] QAbstractSocket: delay bind for TCP and SSL sockets

... because we delete the socket engine anyhow when connecting; so we
just store the local address, port and bind mode and bind after we
deleted the socket engine and before we connect to the server.

DNS traffic is still flowing over the standard interface, because there
seems to be no way to tell getaddrinfo() which route to use.

This change also requires the following changes:
- the socket engine needs to allow connections when in BoundState
- in bind(), we need to always set the local address and port from
  the socket engine, so that in case the bind() failed we clear the
  address and port again.

Change-Id: I883199a7869effc3a66f0ded37a949ba7cd95b3d
Signed-off-by: Peter Hartmann <phartmann@rim.com>
8 years ago[BB10-internal] Move support for socket binding from QUdpSocket to QAbstractSocketPrivate
Peter Hartmann [Sun, 23 Oct 2011 18:04:52 +0000 (20:04 +0200)]
[BB10-internal] Move support for socket binding from QUdpSocket to QAbstractSocketPrivate

(backport of 03f852cb47d508d98aa90f501e9b7f4214e8ad8b)
This is a backport of a Qt5 commit, moving the bind method to
QAbstractSocketPrivate to retain binary compatibility, yet still
being able to use it from the HTTP layer (i.e.

Task-number: QTBUG-121
Change-Id: I733efe90ea70c5774971f11d6a2054c84b467988
Signed-off-by: Peter Hartmann <phartmann@rim.com>
8 years ago[BB10-internal] SSL: Implement session sharing and use it from QNetworkAccessManager
Peter Hartmann [Fri, 21 Dec 2012 13:02:38 +0000 (14:02 +0100)]
[BB10-internal] SSL: Implement session sharing and use it from QNetworkAccessManager

This improves performance since a network round trip can be avoided.

Change-Id: I1aaff7e48ef9638cb137de0f43942c3a4dd2884a
Initial-patch-by: Markus Goetz <markus@woboq.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
Author: Marcel Krems <m.krems@software-vision.eu>
Date:   Thu Feb 7 05:24:52 2013 +0100
SSL: Use correct signature for SSL_get1_session

This fixes a compilation error with GCC 4.7
which was introduced in b5652df775efbd1c52eecee5f08e40e600e5d70b
In function ‘SSL_SESSION* q_SSL_get1_session(const SSL*)’:
invalid conversion from ‘const SSL* {aka const ssl_st*}’ to ‘SSL* {aka ssl_st*}’ [-fpermissive]

Change-Id: I909f7fb4295b2019283a7af66a038d4711e5f7cb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Peter Hartmann <phartmann@rim.com>
(backport of b5652df775efbd1c52eecee5f08e40e600e5d70b and
9b5ec67c18cba4e7b0b8a4d5c8c52b64da7549a9 squashed together)

Signed-off-by: Peter Hartmann <phartmann@rim.com>
8 years ago[BB10-internal] Revert "[BB10-internal] Remove QPerformanceTimer now that QElapsedTim...
Peter Hartmann [Mon, 21 Jan 2013 09:33:09 +0000 (10:33 +0100)]
[BB10-internal] Revert "[BB10-internal] Remove QPerformanceTimer now that QElapsedTimer contains the necessary bits"

This reverts commit 88966515993773e4d7d6276bce6fccfcc13ab6f4.

This apparently caused regressions in Cascades.

Change-Id: I004a89ff387fa4af6e11d77ff271e437d2f8e170
Signed-off-by: Peter Hartmann <phartmann@rim.com>
8 years ago[BB10-internal] QNetworkAccessManager: return default configuration if without session
Peter Hartmann [Mon, 7 Jan 2013 15:52:26 +0000 (16:52 +0100)]
[BB10-internal] QNetworkAccessManager: return default configuration if without session

... instead of a zero configuration. That is documented already for

Task-number: QTBUG-28973
(cherry picked from commit 1df2b9ee2376e132a6bf9596097351f0c79e6b73)

Change-Id: I074265525485b63adecad90f16fd4e2acf6d7b16
Signed-off-by: Peter Hartmann <phartmann@rim.com>
8 years agoDon't bypass overwritten [set]data() methods in the proxy.
Volker Krause [Sat, 4 May 2013 16:26:25 +0000 (18:26 +0200)]
Don't bypass overwritten [set]data() methods in the proxy.

By calling itemData() of the source model directly, the result cannot
contain data provided by the proxy model itself. The base class
implementation however will call data() on the proxy instead.

Cherry-picked from qtbase/96e3c2bcbfedc8b5cb8fc099229a02a1fa335c21.

Change-Id: I7e8b65ab045382089c577d9832edc1555b71419e
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
8 years agoMake Qt 4.8 also compile with the LSB SDK on Linux
Thiago Macieira [Sun, 5 May 2013 21:24:13 +0000 (14:24 -0700)]
Make Qt 4.8 also compile with the LSB SDK on Linux

Generate worse code.

This is similar to Qt5 commits 46bfd84fdc24fa3e3e721a5dda6cfbebe75be073
and c69106d1bf66d64e046c4f639542457151187dfc.

Task-number: QTBUG-25336
Change-Id: Idd61c23d2b528db9d8c7895df008b9c1b0e2a2a4
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
8 years agoFix QtScript crash on 64bit with JIT.
Friedemann Kleint [Mon, 28 Jan 2013 14:15:34 +0000 (15:15 +0100)]
Fix QtScript crash on 64bit with JIT.

During back-trace generation we calculate a code offset towards JIT generated
code. Using JITCode::offsetOf() will crash/assert if the offset doesn't fit
into 32 bits, because the generated code can only encode relative offsets
in 32-bits and not 64-bits. However in this context - backtrace generation -
we just want to calculate the offset and are not interested in this
architectural limitation, therefore we can just calculate the offset ourselves
using the fully sized uintptr_t.

Initial-patch-by: Simon.Hausmann@digia.com
Task-number: QTCREATORBUG-8629
Task-number: QTBUG-23463

Change-Id: I0efadd5ed20855409122e1fcc9236fdfbc4f62a4
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
(cherry picked from qtscript/3b26f6f6643978c9d041a6267dc88e2a59ced763)
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
8 years agoQLocale: Add fr_MA locale
El Mehdi Fekari [Thu, 2 May 2013 14:04:09 +0000 (16:04 +0200)]
QLocale: Add fr_MA locale

French_Morocco locale was introduced in CLDRv22.1 and already exists in Qt5

Change-Id: I4f0452f421cf074eb2c4fae22351d430d5f02e42
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
8 years agomake sure qmake finds itself in CWD on windows
Oswald Buddenhagen [Thu, 25 Apr 2013 14:44:30 +0000 (16:44 +0200)]
make sure qmake finds itself in CWD on windows

and consequently that it finds qt.conf.

Task-number: QTBUG-30583
Change-Id: I48441477e941d9609270d6e5e1b405127c0c0aca
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
(cherry picked from qtbase/e7c3b21b7c1ed9247cb2f9eeddc154534a038549)

8 years agoBring in WebKit r74029 to fix the build with clang.
Raphael Kubo da Costa [Sun, 28 Apr 2013 18:58:04 +0000 (21:58 +0300)]
Bring in WebKit r74029 to fix the build with clang.

r74029 | cwzwarich@webkit.org | 2010-12-14 18:57:14 +0200 (Tue, 14 Dec 2010) | 12 lines

Reviewed by Eric Seidel.

Clang fails to build the JSC interpreter

Clang does not allow indirect gotos out of scopes with cleanup. GCC 4.2 allows
them, but it does not correctly generate the cleanup, causing a leak if the
cleanup decrements a reference count.

* interpreter/Interpreter.cpp:
(JSC::Interpreter::privateExecute): Put an Identifier into its own scope.

Cherry-picked from qtscript/c85662167123b433a69a662212c67ce03e44a25a.

Change-Id: I21ee882961264d131cebdee04cb641c0d0de3d18
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
8 years agoFixed -dbus-linked when cross-compiling from Windows
Matt Fischer [Thu, 28 Feb 2013 16:52:12 +0000 (10:52 -0600)]
Fixed -dbus-linked when cross-compiling from Windows

Since Windows doesn't have pkg-config, it doesn't get -ldbus-1
added to the command line automatically like Linux does.  Code
was present to deal with this case, however it was only configured
to work when native-compiling Qt.  The flag was not added when
cross-compiling, meaning that -dbus-linked did not work correctly
in that case.  This patch changes the code to add the flag properly
in both cases.

Change-Id: I67881643bd658161f4929f3932859ccf636ca7a9
Task-number: QTBUG-29984
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry-picked from qtbase/c82b0815ec80b3750a110d47c68142bb448ddf56)
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
8 years agoFix QPluginLoader-test.
Friedemann Kleint [Mon, 1 Oct 2012 08:04:15 +0000 (10:04 +0200)]
Fix QPluginLoader-test.

Set correct working directory on Windows, do not create app-bundle
on Mac. Changing numbering of garbage libraries to 1..5.
use test data and and check for 'real' error message as well
as plugin cache message.

Set a fixed target for the test plugin, omitting debug suffixes
on Mac and Windows.

Change-Id: Ia2bf826d117ec346915de4cb24b16f8b6d61d579
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
8 years agoRevert "JSCore build fix for WEC7"
Janne Anttila [Wed, 24 Apr 2013 09:08:59 +0000 (11:08 +0200)]
Revert "JSCore build fix for WEC7"

I's reverted, because there seems to be at least two
implementations of the stl in WEC7. One for each BSP SDK
and one shipped with the compiler, which is in this
case Visual Studio 2008. The Compiler has a stl with std::min
etc. Visual Studio GUI also uses the compiler version of
the stl first. It seems to be that the environment was
setup wrongly. Checksdk also uses the right order.

The same patch is reverted for Qt5 as well:

This reverts commit 1fba05343eb6fea40f6617a62e31e10a0e918ec2

Change-Id: I956cc6f0669c67a094a2af464f8aa719a137a7a5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Björn Breitmeyer <bjoern.breitmeyer@kdab.com>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
8 years agoQNonContiguousByteDevice: reset() instead of seek() if possible
Peter Hartmann [Wed, 20 Mar 2013 10:40:30 +0000 (11:40 +0100)]
QNonContiguousByteDevice: reset() instead of seek() if possible

... because e.g. QHttpMultiPartIODevice does not implement seek at all
(QTBUG-30295), which would make resetting such a device fail.

(cherry picked from commit 804a067846cd90e3ca31f985d539c8d75d654d82)

Change-Id: I8ba1ef76cc6e7f5ebf0b39c9a75e3aea26980b82
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
8 years agoQHttpMultipart: reset read pointer when device is reset
Peter Hartmann [Wed, 20 Mar 2013 10:27:08 +0000 (11:27 +0100)]
QHttpMultipart: reset read pointer when device is reset

... otherwise we would not read from the beginning when trying to
read again. The device is reset when we try to resend a request
(e.g. remote host closed etc.).

(cherry picked from commit 795468bdc68931a90454bd1c975f7de7ba670e3b)

Change-Id: I8d7b3afb64b9cd25ee7c13b78f0b470d9dae3021
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
8 years agoFix some warnings in qtquick1 found by Clang
Thiago Macieira [Sat, 22 Dec 2012 08:33:21 +0000 (00:33 -0800)]
Fix some warnings in qtquick1 found by Clang

qml/qdeclarativevme.cpp:286:26: error: destination for this 'memset' call is a pointer to dynamic class 'QObject'; vtable pointer will be overwritten [-Werror,-Wdynamic-class-memaccess]
qml/qdeclarativemetatype.cpp:441:9: error: expression result unused; should this cast be to 'void'? [-Werror,-Wunused-value]
util/qdeclarativefontloader.cpp:87:52: error: addition of default argument on redeclaration makes this constructor a default constructor [-Werror,-Wdefault-arg-special-member]

Cherry-picked from qtquick1/99f138ad08101315cc871489c78cd10755b046b0

Change-Id: If0a690eacf9421f932214d2917cd3fa0a7daac9a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
8 years agoFix Mac OS X Carbon build with Qt in a namespace.
Danny Boelens [Thu, 21 Feb 2013 15:07:08 +0000 (16:07 +0100)]
Fix Mac OS X Carbon build with Qt in a namespace.

Change-Id: I03a4fa4ab7517929c723483deaf1dcb42a8f9b17
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
8 years agoqmlplugindump: add an explicit -relocatable flag
Fawzi Mohamed [Tue, 23 Apr 2013 17:09:22 +0000 (19:09 +0200)]
qmlplugindump: add an explicit -relocatable flag

* explicit -relocatable will allows us to change the default to
* add support for both -notrelocatable and the grammatically correct
* backport from qt5

Change-Id: I0f5335e2cf86ba2eda7ad80b4f7271b8b6ddcada
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
8 years agoFixed QLayout::addChildLayout(QLayout *l) when l had a parent
Jan Arve Saether [Tue, 23 Apr 2013 13:04:26 +0000 (15:04 +0200)]
Fixed QLayout::addChildLayout(QLayout *l) when l had a parent

Previously if l had a parent, addChildLayout would warn and skip the
reparenting, but it would still add the sub layout to the layout.
This caused some inconsistencies in the hierarchy which in worst case
could cause crashes.

Task-number: QTBUG-30758
(cherry-picked from qtbase commit 146658a10f290603470b800d71b778239e764312)
Change-Id: Iee6ace3189620395d7670007a23783823ed616b9
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
8 years agoFixed potential invalid memory access in OpenGL engine glyph cache.
Samuel Rødal [Mon, 22 Apr 2013 07:05:52 +0000 (09:05 +0200)]
Fixed potential invalid memory access in OpenGL engine glyph cache.

We need to clamp glyph_height to prevent from overflowing the texture
cache. A slightly similar issue was fixed for glyph_width in change
9520674b0f02aac55da6. Also, we should only increment the y_offset in
the place where we check for an overflow.

Task-number: QTBUG-26649

Change-Id: I297191b2ffd68a636bfced7f5284fd3b9383e988
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
8 years agoqsql_odbc: fix SQLGetStmtAtt usage
Mark Brand [Tue, 23 Apr 2013 20:46:43 +0000 (22:46 +0200)]
qsql_odbc: fix SQLGetStmtAtt usage

Failure to initialize the variable can cause spurious non-zero


"..value can either be a SQLULEN value or a null-terminated character
string. If the value is a SQLULEN value, some drivers may only write the
lower 32-bit or 16-bit of a buffer and leave the higher-order
bit unchanged. Therefore, applications should use a buffer of SQLULEN
and initialize the value to 0 before calling this function. Also, the
BufferLength and StringLengthPtr arguments are not used."

Follow-up to 1509316a37fb2d365230d020d1dfc251c830fd56

Change-Id: I2e92eb845a2590bea0849c52bde8902adff1b419
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
(cherry-picked from qtbase commit af35ee291a1bbbc8627f9a17f7e104898d49b138)

8 years agoODBC: lost info about column metadata on SQL_NO_DATA
Israel Lins [Mon, 18 Mar 2013 02:20:55 +0000 (23:20 -0300)]
ODBC: lost info about column metadata on SQL_NO_DATA

In reset() if SqlExecDirect returns SQL_NO_DATA the column metadata
is ignored.

Change-Id: I0501fa47c42754bba42b3531da59e66c696eac53
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
(cherry-picked from qtbase commit f9d856b3f5a4ceaeb8a5ac88aad2ad6b9e540abf)
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
8 years agoODBC: fixed consistence of return of QODBCResult::exec()
Israel Lins [Mon, 18 Mar 2013 02:23:15 +0000 (23:23 -0300)]
ODBC: fixed consistence of return of QODBCResult::exec()

The QODBCResult::exec() returns false when query is an delete
with no data do delete caused by SQLExecute function returning
SQL_NO_DATA, but the false return means error on execution.

Task-number:  QTBUG-10569
Change-Id: I6c7ebadcf62ab404b60c7bcccdab6a10bf16a923
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
(cherry-picked from qtbase commit 0646d1131b4bc65cdd9af29f4ce00fdd2398a3df)
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
8 years agoODBC: fix loss of milliseconds when binding QDateTime
Israel Lins [Mon, 11 Feb 2013 19:13:24 +0000 (16:13 -0300)]
ODBC: fix loss of milliseconds when binding QDateTime

Caused by operator precedence error.

Follow-up to commit b8b79a0f37ec74fd5b4ad829e522a384ba3622ae

Task-number: QTBUG-2192
Change-Id: I17decd18c469b48a0bc938ae05c16cced8042219
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
(cherry-picked from qtbase commit 36b6d4afc970a328cced87af3d39b70d327eb3ad)
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
8 years agoSSL internals: do not write after shutting down the socket
Peter Hartmann [Thu, 4 Apr 2013 09:30:43 +0000 (11:30 +0200)]
SSL internals: do not write after shutting down the socket

... but rather throw an error, so the HTTP layer can recover from a SSL
shutdown gracefully. In case the other side sent us a shutdown, we tried
to send one as well, which results in an error.

(backport of commit e145b67fbd54f147dab0f8e460280a9c8533aa7b)
Change-Id: I57291a5363cb0f6585dbd6aaa521c748766a1fdf
Reviewed-by: Richard J. Moore <rich@kde.org>
8 years agoIncrease the size of the QHostInfo cache.
Richard Moore [Sun, 3 Feb 2013 16:12:15 +0000 (16:12 +0000)]
Increase the size of the QHostInfo cache.

This change increases the size of the DNS cache in QHostInfo from 64
entries to 128. Given the figures in the google chrome performance paper
this should mean we can cache enough entries to handle 4 tabs at once.

(cherry picked from commit fd9013658bab096839154ae6e68adfd1a4e10189)

Change-Id: I824aa4127b6067c3ed6a2be3dbc819288ba41d1c
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
8 years agoAllow QHostInfo::lookupHost() with no receiver to warm the DNS cache.
Richard Moore [Mon, 4 Feb 2013 22:28:59 +0000 (22:28 +0000)]
Allow QHostInfo::lookupHost() with no receiver to warm the DNS cache.

This change lets you call QHostInfo::lookupHost() with a null receiver
in order to warm up the DNS cache. This allows you to try to get the
DNS request in flight early.

(cherry picked from commit 4030b6339c3dae4474f60b07700526fccf428b0c)

Change-Id: Ieac3c535b8f9b12a2f894510a898b349712e2fce
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
8 years agoAvoid macro re-definition after 65bd0bd1f047f6db6d67a8f089a9a409354b95a1
Konstantin Ritt [Thu, 21 Jun 2012 20:33:07 +0000 (23:33 +0300)]
Avoid macro re-definition after 65bd0bd1f047f6db6d67a8f089a9a409354b95a1

based on qt5/qtbase: a9ba92740670ddbbcb0c68f80ad1a18cf2ff0598

Change-Id: Ie036d502950f5e3c0b0297d480af6cfd351e3db0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
8 years agoQNX host lookup: do not try to load libresolv.so, it is not there
Peter Hartmann [Mon, 22 Apr 2013 15:23:52 +0000 (17:23 +0200)]
QNX host lookup: do not try to load libresolv.so, it is not there

Not trying to load the lib saves 30 - 50ms upon an apps' 1st host

Task-number: QTBUG-30809
(cherry picked from commit b4985215df767c14ddd888cbb2919be3a7617cfd)
Change-Id: If7338188c05f7fdf2ff80d06d91e7c7022e0e3d7
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
8 years agoFix for Sql query aliases with dots
Marko Kangas [Fri, 8 Feb 2013 10:10:26 +0000 (12:10 +0200)]
Fix for Sql query aliases with dots

Task-number: QTBUG-14904

Cherry-picked Qt5 change:

Change-Id: I81edd9df68cfde15900315978dc3742ca6e22df5
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
8 years agoFix a typo of an internal function name
Liang Qi [Tue, 23 Apr 2013 09:44:49 +0000 (11:44 +0200)]
Fix a typo of an internal function name

becomeDelegteForWindow -> becomeDelegateForWindow

Task-number: QTBUG-30754
Change-Id: Ied7fba42c642deb2c22ff414069659a62cb1a200
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
8 years agoFix warning about narrowing inside {}
Olivier Goffart [Mon, 30 Apr 2012 12:14:11 +0000 (14:14 +0200)]
Fix warning about narrowing inside {}

Such as
qdialogbuttonbox.cpp:259:1: warning: narrowing conversion of
‘2147483650u’ from ‘unsigned int’ to ‘const int’ inside { }

Cherry-picked from qtbase/e1d53553259e7edefb2a76712fd6a1ddc072d22d.

Change-Id: I7fa4b80cc21d5f4765c229f62ff977e7b9076e99
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
8 years agoFix C++11 narrowing error.
Raphael Kubo da Costa [Sun, 7 Apr 2013 16:53:25 +0000 (19:53 +0300)]
Fix C++11 narrowing error.

src/opengl/qgl_x11.cpp:1805:21: error: non-constant-expression cannot be
narrowed from type 'unsigned int' to 'int' in initializer list
  0x20D4, options & QGLContext::CanFlipNativePixmapBindOption ? 0xFFFFFFFF : 0,

Simply add an explicit cast to the expression to make it build with libc++.

No cherry-pick, this file does not exist in qt5.

Change-Id: Ic2fc636fc21a87dae848c062acb048e4a623a1f2
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
8 years agoFix QTableView::doItemsLayout()
J-P Nurmi [Tue, 16 Apr 2013 15:53:46 +0000 (17:53 +0200)]
Fix QTableView::doItemsLayout()

Keep the content aligned to the bottom when the view has been scrolled
to the bottom and the content is relayouted (for example due to

Task-number: QTBUG-30653
(cherry-picked from qtbase commit 00b11ccdead05d77589d4ec5ebb3b376c6ae2ca1)
Change-Id: I183145fbd84339e82d2d1d0bc39cea33d9cc9734
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
8 years agoQSystemTrayIcon: fix narrowing warning
Marc Mutz [Thu, 9 Aug 2012 13:43:56 +0000 (15:43 +0200)]
QSystemTrayIcon: fix narrowing warning

GCC complained:

  warning: narrowing conversion of
  from ‘WId {aka long long unsigned int}’ to ‘long int’ inside { } [-Wnarrowing]

Cherry-picked from qtbase/55819341a9fd899c3f105bd067dd2d1528c9efef.

Change-Id: Idb4caa09be160b8fed626bb154d6bf86c1a97f1c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
8 years agoExplicitly cast some shorts to ushorts.
Raphael Kubo da Costa [Mon, 22 Apr 2013 19:04:42 +0000 (22:04 +0300)]
Explicitly cast some shorts to ushorts.

This should fix some C++11 build errors, as clang was warning that r, g and
b were being narrowed from short to ushort.

Change-Id: I15333063bfdff3503d00e8baac18adcc343dba4b
Reviewed-by: David Faure (KDE) <faure@kde.org>
8 years agoQThreadDataPrivate: fix data race on canWait boolean.
David Faure [Fri, 15 Mar 2013 18:47:46 +0000 (19:47 +0100)]
QThreadDataPrivate: fix data race on canWait boolean.

postEvent() accesses it with the postEventList mutex locked, but
processEvent() was checking it without any mutex locked.

Change-Id: I31bbb50f7a1c337067b8e3de16ee7cd11400b517
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from qtbase/bf3a5ccef13d568662f027be62280aba1f73bada)
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
8 years agoFixed invalid memory read in SSSE3 image blending code.
Samuel Rodal [Fri, 19 Apr 2013 16:06:14 +0000 (17:06 +0100)]
Fixed invalid memory read in SSSE3 image blending code.

We need to do bounds comparison on the actual offset we're going to use
with _mm_load_si128 to read 16 bytes from memory (even though we won't
use the trailing bytes in the end).

Task-number: QTBUG-28324
(cherry-picked from qtbase commit 52619ae7787b3c4febb73a02afa623b12edabc97)
Change-Id: I705ae191312e5ffe25e45caea71ada73ec97f68d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
8 years agoFixed potential access violation in QPixmap::copy() for <32 bit pixmaps.
Samuel Rødal [Mon, 25 Feb 2013 08:58:34 +0000 (09:58 +0100)]
Fixed potential access violation in QPixmap::copy() for <32 bit pixmaps.

QImage is supposed to maintain the invariant that each scan-line begins
on a 4-byte boundary, so we need to verify that this is the case before
using the optimized path of short-cutting QImage::copy() by referencing
the source image's bits directly.

Task-number: QTBUG-14766
Change-Id: I0a178aeb2f34cc64f98deae9470b55b5c53fcb06
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
(cherry picked from commit 711773776ed324efce7f1ed227104da9c7e21e05)
Reviewed-by: aavit <eirik.aavitsland@digia.com>
8 years agoFix clang build on Mac OS X
Danny Boelens [Wed, 17 Apr 2013 12:30:13 +0000 (14:30 +0200)]
Fix clang build on Mac OS X

Clang doesn't like the extra qualification in the forward declaration. Let's
move the forward declaration outside of the Qt namespace, which is better anyway
since TabletProximityRec is defined in the Apple headers/global namespace.

Task-number: QTBUG-29373
Change-Id: Iba59e6592ccbbcc09e91e1b9831a0ee588469b23
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
8 years agoHarfbuzz: backporting fixes from upstream
Ahmed Saidi [Thu, 18 Apr 2013 18:27:55 +0000 (18:27 +0000)]
Harfbuzz: backporting fixes from upstream

81c8ef785b079980ad5b46be4fe7c7bf156dbf65 Fix crash!
81f2ecafa19b602f950df5a9e6e1b99c4b5ea55e Bug 30319
ff0612c2e7df1b86fc702c72e3015a6a5ae39b4c and
2dbd0fd11799c18bb6c66e337c3e31a1419823d4 Fix OOB access possibility
3bebe289aace6daa84b3d6983cebf5c58ddfad78 Fix problem with Indic shaper and control chars
90138e5a4d15c44f05456f90083ecacdc3196c8e Fix bad memory access in Myanmar shaper
b847f24ce855d24f6822bcd9c0006905e81b94d8 Fix Arabic cursive positioning
3ab7b37bdebf0f8773493a1fee910b151c4de30f Fix misc leaks

Change-Id: I6f3a6253782bff6abe4bf741d11c09fdd67542db
(cherry picked from qtbase/7df995a9bd3e989b4136f98424490604eb5178aa)
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
8 years agoMake linguist's source viewer respect the encoding of files.
Mitch Curtis [Wed, 17 Apr 2013 10:45:24 +0000 (12:45 +0200)]
Make linguist's source viewer respect the encoding of files.

It currently loads source files as latin1, which means other encodings
are not supported.

Qt 5 change: c4f1ac0fbcd452f440aee4a3304574cb7fbca0ce

Task-number: QTBUG-27238

Change-Id: Ieb4de351d93bd5ac2939692c5c53bd681fea4386
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
8 years agoqmlplugindump: correctly handle various versions of a meta object
Fawzi Mohamed [Tue, 9 Apr 2013 16:26:20 +0000 (18:26 +0200)]
qmlplugindump: correctly handle various versions of a meta object

Change-Id: I2775c2cf4a3a2b1295d389da665e5e8aadea21e9
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
8 years agoPrevent recursions when triggering menus in QToolButton
Frederik Gladhorn [Wed, 17 Apr 2013 08:31:45 +0000 (10:31 +0200)]
Prevent recursions when triggering menus in QToolButton

With a global shortcut set it would be possible
to let the button re-open the menu again and again,
each time spinning an event loop.

Backport of f5ea183cc6a6cd66fb3f804041fc112687e0a060 from qtbase

Task-number: QTBUG-30399
Change-Id: If7eddc115c77fef3df3e751fd72e7414cedaf272
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
8 years agoPrevent crash when moving elements of a ListView's ListModel.
Mitch Curtis [Tue, 16 Apr 2013 12:26:38 +0000 (14:26 +0200)]
Prevent crash when moving elements of a ListView's ListModel.

QDeclarativeListView::itemsMoved wasn't checking if its list of visible
items was empty before accessing its first element.

Task-number: QTBUG-26836
Change-Id: I5ed42889a55026f19e44e44d14080a61fff63b59
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
8 years agoQNetworkConfigurationManager: check whether app is shutting down
Peter Hartmann [Tue, 9 Apr 2013 16:25:00 +0000 (18:25 +0200)]
QNetworkConfigurationManager: check whether app is shutting down

... before trying to update the configurations. Before, we would check
whether the pointer to the QNetworkConfigurationManagerPrivate instance
was 0 and in that case construct it. This would mean that this code path
was taken "at app shutdown", i.e. when the qAddPostRoutine had already
been called but the other statics were still accessed.

Note: This is not thread safe, but neither is the rest of the code;
making it thread-safe would require additional changes.

Task-number: QTBUG-30585
(backport of commit cc028650e590ac49293558099b3fb87720e9793b)

Change-Id: Ifaae4d758a10b44bc7f838cdc0d3a1129ed63228
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
8 years agoRename qAbs Function for timeval
David E. Narváez [Sun, 24 Feb 2013 04:14:50 +0000 (23:14 -0500)]
Rename qAbs Function for timeval

This decouples it from qAbs which is declared as a constexpr under
certain compilation flags and enables for qtbase to be compiled with
GCC 4.8

Change-Id: I78e02256ffc8b460ca74ae5241e77dfac4e09ba9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry-picked from qtbase commit d9ff510f02bba63dabe7a081a68296056a89ae4c)
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
8 years agoSilence warning from clang
Bradley T. Hughes [Tue, 1 Nov 2011 12:53:13 +0000 (13:53 +0100)]
Silence warning from clang

The original intent was most likely to memset() the entire MD5Context to
zero at the end of MD5Final(), which we do now.

In file included from tools/qcryptographichash.cpp:49:
      argument to 'sizeof' in 'memset' call is the same expression as
      destination; did you mean to dereference it? [-Wsizeof-pointer-
        memset(ctx, 0, sizeof(ctx));    /* In case it's sensitive */
               ~~~            ^~~

Change-Id: I793c6f0944b89c0e4c5f9253cdb1071175c17152
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry-picked from qtbase commit 2bce4627e63947a3ed55009aeb8ff38974e444d3)
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
8 years agoDon't use UNAME_MACHINE on Linux
Thiago Macieira [Tue, 9 Apr 2013 20:45:10 +0000 (13:45 -0700)]
Don't use UNAME_MACHINE on Linux

We don't need it. Let linux-g++ be the default on all Linux builds,

Task-number: QTBUG-30590
Change-Id: I26c73bf4f054684763b64ef5651b3488363ea7a1
(cherry-picked from qtbase commit 2c5188f0777f4a0723b4cb9fd36354a357145519)
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
8 years agoQGtkStyle: remove an unnecessary sanity check for theme name
Dmitry Shachnev [Thu, 11 Apr 2013 13:32:00 +0000 (17:32 +0400)]
QGtkStyle: remove an unnecessary sanity check for theme name

This makes QGtkStyle working again on Debian experimental
and Ubuntu 13.04, where getThemeName() returns empty value.

Backported from QtBase b72aa1cad30a44b1.

Change-Id: If4cc822970088a5fb31aa28d9951db1efc0bb4fd
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
8 years agoBlackBerry: Adjust rotation according to initial orientation
Rafael Roquetto [Wed, 10 Apr 2013 19:07:15 +0000 (16:07 -0300)]
BlackBerry: Adjust rotation according to initial orientation

cherry-picked from qtbase f0425e115e5fe5d29191f0752659a28e9a4b6757

Task-number: QTBUG-29201
Change-Id: Iec31057749d98d66d43f13635da20d097756c8ea
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
8 years agoRemove unnecessary typedef, found by GCC 4.8
Thiago Macieira [Tue, 9 Apr 2013 23:41:23 +0000 (16:41 -0700)]
Remove unnecessary typedef, found by GCC 4.8

qtconcurrentfilter.h:108:47: warning: typedef 'Iterator' locally defined but not used [-Wunused-local-typedefs]

Qt5 commit: d4c241a98059edaa7a4b15beb1cfd16ed041284e (qtbase)
Task-number: QTBUG-30594
Change-Id: Icc69e41c2d4e11962f0c8434236d4847b46e7d9d
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
8 years agoconfigure: Fix url about evaluacion license
Sergio Ahumada [Tue, 9 Apr 2013 07:02:18 +0000 (09:02 +0200)]
configure: Fix url about evaluacion license

Change-Id: Ife495cb67b9b378cbf2668157752219a98c6b435
Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
8 years agoAdded support for multicore CPUs in QThread::idealThreadCount for INTEGRITY target.
Florian Behrens [Tue, 29 Jan 2013 22:48:11 +0000 (23:48 +0100)]
Added support for multicore CPUs in QThread::idealThreadCount for INTEGRITY target.

Cherry-picked from qt5 commit 90361fd36c803c4c5c28d67f05ed66f619e0d39c.

Change-Id: If13954d40d07aebf08b9a143964038c0996c325f
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
8 years agoUse delete[] instead of delete
Sergio Martins [Mon, 8 Apr 2013 10:10:08 +0000 (11:10 +0100)]
Use delete[] instead of delete

This fix isn't needed in Qt5 as the code doesn't exist there.
Change-Id: Icb8e0b45e5bc926cf0432ec3c990bc703f7b7b04
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
8 years agoQWizard/Win: Support RTL layout in Aero style
Ahmed Saidi [Thu, 4 Apr 2013 13:46:35 +0000 (13:46 +0000)]
QWizard/Win: Support RTL layout in Aero style

Task-number: QTBUG-30462
Change-Id: Ie6b3ba4975542a9d92611eb9a8547215e41d3c2c
(cherry picked from qtbase/6f0dc9f4c7c1405bdbfef32395d0fb091bb0c8c8)
Reviewed-by: Ahmed Saidi <justroftest@gmail.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
8 years agoAvoid socket notifiers on invalid file descriptors
Bernd Weimer [Fri, 5 Apr 2013 08:36:32 +0000 (10:36 +0200)]
Avoid socket notifiers on invalid file descriptors

There is potential trouble and no point in registering a QSocketNotifier
on an invalid file descriptor. This is prevented now in addition to the
existing warning.
Backported from qt5/qtbase: d20851f8ecd044479dd1892e92937a9135aa7856

Change-Id: I86e0a2c7ebdc6fb4cffcd39958003506ff01cb46
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
8 years agoCompile with clang when C++11 support is enabled
Bradley T. Hughes [Tue, 29 May 2012 05:32:47 +0000 (07:32 +0200)]
Compile with clang when C++11 support is enabled

text/qtextdocument_p.cpp:1070:43: error: non-constant-expression cannot
be narrowed from type 'int' to 'quint32' (aka 'unsigned int') in
initializer list [-Wc++11-narrowing]
text/qtextdocument_p.cpp:1070:43: note: override this message by
inserting an explicit cast

Cherry-picked from qtbase/6deebc817080f9eb86d5d6fbe50444678eed4dfe.

Change-Id: Id3faf59a8d30dc829b82508c4be50439db1d9722
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
8 years agoUse LC_MESSAGES instead of LC_NUMERIC in QSystemLocale::fallbackLocale()
Dmitry Shachnev [Sun, 31 Mar 2013 13:35:31 +0000 (17:35 +0400)]
Use LC_MESSAGES instead of LC_NUMERIC in QSystemLocale::fallbackLocale()

Backported from QtBase 7dfee3ffc5129307.

Change-Id: I5e7d0116ed95ede87c97d8ac2b9eff3b922818f7
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
8 years agoFixed a bug where the MaximumSizeHint of a layout with spans was wrong
Jan Arve Saether [Tue, 2 Apr 2013 13:05:30 +0000 (15:05 +0200)]
Fixed a bug where the MaximumSizeHint of a layout with spans was wrong

This was spotted while tracking down a similar bug related to spans.
This now also eliminates the Q_EXPECT_FAILs in
heightForWidthWithSpanning(), since it now finally works.

The problem was only for the maximum size, since the size of an ignored
row/column was min: 0, pref: 0, max: FLT_MAX (the default constructed
values for a QGridLayoutBox).

Change-Id: Ibb33c26ede40ed02edd26f596ba6133d59c9962f
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
(cherry picked from qtbase/9d7ae6dfbe25fb70a362a4cf955c187cd24cb007)

8 years agoqmake: increase .pro-file compatibility between Qt 4 and 5
Marc Mutz [Tue, 27 Nov 2012 14:20:08 +0000 (15:20 +0100)]
qmake: increase .pro-file compatibility between Qt 4 and 5

This patch makes qt.prf not warn about libraries in QT that are separate
modules in Qt 5, but exist as part of some larger library in Qt 4.

With this change, both Qt 4.8 and Qt 5 projects can use
  QT += widgets concurrent
to continue compiling unchanged under either Qt version.

Change-Id: I6f7c6a913377d7b44263c8ed152b272aa7ed9aa2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
8 years agoFix a bug in QSystemLocale on BB10
El Mehdi Fekari [Tue, 26 Mar 2013 17:41:53 +0000 (18:41 +0100)]
Fix a bug in QSystemLocale on BB10

Call qt_safe_open in the constructor
to avoid opening the pps files several times.

backport: f1d8987b82ce6b0a852b715a8713608bfd72aabf

Change-Id: Ia6b8ca339fa2f9f85df28792e95242b6ff7b70ca
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
8 years agoFixed a bug where spans across empty cells got broken.
Jan Arve Saether [Tue, 2 Apr 2013 12:35:47 +0000 (14:35 +0200)]
Fixed a bug where spans across empty cells got broken.

If a row/column is only used only because of the spanning of an item,
the cell should be treated as it didn't exist. We keep track of this
with the "ignore" bit array.

The old code would always start from the row/column at position 1.
In the attached testcase this made the effectiveRowSpan become larger
than actually needed.

Task-number: QTBUG-30255

Change-Id: Ief0e7018ee8e5ee36272ce075a43312ffeac7b91
(cherry picked from qtbase/f9e43c526a30ae3912adfe3d5cb781af5ddda4b0)
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
8 years agoAdding transformed support for QNX QWS plugin
Karim Pinter [Wed, 27 Feb 2013 12:21:46 +0000 (14:21 +0200)]
Adding transformed support for QNX QWS plugin

It implements the setDirty function which is called by the transformed
plugin when the screen is rotated. The rotated image is in the surface
memory, just the bliting is done here.

Task-number: QTBUG-29949
Change-Id: I0be2d037d6e1ef85106175aa47cc548b99b05a94
Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@digia.com>
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
8 years agoBlackBerry: Added warning when low memory event is received
Bernd Weimer [Thu, 21 Mar 2013 12:03:16 +0000 (13:03 +0100)]
BlackBerry: Added warning when low memory event is received

Low memory warning has been added for debug purposes.
Backport of 6b413dc32c485853710352a95e8bef928682558a

Change-Id: I79b3815d314227634b739935d85248cc526f2c89
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
8 years agoBlackBerry: show dialogs full screen
Rafael Roquetto [Wed, 27 Mar 2013 10:59:30 +0000 (07:59 -0300)]
BlackBerry: show dialogs full screen

Except for message box, which will have their optimal geometry calculated at

This fix is not necessary on Qt5

Change-Id: Ida4743acdceb5424ab93aa3a32c78db61dd6795c
Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
8 years agoFixed some declarative auto tests
Bernd Weimer [Wed, 13 Mar 2013 15:10:08 +0000 (16:10 +0100)]
Fixed some declarative auto tests

This is a backport from qt5/qtquick1 (commit aad8f0b)

Change-Id: Ia3eacce5ccd50827526203a9992ddef81a9f0c41
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
8 years agoWindows: Fix the last file dialog bottleneck.
Sergio Martins [Wed, 27 Mar 2013 18:30:44 +0000 (18:30 +0000)]
Windows: Fix the last file dialog bottleneck.

Went from taking 30 seconds to 2 seconds, on a SDCard with 10k files.

Windows file dialog does not resolve NTFS symlinks,
it just shows an empty icon, and the link name, not the target.

This allows for a big performance gain by reducing the number of
calls to GetFileAttributesEx() by checking the extension directly.

This also fixes the problems with the native file dialog, which
for some reason, is creating a QFileSystemModel too.

Task-number: QTBUG-13182
(cherry picked from commit 51f00deffac49c4277425837f0132b0c721bb689)

Change-Id: If7bd63d68e1870c5e48907ae79f4c4bdc6972b00
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
8 years agoWindows: Fix one of the two file dialog bottlenecks.
Sergio Martins [Wed, 27 Mar 2013 18:17:34 +0000 (18:17 +0000)]
Windows: Fix one of the two file dialog bottlenecks.

This patch reduces the number of calls to GetFileAttributesEx()
when icon lookup is being done.

The second bottleneck is a couple of isSymLink() calls. Will fix
that next.

Task-number: QTBUG-13182
(cherry picked from commit a7f6f32fadd5024697c16dfcbc07d6d11beb45fa)

Change-Id: If42b791d22fe0429a3b43992bad037afad09c448
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
8 years agoQMdi: Don't emit subWindowActivated during StyleChange handling.
David Faure [Wed, 28 Nov 2012 13:00:45 +0000 (14:00 +0100)]
QMdi: Don't emit subWindowActivated during StyleChange handling.

The handling of StyleChange de-maximizes the child window temporarily,
which was emitting subWindowActivated.
This would crash lokalize, because deactivating a window means deleting
the widgets associated with it, and style-change handling is done in
QApplication by looping over QApplication::allWidgets, which would then
contain dangling pointers.

Full valgrind log at https://bugs.kde.org/show_bug.cgi?id=271494#c7

Change-Id: I256da214bf00fd7925dcee67b4f0414e57fc453b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
(cherry picked from qtbase/a6e5ccbe223c5a606e15556e8708e863442d9f72)

8 years agoBackport some enum optimizations from Qt 5
Alan Alpert [Tue, 26 Mar 2013 23:20:30 +0000 (16:20 -0700)]
Backport some enum optimizations from Qt 5

(backport of 108b9bbe2ff2f5f31525408a08d248499d95a49f in qtquick1)

Saving the int when we check the enum is valid allows us to make it a
literal assignment instead of a binding, which is much faster on object

Change-Id: Ieb174289438a17574c4716df372b04d4dee6d0db
Reviewed-by: Christopher Adams <chris.adams@jollamobile.com>
8 years agoQNonContiguousByteDevice: roll back complete internal state in reset()
Peter Hartmann [Mon, 25 Mar 2013 14:55:40 +0000 (15:55 +0100)]
QNonContiguousByteDevice: roll back complete internal state in reset()

... otherwise we would not start reading from the beginning when the
device was reset.

Change-Id: I897adbad6e1f240fa871758ec7e3d6b499cb5944
(cherry-picked from commit ffe45f1896adfff93258b917f6a566dcc06a6597)
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
8 years agoSSL code: store SSL parameters for debugging, guarded by define
Peter Hartmann [Mon, 25 Mar 2013 09:21:46 +0000 (10:21 +0100)]
SSL code: store SSL parameters for debugging, guarded by define

... so SSL traffic can be decrypted with e.g. tcpdump / Wireshark.
For this to work, the define needs to be uncommented and QtNetwork
recompiled. This will create a file in /tmp/qt-ssl-keys which can
be fed into Wireshark.
A recent version of Wireshark is needed for this to work.

(cherry-picked from commit 1f180e9690a0a5f6cc849c1988ccda13de1b1e20)

Change-Id: I413ffd2494c780f92ccad7e4fdc11b790966e7ce
Reviewed-by: Richard J. Moore <rich@kde.org>
8 years agoFix Mac OS X crc/dwarf2 test for non-default Xcode setup.
Danny Boelens [Wed, 20 Feb 2013 17:11:53 +0000 (18:11 +0100)]
Fix Mac OS X crc/dwarf2 test for non-default Xcode setup.

The crc.test and dwarf2.test scripts are now using the
SDK and arch settings passed to it. If you install Xcode
without the "UNIX Development" option, this is essential
to let the compiler find standard headers and let the test
program compile successfully.

In addition, let configure pass the SDK and arch settings
given on the command line to the scripts.

These scripts are no longer present in Qt 5.

Change-Id: I78c0b3594b91827a6618a9a152949e9201ca64c8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
8 years agoQWindowsVistaStyle::drawPrimitive(PE_Frame): fix background clipping
J-P Nurmi [Wed, 20 Mar 2013 17:05:41 +0000 (18:05 +0100)]
QWindowsVistaStyle::drawPrimitive(PE_Frame): fix background clipping

The purpose of PE_Frame is to draw the frame, not the background. The
old code tried to check whether a custom base brush was set, and
otherwise let the theme draw the background. That didn't work together
with CSS background images. This change removes the background drawing
from PE_Frame, and let's PE_Widget to draw the background using the
base brush that defaults to a color fetched from the theme.

Task-number: QTBUG-24783
(cherry picked from qtbase/f1e681bed21e131864fe1e1c91679f7a56b06823)

Change-Id: Ief256d1d5861abc95dedf0b5d0a4f8e338c48941
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
8 years agomkspecs: fix the path for rcc for win32-g++
Liang Qi [Wed, 20 Mar 2013 13:30:46 +0000 (14:30 +0100)]
mkspecs: fix the path for rcc for win32-g++

patch not needed for Qt5

Task-number: QTBUG-27237
Change-Id: I41856f55b71661bfa01c4011129a35e110a234f9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
8 years agoMake QPixmap::grabWindow work on retina displays.
Morten Johan Sørvig [Fri, 8 Mar 2013 10:30:38 +0000 (11:30 +0100)]
Make QPixmap::grabWindow work on retina displays.

Scale by qt_mac_get_scalefactor.

Change-Id: I94cd4e0b2f81f7a83f14ff018e772dad1da10284
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
8 years agoUse [NSScreen backingScaleFactor] on 10.7+
Morten Johan Sørvig [Fri, 8 Mar 2013 10:24:10 +0000 (11:24 +0100)]
Use [NSScreen backingScaleFactor] on 10.7+

userSpaceScaleFactor is deprecated.

Change-Id: I892cb579e4b3ef9226495759c884d0e74c85a1d6
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
8 years agoFixed QPainter::drawPolyline() not drawing solid lines.
Samuel Rødal [Wed, 13 Mar 2013 10:40:48 +0000 (11:40 +0100)]
Fixed QPainter::drawPolyline() not drawing solid lines.

If a line segment isn't filled we keep using the same point of origin.

Task-number: QTBUG-26156
Change-Id: I20af8410a7039b69848f201ab62fd3c01b95531b
Reviewed-by: Titta Heikkala <titta.heikkala@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
(cherry picked from commit b528e1324add2208abf8f83fb51a8bd2183157f5)

8 years agoFixed artifacts when drawing same line with different clips.
Samuel Rødal [Thu, 14 Mar 2013 07:51:07 +0000 (08:51 +0100)]
Fixed artifacts when drawing same line with different clips.

Expanding on the change fixing QTBUG-24762 with the realization that any
line needs to be drawn in a consistent way regardless of system or
painter clip, not just dashed lines.

Task-number: QTBUG-25036
Change-Id: Ief7ef19cc92c52e7d792500a581a072ba032767e
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
(cherry picked from commit c7191d3e214b9cdb17ec383b61f7e21e784f80d0)

8 years agoInital port of QSystemLocale on BlackBerry 10
El Mehdi Fekari [Fri, 15 Mar 2013 18:03:36 +0000 (19:03 +0100)]
Inital port of QSystemLocale on BlackBerry 10

Backport of: a0c4a712263dbacd2c8d95da64e00bd213d05cbf

Change-Id: I4253067b42a8aa93325d48eeaa3a9937be2d2b75
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
8 years agoFixed bug in QTimeLine::setPaused(false)
Jan Arve Saether [Tue, 12 Mar 2013 10:24:37 +0000 (11:24 +0100)]
Fixed bug in QTimeLine::setPaused(false)

The problem was that the elapsed timer was not restarted,
causing the currentTime() not being adjusted for the time
it was paused.

(cherry-picked from Qt 5: 75614792fa2370b6b0402117bf)

Task-number: QTBUG-30108

Change-Id: I9718aa408075623514717328321c34e7ab3af436
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
8 years agoTests: stabilize tst_QDockWidget on small screens
J-P Nurmi [Mon, 18 Mar 2013 15:33:06 +0000 (16:33 +0100)]
Tests: stabilize tst_QDockWidget on small screens

The test has been recently failing in CI. The problem was easy to
reproduce in a virtual machine by resizing the window of the virtual
machine small enough. This change makes sure that the requested size
hint is significantly smaller than the desktop size, to avoid the
window manager stepping in and limiting the window size.

Change-Id: Id8ce63b2b88cbed964e0330633c5d2e1dc33598c
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
(cherry picked from commit 36e6632fa363152e1a0d42e53a0e5ada09092324)
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
8 years agoReorder for performance reasons.
Sérgio Martins [Mon, 11 Mar 2013 17:39:17 +0000 (17:39 +0000)]
Reorder for performance reasons.

isSymLink() can be expensive in a few cases.

Change-Id: Ib8b9f0c13d7ce141a539a4729be81d9faa4382ea
Reviewed-by: David Faure (KDE) <faure@kde.org>
(cherry picked from commit 1975e65d73ef2bf225bd765e6b50b6f50167f71c)
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
8 years agoImprove emission of FocusScope focusChanged signals.
Andrew den Exter [Wed, 13 Mar 2013 19:44:38 +0000 (20:44 +0100)]
Improve emission of FocusScope focusChanged signals.

Emit activeFocusChanged up the focus tree when an item receives a focus
event, rather than when the focusItem changes which happens before
internal state is sufficiently updated for hasFocus and hasActiveFocus
to return the correct values from within a changed signal handler.

There are some limitions to this. First the signals are not emitted
reliably when the scene is not active which makes sense for activeFocus
but not for focus.  The second is in some instances the focus and
activeFocus can update unnecessarily while the focus chain sorts itself

QDeclarativeItem tests by Andreas Aardal Hanssen <andreas@hanssen.name>

Task-number: QTBUG-28288
Task-number: QTBUG-25644
(cherry picked from qtquick1/c520a69f06317fb90d37324bf284ef9614cb5dbf)

Change-Id: Iac12bf8c95cbf3525b454f4afca06a54a5c14b4e
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
8 years agoQThread::isFinished should return true from finished()
Olivier Goffart [Thu, 3 Nov 2011 13:11:34 +0000 (14:11 +0100)]
QThread::isFinished should return true from finished()

and isRunning() should return false.

This restore the Qt 4.7 behaviour

In Qt 4.7, the finished() was called with the thread's intenal mutex
locked. Which mean that:
 - Call to isRunning or isFinished called from a slot connected to
   finish within the thread would deadlock. (Hence no compatibility
   to keep here)
 - Call to isRunning or isFinished from a slot connected with
   QueuedConnection in another thread would lock the mutex until
   the destructors are finished. and then return as if the thread have

Change-Id: I963eccae8f7634aff90cc4bbab6ca886a78e35eb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry-picked from qtbase commit ec5e59b73c20a7dc6aec96c829f1e53c3fa58c07)
Task-number: QTBUG-30251
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
8 years agoWebKit: Fix using macro to determine Mac user agent architecture
Jonathan Liu [Thu, 14 Mar 2013 02:24:32 +0000 (13:24 +1100)]
WebKit: Fix using macro to determine Mac user agent architecture

Using || operator with #ifdef is incorrect. As a result, the
architecture for the user agent is incorrectly set to PPC on an Intel

This is a partial backport of r128775 in WebKit upstream.

Task-number: QTBUG-30187
Change-Id: I6842f113fd024ababaf67e76dfee8f93e0988d08
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
8 years agoRemove the usage of undefined QFontDatabase::WritingSystem
Liang Qi [Sat, 16 Mar 2013 07:36:10 +0000 (08:36 +0100)]
Remove the usage of undefined QFontDatabase::WritingSystem

There is no definition for Yi, Tagalog...Braille in
QFontDatabase::WritingSystem, see the header file.
(cherry picked from commit qtbase b7b858595e6e2d8dcc9debeb45eb8b9b294b9be6)

Change-Id: I0d3625c58310d9af680799d20867f04b42845ca9
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
8 years agoClear the alphaCache when starting new painting
Andy Shaw [Thu, 7 Mar 2013 23:36:24 +0000 (00:36 +0100)]
Clear the alphaCache when starting new painting

The alpha cache needs to be cleared when starting a new paint otherwise
it will assume that some elements already exist in the PDF when they

Change-Id: I97451c53c0c99b80a25a057735cef7b3bb830a7a
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>