QSystemLocale: Fix the time format on BlackBerry 10

The time format should depend on the device settings (24 hour format)

cherry picked from qtbase/686c94c892006a3e72291ca8971aabf18ea1ec85

Change-Id: I6226486ee1feedc27fab49802a0043619e83659c
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
QUrl stringprep: recalculate the current position if the size changes

If the case folding operation results in either expansion or reduction
of the string, we need to adapt. Reduction happens most often when a
non-BMP character is case-folded to a character in the BMP (example:
mathematical signs at U+1D400-1D7FF). Expansion happens in the rare
case of symbols containing words, like U+2121 ℡ (this is part of the
unit test), and one common case: the German sharp S (ß) is expanded to
"ss".

(cherry-picked from qtbase commit 2ccf4c32cc593f568581dd237e1e27d39fd965a2)
Change-Id: I1bdbdc908b958a89bf30e4bb648d65dfdd9097f8
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
QUrl stringprep: fix case folding from non-BMP to BMP

When uc > 0xffff (non-BMP character) and l == 1 (replacement is in the
BMP), we must use QString::replace so the correct number of characters
is replaced.

There's one case testing this in tst_qurl, but it is being
obscured by another bug (false positive).

(cherry-picked from qtbase commit 86312275197c3fde948035a59c0358162701f9f2)
Change-Id: I32388dd5bef32d4d6804aeeec4904bd5f563e9b9
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
QUrl stringprep: fix handling of prohibited characters

RFC 3454 says about prohibited characters (section 2, "Preparation
Overview"):

   3) Prohibit -- Check for any characters that are not allowed in the
      output.  If any are found, return an error.  This is described in
      section 5.

In other words, we mustn't simply strip the output of prohibited
characters. We must generate an error if they are present. We do that by
clearing the data.

We already had tests for prohibited output, but they were
indistinguishable from being stripped. So instead add some extra
characters so that we can tell whether the label was cleared.

(cherry-picked from qtbase commit 736a052d93d9c75e51e8f3da733bc8e4a50c39ce)
Change-Id: I2d95217c27be5e2d54deed0036cb009e3b7f4886
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
QUrl stringprep: avoid recalculating the surrogates we already know

(cherry-picked from qtbase commit 53388cd8e0451ea375ed250b59f9e89319fb3e1c)
Change-Id: Icac4e81fff6f7f7fa4f46ec2a08105f8d3d2b403
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
QUrl stringprep: fix handling of U+0080: it's prohibited

Edge case: a > that should have been >=. Without it, we never ran the
rest of the IDN nameprepping.

(cherry-picked from qtbase commit 4d93393a6de2d6631979df2bc6d12aa43781dc6f)
Change-Id: I2276d660de3a70d0c561bb18816820d9a0f47e77
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Designer: Fix morphing of widgets in QSplitters.

They were not handled at all, children were just reparented
resulting in the morphed widgets being appended.

Task-number: QTBUG-31911
Change-Id: Idae8f66663416d514a2f3c299e58d726a3dd578a
Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
(cherry picked from qttools/d251ee9dcbd015f2acbe76231902b72163cd05a2)
QNetwork: Check AuthenticationReuseAttribute when using credentials from url

Note: This is not needed in Qt5, as the authenticationRequired method in Qt5
has an allowAuthenticationReuse parameter (bool) that is checked before
the credentials are used.

Change-Id: I5a2734de615a1a96d1fe648bd251850f3b45e167
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
Updated changes-4.8.5 file

Change-Id: I7c5b349e2aecbe2939d2ec5e39c211ad56b7ef1a
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
Fix leak in QDragManager::drag on mac

Change-Id: I467129f989b6e28078c9dd789cde7ff898faf1f5
Reviewed-by: Christoph Schleifenbaum <christoph.schleifenbaum@kdab.com>
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
QNX: Changing the way JSC retrieves the current stack base pointer

What Qt is calling the stackbase is the top of the stack.
The thread local storage [__tls()] area is at the top of the stack
and the stack pointer is initialized below this on thread
creation.
With this patch, the stack base pointer can be retrieved faster then in
the current implementation.

This patch is from Sean Boudreau.

Change-Id: I3d1ac58d5c43997cbf462424c66be0c7caafcf1b
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
fix off-by-one index check

