QNX: adapt SSL lib file name lookup heuristics

I.e. do not try to load file names that are not there anyhow. The
code would search for libcrypto.so.1.0.0 and libssl.so.1.0.0, while
on QNX the libs are called libcrypto.so and libssl.so, and there
are no symlinks with version numbers.

This saves ~ 45 ms in real apps (tested with Facebook, Twitter and
Foursquare), and ~ 24 ms at app startup in an isolated app without
GUI (difference maybe because threads are fighting for CPU or so).

Task-number: QTBUG-32548
(backport of commit 69b31f7b657a7ca611ad980c2974597de160598c)

Change-Id: I33e1c9e2c490b9c7f94aca06add8dc183cce083d
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Expose invokables that are not slots in the xml

Without it the invocations were working but were not listed on introspection

Backported from Qt5: qtbase commit c3f485c5250a503832e767e1fe5e40595126f6c5

Change-Id: Ie62f7dc3577f52b6888ddebf0392fdf51f2845a5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
[Qt][WK1] navigator.plugins shows too few entries.

Backport r153517 from webkit trunk and Qt 5 to Qt 4.8.

https://bugs.webkit.org/show_bug.cgi?id=119332

Reviewed by Jocelyn Turcotte.

Based on input by Choon Sik Cho.

WebPlatformStrategies::getPluginInfo was using the
WTF::Vector::resize method wrongly.

This patch removes the call to Vector::resize as
Vector::append will take care of increasing capacity
if needed.

* WebCoreSupport/WebPlatformStrategies.cpp:
(WebPlatformStrategies::getPluginInfo):

Task-Number: QTBUG-30141
Change-Id: Ief250ee98c4c5d2cb5165d6da3d7b43c54cbd7c8
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
configure: Add QtConcurrent support for Sun CC 5.1x

It compiles and demos run without crashing.

Change-Id: I570a0855ec4fc5673e45580bfdbc387cf86680d0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Remove Nokia reference in Qt Test documentation

Task-number: QTBUG-29307
Change-Id: I00d7faa32058a74955f57296dad900f150dbbf6f
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Don't crash if the relayed signal was emitted from the wrong thread

Under normal circumstances, this should never happen. Signals exported
to D-Bus should only be emitted from the object's own thread. That's the
only way for the receiver (the QDBusAdaptorConnector object) to know
what the sender object and signal were. If they are emitted from another
thread, the sender will be null.

Task-number: QTBUG-31932
Change-Id: Ia5a45d648985e0645bffd4abc0881fca9da64f79
(cherry-picked from qtbase commit d94961d08f91696824d9035f666af5fe28d59ef6)
Reviewed-by: Peter Seiderer <ps.report@gmx.net>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QDBusPendingCall: add a missing QWaitCondition::wakeAll() call

In QDBusConnectionPrivate::waitForFinished(), threads that see
pcall->waitingForFinished == true go to sleep on
pcall->waitForFinishedCondition, but there was no call to
waitForFinishedCondition.wakeAll() anywhere in the code, so add it.

Change-Id: I8d068dc0cc4f20786eb40fd7e2bb9840d8b70c7f
(cherry-picked from qtbase commit 20d7763b19400c062a07f440cc601f486be4039b)
Reviewed-by: Peter Seiderer <ps.report@gmx.net>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Fix unprotected access to QDBusPendingCallPrivate::pending.

In QDBusConnectionPrivate::waitForFinished() pcall->pending was used
after the protection by pcall->mutex was released. A simultaneous
call to QDBusConnectionPrivate::processFinishedCall() was able
to reset pcall->pending to null before it was used for the
q_dbus_pending_call_block(pcall->pending) call.

Fixed by releasing (and setting to 0) of pcall->pending in
processFinishedCall() only in case no one is waiting yet, otherwise
release pcall->pending by the first thread waiting in waitForFinished().

There is still a race condition about deleting QDBusPendingCallPrivate
(too early) which will be fixed in the next two commits.

Task-number: QTBUG-27809
Change-Id: I040173810ad90653fe1bd1915f22d8dd70d47d8c
(cherry-picked from qtbase commit 64e3bd481e5d54d555959ceecbd5c4576c571241)
Reviewed-by: Peter Seiderer <ps.report@gmx.net>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Remove QDBusPendingCallPrivate::autoDelete logic.

First step to fix race condition about deleting QDBusPendingCallPrivate.

In a multithreaded application on a slow/single core cpu the following
race (and segmentation fault) can occur:

First thread A is running:
A:  QDBusPendingReply<> reply = pi->asyncCallWithArgumentList(method, argumentList);

Then when the dbus answer arrives thread B will call:

B:  QDBusConnectionPrivate::processFinishedCall()
B:      ...
B:      locker.unlock()

and runs until here, go on with thread A:

