summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qcollator.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Doc: corrected autolink errors qtbase/corelib/toolsNico Vertriest2014-09-241-1/+1
| | | | | | | | | Also corrected some minor language/spelling issues Task-number: QTBUG-40362 Change-Id: I00d76521fc9beb4e7a4a83ff6dc3334a055a7148 Reviewed-by: Topi Reiniƶ <topi.reinio@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Fix several issues in QCollatorLars Knoll2014-09-101-2/+43
| | | | | | | | | | | | | Refactor the code and move more things into the cross platform code path. Make sure the flags survive changing the locale of QCollator. Use the correct locale on Windows, WinRT and OS X. We now pass all QCollator autotests on these platforms. Task-number: QTBUG-40778 Change-Id: Ic2d3334b5018c323a35a3ea8fc1d7ab5f99b4e62 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QCollator: Add note about ICU dependency.Friedemann Kleint2014-04-161-0/+5
| | | | | | | Task-number: QTBUG-28766 Change-Id: If661915457c4874a72e1111b85897aea596362bf Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QCollatorSortKey: inline operator<Marc Mutz2013-11-171-4/+5
| | | | | | | | | | | | | This code was duplicated in every qcollator_platform.cpp and identical everywhere, except in _icu, which uses a QByteArray m_key and the implementation used QByteArray::operator<, which is semantically and probably code-wise identical to what the other implementations did (after inlining). Inlining this function removes a potential maintenance problem and increases speed without violating encapsulation. Change-Id: If3e9d38a7d4326b49f0611a9f4187c53960e8a03 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QCollator: enable move semanticsMarc Mutz2013-11-171-3/+23
| | | | | | | | | | | | | | | 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>
* QCollator(SortKey): add member-swapMarc Mutz2013-11-151-0/+7
| | | | | | | This is required for a Qt value type these days. Change-Id: Ibd4e1581a4f4791a410caa10fede92c26b35dd9d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Adding mark-up to boolean default values.Jerome Pasion2013-10-081-4/+4
| | | | | | | | | | | | | | | | | Default values should have mark-up to denote that they are code. This commit changes: -"property is true" to "property is \c true". -"Returns true" to "Returns \c true". -"property is false" to "property is \c false". -"returns true" to "returns \c true". -"returns false" to "returns \c false". src/3rdparty and non-documentation instances were ignored. Task-number: QTBUG-33360 Change-Id: Ie87eaa57af947caa1230602b61c5c46292a4cf4e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Make QCollator more flexible to use in different platformsAleix Pol2013-09-131-212/+48
| | | | | | | | | | | | | | | | | So far we've known that we want QCollator as public API. It hasn't been possible yet due to the strong dependency that QCollator used to have on ICU. This patch adds collation support for the platforms where ICU is not the best option by using native collation API. Namely Windows and Mac OS X. Additionally a fallback POSIX back-end is added, so that we can make sure it will work on any posix-compliant platform. Change-Id: Ia1734acbf5f596698a81f2af927cc15636e4c908 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Refactor QCollator to be able to use it in different platformsAleix Pol2013-09-131-219/+111
| | | | | | | | | Propose the API to be changed so that we can implement QCollator in the different platforms where Qt is available. Change-Id: I7b3e933d7e3d1aa26c1b78d21ef75b71c692827f Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make the QCollator class publicLars Knoll2013-09-131-16/+23
| | | | | | | | The class missed the feature freeze for Qt 5.0, but has been ready for quite a while. So make it public in time for Qt 5.2. Change-Id: I9ac3f579ff5e371925fad40684762fff7ee4abd8 Reviewed-by: Lars Knoll <lars.knoll@digia.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>
* Remove qSort from QCollator docsGiuseppe D'Angelo2012-11-161-1/+1
| | | | | Change-Id: I4523b7e4cd2a7f9e07a39e48e8024ceb0d7eb839 Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* 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>
* Doc: Add \inmodule QtCore to all QtCore class doc bodiesThiago Macieira2012-08-231-0/+1
| | | | | Change-Id: I19100755c97cc155c76a859e19940e9f9222d34e Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Fix a couple of qdoc errorsLars Knoll2012-08-181-3/+2
| | | | | Change-Id: I79f689e08ed4a496052529af38fca72c3d4e04cb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Mark QCollator as internal.Lars Knoll2012-08-151-0/+2
| | | | | | | The class is private in 5.0, we'll publish it in 5.1 Change-Id: Ia7511db0393528aafa8c8059b4eb1657c8cdcc64 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Windows/ICU: Compile fix.Friedemann Kleint2012-06-121-1/+1
| | | | | | Change-Id: I95c281b0e577a89e4d92dd16fd039ab9e53036f5 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Add proper collation support to QtLars Knoll2012-06-101-0/+585
QString::localeAwareCompare() has always been a broken way to support collation. The current implementation is not even thread safe. This adds a proper collation class that fixes the problems and finally allows Qt to sort properly according to locale rules. The class is private for now, but is intendent to be made public with 5.1 Change-Id: Idb4e75ff68a398c9813af622af884a90898d2be9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>