Commit Graph

31617 Commits

Author SHA1 Message Date
Marc Mutz
bf2160e72c Clean up QStringLiteral definition
We require lambda support in the compiler since Qt 5.7, so drop
the guard macro.

Apart from MSVC 2013, all our supported compiler also support
char16_t:

- VxWorks uses GCC 4.8, which supports char16_t since 4.5.
- ICC supports char16_t since v12.1; we require v14+.
- ONX uses a GCC which supports char16_t in the compiler,
  but is equipped with a stdlib that does not sport char16_t
  support, which is why we revoke its Q_C_UNICODE_STRINGS in
  qcompilerdetection.h. But we don't need stdlib support, we
  only need the core language feature.
  This is the only platform where this patch actually changes
  something. It removes the, rather unfair, pessimization of
  the platform which could have supported the static-storage-
  duration implementation of QStringLiteral instead of the
  fallback, which uses dynamic memory (QString::fromUtf8()).
- GCC and Clang support char16_t since 4.5 and 3.0, resp.,
  which is far below our minimum compiler requirements in
  effect since Qt 5.7.
- On Windows, MSVC supports char16_t since 2015 only, and we
  still support 2013, but on Windows, wchar_t is the same size
  as char16_t, so instead of u"str" we can fall back to L"str".

So simplify the implementation of QStringLiteral by assuming
that all these feature are present, adding noexcept to the
lambda to make noexcept() queries return true.

This allows us to guarantee:

[ChangeLog][QtCore] QStringLiteral is now guaranteed to be
evaluated at compile-time. The last platform (QNX) to use the
QString::fromUtf8() fallback has been ported to allocate the
string data statically, too.

Change-Id: I7920d7a77001e5c5550e7c7d57ceb7c51c9eb443
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-15 20:14:56 +00:00
Marc Mutz
04d6495bf7 Make some atomic counters zero-based
A variable of static storage duration that is not zero-initialized
takes up space in the DATA segment of the executable. By making the
counters start at zero and adding the initial value afterwards, we
move them over to the BSS segment, which does not take up space in
the executable.

Wrap atomics used across function boundaries into small functions,
to avoid code duplication and to increase readability.

Change-Id: Ida6ed316ecb8fe20da62a9577161349e14de5aed
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-15 20:14:27 +00:00
Marc Mutz
a5febadac5 QString(Ref): make toLatin1()/toLocal8Bit() null handling consistent
Systematic testing in tst_QStringApiSymmetry revealed a bug in
QStringRef::toLatin1(): a null input did not result in a null output,
but an empty one. This is fixed, for consistency with
QString::toLatin1(), and QString(Ref)::toUtf8(), which behaved
correctly already.

The same bug was found in QString(Ref)::toLocal8Bit(), which is
particularly hideous, as it's documented to fall back to toLatin1(),
which preserves null inputs. Fixed, too.

[ChangeLog][QtCore][QString] toLocal8Bit() now preserves nullness of
the input QString (outputs null QByteArray).

[ChangeLog][QtCore][QStringRef] toLocal8Bit() and toLatin1() now
preserve nullness of the input QStringRef (output null QByteArrays).

Change-Id: I7026211922c287e03d07e89edbad2987aa646e51
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-02-15 20:12:36 +00:00
Dmitry Shachnev
a373a01ed7 qcssparser: Undef TILDE to fix compilation on Hurd
Change-Id: Ic3168629565618bcd7f26e47579beaa1bbd22e39
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-02-15 19:56:34 +00:00
Thiago Macieira
a7ba91bd64 Use Qt::PreciseTimer for the QDeadlineTimers in QTest::qWait*
QDeadlineTimer will eventually support CLOCK_MONOTONIC_COARSE on Linux,
so let's be safe before that change appears.

Change-Id: I9b423f1b71194205b27afffd14a383a7e9f66a9d
Reviewed-by: Stéphane Fabry, Cutesoft <stephane.fabry@gmail.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2017-02-15 19:04:21 +00:00
Thiago Macieira
798819bb87 Correct \since for QStorageInfo::subvolume()
3e9db01a2e4be5034d10d6eeafd65d0a8609615b entered dev after the 5.8
branch.

Change-Id: I4139d5f93dcb4b429ae9fffd14a349e85e62a298
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-02-15 16:33:20 +00:00
Thiago Macieira
fb376e0fcc Remove the name cache from QMetaType::typeName
It was unnecessary, since we only cached the static types, which are all
generated by the macro anyway. The way it was implemented, this produced
data races that are strictly-speaking UB, even if all the threads were
writing the same values to the same data locations.

