QDir::tempPath: make fallback code more readable.

This is a no-op because QDir::cleanPath() already takes care of removing
the trailing slash.

Change-Id: Ic19d9a9dd7e377e04447c3ebc776b025f5f0c43a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
QDir::tempPath: clarify trailing-slash situation.

tst_QDir::tempPath already checks that there is no trailing slash.
Except of course when the path is "/" or "C:/", but we can't do much
about that unlikely corner case.

Change-Id: If71d5de1aeebc6720348cecbf659b7fceb83fb0e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
QStandardPaths: fix empty path in XDG_DATA_DIRS being treated as '/'.

The basedir xdg spec says:
"All paths set in these environment variables must be absolute.
If an implementation encounters a relative path in any of these variables it
should consider the path invalid and ignore it."
Therefore we ignore relative paths including the empty string.

Change-Id: I8f779b78981018051b16de23b2514f2e62b7ab39
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
qdoc: fix memory leaks, unchecked open(), hardcoded path - in debugging code

Change-Id: I3b065dd18f60214a858543d062dfb2f0f1dc1b36
Reviewed-by: Laurent Montel <laurent.montel@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Martin Smith <martin.smith@digia.com>
Doc: fix typo in QDebugStateSaver docu

Change-Id: I12e0a725141a570903004c63369c991d383ac82c
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Accessibility: Fix reporting the same name/value twice

NVDA for example reads name and value, so that most of our
accessibles would lead to the same text being read twice in a row.
Instead use Name as that's best supported on all platforms.

[ChangedLog][QtWidgets] Fixed accessibility issues that would lead to
screen readers reading the same text twice.

Task-number: QTBUG-36678

Change-Id: I6c5c9cdcf5392c7135a65bd30f87a590c3c07fb4
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
Remove useless if

Change-Id: Ide9f06b71159e86fdd2aa178cd3aa0ab2faf5d2c
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
Make QUrl::isLocalFile fast by storing a flag

The XDG specification for file URIs requires us to use triple slashes in
file:/// for URLs with absolute paths. I don't like special-casing any
particular scheme, but we've done it for file for many years now.

Since we need to test this situation in a couple of places, it's easier
to just cache the result once, in setScheme (both functions).

Change-Id: I078b45b5b6c861f4caee082b4730fd6f67684ae4
Reviewed-by: David Faure <david.faure@kdab.com>
Fix assert when converting RGBx8888 to ARGB32_PM

RGBx8888 to ARGB32_PM is incorrectly using the RGBA8888 to ARGB32_PM
which asserts the input format is RGBA8888. Since the routine also
performs an unnecessy premul, we should be using a the generic rgba2argb
routine.

Change-Id: I7b67328f804f5f2a9664a35c04836679e8c8b8e5
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Fix drawing vertical gradients in RGBA8888 formats

The RGBA8888 formats was incorrectly using the qt_gradient_quint32
which is argb specific. This caused vertical gradients but only
vertical gradients to be drawn incorrectly.

This changes the RGBA8888 formats formats to use the generic gradient
method and renames qt_gradient_quint32 to qt_gradient_argb32 to
indicate its limitation.

Change-Id: Ia1cd48ca7f4f78b64f31d6263e81cd8ac3b0954e
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Fix log_clusters calculation in HarfBuzz-NG code path

The old code wasn't good enough to catch all the glyph (de)composition cases,
thus leading to an assertion in QTextLayout's addNextCluster() helper.

The new code catches all the corner cases and introduces somewhat
better performance to the HB-NG shaper backend.

Change-Id: I5b6c673395a4a039dc55b200abbf74b0ba5d0829
Reviewed-by: Ahmed Saidi <justroftest@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Minor optimization for QTextEngine::shapeText()

Remember the engine index for each sub-item and avoid moveGlyphData()
where possible (ie. when there are no glyph indexes to care about).
Also don't memmove data we didn't ever initialize.

Change-Id: Ib8e5fd937a10e4e3c8c0e18961a2e2c1a4167924
Reviewed-by: Ahmed Saidi <justroftest@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Fix out-of-tree compilation of widget examples

'styles' are only defined in the qt build internals, when the
examples are compiled inside a configured Qt source. That's not
the case for the examples e.g. in the Qt SDK.

(windows is a default style on all platforms, anyway. So I
think the check is superfluous in the first place.)

Task-number: QTBUG-36655
Change-Id: I7114619efd479408dad99c8514f8e33ddcab7c7c
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Doc: Adjust QDir::tempPath docu as recommended by Ossi.

Change-Id: I709d8ce8151f2bb480865067a3e80ed838b26e4a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Document `moc -f<...>` behavior change in Qt-5.2.0

Better late than never :)
Task-number: QTBUG-33749

Change-Id: I5035255e66a56754b609441f5b81ab119565a7cb
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
support c'tor as second parameter in foreach macro

Passing a constructor as second argument to foreach didn't work when
building with gcc.
For MSVC this already worked as a different foreach implementation is
used.

Change-Id: Id98444c699b4cebc14ea62076c5f7cba33ffb824
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Doc: Fix issues with QOpenGLTexture enumerations

Use correct parameters for \enum commands, and add documentation
for QOpenGLTexture::Filter enumeration.

Task-number: QTBUG-35576
Change-Id: If7099da0b2b570c28e683126f0ba3a885d80f741
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
network tests: do not rely on external servers

They cause test failures from time to time.

Change-Id: I917bef340401d25bf54e133be9d9562b3b133c9f
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Niels Weber <niels.weber@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
Accessibility Linux: Report Active state

The fixme comment is invalid since QAccessibleWidget actually checks for
isWindow and sets the active state.
This is messed up because in Qt 4 there was a work-around to set active
for windows in a different code path.

[ChangeLog][QtGui] Accessibility on Linux now reports the active state
correctly.

Change-Id: I9e2cf436b3ffa7ef28286ee49d6e582f179930c6
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
Cleanup TSLib plugin

This patch cleans up the coding style and includes

Change-Id: I710d4a60795e9975d4f8ee79599018e05d85debe
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>