Merge branch 'stable' into dev

Change-Id: I92283f3740c82fb0059949ef33d476c8c7c5351d
Update module version to 5.2.0

Change-Id: I21840bf20e1e5af71e1f1d359929ad472874956f
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Merge "Merge branch 'stable' into dev" into refs/staging/dev
Merge branch 'stable' into dev

Conflicts:
	.qmake.conf

Change-Id: I24cb8938add75ddf02e1439b4b2898fee7ba8f8b
Merge remote-tracking branch 'origin/stable' into dev

Change-Id: I58d9e479c9b8e5cd138a4f8bf501ad3f39177345
Doc: Setting navigation variables.

-For Qt 5.2, a navigation bar is implemented:
 b11cb96f282fb1037ad31fbafe279c9a8a8dfeda (qtbase)
-The navigation variables point to pages displayed on the
 navigation bar.

This commit follows the pattern in this commit:
200cad26f258a998d3dc8089445d2c6ae9639ab5 (qtbase)

Change-Id: I56f61af54c782f3167050b0a9d0699cd86936d52
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Merge remote-tracking branch 'origin/stable' into dev

Change-Id: I8911bb334d062892ef34cd555ce78badd5835969
Merge remote-tracking branch 'origin/stable' into dev

Change-Id: I421181abd989c88afad14763da25e2406762b7f3
Merge remote-tracking branch 'origin/stable' into dev

Change-Id: I019d89af398aeef55b36dba4380ef0e65b627af2
Doc: Setting \qtvariable in module page.

\qtvariable indicates the QT variable needed in .pro files.
QDoc will place the QT variable in the class documentation.

Change-Id: I22437154f6808f9eba810d0e35ccae59782fc051
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Martin Smith <martin.smith@digia.com>
Merge branch 'stable' into dev

Conflicts:
	.qmake.conf

Change-Id: Ie3c806147c8de043834f9a74b42a768e265d4529
Add function to get serial port handle

Sometimes the Qt functions are just not enough, and for this reason Qt
provides functions like QFileDevice::handle(), QAbstractSocket::
socketDescriptor(), QWidget::winId(), and QProcess::pid(). QSerialPort
should do the same. In my case, I find that QSerialPort is easy to use
and works nicely with the rest of Qt, but my application needs to set
TIOCNXCL right after the serial port is opened.

Change-Id: Ie740e478b5825fa2e699ead079d78c514a0caef4
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Mika Korhonen <mika.j.korhonen@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Linux: Getting properties of USB devices if has no libudev

This decision is based on parse of contents of /sys directory.

Many distros of Linux use /sys as a virtual file system to export data
from the kernel to userspace applications. Thus this decision shall
work only at those kernels in which are this feature is enabled at
assembling.

The initial path are received from the symlink
"/sys/class/tty/<device name>", that points to the lowest kernel node
with the device properties.

For this path name is starting an analysis of matching to the
keywords of subsystems (e.g. "pnp", "platform","usb" and so forth),
which by implication characterize the type of the device.

The device type is used to define a choice of further algorithm of
passing each parent directory:

* For "pnp" devices (standard onboard devices): The device info with
empty properties is added directly to the resulting list. Because we
still can not get desired properties for "pnp" devices.

* For "platform" devices (pseudo terminals): Skip processing and don't
add to the list. Because pseudo-ports aren't support by the library.

* For "usb" devices: Pass each parental directory and look the "events"
key file. From this file it is reading contents and to find in it the
predetermined set of "magic" keywords. If all keywords are found, then
we can be sure that current directory is the required. Contents of
files "product", "manufacturer", "idVendor", "idProduct" is give
requested properties of the device.

* For other devices: Skip processing and don't add to the list.

This decision was tested in ArchLinux x64 and Fedora 19 x64 with the
onboard serial ports, USB PL2303 converter and USB modem ZTE MF180.

Change-Id: I5a736a98656e8767b713af837f8b52557176c236
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Add API for handling the time out errors when waiting for read or write

Task-number: QTBUG-32680
Change-Id: I1e69bea596b45867119c681bd22abba6dbb1861c
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Android: Fix compilation on Necessitas Qt SDK v 1.0.0

It is the first experimental patch to start integration of support of
Android for QtSerialPort. Therefore for build of library it is necessary
to exclude examples and tests.

In this patch was corrected the tcdrain() function. The main problem is
that Android supports this function, beginning from version 4.2 and above:
* https://android.googlesource.com/platform/bionic/+/android-4.2_r1/libc/include/termios.h

I.e. for support of this function the Android API Level shall be more or
is equal 17, see:
* http://developer.android.com/guide/topics/manifest/uses-sdk-element.html

Therefore for the smaller API levels we are stimulated to implement the
tcdrain() function manually, having simply copied its implementation from
the source codes of Bionic libc.

Task-number: QTBUG-33117
Change-Id: I05b5765a4044d24358a07d60bca1ef32b35f9630
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Revert "Android: Fix compilation on Necessitas Qt SDK v 1.0.0"

This reverts commit b80b2eff9d4f0ce86ac168bc758580d6587d0b87.

This change is broken, and was integrated by misleading concepts. This has to be
reverted, and the proper fix will come from stable when the merge happens.
Otherwise, the merge will be painful for the people doing it without expertise
and external communication.

You can find the change on the following URL with the proper design to address
the issue:

https://codereview.qt-project.org/#change,64320

Change-Id: Ib77f2941a7c24a7b0597a4882e7f35b88b7802ee
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Add a "manual since" for the TimeoutError introduced in 5.2

The commit 0f13f6ff introduced this for 5.2, but then "since" tag was ignored as
there is no such support available by qdoc. Still, it is useful to make the end
users aware of this manually.

Change-Id: I46a642ddb8443f5c87d47709fa52921d7fd637a3
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Merge branch 'stable' into dev

Change-Id: Ie8f70b5101225453355a1eb6b0fdc3f3d8a34824
Merge remote-tracking branch 'origin/stable' into dev

Change-Id: Iac1dd793d34782bc2d208f17654c4962630d0da7
Use sysfs on Linux when available

This change is the continuation of the previous:

* sha1: 4bdbbe4c87676ca94daae947ac5908d77966319b

The previous operation was to use the nodes in the "/dev" hierarchy.
The "sysfs" was only used for extending the information that cannot be
obtained from "/dev", like manufacturer, description of the device, etc.

This decision had a shortcoming of expansion of the list of filters in
case of appearance the new device with the new name. Besides, the Linux
kernel has a lot drivers, each of which provide a various names for an
serial devices, so we can't know all these names.

Now the sysfs is used directly, without filters. To search for devices
we use an appropriate "/sys/class/tty" directory that contains all
necessary info.

Notes:

* There are possible some regressions relating to enumeration of rfcomm,
ircomm devices. Because this devices can belong to other subsystems
which we do not process and skip at present. It needs to be checked and
submitted the set of next patches to fix it.

* If sysfs is not available, the fallback algorithm uses the "/dev"
hierarchy by having a predefined device entry list.

Tested on:

* Fedora 19 Desktop Edition (64-bit)
* Ubuntu 12.04.2 LTS (32-bit)

with on-board (PnP) and pluggable (USB) devices using Qt4 and then Qt5.

Change-Id: Ia242bb2ed81d17b6f826a187454bb9d2a12d40a9
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>