This commit changes a little the code to simplify, since we're changing
those lines anyway.

Task-number: QTBUG-58851
Change-Id: Idc5061f7145940f987dffffd14a30047846e3113
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-02-15 16:25:38 +00:00
Tor Arne Vestbø
666b91fb8f macOS: Don't hide NSWindowZoomButton when window can go into fullscreen
The button in the title bar is used both for going into full screen and
maximizing (zooming) the window. We can't hide/disable it unless both
Qt::WindowFullscreenButtonHint and Qt::WindowMaximizeButtonHint are
off.

This means that when Qt::WindowMaximizeButtonHint is off, it's still
going to be possible to Option-click the button to maximize the
window, but this is less of a concern than hiding the full screen
button when Qt::WindowFullscreenButtonHint is set.

Change-Id: I70dbe27b3197fe22c1781277f8bf9a818d71d04d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-02-15 15:23:47 +00:00
Frederik Schwarzer
1e7143cff8 Fix minor typos in apidoc
Change-Id: I5ce9599a60ea336b469807df075e491f0e6df680
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-02-15 15:01:45 +00:00
Samuel Gaist
7dff4b921b Example: migrate flightinfo to QRegularExpression
Update the flightinfo example to use the new QRegularExpression class
in place of the deprecated QRegExp.

Change-Id: I2395b37170565e922500e675210c400e90ae0f73
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2017-02-15 14:45:58 +00:00
Samuel Gaist
6864374f05 Example: migrate grabber to use QRegularExpression
Update the legacy grabber example to use the new QRegularExpression
class in place of the deprecated QRegExp.

Change-Id: I1d1871b7e82cdb214fdd8ad55a606d5e7682fab1
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2017-02-15 14:45:51 +00:00
Samuel Gaist
beb98bdafc Example: migrate the arthur code sample to use QRegularExpression
Update the arthur code sample to use the new QRegularExpression class
in place of the deprecated QRegExp.

Change-Id: Ic7efd4466b4c0fa50170b80ebb22fcb3624399ce
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2017-02-15 14:45:45 +00:00
Samuel Gaist
d2e713f3fd Example: migrate the codecs example to use QRegularExpression
Update the codecs example to use the new QRegularExpression class in
place of the deprecated QRegExp.

Change-Id: Ibd60b7256071f8166c4bf38e6a40935494c3cf3f
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2017-02-15 14:45:40 +00:00
Samuel Gaist
57a710467b Example: migrate settingseditor example to use QRegularExpression
Update the settingseditor example to use the new QRegularExpression
class in place of the deprecated QRegExp.

Change-Id: I07e34bf916bdde161c4253fca70b853061cd589b
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2017-02-15 14:45:36 +00:00
Samuel Gaist
a1cf6e5281 Example: migrate stylesheet example to use QRegularExpression
Update the stylesheet example to use the new QRegularExpression class
in place of the deprecated QRegExp.

Change-Id: I7061b8fd462ff012cb67bfdade656b3bfe442dd8
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2017-02-15 14:45:29 +00:00
Samuel Gaist
280225495d Doc: fixed explanation in Qt::Tool documentation
Clarify the the macOS implication of the flag.

Change-Id: Ic68e1ac668cfa68abf868ba6bdd46241dfa9b9a7
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2017-02-15 14:45:18 +00:00
Tor Arne Vestbø
54e4735f89 qpa: Let platform plugins report old state for window state changes
The previous logic relied on QPlatformWindow::setWindowState() being
synchronous and delivering the QPA event before returning to QWindow,
in which case window->windowState() would still refer to the old
state. Async platforms can now report the previous state correctly.

Change-Id: Ib9148fe23fb62be55b7e3a0ccf63d32c71dc2ad3
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-02-15 14:37:03 +00:00
Olivier Goffart
1037eebc0b Windows QPA: Use the native algorithm to find out the window's screen
QPlatformWindow::screenForGeometry uses the screen where the center
of the window is, but native application use the one which intersects
with the bigger area. It might not be the same.

