summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
Commit message (Collapse)AuthorAgeFilesLines
* Fix comparisons between QByteArray and QString.Christian Kandeler2015-09-281-4/+4
| | | | | | | | QByteArray::operator< and friends had their logic reversed. Task-number: QTBUG-48350 Change-Id: I625209cc922b47e78dfb8de9fe100411f285a628 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDateTime: Ensure a valid timezone when using the "offset constructor".Christian Kandeler2015-09-231-0/+1
| | | | | | | | The timeZone() function used to assert when called on such an object (or, for a release build, return an invalid time zone). Change-Id: I6ae8316b2ad76f1f868e2498f7ce8aa3fcabf4a6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QString perf improvement : removal of useless testJulien Blanc2015-08-261-2/+0
| | | | | | | | | Removed a test in QStringAlgorithms trimmed_helper. That test is not needed because both null / empty QStrings are already handled by the previous test, other cases are handled just fine by the general case. Change-Id: I26db1142a656a7d06dfdd6b3b8f8a3ee6ca22302 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Avoid overflow in QTime::addSecs with too big a number of secondsThiago Macieira2015-08-191-0/+1
| | | | | | | | | | QDateTime::addSecs needs to do something similar, but not identical because it needs the number of days too. And then there are daylight savings transitions... Task-number: QTBUG-47717 Change-Id: I7de033f80b0e4431b7f1ffff13f976f4f5e5a059 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* QRegularExpression: fix matching over QStringRefsGiuseppe D'Angelo2015-08-181-24/+21
| | | | | | | | | | | | | | | | | | | | | | | Playing with the offset argument of pcre_exec is not equivalent to adjusting the pointer to the subject string. In particular, PCRE can go behind the offset to check for lookbehinds or "transition" metacharacters (\b, \B, etc.). This made the code that deals with QStringRefs not matching in behavior with the corresponding code dealing with QStrings. For instance, QString subject("Miss"); QRegularExpression re("(?<=M)iss"); re.match(subject.mid(1)); // doesn't match re.match(subject.midRef(1)); // matches!!! Instead, actually adjust the pointer to the subject string so that the behavior is identical. A broken test that relied on the equivalence is also removed. Change-Id: If96333241ef59621d7f5a6a170ebd0a186844874 Reviewed-by: Volker Krause <volker.krause@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix QChar char constructors documentationSamuel Gaist2015-08-131-2/+10
| | | | | | | | | | | Reverts the wrongly added \internal and adds a warning for users that the constructors will not be available if QT_NO_CAST_FROM_ASCII is defined Task-number: QTBUG-39862 Change-Id: I038eea3f4eef0b914b470309a2f515741eec35a9 Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
* Cocoa: fix integer multiplication overflow in qt_gettime()Michael Klein2015-08-131-0/+5
| | | | | | Task-number: QTBUG-24031 Change-Id: Iae00b10b6a7423508669ef173a80a03b3dd388c6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge "Merge remote-tracking branch 'origin/5.4' into 5.5" into refs/staging/5.5Oswald Buddenhagen2015-08-121-1/+1
|\
| * Merge remote-tracking branch 'origin/5.4' into 5.5Oswald Buddenhagen2015-07-171-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: doc/global/manifest-meta.qdocconf src/corelib/global/qnamespace.qdoc src/corelib/io/qstorageinfo_unix.cpp src/corelib/tools/qtools_p.h src/sql/drivers/psql/qsql_psql.cpp Change-Id: I23a15ac84e03ad61d865e3df872b013eb0752949
| | * Check for integer overflows in places where qAllocMore is usedMikhail Lappo2015-06-195-5/+31
| | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-41230 Change-Id: Ic2167364e326092482657f2d2b4ab6ad3e5af631 (partially cherry-picked from 880986be2357a1f80827d038d770dc2f80300201) Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Doc: mark private QChar constructors as internalSamuel Gaist2015-08-061-0/+2
| | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-39862 Change-Id: Ie0d533e3897200589248c803069c41661b15997e Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* | | Add reference to QRegularExpressionSamuel Gaist2015-08-061-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently there's no mention of QRegularExpression in QRegExp's documentation. This makes it hard to find QRegularExpression for user used to QRegExp. This patch adds that missing reference. Task-number: QTBUG-46816 Change-Id: If3a981d5759fbed3eecd07e046882e6da378cc4e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
* | | Don't check if Pentium's CPUID leaf 1 existsThiago Macieira2015-08-061-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It does. When CPUID was introduced in late 486, it already supported leaf 1. That means all Pentium-class systems (including Intel's new Quark systems) have CPUID and they have at least leaf 1. Change-Id: Ib306f8f647014b399b87ffff13f1d5d2530d9ddd Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Doc:added doc to undocumented functionsNico Vertriest2015-07-223-5/+5
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-36985 Change-Id: Ic358682b276d67ef804f727bcf14191718613469 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* | | QTimeZone: Convert fractional timezones properly.Cesar Garcia Naranjo2015-07-211-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | [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>
* | | Remove attempt at detecting compile-time HLEThiago Macieira2015-07-202-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | There's no __HLE__ macro and there won't be, since the HLE prefix can be run on older CPUs. There's no need for runtime detection. Change-Id: Ib306f8f647014b399b87ffff13f1daba0e654b02 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | QtCore: Fix const correctness in old style castsThiago Macieira2015-07-202-19/+19
| | | | | | | | | | | | | | | | | | | | | Found with GCC's -Wcast-qual. Change-Id: Ia0aac2f09e9245339951ffff13c8d4b2920a11fb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Don't complain about missing CPU features under ValgrindThiago Macieira2015-07-181-1/+10
|/ / | | | | | | | | | | | | | | | | | | | | | | If you're running Qt under valgrind, it stands to reason that you know what you're doing. In particular, Valgrind does support AVX and AVX2 instructions, but some versions seem to be missing the necessary CPUID bits. Change-Id: I9a75ad8521ae4e5cbbe5ffff13d1940f6fa5c4f4 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: David Faure <david.faure@kdab.com>
* | Fix compilation with GCC 4.9.2 and up in debug modeThiago Macieira2015-07-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | Somehow the const int is no longer understood to be an immediate. GCC 4.8 still compiles this fine. qstring.cpp:316:34: error: the fifth argument must be an 8-bit immediate Change-Id: Ib056b47dde3341ef9a52ffff13ef24d541833abc Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Make the Windows qt_msectime() function return 64-bitThiago Macieira2015-07-081-1/+1
| | | | | | | | | | | | | | | | 32-bit integers overflow after 49.7 days. Task-number: QTBUG-43777 Change-Id: Ief8943bc86ba32e5a66b48604c583031af95ad42 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | QDate/QTime: fix SiC introduced by adding new non-explicit ctorsMarc Mutz2015-06-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new constructors were added in c94d41d9 to help constexpr'ify QDate and QTime. Even though private, they participate in overload resolution and break function pairs overloaded on QDate and int or QTime and int. Mark them explicit. [ChangeLog][QtCore][QDate/QTime] Fixed a minor source-incompatibility between Qt 5.4 and 5.5.0 involving sets of functions overloaded on QTime and some integer or QDate and some integer. Change-Id: I65a09aaca2b083cda90255c24cc72ef51119d3b1 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | QLocale: Fix example return value for uiLanguages()Kai Koehne2015-06-241-1/+1
| | | | | | | | | | | | | | | | | | | | The documentation (correctly) states that the first item in the list is the most preferred one. Anyhow, then it doesn't make much sense to list "en_US" after "en". Change-Id: Ib88e5c97d4329b444d1cb49eeb49eaed2ddedad3 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Improve QString doc when using non-spaced numbered place markerSamuel Gaist2015-06-191-0/+19
| | | | | | | | | | | | | | | | | | | | | | Currently when a developer uses a string like QString("%1%3%2").arg(x).arg(y).arg(z) he can be bitten by the sequential replacement done by QString. Adding an example with a little explanation should help future Qt user avoid generating buggy strings. Task-number: QTBUG-44044 Change-Id: I81e20af8d9fb2a07e12ec61dcd5bb4544d863777 Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
* | Doc: corrected qdoc syntax errorNico Vertriest2015-06-101-0/+1
| | | | | | | | | | | | Task-number: QTBUG-36985 Change-Id: I8cf79432bcdd497ee11c3f2ed70b11eaac1c0f57 Reviewed-by: Martin Smith <martin.smith@digia.com>
* | Don't assign iterator to const_iteratorSérgio Martins2015-06-021-4/+4
| | | | | | | | | | | | | | | | It should also be possible to use QT_STRICT_ITERATORS in Qt's own code base Change-Id: I0914db480d4d2b06e71e3a2588163efdd3ff6d27 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Translate AM/PM under the QDateTimeParser context so it is consistentAndy Shaw2015-05-282-8/+9
| | | | | | | | | | | | | | | | | | | | In order to ensure that the same text will be used in both QDateTimeParser and QDateTimeEdit, use the QDateTimeParser context for the AM and PM strings. Task-number: QTBUG-251 Change-Id: I89b0809825251181440bf19cbe5828024a43acfb Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | Fix compilation of QContiguousCache::operator=Thiago Macieira2015-05-201-1/+1
| | | | | | | | | | | | | | | | | | freeData() takes a Data*, not a QContiguousCacheData*. Task-number: QTBUG-45783 Change-Id: I96d7ac38dac24b418138ffff13d7fdf09b1d6b07 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | Doc: added doc to undocumented functionsNico Vertriest2015-05-186-28/+200
| | | | | | | | | | | | | | Task-number: QTBUG-36985 Change-Id: Ia98654f88cf5da77245b3fcd903b860d12862fc2 Reviewed-by: Martin Smith <martin.smith@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* | QSize, QSizeF: Add Q_REQUIRED_RESULTSérgio Martins2015-05-131-9/+9
| | | | | | | | | | | | | | | | ...to signatures matching the pattern: T T::<verb in past tense>() const; Change-Id: I75d724a3eef5cb94559e31d86914c6e0655b7f13 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Add Q_REQUIRED_RESULT in several placesSérgio Martins2015-05-042-2/+2
| | | | | | | | | | | | Change-Id: Icda3000f1d9f0d41612a50a816aa5de5e32028d4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | QRegularExpression: add error strings from PCRE 8.37Giuseppe D'Angelo2015-05-011-1/+2
| | | | | | | | | | | | | | Change-Id: Id62abd91c1584e4e63b95afec0520995125fe807 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Doc: Bring QSizeF/QPointF::isNull() documentation up to dateTopi Reinio2015-04-272-12/+4
| | | | | | | | | | | | | | | | | | | | | | | | Since Qt 5.0 (commit 09dd19df) sign is ignored when testing whether a QPointF or QSizeF is null. This updates the documentation accordingly. Change-Id: I3de1c748f3caa63b8bd8990006de5ba572eac83e Task-number: QTBUG-45669 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
* | QVector: Save one copy-CTOR call if we don't reallocSérgio Martins2015-04-241-5/+12
| | | | | | | | | | Change-Id: Ie0f2eb922500bc3d76852939cf2c5d28d65a43ae Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | qdoc: Remove #ifdef Q_QDOC for uses of QPrivateSignalMartin Smith2015-04-201-20/+4
| | | | | | | | | | | | | | | | | | | | | | | | Signals marked with QPrivateSignal had the QPrivateSignal marker ifdefed out for qdoc. This is no longer necessary, so the #ifdefs are removed. Change-Id: Idb334ed311c6ed6883d7b7b5a3fcdede60c4a1f8 Task-number: QTBUG-45535 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* | QScopedValueRollback: add two strategic qMove()sMarc Mutz2015-04-161-2/+2
| | | | | | | | | | | | | | | | Use moves instead of copies when the rhs is no longer needed afterwards. Change-Id: If053bfce03b886099688452ada74f6a6f36db5c2 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | QScopedValueRollback: use ctor-init-listMarc Mutz2015-04-161-4/+2
| | | | | | | | | | | | | | Avoids calls to the default ctor for member 'oldValue'. Change-Id: Ieb9570b74e4a46b28c04625fac3ce267074c4a76 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | QList: make QListSpecialMethods dtors protectedMarc Mutz2015-04-163-1/+14
| | | | | | | | | | | | | | | | | | QList publicly inherits from QListSpecialMethods. Thus, any specialisation of QListSpecialMethods should make their destructor protected, to avoid deletion through a pointer to QListSpecialMethods invoking UB. Change-Id: I7e317606f84826cc0faf1bfc05dee97da6eaf2eb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.4' into 5.5Liang Qi2015-04-153-10/+10
|\| | | | | | | Change-Id: I004854a25ebbf12b1fda88900162fe7878716c58
| * Doc: Fix using Apple-related terminology in Qt CoreAlexander Volkov2015-03-313-10/+10
| | | | | | | | | | | | | | | | | | | | | | Use the name "OS X" instead of "Mac OS X", "Mac OS" and "OSX", and mention iOS. Replace "Carbon Preferences API" by "CFPreferences API" in the QSettings documentation. Change-Id: Ia7f9fb874276c7c445a1649df521b96ff43daa0c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* | QByteArray: begin()/end() are not \internalMarc Mutz2015-04-071-8/+26
| | | | | | | | | | | | | | Docs copied from corresponding QString functions. Change-Id: Ia2b0f0521780246d82003a1fda539c132823b294 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | docs: QString contains characters, not itemsMarc Mutz2015-04-071-2/+2
| | | | | | | | | | Change-Id: I479a731780dfce81e138d1aca950385437266763 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Remove unnecessary QDateTime::detach() functionThiago Macieira2015-04-072-22/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Last commit changed QDateTime::d to be a QSharedDataPointer that implicitly detaches on non-const operator->() calls. That means we no longer need to explicitly call detach(). More than that, we should not do it, so we avoid checking the ref count and try to detach on every use. To do that, in functions where the d pointer was accessed more than once, I detach at the top and shadow the "d" variable with a local plain pointer. We don't compile our sources with -Wshadow, so this should not be a problem. Change-Id: Ic5d393bfd36e48a193fcffff13b969c281c36d0c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Use QT_WARNING_.. instead of #pragma GCC diagnostic ..Konstantin Ritt2015-04-071-7/+3
| | | | | | | | | | Change-Id: I0bb55a7f1074f3b8d6fb681b1d4dab5105ae7569 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QQueue: unhide QList::swap(int, int)Marc Mutz2015-04-071-0/+5
| | | | | | | | | | | | Task-number: QTBUG-34197 Change-Id: I0b405ab0fabff8852b2705d651848fbff74fc4c2 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | Removed unused code on QT_STRING_UCS4 macroThiago Macieira2015-04-051-6/+0
| | | | | | | | | | | | | | This isn't defined or used anywhere else. Change-Id: I9a75ad8521ae4e5cbbe5ffff13d2356883b82dbc Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | QVLA: Add operator= for initializer listsKai Koehne2015-04-042-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a dedicated operator=(std::initializer_list) that first resizes the QCLA, and then replaces the elements one by one. This should be usually faster than creating a temporary QCLA and then copying it, except for the case where the new array does not fit into the allocated stack - but this is IMO nothing to optimize for. Task-number: QTBUG-45041 Change-Id: I147d6d01186b1ca3c635b2c8365d8f6e638ce6fe GPush-Base: 08de3113051e1289f0de0651ec5647c9ee6feb27 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge "Merge remote-tracking branch 'origin/5.4' into 5.5" into refs/staging/5.5Liang Qi2015-04-012-21/+32
|\ \
| * | Merge remote-tracking branch 'origin/5.4' into 5.5Liang Qi2015-03-312-21/+32
| |\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/android-g++/qmake.conf qmake/generators/unix/unixmake2.cpp src/gui/image/qimage_conversions.cpp Change-Id: Ib76264b8c2d29a0228438ec02bd97d4b97545be0
| | * Core: fix crash in QCollator if ucol_open() failedLiang Qi2015-03-111-13/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | If ucol_open() failed, call back to QString::compare() implementation. Task-number: QTBUG-44796 Change-Id: I03446e5227e1dedac6c5f824ac6d74a494fc0ace Reviewed-by: Gergely Nagy <ngg@tresorit.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| | * Windows Embedded: GetTickCount64 won't be available so just remove itAndy Shaw2015-03-111-8/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since GetTickCount64 still relies on the usage of kernel32, then it will not find the function anyway as the library does not exist for Windows Embedded. Therefore it is best to remove it altogether to save time trying to locate something we know is not there. Change-Id: Id879382fdd0692fb9443231a405c0e28d9bcc328 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>