summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Separate out the time, zone, date code from corelib/tools/Edward Welbourne2019-06-061-1340/+0
| | | | | | | | | | We'll be adding calendar code here as well, and tools/ was getting rather crowded, so it looks like time to move out a reasonably coherent sub-bundle of it all. Change-Id: I7e8030f38c31aa307f519dd918a43fc44baa6aa1 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Support POSIX rules as $TZ valuesEdward Welbourne2019-05-101-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The TZ environment variable can validly contain a POSIX rule, rather than an IANA ID, as described here: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_03 However, if TZ were set to such a value, leading to it being used as systemTimeZoneId(), it would be passed to QTzTimeZonePrivate::init(), which is a no-op unless it manages to open a zoneinfo/ file with the given ianaId as name. When the environment variable doesn't name a zoneinfo/ file, we would thus get an invalid time-zone. We can, instead, check whether the ianaId looks like a valid POSIX rule and, if it does, use it as m_posixRule, enabling us to correctly handle this case. Tweak parsing of POSIX rules so that a zone using name "UTC" or "GMT" with an offset other than 0 will be rejected as invalid. This avoids parsing a zone name such as "GMT+17" or "UTC+00:01" as a POSIX rule, where it should be understood as an offset from UTC (and only certain well-established offsets are supported). Added two test-cases to tst_QTimeZone::tzTest() for validity of a POSIX zone value - a simple one constructed during discussion of the bug, the other taken from an example in: http://leaf.sourceforge.net/doc/buci-tz3.html Task-number: QTBUG-75565 Change-Id: Ia5cb1cc56b13b0f6b56258e48be98d04d909e32a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-04-101-1/+6
|\ | | | | | | | | | | | | | | Conflicts: mkspecs/win32-clang-msvc/qmake.conf src/gui/image/qpnghandler.cpp Change-Id: Ied79d02912ffb3a307a99483df7db08c7f9d0cd8
| * Fix various uncommon cases in QTzTimeZonePrivate backendEdward Welbourne2019-04-051-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Includes a fixup for 03fadc26e7617aece89949bc7d0acf50f6f050a9, which removed the check on empty transition list, needed when no data are available. Ensured that such a data-free zone would in fact be noticed as invalid during init(). Fixed handling of times before the epoch (we still want to consult a POSIX rule, if that's all that's available) while ensuring we (as documented) ignore DST for such times. Fixed handling of large times (milliseconds since epoch outside int range) when looking up POSIX rules. Gave QTimeZonePrivate a YearRange enum (to be moved to QTimeZone once this merges up to dev) so as to eliminate a magic number (and avoid adding another). Moved year-munging in POSIX rules after the one early return, which doesn't need the year range. Added test-cases for the distant past/future (just checking UTC's offsets; SLES has a minimal version of the UTC data-file that triggers the bugs fixed here for them). Fixes: QTBUG-74666 Fixes: QTBUG-74550 Change-Id: Ief7b7e55c62cf11064700934f404b2fc283614e1 Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-03-311-0/+4
|\| | | | | | | | | | | | | Conflicts: src/corelib/configure.json Change-Id: I93ac67f3bf4844bc7c691183e94bceb922b7b919
| * Fix broken data for time-zones with no transitionsEdward Welbourne2019-03-221-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While an invalid time-zone shall have no transitions, so may various constant zones, like UTC. The TZ data may include only the POSIX rule for such a zone, in which case we should use it, even if there are no transitions. Broke out a piece of repeated code as a common method, in the process, since I was complicating it further. Added test for the case that revealed this; and made sure we see a warning if any of the checkOffset() tests gets skipped because its zone is unsupported. Fixes: QTBUG-74614 Change-Id: Ic8e039a2a9b3f4e0f567585682a94f4b494b558d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QtBase: replace deprecated QString functionsChristian Ehrlicher2019-03-041-2/+1
|/ | | | | | | | | | | | Replace deprecated QString functions in examples and tests: - QString::sprintf() - QString::null - QString::fromAscii Change-Id: I4404d17c1a65496c9079e8a7300e72a5b3740fe5 Reviewed-by: Luca Beldi <v.ronin@yahoo.it> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* Avoid test failures in tst_qtimezone.cpp and Windows 10 1809Kai Koehne2019-01-281-2/+1
| | | | | | | | | | | The test started to fail now also for latest Windows 10 Update Restone 2. It's unclear why the test was succeeding before, since this seems a generic Windows API issue. Task-number: QTBUG-64985 Task-number: QTQAINFRA-2255 Change-Id: I804f6a61c63ea70157353d1aee9027d0735073ab Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-07-021-1/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/cocoa/qnsview.mm src/plugins/platforms/cocoa/qnsview_dragging.mm src/plugins/platforms/ios/qiosinputcontext.mm src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/plugins/platforms/xcb/qxcbwindow.cpp src/tools/androiddeployqt/main.cpp Was moved from qttools into qtbase in 5.11. So re-apply 32398e4d here. tests/auto/corelib/global/qlogging/test/test.pro tests/auto/corelib/global/qlogging/tst_qlogging.cpp tests/auto/corelib/io/qfile/tst_qfile.cpp tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp tests/auto/corelib/thread/qthreadstorage/test/test.pro tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp tests/auto/widgets/kernel/qapplication/test/test.pro Done-with: Gatis Paeglis <gatis.paeglis@qt.io> Done-with: Mårten Nordheim <marten.nordheim@qt.io> Done-with: Oliver Wolff <oliver.wolff@qt.io> Change-Id: Id970486c5315a1718c540f00deb2633533e8fc7b
| * Android: tst_QTimeZone::transitionEachZone: skip 2 zonesMårten Nordheim2018-06-271-0/+4
| | | | | | | | | | | | | | | | | | When testing zones "America/Mazatlan" and "Mexico/BajaSur" the test crashes from an assert. Skip testing the zones for now. Task-number: QTBUG-69132 Change-Id: I595089647792e9a2c094d63cb837584b8cdc9cb9 Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
| * Make tests compile for AndroidLiang Qi2018-06-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This only enables compilation, it doesn't fix any test. Qt on Android supports process, but not TEST_HELPER_INSTALLS. See also acdd57cb for winrt. android-ndk-r10e is used to compile, see http://doc-snapshots.qt.io/qt5-5.11/androidgs.html . corelib/io/{qdir,qresourceengine} need to be fixed later. Done-with: Frederik Gladhorn <frederik.gladhorn@qt.io> Done-with: Mårten Nordheim <marten.nordheim@qt.io> Change-Id: I34b924c8ae5d46d6835b8f0a6606450920f4423b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | Clean up some trivia in tst_QTimeZoneEdward Welbourne2018-04-121-2/+3
| | | | | | | | | | | | | | | | | | Fix a mistaken #ifdef that should have been #if; and only call QTimeZone::availableTimeZoneIds() once in transitionEachZone_data(), while switching to use of a ranged-for. Change-Id: Id27aae9ef450f21350283099c892ca7173884b94 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Adjust tst_QTimeZone's Q_OS_WIN #if-ery now that ICU is the defaultEdward Welbourne2018-03-091-9/+13
|/ | | | | | | | | | | | | Various tests were adapted to Q_OS_WIN to take account of the deficiencies in its TZ APIs; which are now bypassed when ICU is configured, as we use it instead. Replace some #if-ery on a local define with QT_CONFIG(icu) and QMAKE_USE_PRIVATE += icu here, to match in corelib/tools/tools.pri Task-number: QTBUG-66367 Change-Id: Ia93abdeb7d12046310f0bb4a78c2669f8eecbbc2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Test Russia's post-DST transitions are reported correctlyEdward Welbourne2018-01-191-0/+62
| | | | | | | | | | | | This is a regression test for bugs resulting from failure to take account of the MS TZ APIs fake-DST handling of standard-time transitions happening during DST. Has to skip the 2014 test on Win7, as it's so old it doesn't know about the (for it) "future" transition. Task-number: QTBUG-42021 Change-Id: I853b86d03a86f0269371bf1622bf63882fb8ee5d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Kludge round MS TZ APIs' lies breaking a testEdward Welbourne2017-12-131-0/+8
| | | | | | | | | | | | | | | | Commit 68bcccac took account of MS TZ APIs mis-describing non-DST zones making changes to standard offset (e.g. Europe/Samara in 2011 at the end of October); however a DST transition that coincides with an equal and opposite change to standard offset, while the other end of its DST period changes normally, ends up looking exactly the same (although it's nominally subtly different), in MS's APIs. Thus fixing the more common case broke this more obscure case; there is no way to fix this (other than not using MS's broken-by-design APIs). So kludge the test to skip the bit we know this breaks. Task-number: QTBUG-64985 Change-Id: I068500e2e783ab72b400bfd6dbb7dbbd5b08a7bc Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add a check of selected time-zone offset dataEdward Welbourne2017-11-301-0/+47
| | | | | | Task-number: QTBUG-64122 Change-Id: I6b113f2f05db9659b8c542744846096e39f285ab Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix typo in tst_QTimeZone::testEpochTranPrivate()Edward Welbourne2017-11-061-1/+2
| | | | | | | | | | The milli-seconds since epoch value for an invalid transition is, of course, invalidMSecs(), not invalidSeconds(). Added a comment while I was at it, explaining why we expect a transition before the epoch, if such transitions are supported. Change-Id: I0f376f9d69c0e6e79a309dc011943baa41175135 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add test for time zone transitions near the epochEdward Welbourne2017-07-281-0/+44
| | | | | | | | | | | | | | | | | | | | | This needs a zone with transitions near the epoch; and the only CET with DST that winter was Italy (copied by Malta), for which the Olson database had a recent (2016) correction to its data, for that winter. That means we get inconsistent results on O/Sen of different ages. So add a separate testEpochTranPrivate(), alongside testCetPrivate(), and test it with America/Toronto. (Unfortunately, MS-Win gets the date wrong on the first transition after the epoch, so we have to code round that.) Since information before the epoch isn't reliably available, only test the search backwards if nextTransition does find something before it. (We can safely assume all real transitions happened since 1601; non-celestial time-keeping wasn't accurate enough, before that, for anyone to synchronize with anything but celestial time.) Change-Id: I984b46938a2805b93bb2afd6855e317b5d66b386 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* tst_QTimeZone: improve readability of code and failure reportsEdward Welbourne2017-07-251-36/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When QCOMPARE(,) reports two 12-digit numbers, it's not always immediately obvious what the difference is (much less what 1/3600000 of it is); nor is it obvious that (or why) a given 12-digit number is in fact correct. In contrast, our eyes can make sense of a QDateTime's reported value quite well, enabling us to see what's different; and it's possible to at least confirm the plausibility of 2-or-3 am on a spring or autumn day at a plausible transition (or even to confirm it exactly by consulting suitable web-sites). Also document the actual transition happening in each case (since I *did* consult a suitable web-site). So prefer to QCOMPARE(,) two QDateTime values instead of two 12-digit qint64s. Where a that would be unsuitable, at least compare the difference to zero, to make the error easier to understand (except when one of the twelve-digit numbers consists entirely of 9s; that, for once, actually is easy to see). Write various multiples of 3600 as the relevant intelligible whole number times 3600, rather than premultiplying, to make it obvious to reders what's going on. None of this changes what is actually tested. Change-Id: I488e751283a55d4623c93612af13ad631144900d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix a loop-test and the bogus data the loop expectedEdward Welbourne2017-07-251-3/+3
| | | | | | | | | | | A loop initialized i = 0 and used i > 2 as its condition; it didn't get very far. Consequently, the test it was in never checked whether CET's 2011 transitions happened at the times expected - which they didn't, as the times in question were in fact the times at which Pacific/Auckland had its transitions that year. Change-Id: I94d1f8df615c5bcfe48e73d41b4c7faf2beccb96 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-06-191-1/+15
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qprocess_unix.cpp src/corelib/io/qprocess_win.cpp src/plugins/platforms/android/qandroidplatformintegration.h src/plugins/platforms/windows/qwindowscontext.cpp src/plugins/platforms/windows/windows.pri src/tools/uic/cpp/cppwriteinitialization.cpp src/widgets/doc/src/widgets-and-layouts/gallery.qdoc Change-Id: I8d0834c77f350ea7540140c2c7f372814afc2d0f
| * Fix sending UTC-offset QTimeZones through QDataStreamChris Wilson2017-06-081-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QTimeZone("UTC") should be valid, as "UTC" appears in the list of availableTimeZoneIds(), and tst_QTimeZone::dataStreamTest() constructs timezones like this, which are considered valid. The internal representation of a QTimeZone("UTC") as created by QTimeZone::QTimeZone(const QByteArray &ianaId) is a QUtcTimeZonePrivate which isValid(), so the containing QTimeZone isValid() too. When QTimeZone is serialized into a QDataStream, it calls tz.d->serialize(ds) which is QUtcTimeZonePrivate::serialize. This writes QStringLiteral("OffsetFromUtc") followed by the IANA ID and the offset (etc.) to the datastream. When QTimeZone is deserialized it looks for this marker string, and if present, it passed all of the parameters to the QTimeZone constructor (not just the name). However, that constructor does not support standard IANA timezones (only custom ones), and when it detects that the supplied IANA ID is actually listed in availableTimeZoneIds(), it leaves the pointer to the QTimeZonePrivate uninitialized (NULL), which leaves the QTimeZone invalid (isValid() returns false). Thus, a valid timezone which was serialized and then deserialized has become invalid. This also affects serialization of QDateTimes with timezones. Fixed by calling the name-only constructor first, which works (only) for IANA standard timezones and leaves the QTimeZone invalid (isValid() returns false) otherwise. In which case, we can call the many-argument contructor to create a custom timezone with the same offset as the one which was originally serialized. [ChangeLog][QtCore][QTimeZone] Fixed sending IANA standard UTC-offset QTimeZones through QDataStream, which previously came out invalid after deserialization. Task-number: QTBUG-60595 Change-Id: Id9c47e8bda701faae4d800e012afb6db545b2fe9 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | tst_QTimeZone: fix #if-ery to use Q_OS_DARWINEdward Welbourne2017-03-221-4/+4
|/ | | | | | | Avoid using deprecated define in test. Change-Id: I33550ae6cfb1ebe03550826371c763afa35f1972 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Unexport QTimeZonePrivateMarc Mutz2017-02-231-0/+2
| | | | | | | | | | | It's only used in the autotests, and it private API, so downgrade from Q_CORE_EXPORT to Q_AUTOTEST_EXPORT. Fix a use of QTimeZonePrivate functions unprotected by QT_BUILD_INTERNAL in tst_qtimezone.cpp. Change-Id: I70eaea06f8fcf2983aeafb6894c3a5d2a4b272a7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add conversion functions for QTimeZone and CFTimeZone/NSTimeZoneJake Petroules2017-01-231-0/+11
| | | | | Change-Id: I3a2e18d69577296bf612e13e40414bce1daa6a71 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* tst_QTimeZone::printTimeZone: pass zone by referenceEdward Welbourne2016-12-121-2/+2
| | | | | | | It's a const parameter, so no sense copying it. Change-Id: I4a673a6a60af9bfe7cb61ce28de2aa295fa1d069 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* tst_QTimeZone: tidy up handling of debug memberEdward Welbourne2016-12-121-8/+4
| | | | | | | | Make it const, initialize it instead of assigning, consolidate testing of it round some #if-ery. Change-Id: I2efbf58292a0edd2ceb3da8d3cc16246e84a3bac Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDateTime, QTimeZone: fix mappings from zone time to UTCEdward Welbourne2016-12-121-0/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.6' into 5.7Liang Qi2016-06-061-0/+10
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Fix parsing of tzfile(5) POSIX rule zone names with bracket quotesThiago Macieira2016-05-241-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | POSIX.1-2001 allows quoting a zone name so that it can contain other characters besides letters, by enclosing it in angle brackets ('<' and '>'). This hadn't been used until recently (tzdata2016b), when the Asia/Barnaul rule started using a zone name "+07" (the name variable contained the value "<+07>-7"). Thanks to Paul Eggert for reporting and investigating the root cause. Task-number: QTBUG-53071 Change-Id: Id5480807d25e49e78b79ffff1449bc410776cb66 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-291-6/+12
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/features/qml_module.prf mkspecs/features/qt_common.prf src/gui/text/qzip.cpp src/plugins/platforms/cocoa/qnsview.mm src/plugins/platforms/windows/array.h src/testlib/qtestcase.cpp src/widgets/dialogs/qfilesystemmodel.h Change-Id: Ie41c5868415b81f7693c80e045497035504bb210
| * Autotest: fix the QTimeZone::tzTest failure when database contains LMTThiago Macieira2016-04-291-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On some operating systems, tzdata files carry the Local Mean Time (LMT) for the city in question, which better represents how time was tracked before standard, hourly timezones were introduced in the early 20th century. The test was asking for the data for 1653-02-09 and assumed that it would find the first Central European Time (CET) rule, which Germany didn't start using until 1893-04-01. This fix allows us to remove the blacklist that had been applied to this test without investigation. It wasn't related to OpenSUSE, aside from the fact that OpenSUSE tzdata carries the LMT data. Change-Id: Id5480807d25e49e78b79ffff1449bdaf46901367 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-03-211-1/+1
|\| | | | | | | | | | | | | | | | | Conflicts: src/widgets/styles/qgtkstyle_p.cpp tests/auto/corelib/io/qtextstream/test/test.pro tests/auto/corelib/plugin/plugin.pro Change-Id: I512bc1b36acf3933ed2b96c00f476ee3819c1f4b
| * WinRT: Fix QTimeZone transitions by switching backendMaurice Kalinowski2016-03-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously WinRT was using the UTC backend which fails on all platforms for some QDateTime autotests related to timezone items. Hence switch to the Windows implementation for WinRT as well. However, the windows backend does query the registry heavily, which is not supported on WinRT. Instead use the API version provided by the SDK. Long-term we might want to switch to this version on desktop windows as well, as direct registry access would not be required and we could harmonize the codepaths for both platforms. Change-Id: I620b614e9994aa77b531e5c34c9be1da7e272a30 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* | Updated license headersJani Heikkinen2016-01-211-17/+12
|/ | | | | | | | | | | | | From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some exceptions, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one (in those files which will be under GPL 3 with exceptions) Change-Id: I42a473ddc97101492a60b9287d90979d9eb35ae1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* QTimeZone: Convert fractional timezones properly.Cesar Garcia Naranjo2015-07-211-0/+18
| | | | | | | | | [ChangeLog][QtCore][QTimeZone] Fixed a wrong timezone conversion when the POSIX timezone rule contains a fractional timezone (e.g. VET4:30). Task-number: QTBUG-47037 Change-Id: I5d9052929bbcde174614ccf07c329264603e6431 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | 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>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* tst_QTimeZone: test QTimeZonePrivate::isValidId()Marc Mutz2014-07-311-0/+61
| | | | | | | This is in preparation of rewriting the function for efficiency. Change-Id: Id5c16b984b95d76e1f26d862e3813f75980f44fb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-12-161-0/+31
|\ | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qplatformtheme.h tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp Change-Id: Iecd3343d6a050b8764f78d809c4a1532aeba69e5
| * QTimeZone: Fix isValidId()John Layt2013-12-061-0/+31
| | | | | | | | | | | | | | | | | | | | Fix isValidId() which was failing valid IDs because it was splitting name parts by \ instead of /. it was also rejecting offset from UTC formats names. Add unit tests. Task-number: QTBUG-35025 Change-Id: I4d23d2e54f4a9fac9afcc4eff0a02d6f4af21385 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-11-261-22/+72
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the conflicts in msvc_nmake.cpp the ifdefs are extended since we need to support windows phone in the target branch while it is not there in the current stable branch (as of Qt 5.2). Conflicts: configure qmake/generators/win32/msvc_nmake.cpp src/3rdparty/angle/src/libEGL/Surface.cpp src/angle/src/common/common.pri src/corelib/global/qglobal.h src/corelib/io/qstandardpaths.cpp src/plugins/platforms/qnx/qqnxintegration.cpp src/plugins/platforms/qnx/qqnxscreeneventhandler.h src/plugins/platforms/xcb/qglxintegration.h src/widgets/kernel/win.pri tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp tools/configure/configureapp.cpp Change-Id: I00b579eefebaf61d26ab9b00046d2b5bd5958812
| * QTimeZone - Fix dateForLocalTime() to check validity of next transitionJohn Layt2013-11-211-0/+4
| | | | | | | | | | | | | | | | | | The private method dateForLocalTime() was not checking that transitions were valid, resulting in infinite looping when a time zone didn't have any future transitions. Change-Id: I0e5d07063861778dd86056a80c36fdd9f9d36133 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * QTimeZone - Fix TZ file abbreviationsJohn Layt2013-11-211-4/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix parsing of TZ file abbreviations, to correctly return cases where POSIX rule doesn't have separate DST rules, and where abbreviation is a sub-string of another abbreviation, otherwise any toString() call will crash. Add test to exercise all available time zones, especially useful for TZ file to confirm all file format variations dealt with. Fix parsing of Version 3 of TZ file, and ICU display name, to allow all files generated from release 2013f to pass, otherwise isValid() call will crash. Task-number: QTBUG-34061 Change-Id: Ie0b6abc218adff1c8967eb33fdb0762041d2305f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * QTimeZone - Change Olsen ID to IANA IDJohn Layt2013-11-211-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The name Olson was misspelled as Olsen in the public api of QTimeZone which is needed to be fixed before first public release in 5.2 would freeze the api and prevent it being fixed. It has been decided that renaming as IANA ID would be more future-proof. Fixes to the private code will be done separately to keep this patch against release branch to the minimum required. Task-number: QTBUG-34735 Change-Id: I8ee90644862c907f6d1937b8536f0c02583ae736 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Fix QTimeZone test compilation on WinRTAndrew Knight2013-11-041-1/+1
|/ | | | | | | | WinRT doesn't use the Windows Timezone backend, so don't build the Windows test. Change-Id: I32620546de3ad1f19402cc1359f8038200c915ec Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* QTimeZone - Add Windows backendJohn Layt2013-09-231-25/+84
| | | | | | | Add backend implementation for Windows times zones. Change-Id: I30946f6672488c3f1d1d05754e9479aa62cce46f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTimeZone - Add Mac backendJohn Layt2013-09-231-0/+50
| | | | | | | Add Mac backend support Change-Id: Iafa2dbd925e18431f571e3eac62983015f8bc977 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTimeZone - Add TZ File BackendJohn Layt2013-09-221-0/+138
| | | | | | | | | | Add a backend for TZ Files. If available uses ICU for the display names and translations, otherwise the abbreviation is used. Change-Id: I58c777462810b1a76ea7bd95886836b70b8a3db5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTimeZone - Add ICU supportJohn Layt2013-09-221-0/+141
| | | | | | | Add ICU backend for QTimeZone Change-Id: I92e53a848477e366591102064b093e936f0b49d2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>