Commit Graph

506 Commits

Author SHA1 Message Date
Frederik Gladhorn
3061dc4abd Merge remote-tracking branch 'origin/release' into stable
Change-Id: I83ff8f4d7dffd7385013a1bd8a1732a89ee20d56
2013-11-26 10:51:34 +01:00
John Layt
6ad97bfa73 QTimeZone - Fix dateForLocalTime() to check validity of next transition
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>
2013-11-21 09:25:23 +01:00
John Layt
8e6258f059 QTimeZone - Fix TZ file abbreviations
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>
2013-11-21 09:25:23 +01:00
John Layt
6bf759b310 QTimeZone - Change Olsen ID to IANA ID
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>
2013-11-21 09:25:23 +01:00
Frederik Gladhorn
72ea790085 Merge remote-tracking branch 'origin/release' into stable
Change-Id: Ie6d44caf1d630cb029178a1af40c637f24a25ee7
2013-11-18 12:27:04 +01:00
Marc Mutz
eb122a6fe4 tst_QAlgorithms: fix compilation with C++11 enabled
GCC refuses to use a merely static const uint array in a constexpr function.

Fix by making the array constexpr if supported by the compiler.

Change-Id: Idd59d3f74f8f4e98aad82bc892f4a6469932df9f
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-11-17 09:48:17 +01:00
Marc Mutz
3e803b5180 QCollator: enable move semantics
This necessitates adding d==0 checks in QCollator. By documenting that
moved-from instances can only be assigned to or destroyed, we can
limit the functions in which to check for d==0 to the assignment
operator and the destructor.

Doing otherwise would destroy all advantages of move semantics by
introducing a heap allocation to re-populate other.d.

