summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qdatetime.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Use list-initialization moreMarc Mutz2017-04-201-2/+1
| | | | | | | Fixes a few ugly code pieces I added over the years. Change-Id: I5c06b73e858add04ea184120c6df71720baf9be3 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QDateTime: replace home-grown version of qToStringViewIgnoringNull with the ↵Marc Mutz2017-04-201-10/+3
| | | | | | | real thing Change-Id: Ie71ed4f5c9a2bd0b14818f0f3cff4f88c2100546 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-04-201-1/+2
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qbytearray.h src/corelib/tools/qdatetime.h src/corelib/tools/qstring.h src/corelib/tools/qversionnumber.h src/plugins/platforms/android/qandroidplatformintegration.cpp tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp Change-Id: Iefd92a435e687a76cd593099e40d9a9620a1454d
| * Ask MS runtime to reload the timezone details if they've changedThiago Macieira2017-04-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | POSIX documents that localtime() ensures that tzset() has been called, but the wording could be understood to mean that it only needs to do so the first time. Anyway, we're sure that the MS runtime only gets the timezone information from the Control Panel once. That means Qt-based applications will not react to a change in the timezone. Attempt to do that by moving tzset() out of the #if, to apply to all operating systems. Task-number: QTBUG-60043 Change-Id: I6ab535fb61094af19fc1fffd14b413541fe5a64c Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | QDate/Time: add toString(QStringView) overloadsMarc Mutz2017-04-121-5/+46
| | | | | | | | | | | | | | | | [ChangeLog][QtCore][QDate/QTime/QDateTime] Added toString() overloads taking the format as a QStringView. Change-Id: I322fa22e6b13fe8ba4badf0a3133425bd067ef32 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | QLocale: add toString(Q(Date|QTime)+, QStringView format) overloadsMarc Mutz2017-04-121-2/+2
|/ | | | | | | | | | | | | While at it, change the interface of qt_repeatCount() to just take a single QStringView, since QStringView::mid() is so cheap. Add some \internal docs. [ChangeLog][QtCore][QLocale] Added toString(QDate/QTime/QDateTime) overloads taking the format string as a QStringView. Change-Id: Ic078796677a6db06227c8a3e276dbdb1039ceead Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Do not assume QStringRef(const QString*) to be implicitMarc Mutz2017-03-141-1/+1
| | | | | | | | It won't be for very much longer. Change-Id: I30e3e0cd8c8ecf0833f759557382a3ded7bdea34 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-03-131-1/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/network/network.pro mkspecs/features/mac/default_post.prf src/corelib/io/qfilesystemengine_win.cpp src/corelib/io/qprocess.cpp src/corelib/io/qprocess.h src/corelib/io/qprocess_p.h src/corelib/io/qprocess_unix.cpp src/corelib/io/qprocess_win.cpp src/corelib/thread/qmutex.cpp src/platformsupport/fontdatabases/windows/windows.pri src/plugins/platforms/eglfs/eglfsdeviceintegration.pro tests/auto/corelib/io/io.pro Change-Id: I8a27e0e141454818bba9c433200a4e84a88d147e
| * QDateTime: Fix clearing the ShortData flag in setMSecsSinceEpochThiago Macieira2017-02-241-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unlike setTimeSpec, this forgot to clear the bit when detaching. So it's possible that some further use of the flags could incorrectly conclude that the data was short and then proceed to corrupt the pointer. The example from QTBUG-59061 caused this because toUTC() -> toTimeSpec() calls setMSecsSinceEpoch which left the bit set; then addDays() calls setDateTime(), which calls checkValidDateTime() and that corrupted the pointer. This problem was more visible on 32-bit systems because no QDateTime was short (except for default constructed ones), but it can happen on 64-bit with sufficiently large dates. Task-number: QTBUG-59061 Change-Id: Ibc5c715fda334a75bd2efffd14a562a375a4e69b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Simplify QDateTime::toString(Qt::TextDate)'s text constructionEdward Welbourne2016-12-141-8/+4
| | | | | | | | | | | | | | | | | | We can in fact delegate to QDate::toString(), contrary to the comment that was there; we just need to insert the time in the right place, which is easy enough to find. Change-Id: I66624724628d45ce283243879b102ec8f741a15f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Fix handling of time-zones in QDateTime::toString(Qt::TextDate)Edward Welbourne2016-12-141-1/+10
| | | | | | | | | | | | | | | | | | | | | | Previously, a zone-based time would claim to be GMT, rather than identifying its zone properly. Sadly, testing this reveals that proprietary operating systems don't handle abbreviations ideally. Task-number: QTBUG-57320 Task-number: QTBUG-57298 Change-Id: I8d8b7fffdbf65ac6178a65f5fc2df4d25afb1a14 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Fix QDateTime::toString(Qt::ISODate)'s handling of Qt::TimeZoneEdward Welbourne2016-12-141-2/+14
| | | | | | | | | | | | | | | | | | | | When the time is specified relative to a zone, the ISO date produced lacked its offset suffix; all zones were treated as if they were local time. Handle zone as for an offset from UTC and ensure we do set the date-time objects's offset from UTC when it's zone-based. Change-Id: I7c9896bb8ec0a9d89df14a6e94b005174ab9e943 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-12-131-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure qmake/Makefile.unix.macos qmake/Makefile.unix.win32 qmake/generators/win32/msvc_vcproj.cpp src/3rdparty/pcre/qt_attribution.json src/corelib/io/qsettings.cpp src/corelib/kernel/qdeadlinetimer.cpp src/platformsupport/kmsconvenience/qkmsdevice.cpp src/platformsupport/kmsconvenience/qkmsdevice_p.h src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevicescreen.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.h tests/manual/qstorageinfo/printvolumes.cpp tools/configure/configureapp.cpp Change-Id: Ibaabcc8e965c44926f9fb018466e8b132b8df49e
| * Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-11-251-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/painting/qcoregraphics.mm src/gui/painting/qcoregraphics_p.h src/plugins/platforms/cocoa/qcocoahelpers.h src/plugins/platforms/cocoa/qcocoahelpers.mm Change-Id: Ibe5efcae73526b3d3931ed22730b13d372dcf54e
| | * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-11-251-1/+1
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/features/qml_module.prf src/corelib/tools/qdatetimeparser_p.h Change-Id: I5382cee3ddb33107dc61ee20f7a9188c4a68a882
| | | * Typo fix in QDateTime::toString() documentationEdward Welbourne2016-11-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Text that should simply have been naming days of the week used Qt::Sunday rather than the simple day name. Change-Id: I64a3cdacd854c1c9c0fbf2d11826555086d674f4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | | QDateTime, QTimeZone: fix mappings from zone time to UTCEdward Welbourne2016-12-121-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Such mappings are ill-defined in the presence of daylight-savings time (DST); at its transitions, you need information about whether DST is active or not to determine the correct UTC value. Existing code did not have a way to be told that hint, so could not be correct. Fixing this required changing the (thankfully private) APIs by which QDateTime accessed QTimeZone's information stipulated by zone time. In QDateTime, this required propagating the needed hint, when DST status was known. QAndroidTimeZonePrivate overloaded QTimeZonePrivate::dataForLocalTime with an implementation that works whenever !hasTransitions(); the base implementation handled this case lamely, so I've moved the Android implementation there, to have only one place for both re-writes. Amended tst_QDateTime's expected failures; passing a date and time to the constructor *is* ambiguous when the moment indicated is in a transition. I have changed which way we resolve that ambiguity. Added round-trip test of QDateTime's fromMSecs/toMSecs (but as a QTimeZone test, since that's what's actually getting tested), based on a test-case from Marko Kangas. Initially failed for various zones, each at one hour-offset; and, on some platforms, for some zones, at all offsets. These last revealed that a platform may claim to have zone information yet, for some zones, lack it (or have very incomplete information). In each case, despite this, the platform does give offsetFromUtc(). (The test also found another pre-existing bug on Linux; fixed in an earlier commit.) To accommodate these gaps in transition data, the transition-based code now falls back to the offsetFromUtc()-based code (used when there are no transitions) if it can't find a previous transition (which, in any case, it needs to do its job). Task-number: QTBUG-56460 Task-number: QTBUG-56397 Task-number: QTBUG-52284 Change-Id: I2f7422a9e9d3767940b1901d887c6a2c1f36ac9f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-11-021-10/+24
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Blacklist tst_QMenuBar::taskQTBUG46812_doNotLeaveMenubarHighlighted() on macOS. Conflicts: mkspecs/features/mac/default_post.prf mkspecs/features/mac/sdk.prf mkspecs/features/uikit/default_post.prf mkspecs/features/uikit/sdk.prf src/angle/src/libEGL/libEGL.pro src/platformsupport/fontdatabases/fontdatabases.pro src/platformsupport/platformsupport.pro src/plugins/platforms/cocoa/qnswindowdelegate.mm src/plugins/platforms/direct2d/qwindowsdirect2dintegration.cpp src/plugins/platforms/ios/ios.pro src/plugins/platforms/ios/kernel.pro tests/auto/widgets/widgets/qmenubar/BLACKLIST tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp Task-number: QTBUG-56853 Change-Id: If58785210feee3550892fc7768cce90e75a2416c
| * | | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-11-011-3/+6
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config.tests/win/msvc_version.cpp configure.pri mkspecs/macx-ios-clang/features/default_post.prf mkspecs/macx-ios-clang/features/resolve_config.prf mkspecs/features/uikit/default_post.prf mkspecs/features/uikit/resolve_config.prf src/corelib/io/qsettings_mac.cpp src/corelib/json/qjsondocument.cpp src/plugins/platforms/cocoa/qcocoawindow.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/cocoa/qnswindowdelegate.h src/plugins/platforms/cocoa/qnswindowdelegate.mm src/plugins/platforms/ios/ios.pro src/plugins/platforms/ios/kernel.pro src/plugins/platforms/ios/qiosintegration.h src/plugins/platforms/minimalegl/qminimaleglintegration.cpp tests/auto/gui/painting/qpainter/tst_qpainter.cpp tools/configure/environment.cpp Change-Id: I654845e54e40f5951fb78aab349ca667e9f27843
| | * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-171-3/+6
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/macx-ios-clang/features/resolve_config.prf src/testlib/qtestcase.qdoc Change-Id: Icefa63056ffb37106f35299a8f19165535571799
| | | * Document that am/pm in QDateTime::toString are locale-specificKai Koehne2016-10-131-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I28382b25ac94cbfbad4acff1308ddd8baf5ca693 Task-number: QTBUG-55632 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * | | Add Qt::ISODateWithMs date format, with support in QTime/Date/DateTimeTor Arne Vestbø2016-10-201-7/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Qt::ISODate format strips milliseconds, so a new format is introduced that keeps the milliseconds. A new format was chosen over fixing the existing format due to the behavioral change of suddenly having ms as part of Qt::ISODate. Change-Id: If8b852daed068cce8eee9b61a7cd4576bc763443 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-10-131-39/+41
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/library/qmakeevaluator.cpp (cherry picked from commit 1af6dc2c8fb4d91400fddc5050166f972ae57c9a in qttools) src/corelib/kernel/qcore_mac_objc.mm src/gui/painting/qcolor.h src/plugins/platforms/cocoa/qcocoawindow.mm Change-Id: I5b3ec468a5a9a73911b528d3d24ff8e19f339f31
| * | | Add configure feature for time zone supportLars Knoll2016-10-111-39/+41
| | | | | | | | | | | | | | | | | | | | Change-Id: I6ea02dab33e67e7f312a62d94d82eaf1fbe9d9bc Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | | | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-09-261-12/+19
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/ios/qiosmessagedialog.mm Change-Id: Icfbf55c3215ec088e552d0b42a5c94d04b17c65f
| * | | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-09-211-12/+19
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5971b88e is not needed in new configure. This merge also reverts "fix QMAKE_DEFAULT_*DIRS resolution with apple SDK", 2c9d15d7, because it breaks iOS build with new configure system. Conflicts: mkspecs/features/default_pre.prf mkspecs/features/mac/toolchain.prf mkspecs/features/toolchain.prf src/dbus/qdbusconnection.cpp src/plugins/sqldrivers/mysql/qsql_mysql.cpp src/sql/drivers/mysql/qsql_mysql.cpp src/widgets/widgets/qmenubar.cpp src/widgets/widgets/qmenubar_p.h tools/configure/configureapp.cpp tools/configure/environment.cpp tools/configure/environment.h Change-Id: I995533dd334211ebd25912db05b639d6f908aaec
| | * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-09-161-12/+19
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp Change-Id: I0af32ee55936d523cbd259b6fe82eb9c409f9074
| | | * Q(Date|Time)+::(to|from)String(): mention relevant QLocale methodsEdward Welbourne2016-09-161-12/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The const QString &format variants of these methods lack adequate control over the locale used; the Qt::DateFormat variants give only limited control over the format string. So reference the QLocale methods that provide the general case, in the docs of each. Also made the \sa cross-referencing among these methods a little more coherent. Task-number: QTBUG-55632 Change-Id: Icd0c8548045e74879e941ba089c3bdea78f14e34 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | | Q(Date|Time)+::(to|from)String(): use C locale from Qt 6Edward Welbourne2016-09-161-3/+6
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're using QLocale::system() by default for conversions between date/time and strings; locale-dependency should be left to QLocale's methods, so we should switch to using the C locale for the date/time classes' methods, to make the results locale-independent. Task-number: QTBUG-55632 Change-Id: I6ea6e8d2289e537f4d26eccf69a4f314c501f116 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-08-291-3/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cf53aa21bf0f8fbd13c0ce2d33ddf7bc63d0d76a and 3aaa5d6b32130d3eeac872a59a5a44bfb20dfd4a were reverted because of reconstruction in 5.7. defineTest(qtConfTest_checkCompiler) in configure.pri is smart enough to cover the case in a9474d1260a8c8cc9eae14f2984098919d9684e5. DirectWrite: Fix advances being scaled to 0 Since 131eee5cd, the stretch of a font can be 0, meaning "whatever the font provides". In combination with ec7fee96, this would cause advances in the DirectWrite engine to be scaled to 0, causing the QRawFont test to fail. Conflicts: configure mkspecs/features/uikit/device_destinations.sh mkspecs/features/uikit/xcodebuild.mk src/corelib/global/qglobal.cpp src/corelib/global/qnamespace.qdoc src/plugins/platforms/cocoa/qcocoamenuitem.h src/plugins/platforms/windows/qwindowsservices.cpp src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp src/widgets/kernel/qapplication.cpp tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp Change-Id: I4656d8133da7ee9fcc84ad3f1c7950f924432d1e
| * | Doc: Remove references to Windows CE in Qt CoreVenugopal Shivashankar2016-08-231-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | The platform is not supported since Qt 5.7 Task-number: QTBUG-55331 Change-Id: I98b90d574d9a76c4281852d93818620b5f489117 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* | | Support C++17 fallthrough attributeAllan Sandfeld Jensen2016-08-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Replaces our mix of comments for annotating intended absence of break in switches with the C++17 attribute [[fallthrough]], or its earlier a clang extension counterpart. Change-Id: I4b2d0b9b5e4425819c7f1bf01608093c536b6d14 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.7' into devEdward Welbourne2016-07-191-4/+14
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/library/qmakebuiltins.cpp qmake/library/qmakeevaluator.cpp qmake/library/qmakeevaluator.h qmake/project.h QMakeEvaluator: * evaluateConditional(): one side changed return type, the other changed a parameter type. * split_value_list(): one side changed a parameter adjacent to where ... * expandVariableReferences(): ... the other killed one overload and changed the survivor src/corelib/io/qlockfile_unix.cpp One side changed a #if condition, the other moved NETBSD's part of what it controlled. src/corelib/tools/qdatetime.cpp One side fixed a reachable Q_UNREACHABLE in toMSecsSinceEpoch(), the other moved it from the private class to the public one, in the midst of the "short date-time" optimization, which confused diff entirely. One side changed a QStringLiteral to QLatin1String, the other rewrote adjoining code. src/network/kernel/qauthenticator.cpp Both rewrote a line, equivalently; kept the dev version. src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h One side changed #if-ery that the other removed. tools/configure/configureapp.cpp One side added a check to -target parsing; the other killed -target. tests/auto/testlib/selftests/expected_cmptest.lightxml tests/auto/testlib/selftests/expected_cmptest.teamcity tests/auto/testlib/selftests/expected_cmptest.txt tests/auto/testlib/selftests/expected_cmptest.xml tests/auto/testlib/selftests/expected_cmptest.xunitxml Regenerated using generate_expected_output.py I note that quite a few other expected_* come out changed, now. There was no git-conflict in src/widgets/kernel/qformlayout.cpp but it didn't compile; one side removed some unused methods; the other found uses for one of them. Put FixedColumnMatrix<>::removeRow(int) back for its new user. Change-Id: I8cc2a71add48c0a848e13cfc47b5a7754e8ca584
| * | Use QStringLiteral more judiciouslyAnton Kudryavtsev2016-07-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace it with QL1S in QStringBuilder expressions and in overloaded functions. Replace patterns 'QString::number() + QStringLiteral' and 'QStringLiteral + QString::number()' with QString::asprintf. Saves some text size. Change-Id: Ib39b2332264dfc3df04e77f2c101b47a1030cef4 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Edward Welbourne2016-07-041-3/+13
| |\| | | | | | | | | | Change-Id: Ibd81cd1df4a0650d93fcb556a57be90be2e1f569
| | * QTime: restore Qt3 compatibility in the QDataStream operatorsDavid Faure2016-07-021-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A Qt5 program writing a null QTime() using setVersion(QDataStream::Qt_3_3), and then a Qt3 program reading that, would lead to a weird QTime, with isNull=false, isValid=false, hour=1193, minute=2, second=47, ms=295. This commit restores interoperability, by writing out the expected value (0) for a null QTime rather than the -1 value used by Qt4 and Qt5. Change-Id: Icde468a8f6fc9434ef7018296725819b44d672af Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * QDateTime: early return to make a Q_UNREACHABLE actually true.Edward Welbourne2016-06-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | It could be reached when QT_BOOTSTRAPPED was defined. Change-Id: I632d6f908a3bcbde81a6ebbadcaf2800dfe1449d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Make QDateTime's default constructor not allocate memory on 32-bitThiago Macieira2016-07-091-27/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit fb498a651990df5e04c75a9076da28e875c43f73 introduced the short datetime optimization, but it accidentally removed the optimization from Qt 5.7 that made QDateTime's default constructor not allocate memory. Instead of bringing back the Q_GLOBAL_STATIC that was used, let's use the short date time optimization on 32-bit too. The CanBeSmall constant remains false on 32-bit systems, but judicious non-use of that constant in a few functions allows 32-bit systems to use the optimization. We still say that any date/time value is "unsmall", as there's no sense in calculating whether the date is between 1970-01-01 and July 14 of the same year. Change-Id: I413d458307aa46469b80fffd145a9db0325c08cc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | Fix some qdoc-warnings for Qt 5.8.Friedemann Kleint2016-06-281-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qtbase/src/corelib/tools/qstring.cpp:8341: warning: Unknown command '\length' qtbase/src/corelib/tools/qstring.cpp:8354: warning: Unknown command '\length' qtbase/src/corelib/tools/qstring.cpp:8366: warning: Unknown command '\length' qtbase/src/corelib/doc/src/animation.qdoc:38: warning: Can't link to 'QAbstractAnimation::updateCurrentValue()' qtbase/src/corelib/io/qdatastream.cpp:529: warning: Undocumented enum item 'Qt_5_8' in QDataStream::Version qtbase/src/corelib/tools/qdatetime.cpp:4377: warning: No documentation for 'QDateTime::currentSecsSinceEpoch()' qtbase/src/corelib/tools/qcommandlineoption.cpp:435: warning: Undocumented parameter 'flags' in QCommandLineOption::setFlags() qtbase/src/network/ssl/qsslconfiguration.cpp:857: warning: Undocumented parameter 'dhparams' in QSslConfiguration::setDiffieHellmanParameters() qtbase/src/network/ssl/qsslconfiguration.cpp:830: warning: Undocumented parameter 'hint' in QSslConfiguration::setPreSharedKeyIdentityHint() qtbase/src/network/ssl/qssldiffiehellmanparameters.cpp:225: warning: No such enum item 'ErrorUnsafeParameters' in QSslDiffieHellmanParameters::Error qtbase/src/network/ssl/qssldiffiehellmanparameters.cpp:225: warning: No such enum item 'ErrorInvalidInputData' in QSslDiffieHellmanParameters::Error qtbase/src/network/ssl/qssldiffiehellmanparameters.cpp:225: warning: Undocumented enum item 'UnsafeParametersError' in QSslDiffieHellmanParameters::Error qtbase/src/network/ssl/qssldiffiehellmanparameters.cpp:225: warning: Undocumented enum item 'NoError' in QSslDiffieHellmanParameters::Error qtbase/src/network/ssl/qssldiffiehellmanparameters.cpp:225: warning: Undocumented enum item 'InvalidInputDataError' in QSslDiffieHellmanParameters::Error qtbase/src/network/ssl/qssldiffiehellmanparameters.cpp:105: warning: Undocumented parameter 'encoding' in QSslDiffieHellmanParameters::QSslDiffieHellmanParameters() qtbase/src/network/ssl/qssldiffiehellmanparameters.cpp:129: warning: Undocumented parameter 'encoding' in QSslDiffieHellmanParameters::QSslDiffieHellmanParameters() qtbase/src/network/ssl/qssldiffiehellmanparameters.cpp:208: warning: Can't link to 'clear()' qtbase/src/network/ssl/qssldiffiehellmanparameters.cpp:277: warning: Undocumented parameter 'dhparam' in operator<<() qtbase/src/network/ssl/qssldiffiehellmanparameters.cpp:277: warning: No such parameter 'dhparm' in operator<<() qtbase/src/widgets/kernel/qapplication.cpp:999: warning: Cannot find 'QApplication::autoMaximizeThreshold' specified with '\property' in any header file Change-Id: I4ac00f0fc0dbc4d421cf7c0273635d9681962645 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-06-231-2/+0
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/common/mac.conf mkspecs/features/configure_base.prf mkspecs/features/configure.prf mkspecs/macx-clang-32/qmake.conf mkspecs/macx-clang/qmake.conf mkspecs/macx-ios-clang/qmake.conf src/network/ssl/qsslsocket_openssl_symbols_p.h Change-Id: I768b592e8e589662b1fdb9b8cbd633fef26845b6
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-06-231-2/+0
| |\| | | | | | | | | | | | | | | | | | | | | | Conflicts: src/angle/src/libGLESv2/libGLESv2.pro src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp Change-Id: If8da4cfe8f57fea9f78e7239f378a6302c01674e
| | * Win: Get rid of unused variables un QDateTime::currentMSecsSinceEpochThiago Macieira2016-06-221-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | The compiler didn't complain that they were unused or -Werror / -WX was not active. Change-Id: Ib57b52598e2f452985e9fffd145a7b63a32189fd Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* | | QDateTime: introduce {to,from,set,current}SecsSinceEpochThiago Macieira2016-06-221-12/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These new functions use a 64-bit integer in the API, instead of the broken 32-bit unsigned integer that the previous xxxTime_t functions used. That was a design flaw when the API was introduced back in Qt 4.2, so I'm deprecating the API and slating it for removal in 6.0. The changes to qfilesystemmetadata_p.h and quuid.cpp are necessary to build the bootstrap library. The rest of the adaptation to the new API will come in the next commit. [ChangeLog][QtCore][QDateTime] Introduced toSecsSinceEpoch, fromSecsSinceEpoch and setSecsSinceEpoch functions, which use 64-bit integers to represent the number of seconds. [ChangeLog][QtCore][QDateTime] The toTime_t, fromTime_t and setTime_t functions are deprecated and will be removed in Qt 6.0. For new code, use the equivalent functions with "SecsSinceEpoch" in the name, or the equivalent ones with millisecond accurancy that have existed since Qt 4.7. Change-Id: Ib57b52598e2f452985e9fffd145a355d0e7ff48d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Fix MSVC warning about casting to pointer of different sizeThiago Macieira2016-06-201-1/+1
| | | | | | | | | | | | | | | | | | | | | qdatetime.cpp(2834): warning C4312: 'reinterpret_cast': conversion from 'int' to 'QDateTimePrivate *' of greater size Change-Id: Ib57b52598e2f452985e9fffd1458fe3ba3fcfb48 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-06-131-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config_help.txt configure mkspecs/features/uikit/sdk.prf src/corelib/global/qhooks.cpp src/corelib/io/qfilesystemwatcher.cpp src/corelib/io/qlockfile_unix.cpp src/corelib/tools/qalgorithms.h src/gui/kernel/qwindowsysteminterface.h src/gui/text/qtextdocument_p.cpp src/network/access/access.pri src/network/access/qnetworkaccessmanager.cpp src/network/access/qnetworkreplynsurlconnectionimpl.mm src/src.pro src/testlib/qtestcase.cpp src/widgets/kernel/qwidgetbackingstore_p.h src/widgets/styles/qwindowscestyle.cpp src/widgets/styles/qwindowsmobilestyle.cpp tests/auto/corelib/io/qdiriterator/qdiriterator.pro tests/auto/corelib/io/qfileinfo/qfileinfo.pro tests/auto/gui/kernel/qwindow/BLACKLIST tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp tools/configure/configureapp.cpp Change-Id: Ibf7fb9c8cf263a810ade82f821345d0725c57c67
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-06-061-1/+1
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf config.tests/unix/nis/nis.cpp mkspecs/unsupported/freebsd-g++/qplatformdefs.h src/corelib/tools/qdatetime.cpp src/corelib/tools/qsimd.cpp src/corelib/tools/qsimd_p.h src/network/access/access.pri src/network/access/qnetworkreplynsurlconnectionimpl.mm src/network/access/qnetworkreplynsurlconnectionimpl_p.h src/plugins/platforms/cocoa/qnsview.mm src/plugins/printsupport/windows/qwindowsprintdevice.cpp tests/auto/corelib/kernel/qobject/tst_qobject.cpp tests/auto/network/access/qnetworkreply/BLACKLIST tests/auto/widgets/widgets/qopenglwidget/BLACKLIST Change-Id: I4b32055bbf922392ef0264fd403405416fffee57
| | * Compile fix: convert argument to long to match parameter comparisonRalf Nolden2016-05-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC creates a warning "enumeral and non-enumeral type in conditional expression" as the types of the two arguments don't match. Fix the compile warning by converting the first argument to (long) to match the type of the second parameter. Fix confirmed to work on NetBSD and FreeBSD, obtained from Kamil Rytarowski <n54@gmx.com>, NetBSD qt ports maintainer. Change-Id: I777dd066a0a8cc8a46e34bd39b256882080a7773 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Add move constructor to QDateTimeThiago Macieira2016-06-101-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The move constructor is slightly more interesting than the copy constructor because we can reset other to a short data state on 64-bit systems. The assembly of that function is simply: mov (%rsi),%rax mov %rax,(%rdi) movq $0x1,(%rsi) retq The move-assignment operator for QDateTime was already there. There's no need for one for QDateTime::Data since it's never called. Change-Id: I06bae9392f534e45b3f1ffff144dffdd7f23b170 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Allow QDateTime to shrink back to short data mode on copyThiago Macieira2016-06-101-5/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We won't shrink on manipulation when we have memory allocated, but it's a good idea to create a non-shared copy if we can. It's an unlikely scenario, though, because it requires the QDateTime object to have been set to a large state then manipulated back into a small state. Change-Id: I06bae9392f534e45b3f1ffff144dfee755bafa01 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | Move the QDateTime file static functions to their right placeThiago Macieira2016-06-101-178/+170
| | | | | | | | | | | | | | | | | | | | | | | | | | | The file has an organization, so let's follow it. This commit has no other changes besides moving code around. Change-Id: I06bae9392f534e45b3f1ffff144e0b1f6dd72622 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>