summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qversionnumber.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-11-091-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qwindow.cpp src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/windows/qwindowssystemtrayicon.cpp src/plugins/platforms/xcb/qxcbconnection_xi2.cpp tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp tests/auto/widgets/kernel/qaction/tst_qaction.cpp Change-Id: Ifa515dc0ece7eb1471b00c1214149629a7e6a233
| * Doc: Be more specific on full stop in QVersionNumberKai Koehne2017-11-081-2/+2
| | | | | | | | | | | | | | So far we just write ... '.'. , which looks weird. Change-Id: Iac6fc781c80976994ea0a182b55958baa39a7e52 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* | QVersionNumber: add fromString(QStringView/QLatin1String) overloadsMarc Mutz2017-04-081-8/+45
|/ | | | | | | | | | | | | | | The parsing code anyway operated on a QByteArray created from toLatin1(), so expose this to the user by providing a QLatin1String overload. Also provide a QStringView overload, since we can. Port one user (in qmake) to the new overload. [ChangeLog][QtCore][QVersionNumber] Added QStringView and QLatin1String overloads of fromString(). Change-Id: Idbff44c3997f5cfa86ea1bce8b3da4b700a3d9cc Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add Intel copyright to files that Intel has had non-trivial contributionThiago Macieira2016-01-211-0/+1
| | | | | | | | | I wrote a script to help find the files, but I reviewed the contributions manually to be sure I wasn't claiming copyright for search & replace, adding Q_DECL_NOTHROW or adding "We mean it" headers. Change-Id: I7a9e11d7b64a4cc78e24ffff142b506368fc8842 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* doc: fix a typo in QVersionNumber docsMarc Mutz2015-10-071-1/+1
| | | | | | Change-Id: I6ba901efe0822ed1d5ae8359f8b7aefe730f2d06 Reviewed-by: Keith Gardner <kreios4004@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Refactor QVersionNumber so it stores values in-classThiago Macieira2015-07-291-11/+48
| | | | | | | | | | | | | | | | | | | | | | | | | The common case of QVersionNumber is that there are few segments and each segment is a small integers. So instead of allocating a QVector<int>, just store those numbers in the class itself if possible. Think of this as a "Small String Optimization" for QVersionNumber. QVector<int> costs 16 + 4*N bytes, plus malloc overhead. After this change, QVersionNumber(5,4,0) will have an overhead of zero. The memory layout is explained in the header. I've coded it so big endian also works, but I have not tested it at all. Aside from the special functions for QVersionNumber and operator>>, all the rest of the algorithm could have been left unchanged. I only updated segments(), normalized(), compare(), commonPrefix() and fromString() to take advantage of the smaller implementation in a more efficient way. Note: QVersionNumber's constructors often leave half of the object or more uninitialized. That's not a problem. Change-Id: I4a2a0ce09fce2580f02d678e2f80b1dba74bac9d Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Remove the ref-qualified versions of segments and normalizedThiago Macieira2015-07-161-15/+15
| | | | | | | | | | They can't be ref-qualified if the QVersionNumber object doesn't actually hold a QVector<int>, as the next commit will make it: for segments(), there might not be a QVector to be moved; for normalized(), the common case will be that there's no gain in ref-qualifying. Change-Id: I4bfb8b8765a502c0de6aed693752217106e575a2 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Refactor QVersionNumber to use the public functions when possibleThiago Macieira2015-07-161-29/+37
| | | | | | | | | Use segmentCount() and segmentAt() instead of going to m_segments. This is done in preparation for a major refactor of QVersionNumber that will store the version numbers in the object itself, without QVector. Change-Id: I03dbdee59a3c74c21a0a4e70c1bb9182250f6223 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* doc: mark QVersionNumber as \since 5.6Keith Gardner2015-07-131-2/+2
| | | | | Change-Id: Id109eb34a34504f01358080cb2c4c447e1288f03 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Added QVersionNumber to QtCore's public APIKeith Gardner2015-07-101-2/+1
| | | | | | | | | [ChangeLog][QtCore] Added QVersionNumber. Change-Id: I11acc1fae3dc9368a72593afcfa2e462c53a620e Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Keith Gardner <kreios4004@gmail.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Fixed license headersJani Heikkinen2015-02-171-1/+1
| | | | | Change-Id: Ibebe1318d1c2de97601aa07269705c87737083ee Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-22/+14
| | | | | | | | | | | | | | | | | | 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. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* QtCore: Use QDebugStateSaver in (almost) all QDebug operator<<Kai Koehne2015-02-091-1/+2
| | | | | | | | | Unify the behavior of the different operator<< by always using QDebugStateSaver (appending an optional space at exit), and making sure that the space(), nospace() setting isn't 'leaked'. Change-Id: I38e4f82fa6f7419d8b5edfc4dc37495af497e8ac Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* QVersionNumber: use qHashRange()Marc Mutz2015-01-091-7/+1
| | | | | | | Change-Id: Ia7cfb8030cded33f4246206392b46d1013067ef3 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Keith Gardner <kreios4004@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make QVersionNumber privateThiago Macieira2014-11-131-1/+2
| | | | | | | | | | We're not ready. [ChangeLog][EDITORIAL] Remove all mentions of QVersionNumber. Change-Id: I03ad95992982eb3177f982c1eeddb6a6bc29336c Reviewed-by: Keith Gardner <kreios4004@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QVersionNumber: correctly fail for numerically very large segmentsMarc Mutz2014-09-231-4/+4
| | | | | | | | | | | | | | | | | | The result of qstrtoull() was unconditionally truncated to an int, resulting in wrong values being appended to the segments vector when the numerical segment value was above INT_MAX. Prevent this by first checking the return value of qstrtoull as a qulonglong for values larger than INT_MAX and stopping processing in that case. That means that segments that numerically overflow an int are now considered part of the suffix. Also added tests for the case where a segment value is larger than ULLONG_MAX. That was already working correctly. Change-Id: Ia4b89021dcfe6bfae27c8d89bb678ec5e0e3b847 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Long live QVersionNumber!Keith Gardner2014-08-091-0/+484
The class provides compare operators, stream operators, and hashing functions. This class aims to be compatible with (but not restricted to) the Semantic Versioning 2.0 standard (semver.org). [ChangeLog][QtCore] Added QVersionNumber class Done-with: Marc Mutz <marc.mutz@kdab.com> Change-Id: I244c8ccc002909af03987a2df052734d1a8621a9 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>