summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qdatetime_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-04-101-0/+4
|\ | | | | | | | | | | | | | | 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-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | More nullptr usage in headersKevin Funk2019-03-141-1/+1
|/ | | | | | | | | | | Diff generated by running clang-tidy's modernize-use-nullptr checker on the CMake-based Qt version. Skipping src/3rdparty, examples/, tests/ Change-Id: Ib182074e2e2fd52f63093f73b3e2e4c0cb7af188 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Remove two unused static methods of QDateTimePrivateEdward Welbourne2017-01-121-3/+0
| | | | | | | ... along with the two matching unused methods of QDateTime's test. Change-Id: Id11a4b1b0132587f0df451d49c0043e9425d87ad Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix QDateTime::toString(Qt::ISODate)'s handling of Qt::TimeZoneEdward Welbourne2016-12-141-0/+3
| | | | | | | | | | 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>
* QDateTime, QTimeZone: fix mappings from zone time to UTCEdward Welbourne2016-12-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Add configure feature for time zone supportLars Knoll2016-10-111-6/+8
| | | | | Change-Id: I6ea02dab33e67e7f312a62d94d82eaf1fbe9d9bc Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Make sure all private headers in Qt Core include qglobal_p.hThiago Macieira2016-06-251-0/+1
| | | | | | | | | | | | The rule was: - if the header included qglobal.h, turn that into qglobal_p.h - otherwise, insert the #include after the "We mean it" warning qglobal_p.h currently only includes qglobal.h. Change-Id: Ib056b47dde3341ef9a52ffff13ef677e471674b7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Long live the short QDateTime optimizationThiago Macieira2016-06-101-3/+7
| | | | | | | | | | | | | | | | Well, maybe not for so long: we may want to revisit it for Qt 6. At the very least, we should enlarge the size of QDateTime on 32-bit system so that they too can benefit from the optimization. With this optimization, on 64-bit systems, the most common uses of QDateTime now no longer allocate memory at all. The range is slightly reduced from 584,554,049 years to 2,283,414 years around 1970. The other drawback is that calling QDateTime::offsetFromUtc() on a localtime now needs to recalculate the offset, instead of using the cached offset. (QDateTime::toMSecsSinceEpoch() didn't use the cache). Change-Id: Id5480807d25e49e78b79ffff144a8b2c9af91814 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QDateTimePrivate refactor: static'fy the date/time manipulatorsThiago Macieira2016-06-101-7/+0
| | | | | | | | | | | | | | | This commit moves QDateTimePrivate functions setTimeSpec, setDateTime, getDateTime, checkValidDateTime and refreshDateTime outside the class. Like the previous commit, this is done in preparation for the "Short QDateTime Optimization" as the "msecs" field will be placed in the short data, if possible. By making them file-level static, this also improves code generation, as the compiler doesn't know whether it has to emit the class members for out-of-line use or not. Change-Id: I06bae9392f534e45b3f1ffff144df4d73cbc9184 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QDateTimePrivate refactor: static'fy access to d->m_statusThiago Macieira2016-06-101-15/+0
| | | | | | | | | | | This commit changes most accesses to the d->m_status (including d->spec() and d->setSpec() uses) to use new static functions. This is done in preparation to the "Short QDateTime Optimization" as the status byte will be kept in the short data. Change-Id: I06bae9392f534e45b3f1ffff144dbd795d03227a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Move QDateTimePrivate::toMSecsSinceEpoch() code into QDateTimeThiago Macieira2016-06-101-3/+0
| | | | | | Change-Id: I06bae9392f534e45b3f1ffff144dbad485814779 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Remove QDateTimePrivate::isNull{Date,Time}()Thiago Macieira2016-06-101-2/+0
| | | | | | | | | | They're superfluous, since b491fab02a6a67fcd18d8076ac802d2f8c4f6972 removed the distinction between null and invalid. Just use the isValidXxx equivalents. Change-Id: I06bae9392f534e45b3f1ffff144db9badad010fd Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Stop QDateTimePrivate from inheriting QSharedDataThiago Macieira2016-06-101-5/+4
| | | | | | | | | | | | | | | | | | | | | | We're going to have to stop using QSharedDataPointer because of the upcoming short-datetime-optimization. By dropping the inheritance, I am also able to rearrange the members and remove the padding hole that existed. The second padding hole was removed in the previous commit, which merged two 32-bit fields into one. On 64-bit systems, there's no way around a remaining 4-byte hole somewhere due to the odd number of 32-bit members. I chose to leave it in the middle of the struct, before the m_timeZone member, instead of tail padding, so that the layout of the first members structure are the same in bootstrapped and non-bootstrapped builds. That should help debugging the bootstrapped tools in Qt Creator. It's also now the same in 32- and in 64-bit systems. Change-Id: Id69569111e7d4e619e22ffff144b1fba708885f7 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QDateTimePrivate: merge the time spec, DST status and validity flagsThiago Macieira2016-06-101-11/+24
| | | | | | | | | | | | Storing them in a single byte is the first step towards the Short QDateTime Optimization. The bump in the "private version" by 10 is to accommodate possible changes in the Qt 5.7 branch. Change-Id: Id5480807d25e49e78b79ffff144a59420457bcf0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QDateTime: Remove the distinction between null and invalid date and timeThiago Macieira2016-05-081-2/+2
| | | | | Change-Id: Id5480807d25e49e78b79ffff144a523e6851c03f Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* QDateTime: Remove NoDaylightTime flagThiago Macieira2016-05-081-1/+0
| | | | | | | It's not used. Change-Id: Id5480807d25e49e78b79ffff144a51cb80bd8abf 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>
* QDateTimePrivate: replace out parameters with return-by-value in getDateTime()Marc Mutz2015-03-251-1/+2
| | | | | | | | | | | | Compilers don't like out parameters. Effects on Linux GCC 4.9 stripped release builds: text -584B data +-0B relocs +-0 Change-Id: Ie00c89b9edaced3a6adeb2707734c8f5238e67c1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix race condition in QDateTime::timeZone() and other methodsThiago Macieira2015-03-071-9/+5
| | | | | | | | | | | | | | | | | | | | When timezone support for QDateTime was added, we decided it was a good idea to delay creating the QTimeZone object and checking that the time is valid in that timezone (including for local time) until the user requested that information. Unfortunately, QExplicitlySharedDataPointer returns a non-const T* in operator->(), which meant we were accidentally modifying the d pointer's contents in const methods, which in turn means those const methods were not thread-safe when operating on the same object. This commit changes the d pointer to QSharedDataPointer, which is safer in this regard and pointed out where the issues with constness were located. Since we can't lazily calculate QTimeZone anymore, we need to do it whenever the date, time or offset changes. Task-number: QTBUG-43703 Change-Id: Ic5d393bfd36e48a193fcffff13b9686ef4ef1454 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QDateTimePrivate: make bit manipulation code more readableMarc Mutz2015-02-171-5/+5
| | | | | | | | | ...by using var op= ... instead of var = var op ... No change in executable code size. Change-Id: I1c29ff6700f0f21be07768af8d002f0823c89fbd Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* QDateTimePrivate: remove pointless comparisonsMarc Mutz2015-02-171-6/+6
| | | | | | | | | | | | | | | | | | | | For any 1-bit flag: bool(var & flag) <=> (var & flag) == flag but gcc didn't seem to get it: (Surprising) effects on Linux GCC 4.9 stripped release builds: text -4936B (!!) data +-0B relocs +-0 It seems this enables some dead code detection, but I must confess I don't quite understand how such a small change can have such a dramatic effect on the executable size, even after diffing the assembler output. Change-Id: Ia307fde0de16160ea51bbb3ed6c1ff203d4f9091 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDateTimePrivate: remove pointless copy ctorMarc Mutz2015-02-171-10/+0
| | | | | | | | | | The compiler-generated one is just as fine, more maintainable, and doesn't inhibit moves (which probably doesn't matter here). No change in executable code size. Change-Id: Ideee493a5911808430d3e09e6eb07e91d7a19b12 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>
* Merge remote-tracking branch 'origin/5.4' into devOswald Buddenhagen2014-09-291-19/+11
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qbytearray.cpp src/gui/image/qimage.cpp src/gui/image/qppmhandler.cpp src/gui/kernel/qguiapplication.cpp src/gui/painting/qpaintengine_raster.cpp Change-Id: I7c1a8e7ebdfd7f7ae767fdb932823498a7660765
| * 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>
* | QDateTimePrivate: Add a note about wasted spaceRobin Burchell2014-09-161-0/+3
|/ | | | | | | And a comment to fix it when the tooling situation improves. Change-Id: I79781da18a36d4e11cede8477f90f216e08bffe2 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QDateTime - Fix round-trip of second occurrence timesJohn Layt2013-09-271-5/+11
| | | | | | | | | | | | | | | | | | | | | | | At the Daylight Tme to Standard Time transition, the local time repeats itself, i.e. 2am occurs twice. Qt's behavior when setting this using the local time is ambiguous, as it depends on the system implementation of mktime, which behaves differently on different platforms. Currently this behavior remains undefined. When setting using an msecs or time_t value however we can determine the correct instance to use and cache it to ensure that any conversion back from local time to msecs is performed consistantly on all platforms. Note that caching this value will result in any calculations being wrong should the system time zone change, or its rules change. This will be fixed in Qt 5.3 when the system time zone change signal is implemented and QDateTime switches to using QTimeZone instead of mktime to provide consistnt behavior across platforms. The QTimeZone spec does not require this fix as it already caches the correct offset in setMSecsFromEpoch(). Change-Id: I799588db474e744a6d81e80f6a0442920569ebd3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDateTime - Add QTimeZone supportJohn Layt2013-09-231-2/+24
| | | | | | | | | | | Add support to QDateTime for time zones using the new QTimeZone class. [ChangeLog][QtCore][QDateTime] Add support for a new Qt::TimeZone spec to be used with QTimeZone to define times in a specific time zone. Change-Id: I21bfa52a8ba8989b55bb74e025d1f2b2b623b2a7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDateTime - Fix Daylight Transition for "missing" hourJohn Layt2013-09-201-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | When Daylight Time transtion goes from Standard Time to Daylight Time there is a "missing" hour, i.e. at 2am CET the clock goes forward to 3am. Currently QDateTime ignores this gap and considers the time to be valid and able to be manipulated. This change respects the transition, so any time set in the missing hour is considered invalid, and any date maths returns valid results. The validity in the current time zone needs to be checked every time isValid() is called in case the system time zone has changed since the last time it was checked. This is done by calling mktime to check the returned result matches the expected result. This could be very inefficient, but the returned offset value is cached each time so mktime is not required to be called again within each method call, effectively meaning mktime is called the same number of times by each method. Note that this means any new methods added must be careful to ensure either isValid() or refreshLocalTime() is called first by any method needing to use the UTC value. [ChangeLog][QtCore][QDateTime] The Standard Time to Daylight Time transition for Qt::LocalTime is now handled correctly. Any date set in the "missing" hour is now considered invalid. All date math results that fall into the missing hour will be automatically adjusted to a valid time in the following hour. Change-Id: Ia652c8511b45df15f4917acf12403ec01a7f08e7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDateTime - Change date/time storage to msecsJohn Layt2013-09-201-14/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change from storing the date and time as QDate and QTime to a serialised msecs format. This format is a direct translation of the QDate and QTime values, it is not the actual msecs since the Unix epoch. This msecs format ensures we are always able to recreate the original QDate and QTime values, but should still simplify the code and improve performance. Because we no longer store the explicit date and time we need to store their isNull()/isValid() status separately. The changes in storage results in the same memory footprint as before. Note that this change does not optimize the code nor set out to fix the known bugs, it only seeks to maintain the current behavior, although some bugs are fixed implicitly. More bug fixes and optimizations will follow. [ChangeLog][Important Behavior Changes] The supported date range in QDateTime has been reduced to about +/- 292 million years, the range supported by the number of msecs since the Unix epoch of 1 Jan 1970 as stored in a qint64, and as able to be used in the setMSecsSinceEpoch() and toMSecsSinceEpoch() methods. Change-Id: I98804d8781909555d3313a3a7080eb8e70cb46ad Reviewed-by: Sérgio Martins <sergio.martins@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDateTime - Store Qt::TimeSpec, remove Daylight StatusJohn Layt2013-09-141-4/+22
| | | | | | | | | | | | | | Change storing the spec from QDateTimePrivate::Spec to Qt::TimeSpec. Remove the storage and use of the Daylight Status as it is almost never set or used, and would be inaccurate if the tz were to change. It will be replaced later with proper daylight transition support. This simplifies the code and makes the msecs storage change easier. Change-Id: I78a70905025d7eddf1c2dc6001f6b490e5a2b3b8 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDateTime - Switch to using msecs based functionsJohn Layt2013-09-141-2/+0
| | | | | | | | | | | | | | | | | | | | | | A number of QDateTime functions directly use or modify the data stored in the private, but future changes to store msecs and status make this maintenance more complicated. Where possible simplify this code to use the standard msecs functions, standard constructors, or public api instead. This greatly simplifies the functions and the following msecs storage code changes. This is an intermim step towards storing the time in msecs. Some functions will be slower as a result of this change, optimization will take place after all the msecs changes are completed. Note this also removes a test that used valid QDates outside the range of msecs, this change in behavior will be documented in the final mscs change. Change-Id: I6ef710f24babc7024091010064082e9be0b5bbfe Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDateTime - Split QDateTimeParser into a separate fileJohn Layt2013-09-091-208/+0
| | | | | | | | | | | | | Not strictly needed yet, but helps to reduce the size of QDateTime and make it easier to read a major re-write. Imposes separation of parser which will be needed if we make QLocale always use the system backends, after which only QDateTimeEdit widget will need the parser and it can be moved there. Change-Id: I6a5e9a3edf6fe8ff2340af6afecd8ba4bfde9dd4 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* QDateTime - Improve and expose Qt::OffsetFromUtcJohn Layt2013-08-281-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | The Qt::OffsetFromUtc TimeSpec was made public in Qt 4.4 but the access methods were never made public in the apidox effectively meaning the feature was never used. The implementation was also incomplete and inconsistent. This change cleans up the implementation and exports new public API for using the TimeSpec using new method names consistent with the new QTimeZone support. This change increases the QDataStream Version number for Qt 5.2 to 15. The behavior of one constructor has changed slightly to be consistent with the rest of the feature, but this behavior was never documented. [ChangeLog][QtCore][QDateTime] Fully implement support for Qt::TimeSpec of Qt::OffsetFromUTC, added new methods for offsetFromUTC(), toTimeSpec(), and toOffsetFromUTC(). Task-number: QTBUG-26161 Task-number: QTBUG-29666 Change-Id: If3cc7fc9778ca2b831644408ae749448d5975a3a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* Ensure QDateTime can handle QDate's full range of julian dates.Mitch Curtis2013-02-121-0/+3
| | | | | | | | Currently, using QDate::maxJd() in tests will fail. This patch changes some ints to qint64s to prevent overflows where necessary. Change-Id: I61ebf8f233411a7544689fd5bfa9c3abee54e933 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Fix QDateEdit displaying day as a number for short and long day formatsMitch Curtis2012-09-051-2/+3
| | | | | | | | | | | When 2 (February) is entered as the month for (e.g.) 31/Jan/2000 (which is following the format: "dd/MMM/yyyy"), the day is corrected to 29 but displayed as its numerical value instead of its short (or long) name. Task-number: QTBUG-27036 QTBUG-19091 Change-Id: I558ee13b224707d22b26c2ec2c045f96118bd5a1 Reviewed-by: Mitch Curtis <mitch.curtis@nokia.com> Reviewed-by: aavit <qt_aavit@ovi.com>
* Fix 3 digit day being displayed by QDateEdit.Mitch Curtis2012-09-051-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | When a QDateEdit has its display format set to "yyyy/MM/dd", its day set to 31 and its month set to 2, it will display 291 as the day until the cursor is moved or the focus changed. This is because QDateTimeParser::parse calls sectionSize() for the day section, which will sometimes return an incorrect size. There are also other display formats affected by this bug (e.g. long day names). For example, (in the context of sectionSize()) when text is "2000/01/31" and displayText() is "2000/2/31", there is a difference between displayText() and text - text is the previous value and displayText() is the new value. The size difference is always due to leading zeroes. This patch makes QDateTimeParser keep track of the quantity of zeroes added to each section and then factors this value into the result of sectionSize() if there is a size difference between text and displayText(). Task-number: QTBUG-26847 Change-Id: I3823cc41167ec920f742cb6a20d39fc5f433c915 Reviewed-by: Mitch Curtis <mitch.curtis@nokia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com> Reviewed-by: aavit <qt_aavit@ovi.com>
* Document the purpose of QDateTimeParser::cachedDay.Mitch Curtis2012-08-311-0/+13
| | | | | | | | | It's useful to know what this member variable is used for, since there is very little documentation for QDateTimeParser, which makes maintenance yucky. Change-Id: I9ecf5aa5ef0b5d778ceb858c323e3bab1ebaa7dc Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove Symbian code from QtCore.Xizhi Zhu2012-01-241-7/+0
| | | | | Change-Id: I9abdc674bcfa7bb38ce27c5213c5a672f59e63d5 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Cleanup reference counting in QDateTimePrivate class.Jedrzej Nowacki2011-07-121-3/+2
| | | | | | | | | | It is better to use QSharedData which is a common interface for ref counting. Change-Id: I990476d6763901bf383f241bce16fe26665b021c Reviewed-on: http://codereview.qt.nokia.com/1439 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com>
* Update licenseheader text in source files for qtbase Qt moduleJyri Tahtela2011-05-241-17/+17
| | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Initial import from the monolithic Qt.Qt by Nokia2011-04-271-0/+289
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12