Change-Id: I831a5fcaea0e293e9f0f93ef5e562cce57fae2f4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-02-15 14:19:12 +00:00
Timur Pocheptsov
b5995afc79 Fix http2 auto-test
After it started to fail (somehow it's only OpenSUSE 42.1) again and again
and after a quick re-evaluation it appears the logic testing SETTINGS|ACK
is incorrect. We (client side) start by sending the preface and then
continue to send our request(s). The other side (server) starts from sending its
SETTINGS frame. These settings must be ACKed, but apparently it can happen,
that server receives a requests and sends a reply before it receives SETTINGS|ACK,
resulting in replyFinished (replyFinishedWithError) signal and event loop stopping.
As a result - QVERIFY(serverGotSettingsACK) fails.

Task-number: QTBUG-58758
Change-Id: I8184cf459b2b88f70c646171e0115c184237fad1
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-02-15 14:11:19 +00:00
Kimmo Ollila
a0a9e8b2d7 Fix is_iec559 assert on GHS compiler
GHS compiler is not fully compliant with iec559.
Therefore we need to replace is_iec559 assertion
with separate checks to build quint16.

Change-Id: I88c57e394b8d4e7899ee7d4a13cbfbac9436b2fc
Reviewed-by: Rolland Dudemaine <rolland@ghs.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-15 13:52:26 +00:00
Edward Welbourne
2aec5c9b34 Package transient zone setting in test to ensure restore on fail
tst_QDateTime::operator_insert_extract() was setting the time-zone and
taking care to restore it at the end of the test; however, if the test
were to fail, the restore would be skipped.  Package the zone-setting
and restore in a class instance, so that premature return can't bypass
the restore.

Change-Id: I3df63260da17e481ef4d0d107d9f0fdea3e147e7
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-02-15 13:48:37 +00:00
Marc Mutz
03903ec783 QJNIHelpers: make mutexes static
Amends 265db5ad9b.

Change-Id: I707bb88285531ee9f82efec46901871d53413eb3
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-02-15 13:06:12 +00:00
Kevin Funk
e0c43fb046 QFileDialog: Protect against nullptr dereference
When the QFileDialog receives a language change event, and native
dialogs are used, this code path dereference a nullptr in the qFileDialogUi member.

Protect by checking the return value of QFileDialogPrivate::usingWidgets() as
done in other places deferencing qFileDialogUi.

Fixes a crash in GammaRay

Change-Id: I3e9eb81c75d9fc983519a58c5ec06e316ac80263
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-02-15 12:46:30 +00:00
Frederik Schwarzer
9e888e633b Fix indentation of source code example in docs
Change-Id: Icf94c9adc55d16acd26831cce331054a8c49652d
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-02-15 11:58:12 +00:00
Marc Mutz
b4689401a5 tst_QThreadPool: don't deadlock when a cancel() test fails
We keep the runnables from finishing by having them block
on a QSemaphore::acquire() call inside run().

If we fail a test that precedes the call to sem.release()
further into the test, the early return will cause the
thread pool to be destroyed, which will then attempt to
wait for the runnables to finished, which, in turn wait
for the semaphore to be released.

-> dead lock

Fix by introducing a RAII object to release the semaphore
with a sufficiently large number to unblock all runnables.
That number will in some situations be too large, but that
does not matter.

Change-Id: I1ec7e29b37bc36309e93e6e30708cc7db3c9579c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-15 11:25:48 +00:00
Marc Mutz
410a14cc76 Wait for runnables to start up in tst_QThreadPool::cancel()
In order to get reproducible runs of the test, we need to
wait in the main thread until all runnables have started
executing. Otherwise, what the cancel() loop below actually
does will vary from run to run.

Change-Id: Ib912b0943e7bbd55c9480ae6fd4011ba20ac457e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-15 11:25:39 +00:00
Marc Mutz
8087ea67b1 tst_QThreadPool: simplify cancel()
Instead of allocating a statically-sized array on the heap,
use an automatic C array instead.

Replace some magic numbers with named constants.

Change-Id: I17d29a76a67c4a413453ac26a5dee8cd54a8a37d
Reviewed-by: David Faure <david.faure@kdab.com>
2017-02-15 11:25:30 +00:00
Marc Mutz
dcf74bdec8 Fix UB (data race) in tst_QThreadPool::cancel()
Manipulating a simple int from multiple threads is a data race,
thus undefined behavior.

Fix by using QAtomicInt and atomic operations instead.

Change-Id: I5418bc260da57fe353a71b8e5c7c1c97adbe7597
Reviewed-by: David Faure <david.faure@kdab.com>
2017-02-15 11:25:24 +00:00
Marc Mutz
af8771867c Fix UB (data race) in QtAndroidPrivate::requestPermissionsSync()
If the QSemaphore::tryAcquire() call times out, we mustn't
touch *res, because there was no happens-before relation
established between *res = result in the lambda and our
returning *res;

Fix by returning a default-constructed hash in that case.

Add a strategic std::move().

The same problem exists in runOnAndroidThreadSync(), but
I have no idea how to solve it, because there the shared
object is the runnable itself.

Change-Id: I9a2c431144c169fbd545763555d96153143a11bf
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-02-15 11:24:18 +00:00
Marc Mutz
39820cf8c3 QJNIHelper: fix a potential race in sendRequestPermissionsResult()
The code obtained an iterator into a QHash under mutex protection,
then dropped the lock, dereferenced the iterator several times and
only retook the lock to erase the element from the QHash.

This is very smelly. QHash provides no official iterator validity
guarantees, and the container isn't const, either (which would imply
thread-safety). In particular, the dereference into the container
outside the critical section is cause for concerns.

