summaryrefslogtreecommitdiffstats
path: root/src/serialport/qtudev_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Replace 'Q_NULLPTR' and 'NULL' with 'nullptr'Denis Shienkov2016-06-171-1/+1
| | | | | | | | | We can use nullptr since Qt 5.7. Change-Id: Id5354280d6a94b2c1f4c5967c65a22db878eca3e Reviewed-by: Anton Kudryavtsev <a.kudryavtsev@netris.ru> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Unify license header usageAntti Kokko2016-02-021-13/+19
| | | | | | | | Update old header.LGPL3 to header.LGPL Change-Id: I1b17b6f798ee521d2e3bd8c37024df7cd65ee0c4 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
* Remove the QT_VERSION_CHECK(5, 0, 0) macrov5.5.0-beta1Denis Shienkov2015-04-191-6/+0
| | | | | | | | ... since current branch supports only Qt5. Change-Id: I2aaf4261b307eb6ca7ae32e94ddaf7801395f022 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Update copyright headersJani Heikkinen2015-02-131-6/+6
| | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I35f551de8408a2eb6a0f39df1f09d90c8084a7c0 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Merge remote-tracking branch 'origin/5.3' into 5.4Frederik Gladhorn2014-10-141-1/+1
|\ | | | | | | Change-Id: Id7e66059233e8d07ba44cad19048d9cddc68e250
| * Fix segfault related to dynamic udev loadingSergey Belyashov2014-10-011-1/+1
| | | | | | | | | | | | | | | | | | Problem was caused by conflict of libudev symbols and function pointers declared in qtudev_p.h. Task-number: QTBUG-40113 Change-Id: I599575e8a1b9ffe32295331d46d991422975f773 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* | Update license headers and add new license filesAntti Kokko2014-09-091-18/+10
|/ | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I08685205169cdd4b49a651ed98f36ba1e6c1bb29 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* Add missing private headers warningsSamuel Gaist2014-08-181-0/+11
| | | | | Change-Id: Ia60bf0d020d98a6fda8f689d631bb8681950d15f Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* Simplify of the availablePortsByUdev()Denis Shienkov2014-06-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no sense to use udev_device_get_subsystem() for comparing with the predetermined names of subsystems (like "pnp", "usb" and so on). This idea was preliminary and required further revising after accumulation of some statistic. The main ideas in favor of refactoring are given below: * It seems that reasonable to use the "ID_MODEL", "ID_VENDOR" and others identifiers to query of properties for all types of serial ports. We lose nothing, because in the worst case the getUdevPropertyValue() function will simply return an empty string, as before. * Earlier we excluded from the list all ports which have a subsystem with the "platform" name. Practice showed that for these devices is used the serial8250 driver. Therefore it is reasonable to exclude this type of devices by the name of drivers instead of by the name of subsystems. Also are made related changes: * Is added the resolving of chars for the new udev_device_get_driver() function * The functions of getting properties are wrapped for reduction of length up to 100 characters. Tested on ArchLinux 64-bit with the on-board, PL2303 serial devices using Qt4 and then Qt5. Tested build on Android x86 using Qt5. Change-Id: I1a66164ca1893180e1ed97524cff98b4a933a63b Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Use Q_GLOBAL_STATIC for the udev symbol loading QLibrary instanceLaszlo Papp2014-02-161-14/+12
| | | | | | | | | | | | | | | | | | | | | | Even though this has been introduced in 5.1, officially, we can rely on it in the previous versions even if private API that it was. * Global variables are better avoided. * Q_GLOBAL_STATIC is thread-safe in Qt 5. * QLibrary depends on QCoreApplication and we need to make sure that is initialized afterwards, respectively. The instantiation is now moved into the corresponding source file so that if it is included at more than one place, it will not be instantiated each time it is used in a new source file including this header. Task-number: QTBUG-36870 Change-Id: I96de1257e5836b69d0c48b717d7c2e708d6b0fee Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* Try to load udev at runtime if we do not link against itLaszlo Papp2013-11-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | There was an explicit option previously added into 5.2.0 due to lack of time to implement this runtime resolution properly. The libudev load variable can now be eliminated which also simplifies the packaging. This change also takes care of avoiding the regression by not loading udev at runtime at all for Qt 4. That has always been the case, so there are no regressions there. A TODO comment has been left in the code though about it. The helper free functions cannot be static because they are declared as friend outside that source file. Ideally, we could have a better approach, but that would require more significant refactoring, and such a revamp has to become stable in the 'dev' branch before going into the 'stable' branch. Thereby, this is an acceptable compromise. It does not break binary compatibility either to remove or add friend declarations to a class. The change has been tested on Archlinux (x86_64) with Qt 4 and then 5 using the cenumerator example. The change has been tested both with udev and without that, i.e with sysfs on my Linux system. Change-Id: Ia7d7ecb336c1de1913e1dd60177ae7469e90c329 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Define QStringLiteral when undefined (e.g. Qt 4)Laszlo Papp2013-11-061-2/+2
| | | | | | | | | | | | This will allow us Qt 5 style coding. QLatin1String replaced everywhere where it works for Qt 4 and 5, namely: the direct literal passing. Note that the "standard" typo has also been fixed in this commit as the line had to change anyway, so it is not much of an additional noise. Change-Id: I8b7e4fe5f337441000bd3d8f58db528fdd0e175b Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* Add support for loading udev at run-timeLaszlo Papp2013-10-281-0/+144
QtSerialPort is linked against udev by default if the development files can be detected on the system. The reason for this is that, it is more common to link against udev than loading it at run-time. People will usually use distribution packages where there cannot be inconsistency between different versions, and hence ABI breaks, etc. The relevant LINK_LIBUDEV variable will be set. This can be overridden by defining LOAD_LIBUDEV for qmake: qmake "DEFINES += LOAD_LIBUDEV" -r It is also worth noting that the common code is separated into a private header, and it can be included for either type of libudev usage. There is no need for its user to handle the compile-time linking or run-time loading separately on top of that. Task-number: QTBUG-34329 Change-Id: I45ffaaede2a74498587a6452fbe3fec7eaf83483 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>