Add a test for this (QCollator didn't have any before).

Change-Id: Ic6ff202072822bebfd5e48259c3d0fa345a63118
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-11-17 09:47:07 +01:00
David Faure
2026e50259 QCommandLineParser: add word-wrapping algorithm
Rather than breaking at column 79 precisely, break entire words,
to improve readability.

Change-Id: Ie30db00f0e6ed95cce87480c3b91804826c6076b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-11-17 00:45:03 +01:00
Joerg Bornemann
721ec98501 remove qt_windows.h include from qwineventnotifier.h
We must not include qt_windows.h in public headers,
otherwise we're cluttering the environment with a colorful
bouquet of Windows API preprocessor macros and typedefs.

Task-number: QTBUG-34058

Change-Id: I415717ea2a47f39e7f4b7ce1c1df9d49afc99278
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-10-29 19:59:17 +01:00
El Mehdi Fekari
2a704239ea QLocale: Add auto tests for Poruguese(Brazil) and Greek locales
Change-Id: Ib1b553efb39a150710ceb609d2cb099f19f73e35
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-10-29 16:09:53 +01:00
John Layt
93f5e0598a QDateTime - Fix RFC 2822 Date Formatting
The RFC 2822 date format should always use en_US locale for month and
day names instead of whatever the system locale is.  Also remove some
duplicate code.

Change-Id: Ia2f7ee405b4e0e2f04980301783b9488628da73f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-10-17 23:31:10 +02:00
John Layt
6a63554bf8 QDateTime - Fix toTimeSpec() for invalid datetimes
Check if the datetime is valid before converting it to a different time
spec.  If it is invalid then just change the spec to keep behavior
consistent with 5.1.

Task-number: QTBUG-34020
Change-Id: I6630ec1d50f810a2178ab3222bd32af018085f81
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-10-16 21:29:17 +02:00
Oswald Buddenhagen
f14e268694 don't erroneously claim that gui support is needed
Change-Id: Ia7b1f02cab9fa0fc9e487ca49d75e85ed0cfee9d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-10-16 17:10:15 +02:00
Friedemann Kleint
8178a6cab1 Add missing operators QMargins -=,+= (int).
Task-number: QTBUG-34079

Change-Id: If61cc01ba70345b01f13072769d3a38f23e8cefc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-10-15 18:20:37 +02:00
John Layt
475cbed244 QDateTime - Fix round-trip of second occurrence times
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>
2013-09-27 21:47:55 +02:00
John Layt
77dc33dcdb QLocale - Fix Mac date format code translation
Mac uses the CLDR format codes which need to be translated into their
Qt equivalent.  The existing code mistranslates the year code, is
outdated for a number of new codes introduced in recent versions of
CLDR, and by default accepted any codes it didn't recognize.

This change updates support to the latest version of CLDR, fixes the
treatment of years, and defaults to ignoring any new format codes
added in the future.

Note that this change cannot have auto tests written as the system
locale formats change between versions of OSX.  Testing must be
done manually by changing system locale and formats.

Task-number: QTBUG-25057

Change-Id: I69dda25b4a0b38d3971995644546306876922d57
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2013-09-26 20:42:33 +02:00
Marko Pellikka
e120ad442d QString::reserve fix to avoid truncation
In case of implicit memory sharing, QString::reserve caused data
truncation if given size was smaller than size of data.

Task-number: QTBUG-29664
Change-Id: If2da5ad051385635ebb829c18b5ebaa349f08e8a
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-09-26 18:45:16 +02:00
Tor Arne Vestbø
a3530859e9 Expose QTest::currentAppName() and remove hard-coded argv[0] in tests
Except where we're actually testing QCoreApplication::applicationName()
and friends.

Change-Id: I25514884c11f43a4f82b1f818f822dc3d79f69a3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2013-09-26 18:45:16 +02:00
John Layt
55f5b29d79 QDateTime - Add QTimeZone support
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>
2013-09-23 01:14:03 +02:00
John Layt
8af776d414 QTimeZone - Add Windows backend
Add backend implementation for Windows times zones.

Change-Id: I30946f6672488c3f1d1d05754e9479aa62cce46f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-23 01:13:58 +02:00
John Layt
7ed7d66b5a QTimeZone - Add Mac backend
Add Mac backend support

Change-Id: Iafa2dbd925e18431f571e3eac62983015f8bc977
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-23 01:13:49 +02:00
John Layt
8dfaf91038 QTimeZone - Add TZ File Backend
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>
2013-09-22 22:21:24 +02:00
John Layt
9c2cbee2b1 QTimeZone - Add ICU support
Add ICU backend for QTimeZone

Change-Id: I92e53a848477e366591102064b093e936f0b49d2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-22 22:21:19 +02:00
John Layt
48e2c3ac33 QTimeZone - Define new class and api
Implement the new QTimeZone class based on the Olsen Time Zone ID's.

This is the base implementation and does not include the Platform
backends which are implemented separately.

This change does include a default UTC backed to be used if no Platform
backend is available, i.e. if QT_NO_SYSTEMLOCALE is set and ICU is not
configured.  This backend also provides a default set of time zones in
the standard "UTC+00:00" offset format that are guaranteed to always
exist regardless of the Platform backend.

This change includes conversion functions between the Olsen ID's and
Windows ID's using a conversion table based on Unicode CLDR data.
This is implemented for all platforms for scenarios such as a Linux
program needing to communicate with a Windows Exchange Server using
the Windows ID.

The CLDR conversion table is included under the UNICODE license, see
http://unicode.org/copyright.html for details.

[ChangeLog][QtCore][QTimeZone] Added new QTimeZone class to support
time tone calculations using the host platform time zone database
and the Olsen time zone ID's.

Change-Id: Ibb417d08cf2663a0979d2be855d2c6ad6ad01509
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-22 22:21:15 +02:00
Morten Johan Sørvig
2b65bba77d Add Mac type conversion functions to QtCore
New API:
    static QString QString::fromCFString(CFStringRef string);
    CFStringRef QString::toCFString() const;
    static QString QString::fromNSString(const NSString *string);
    NSString *QString::toNSString() const;

    static QUrl QUrl::fromCFURL(CFURLRef url);
    CFURLRef QUrl::toCFURL() const;
    static QUrl QUrl::fromNSURL(const NSURL *url);
    NSURL * QUrl::toNSURL() const;

Add Q_OS_MAC-protected function declarations to header
files, add implementation to _mm files.

CF and NS types are forward-declared in the header
files to avoid including the CoreFoundation and Foundation
headers. This prevents accidental use of native types
in application code. Add helper macros for forward-
declaration to qglobal.h

Add cf_returns_retained/ns_returns_autoreleased attributes
to toCFString() and toNSURL(). These attributes assists
the clang static analyzer. Add Q_DECL_ helper macros
to qcompilerdetection.h.

Add test functions (in _mac.mm files) to the QString
and QUrl tests. Split out the test class declarations
into a separate headers files.

Change-Id: I60fd5e93f042316196284c3db0595835fe8c4ad4
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2013-09-21 05:09:41 +02:00
John Layt
8d6ee59948 QDateTime - Add api for isDaylightTime()
Add new method to return if the current time is Daylight Time.

[ChangeLog][QtCore][QDateTime] Added new method isDaylightTime() to
return if the datetime is in Daylight Time or not.

Change-Id: Icb93fd5dd0b2f7d83d2d4643eeb12922c1137e3e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-20 23:45:06 +02:00
John Layt
7b07c3ff78 QDateTime - Fix Daylight Transition for "missing" hour
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>
2013-09-20 23:45:06 +02:00
John Layt
18322bfabc QDateTime - Change date/time storage to msecs
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>
2013-09-20 23:45:06 +02:00
Mitch Curtis
438912f273 Revert 15da0a5af2.
It apparently breaks users' applications.

Task-number: QTBUG-33487

Change-Id: Iaeceb3a02b5c7b9ab839c14693aaffcdf9394bc6
Reviewed-by: John Layt <jlayt@kde.org>
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-09-19 14:58:27 +02:00
John Layt
e76c312eb8 QDateTime - Switch to using msecs based functions
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>
2013-09-14 18:31:00 +02:00
John Layt
3a8b8edd01 QDateTime - Add test case for Daylight Time Transitions
Test the Daylight Time transitions.  QDateTime does not correctly deal
with many of these scenarios so those tests are marked as QEXPECTFAIL.
These bugs will be progressively addressed in coming commits.

Change-Id: I01eba9d6143a792f081542cb198e221efcf28e98
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-09-14 11:38:15 +02:00
Thiago Macieira
cc74159702 Base64: Implement the "base64url" encoding and the stripping of '='
The "base64url" encoding is defined in RFC 4648, which is the newest
version of Base64. There are also a few situations where the ending
'=' is not desired.

Change-Id: I9bb9fa55817b57d125189e4e795d6fde97caea6d
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-09-14 03:20:25 +02:00
John Layt
92b0a7fa3e QTime - Add public api for get/set msecs since start of day
Add new public api to get and set the number of msecs since the start
of the day.  Modify QDateTime to use the new msecs api.

[ChangeLog][QtCore][QTime] Added new methods fromMSecsSinceStartOfDay()
to create a new QTime from an msecs value, and msecsSinceStartOfDay()
to return the QTime as the number of msecs since the start of the day.

Change-Id: I285b725b883f1f5524fda87ca81bd64ed99fe6f4
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-09-13 22:06:26 +02:00
Jędrzej Nowacki
ec846146b4 New QStringRef methods.
New functions left, right, mid were missing in the api.

Change-Id: I3590a84431555d009d5012b204c111385bdceed3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-11 08:06:21 +02:00
David Faure
32fa8ab704 QCommandLineOption: improve runtime warnings
Change-Id: I48a278acf3a8eb0cfa829deb65cf65dfd8ec23af
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-10 19:07:07 +02:00
David Faure
4ff6951550 Fix escape handling in qWinCmdArgs
-DKEY="VALUE" was correctly turned into -DKEY=VALUE,
but -DKEY=\"VALUE\" was turned into -DKEY=\VALUE"
due to the erroneous check ('quote' is still 0 when
encountering the first '\' character).

This fixes QCoreApplication::arguments() as used by
moc.exe after porting to QCommandLineParser.

Further investigation shows that double-quotes and single-quotes
are handled differently. The tests now ensure that this parser
respects what Windows sends in argv, and in particular that
QTBUG-15379 doesn't regress, as well as fixing QTBUG-30628.

Task-number: QTBUG-15379, QTBUG-30628

Change-Id: I95062c9a6022632b321b2f6fae3089f07be7b5c6
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-10 19:05:19 +02:00
Mathias Hasselmann
50e2db6a75 Add first/last accessors to QMap
QMap explicitly sorts its entries by key value. For an ordered container
it's (often?) useful to access the first or last entry, for instance to
quickly compute the next key of the mapping. The first entry is easily
accessible by the STL begin() method, but for accessing the last entry
pretty ugly iterator arithmetics must be applied: *(end() - 1). With
their first() and last() accessors the container classes QList and
QVector provide a much nicer method of accessing extrema, so for
consistency this syntactical sugar also should be applied to QMap.

Change-Id: Ibd544acbad8c3ac16f12a1e74362207ea1694375
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2013-09-08 16:13:16 +02:00
John Layt
61b56a89a1 QDateTime - Clean up Qt::DateFormat formatting and parsing
Clean-up the implementation of toString() and fromString() methods in
QDate, QTime and QDateTime code to be more consistent in ISODate and
TextDate behavior, especially when handling TimeSpec.

Reformat some code so all methods are consistent in appearance and
function to make maintenance easier.

This changes some corner-case behavior in TextDate and ISODate, but
this either fixes bugs or makes the behavior match the documentation.

Change-Id: I457aa1d7cd4f448cd9f8a2e80ec635f3cb98e58c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-09-06 01:53:11 +02:00
John Layt
35af88b37e QDateTime - Switch to using the QLocale date formatter
Switch the implementation of toString() methods in QDate, QTime and
QDateTime to use the QLocale formatter, and remove the now redundant
QDateTime formatter.

Change-Id: Ie4f17c8a6e31acde3ce066f19835bb2b83351ce8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-09-05 23:20:09 +02:00
John Layt
dd488bb7a4 QLocale - Improve date formatter
Modify the QLocale date formatter to be consistent with the QDateTime
date formatter and able to replace the QDateTime formatter in a
subsequent change.

Fix the treatment of negative years.

The internal QLocale::timeZone() has been replaced by the
QDateTime::timeZoneAbbreviation() to ensure the correct tz for the
date/time is used rather than always the current system default.

Change-Id: I2ef26700856e2e69b979069226aa504ecbb50071
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-09-05 23:20:09 +02:00
Giuseppe D'Angelo
9fc2c729b4 Make tst_qalgorithms compliant with the Standard
§24.4.1 [iterator.traits] of N3337 makes it *mandatory* to define the
various types

    std::iterator_traits<Iterator>::{value,pointer,...}

for any given iterator.

§24.4.1.2 makes it enough to define them within our iterator class.

Change-Id: I1305c8392d224889b09395e30ecc77b194020a15
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-05 09:48:22 +02:00
Stephen Kelly
3f6ed5566f Revert "Implement move-ctor and move-assignment-op for QScopedPointer"
This reverts commit 5b9006bbdb.

Also revert "Doc: Enable documentation for QScopedPointer's rvalue ref functions"

This reverts commit 5f8416ec65.

Adding a move contructor to QScopedPointer makes no sense, because moving
means 'escaping the scope', which breaks the fundamental point of
QScopedPointer.

Change-Id: I4ac1b108bf199af6e436fa1629aa2d3b93c27724
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-05 08:20:19 +02:00
John Layt
5ec1c7727b QDateTime - Add api for Time Zone Abbreviation
Add a new method to return the time zone abbreviation for the current
time spec.  For LocalTime this is the abbreviation returned by mktime.

This new method will later be used in changes to the date formatter
and QTimeZone.

Note this change does not implement WinCE support.

[ChangeLog][QtCore][QDateTime] Add method timeZoneAbbreviation() to
return effective time zone abbreviation.

Change-Id: I265a5e96c72eb7236974f80f053f1fb341e3c816
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-09-03 14:31:06 +02:00
Andrew Knight
cd582f8410 Add QT_NO_PROCESS guards in tests where they are missing
A handful of tests lack QT_NO_PROCESS guards, making them non-compilable
on Qt builds with no QProcess support. This commit does not change
QProcess-specific tests, which should be left out of the build using the
.pro file mechanism.

Change-Id: Iac8562428abc1f59ccbb23bf5c3a919785e41f12
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-09-03 08:42:24 +02:00
Thorbjørn Martsum
6ee9baf044 QLinkedList - extend the auto test.
This extends the QLinkedList auto test. This is copy paste
with small edits from the QList auto test.

Change-Id: I5bce7ee304998d1c7258f11b2f31a7fb87706936
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-08-29 08:16:44 +02:00
John Layt
ad77048d1f QDateTime - Extend fromMSecsSinceEpoch API
Add convenience methods for fromMSecsSinceEpoch() and
fromTime_t() to enable direct creation of other time specs
than LocalTime without the overhead of unncessary conversions.

For example instead of:
  QDateTime dt = fromMSecsSinceEpoch(12345).toUtc();
the following saves two conversions:
  QDateTime dt = fromMSecsSinceEpoch(12345, Qt:UTC);

This will improve the performance of the new QTimeZone class.

[ChangeLog][QtCore][QDateTime] Added convenience methods for
fromMSecsSinceEpoch() and fromTime_t() to take time spec to be used in
returned datetime.

Change-Id: I133635bfe3d35ee496a287257e13b2d600225a38
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-08-29 00:32:08 +02:00
John Layt
13c16bbd06 QDateTime - Improve and expose Qt::OffsetFromUtc
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>
2013-08-28 19:08:14 +02:00
David Faure
404598b613 Long live QCommandLineParser!
The QCommandLineParser class provides a means for handling the command line options.

QCoreApplication provides the command-line arguments as a simple list of strings.
QCommandLineParser provides the ability to define a set of options, parse the
command-line arguments, and store which options have actually been used, as
well as option values.

Done-with: Laszlo Papp <lpapp@kde.org>

Change-Id: Ic7bebc10b3f8d8dd06ad0f4bb897c51d566e3b7c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-08-24 21:33:39 +02:00
Thorbjørn Martsum
c35b55f076 QLinkedList - fix insert with iterator when the list is shared.
Before a call to erase on a shared instance would imply that the
item was inserted into the shared data (i.e all instances)

Change-Id: I655ccf04b1ad9bf82e6bfade58929538fa7df000
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-08-24 15:36:30 +02:00
Thorbjørn Martsum
97f867212f QList - fix insert with iterator on shared instance
This patch ensures correct detach when insert with an iterator is
called on a shared instance (i.e same behavior as QVector)

Change-Id: Id660eacd3cc7b633456dfa989997bbad747e1df2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-08-24 15:36:30 +02:00