Simplify the code, removing any doubts about its race-freedom, by
taking the payload item out of the hash before dropping the lock, and
using only the local strong reference in the remainder of the
function.

The only other references to g_pendingPermissionRequests are
insertions with unique-by-construction keys in QtAndroidPrivate's
requestPermissions(), so there was no reason to keep the item in the
hash for the whole duration of the sendRequestPermissionsResult()
call.

Change-Id: I39fe0803b13b3046d1f0fd9c8e96c531406d57da
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-02-15 11:23:28 +00:00
Aaron Linville
a05116e6f1 Update QSyntaxHighlighter docs to use QRegularExpression
Update the QSyntaxHighlighter examples to use the new QRegularExpression
class in place of QRegExp.

Fix typos. Remove duplicated snippet. Replace lengthy section of
duplicate text in highlight(..) with a note to see the detailed
description.

Task-number: QTBUG-58494
Change-Id: Id8d94bddbed52e6e52feac107f6fc84e2fe4518a
Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch>
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2017-02-15 10:29:21 +00:00
Heikki Haveri
aebf66d242 Enable QtAndroid::runOnAndroidThread in a Service
Change-Id: I214f5dc70c52011a5e1712ea70f97f8b564fb664
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-02-15 10:04:17 +00:00
Thiago Macieira
cab4d495b2 50 ms isn't enough for the CI, so increase to 100 ms
This should reduce the failure rate. We're still doing qSleep of the
same amount of time, but we now only fail if the slip is over 100 ms.

Task-number: QTBUG-58713
Change-Id: I536c32a88bff44dab37afffd14a1afdf0b2e522a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-02-15 08:09:57 +00:00
Thiago Macieira
b58af67d7b Turn QThreadData::threadId into a QAtomicPointer
Solves a data race found by TSan.

Since thread and threadId are QAtomicPointer, I've removed the explicit
initialization in the QThreadData constructor

Task-number: QTBUG-58855
Change-Id: I4139d5f93dcb4b429ae9fffd14a34082f2683f76
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-02-15 08:08:58 +00:00
Timur Pocheptsov
5542e772d6 tst_qlocale::macDefaultLocale - remove flaky/incorrect test
currencySymbol == "$" does not mean negative currency values will be formatted
as "($value)". With all locales I have on my mac machines (10.11/10.12) the
result is different from what this test expects. Also, the results are very
different for different locales.  Apparently, we never saw this problem before
since in our CI "macs" we never have US Dollar/en_US selected in System Preferences.

Task-number: QTBUG-58784
Change-Id: Ic2c3a3172bf1e715e99092ddee8f461b216d995a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-02-15 07:43:26 +00:00
Friedemann Kleint
0b30a6e6aa QElfParser: Fix plural form in error message
Amends change dcec1420ea.

Change-Id: I54c7db012d87a55c310141debac19118e7cb284a
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-15 07:18:55 +00:00
Tobias Koenig
146f6d261b Make output of QPdfWriter more PDF/A-1b compliant
Add the recommended comment line after the header line, which contains
4 bytes with character codes > 128 (see PDF 32000 7.5.2), add the missing
EOL markers in front of any 'endstream' and 'endobj' keywords and modify
writeString to use '()' for empty strings (no UTF-16 encoding needed in that case).

Change-Id: I17aabde0ba06061ba14e37405e02edf47f3ddd81
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-02-14 21:31:22 +00:00
Marc Mutz
265db5ad9b QJNIHelper: clean up atomic int and mutex handling
1. Do not use Q_GLOBAL_STATIC to hold QAtomicInt or QMutex, use
   file-static QBasicAtomicInt and QBasicMutex instead. They are
   zero-initialized PODs.
2. Use only QMutexLocker to lock mutexes.

Also wrap the atomic counter into a next...() function, as done
elsewhere.

Change-Id: I4b14ac0de9d4cb6780b1f1372c2b5fc88e918e4c
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-02-14 21:11:03 +00:00
Jesus Fernandez
5fcdb6c459 Add Q_ASSERT before dereference pointer
Fix Null pointer dereferences  (NULL_RETURNS)
CID 176640:  Null pointer dereferences  (NULL_RETURNS)
Assigning: "p" = null return value from "value".