Change-Id: I6d6461eec24895e9aa0e77deccd39210958b7e2c
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
(cherry picked from qtbase/96a22ed926cfd706c1b5aca1881f124bc9624f2f)
Bring in WebKit revisions 139553 and 139921.

They are primarily useful for getting rid of some libstdc++-specific
includes which break the build with libc++, and also for simplifying the
code and removing a Darwin-specific code path.

r139553 by ossy@webkit.org:
  Use sync_add_and_fetch instead of gnu_cxx::exchange_and_add
  https://bugs.webkit.org/show_bug.cgi?id=106729

  After r139514 we need atomicIncrement(int64_t volatile*) for all
  platform. Now the GCC implementation of atomicIncrement() is based on
  gnu_cxx::exchange_and_add, which doesn't support int64_t type, but
  sync_add_and_fetch does.

  Reviewed by Benjamin Poulain.

r139921 by benjamin@webkit.org:
  Use GCC's implementation of atomicIncrement/Decrement on Mac
  https://bugs.webkit.org/show_bug.cgi?id=106976

  Reviewed by Filip Pizlo.

  wtf/Atomics.h: GCC and LLVM have builtin for atomic ADD and SUB:
                 sync_add_and_fetch, sync_sub_and_fetch.

  Using them let the compiler just generate the atomic operations inline
  instead of generating a function call to LibC. It also simplify the
  code a bit.

Cherry-picked from qtwebkit/0baf197 and qtwebkit/801fc96. I'm cherry-picking
both revisions together to match what was done in 0de22e80.

Change-Id: Ie5c1067980662ff04e8e36d8cf6e9459b7c46aab
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
BlackBerry: Increased loop level around bps_get_event

This is needed, because bps_get_event can also invoke callbacks.
Deferred deletions in such a callback are not executed for instance,
because the loop level might already be at its minimum.
Backported from qtbase: f62c92b

Change-Id: I83d72d773d53b7b84ec590180f6b1131a57e0f46
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Set projection matrix for systems with OpenGL 3.1

The projection matrix should also be set for systems
running OpenGL 3.1 with GL_ARB_compatibility extension.

Task-number: QTBUG-28284

This fix is based on Commit 9514422eeecb468fbf0a60604f5699f9caba3f39
from qt/qtbase project.

Change-Id: Iadc5bf3a0e73e401e5c8c5b220fb9bd0ace3970f
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Fix drawing of 0-width polylines from outside the devicerect.

This was broken by a previous fix which aimed to fix gaps in
polylines with tiny line segments. The result was that we
skipped updating the origin point when stroke() didn't produce
pixels which accidentally included the case of the line
being completely outside the deviceRect. I fixed this
by returning the value of clipLine in drawLine to the caller
so we could still update the origin for this case.

Task-number: QTBUG-31579
Change-Id: Iac29436f042da7658bbeaf9370351dc6f2c95065
(cherry picked from qtbase/900cccfd459fcbdbc4aa3d313afe12cfbf68fd87)
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
can show the Cocoa color panel repeatedly

Task-number: QTBUG-11188
Change-Id: I8491985dd6f04971a7aae2ccf7a53fd7294b799b
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
qfilesystemengine_mac.cpp is empty => purge

All mac related qfilesystemengine operations are done in
qfilesystemengine_unix.
Purging it like commit bd7ca33889139782f3f0063f93ca9c1f39501a17 in
qtbase

Change-Id: I16ba494b699d731c3cd688cbd34b81cc67851b47
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Fix clipping of QTextList decorators.

List decorators may be clipped if you set a large font size and/or
small indent for a QTextList. This fix is to prevent clipping by
moving list decorators and items to left (or to right in case of
right to left layouts) so that the list decorator is always painted
inside the layout.

This commit fixes painting related issue, so auto test is not needed.
The manual test program can be used for verification purposes.

Task-number: QTBUG-5111
Change-Id: I0de01f4d6b833289948ac29e38dd3cc8ab9bca9e
(cherry picked from commit qtbase/ad443dfb1d8e9096c4913686aa2ed0bc9b3f5de7)
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Fix Mac static builds so they get the qt_menu.nib from the resource file

Instead of loading the file from the bundle (if it existed) then we
create the qt_menu.nib from the resources instead. This ensures that
static builds no longer have to have the qt_menu.nib file manually
copied to be in the Resources folder for every application.

Change-Id: I7abb6fad6395d466e22e7a3b7ffb63b50ae82f65
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>