A:  reply.waitForFinished();
A:    QDBusPendingCallPrivate::waitForFinished()
A:    {
A:        QMutexLocker locker(&mutex);
A:        if (replyMessage.type() != QDBusMessage::InvalidMessage)
A:            return;

which returns immediately (mutex acquired, replyMessage alread set), now
reply goes out of scope (destructor called) and QDBusPendingCall::d's
destructor of type QExplicitlySharedDataPointer<QDBusPendingCallPrivate>
deletes the reference counted object QDBusPendingCallPrivate.

Now thread B continues, still in processFinishedCall()

B:      if (call->watcherHelper)
B:          call->watcherHelper->emitSignals(msg, call->sentMessage);
B:
B:      if (msg.type() == QDBusMessage::ErrorMessage)
B:          emit connection->callWithCallbackFailed(QDBusError(msg),
B:              call->sentMessage);

accessing alread deleted object QDBusPendingCallPrivate via call->...

Fixed QDBusPendingCallPrivate deletion by proper reference counting
will be done in the next commit.

Task-number: QTBUG-27809
Change-Id: I15b3f0242471b62eaafadc763fb6a33339ff2fe1
(cherry-picked from qtbase commit 72ecf5a7ecb688a7e19cbc2f70e358a94d02edf7)
Reviewed-by: Peter Seiderer <ps.report@gmx.net>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Change QDBusPendingCallPrivate to full reference counting for deletion.

Fixes race between QDBusConnectionPrivate::processFinishedCall()
releasing the mutex before emitting signals (using various members of
QDBusPendingCallPrivate) and deletion of the QDBusPendingCallPrivate
object through QDBusPendingCall::d's destructor (a member of type
QExplicitlySharedDataPointer<QDBusPendingCallPrivate>) leeds to
segmentation fault with CrashTest example on slow/single core
arm cpu).

Task-number: QTBUG-27809
Change-Id: I3590d74d1cfa5816ede764b50b83a7008ec780ff
(cherry-picked from qtbase commit 6c21f42657b494e24112c90d8b9fff719f1f8791)
Reviewed-by: Peter Seiderer <ps.report@gmx.net>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QHttpMultiPart: fix data corruption in readData method

When readData() is called repeatedly, we need to keep track which
part of the multipart message we are currently reading from.
Hereby we also need to take the boundary size into account, and not
only the size of the multipart; otherwise we would skip a not
completely read part. This would then later lead to advancing the
read pointer by negative indexes and data loss.

Task-number: QTBUG-32534
Change-Id: Ibb6dff16adaf4ea67181d23d1d0c8459e33a0ed0
Reviewed-by: Jonathan Liu <net147@gmail.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
(cherry picked from qtbase/af96c6fed931564c95037539f07e9c8e33c69529)
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Fix build regression caused by 7b7c321d5f35b6ee70db5a72d5d37e19e125d7cf.

Change-Id: I54f4e0ca2ca677a41c22183263931c9d65896168
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Fix QListWidget item widget scroll bug

This fix applies the patch uploaded in the bug report. The patch was
provided by Qt-Commercial support but seems to have never found it's
way to the sources although the bug was fixed in Qt 5.

Task-number: QTBUG-27043
Change-Id: I41c5a7b8f3698bb4396046e5e74863e090ba185a
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Fix double transform for items ignoring parent transformations.

Previously, the topmost untransformable's scene transform, which
includes the item's position and local transformation, was used to
determine the item's anchoring position. This position was then
passed on to be multiplied by the item's transform again. This
works fine for toplevel untransformable items that don't have any
transform set at all, but those who do would have their transforms
applied twice - one to determine the anchoring position, and again
to transform the item itself. Since only translation transformations
can affect the first operation (the anchoring pos), this bug only
applies to items that set ItemIgnoresTransformations and use a
local transform that includes translation.

Task-number: QTBUG-21618
Change-Id: I3f3c4f2357e2ca6cd0c75cb5b7e428c0803d9e73
Reviewed-by: Alexis Menard <alexis@webkit.org>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
Return the correct system font on OS X Mavericks.

Also prints a warning if other private system fonts are encountered.

Task-number: QTBUG-32789
Change-Id: I04e1471d25119caddb587972561e98defb1ffda1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Make libtiff link on OS X 10.9.

Backport of Ie6f8639fb920e57289c7d0ad8952603abcfe7377.

Change-Id: I9d0cd625734fda88a9564d4fef7b1f5e9f22c774
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Don't assume that all CFPropertyListRef are CFArrayRefs

We might need more robust code in the future. But at least for this case
it looks like a CFStringRef is also a possibility.

Task-number: QTBUG-29776
Change-Id: Iaf50835122fcbb7e6e9c7fbf65e31e6143b2bc54
(cherry-picked from qtbase commit 1b08e0307dfebe561fbb0819a2d6b53edd8e8e93)
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Make sure to also check for null CFPropertyLists.

In 1b08e0307dfebe561fbb0819a2d6b53edd8e8e93, I removed the null check
by accident. It's possible for the Darwin API to return a null
property list.

Task-number: QTBUG-30760
Change-Id: Iaf0125767fe4b47c19810b70483a5219e94e4305
(cherry-picked from qtbase commit 96134c6f585963c9d449db17589f21e67519a2a8)
Reviewed-by: Denis Dzyubenko <denis@ddenis.info>
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Remove a left over cast that is now semantically incorrect.

CFPropertyListRef is a typedef for void*, which is why this code was
compiling OK prior to this change.

Change-Id: I67f2affeeb97459f85eedc8becb5d963557d34c3
(cherry-picked from qtbase commit fb25d6c7f6690402060027422343957c7d8ee718)
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Include <new> instead of <ciso646> for libc++ detection.

As usual, MSVC does things differently and its ciso646 header does
unexpected things, like #define'ing xor and causing all sorts of breakages.

Include <new> instead: it should be as inocuous as ciso646 should have been.

No backport because Qt5 does not have QT_NO_STL.

Task-number: QTBUG-32773
Change-Id: I01a48ec2c726367e9498aeec4efb42f49d68bbe4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>