Change-Id: I3af9aae3bbebd6f4de90854ba56cd601669b1b5a
Coverity-Id: 176640
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-02-14 15:06:18 +00:00
Marc Mutz
1cbf402ea6 tst_QMimeDatabase: increase timeout
The runUpdateMimeDatabase() call was timing out on the CI due to
running out of the default 30s timeout for QProcess::waitForFinished()
(on my machine, that call takes less than 0.5s, reliably...).

Increase to two minutes.

Change-Id: I61b2e060ea9c2508b853847ba7040ad499e0084c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
2017-02-14 13:51:12 +00:00
Marc Mutz
6c4d75a485 tst_QSemaphore: avoid deadlock on test failures
When one of the QCOMPAREs in Consumer::run() fails, the consumer
returns early, leaving the producer deadlocked in a QSemaphore's
acquire() call. Change these to tryAcquire() with a large timeout,
so the producer, too, eventually leaves run().

Change-Id: I7421d43305decd4754e09c8e092363594d1be06b
Reviewed-by: David Faure <david.faure@kdab.com>
2017-02-14 13:30:16 +00:00
Friedemann Kleint
737383875e Blacklist tst_QTimer::remainingTime() on Windows and macOS
Task-number: QTBUG-58519
Change-Id: Ib03aa0bdeaa9ed0dc2f0d92aa11d07ffcdc2bc26
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-02-14 13:30:12 +00:00
Marc Mutz
c4a5307a3e QMutex/Linux: remove unused QBasicAtomic
$ git grep -we futexFlagSupport
  src/corelib/thread/qmutex_linux.cpp:static QBasicAtomicInt futexFlagSupport = Q_BASIC_ATOMIC_INITIALIZER(-1);

The last user of this variable was removed in 9ef59b5.

Change-Id: I818a13a481ad25baa5ff7d389a737b8801adcfcc
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-02-14 13:30:05 +00:00
Kai Koehne
414a124e81 Doc: Remove mentioning of Windows CE from qmake documentation
Change-Id: Ibfd575a63dd80b1571d1ba61d593aff75dd83f9f
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-02-14 12:48:35 +00:00
Milla Pohjanheimo
c6792bcb95 Binary compatibility files for QtBase (5.8.0)
Added BC files for QtBase for Qt 5.8.0

Change-Id: I36d5453b8cfb5d34511a9b6196d4dc83d5c9f9f6
Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
2017-02-14 12:42:20 +00:00
Olivier Goffart
9e3a3250e0 Windows QPA: Fix compilation with QT_NO_OPENGL
Compilation error introduced in 7780ee9e5f

Change-Id: Ia770ca207cdd25bb15c74d681ece391a844791a7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-02-14 12:09:47 +00:00
Liang Qi
27432d40f2 Merge remote-tracking branch 'origin/5.8' into 5.9
Change-Id: I2bd2e61bae1eab4fc74fa6accd741ed9ae1f0669
2017-02-14 11:33:02 +01:00
Marc Mutz
10ecbc4041 Blacklist tst_QWaitCondition::wakeOne() on Windows
This test was determined to be flaky on the CI.

Task-number: QTBUG-58741
Change-Id: I43196d3a27f726fb96b427f5071e726b571a0404
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
2017-02-14 06:51:52 +00:00
Marc Mutz
f0ee4ed0a2 Long live QSemaphoreReleaser!
This is a simple RAII class that makes semaphore releasing
reliable in the face of exceptions and early returns.

This code originates from KDTools' KDSemaphoreReleaser[1], but
has been extensively reworked to support C++11 move semantics.

[1] https://docs.kdab.com/kdtools/2.3.0/class_k_d_semaphore_releaser.html

[ChangeLog][QtCore][QSemaphore] Added a new RAII class, QSemaphoreReleaser,
to reliably perform release() calls.

Change-Id: I6aff64d37cc0882b17c4419817bde60b542f34d9
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-14 06:46:03 +00:00
Mikkel Krautz
9c765522d1 qsslsocket_mac: handle 'OrLater' SslProtocols in verifySessionProtocol()
The verifySessionProtocol() method in the SecureTransport backend did not
properly handle TlsV1_0OrLater, TlsV1_1OrLater and TlsV1_2OrLater.

This commit teaches verifySessionProtocol() about them.
It also adds TlsV1_0OrLater, TlsV1_1OrLater and TlsV1_2OrLater to the
protocolServerSide() test in tst_qsslsocket.

Change-Id: I394766c75dbea4d89bf3d6b9c3f3c89530ac0749
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-02-13 21:44:05 +00:00