summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qlist.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Move a few QStringList methods up to QList<QString>Thiago Macieira2015-01-071-0/+6
| | | | | | | | This should be completely source-compatible, aside from the indirect header order change. Change-Id: I4cf8800ea1bfeb3023c7319991ab8ae281c925e8 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-11-241-10/+10
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qiodevice.cpp src/plugins/bearer/linux_common/qofonoservice_linux.cpp src/plugins/bearer/linux_common/qofonoservice_linux_p.h src/plugins/platforms/android/qandroidplatformtheme.cpp src/tools/bootstrap/bootstrap.pro src/widgets/styles/qmacstyle_mac.mm Change-Id: Ia02aab6c4598ce74e9c30bb4666d5e2ef000f99b
| * Fix warnings about size conversion in QListThiago Macieira2014-10-311-10/+10
| | | | | | | | | | | | | | | | | | | | | | Because difference_type is 64-bit on 64-bit systems, there's a downconversion warning from MSVC and possibly other compilers when it gets passed to functions taking simply int. Task-number: QTBUG-41092 Change-Id: I46a710810f4a57b8b84c4933f419a1f1fdf6bb5a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Check for integer overflows in places where qAllocMore is usedUlf Hermann2014-10-171-0/+2
|/ | | | | | | Task-number: QTBUG-41230 Change-Id: I5e932c2540c0bd67f13fab3ae20975d459f82c08 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Doc: Use title case in section1 titlesNico Vertriest2014-09-301-1/+1
| | | | | | | | Using Python script title-cased.py Task-number: QTBUG-41250 Change-Id: I00d3d7a0b30db7304a7904efd6d63abd9a7b493b Reviewed-by: Topi Reiniö <topi.reinio@digia.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>
* Doc: corrected autolink errors qtbase/corelib/toolsNico Vertriest2014-09-241-2/+2
| | | | | | | | | 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>
* Move the special QByteArrayList methods into QListThiago Macieira2014-08-091-0/+5
| | | | | | | | | | | | | | | | | | | | | | | and make QByteArrayList be a simple typedef. As a side-effect, the constructor taking a QByteArray is no longer available since I couldn't find a way to add it to QList<T> when T is QByteArray. My template-foo failed me. I tried: - QEnableIf<is_same<T, QByteArray>::value, QByteArray>::type => makes QList fail to compile for any T that isn't QByteArray - make the constructor a template member => it compiles if the parameter is a QByteArray, but not a const char[4] like the test was - inheriting constructors => runs into ICC and Clang bugs that I could not work around Besides, the constructor with std::initializer_list is a superior solution anyway. Change-Id: Ic86fbadc1104142bfd907a5c4147199bf839fb89 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Unify all mid() functions in QtBase.Jędrzej Nowacki2014-05-161-3/+3
| | | | | | | | | | | | | | | | | | | Up to now, Qt had at least 3 different implementations of the mid(). Only QString::mid implementation was not crashing on edge cases and was protected against overflows, therefore I picked that one as the base implementation, even if it has weird semantics for an invalid input. As a side effect QVector::mid was slightly optimized to not detach in all cases (which follows current QList behavior). Documentation of QVector::mid and QList::mid was updated to not mention "copy of data" which could suggest that the mid() result is detached. QStringRef::mid was fixed and now it follows general Qt behavior, by returning a null value for a null input. Change-Id: Ie9ff5d98372bd193d66508e6dd92b6ed1180ad9b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Improve implicit shared documentation a bitThorbjørn Martsum2013-10-151-0/+10
| | | | | | | | Task-number: QTBUG-27061 Change-Id: I66e000a9f59fda3654066013e6e78c3ba6fd27fe Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QList - fix a few doc issuesThorbjørn Martsum2013-10-151-10/+14
| | | | | | | | | Though some of it was mensioned in the introduction to the class, we are not in O(1) if we modify a shared container. Change-Id: If63b4cb4bdfc98d6b1333bae307e5650341e5484 Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Adding mark-up to boolean default values.Jerome Pasion2013-10-081-28/+28
| | | | | | | | | | | | | | | | | 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>
* Doc: Add docs for rvalue references and move constructorsGeir Vattekar2013-09-271-0/+17
| | | | | | | | | These members were introduced in 4.8, but left undocumented. Because we consider undocumented API to be internal, the members are \since 5.2. Change-Id: I52e2840a8cfaa7f59f410b3e2a06c0942ea06539 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Update the documentation for C++11 initializer lists supportLaszlo Papp2013-03-071-1/+2
| | | | | | | | The documentation was written for 4.8 when the C++11 standard did not have the name yet. Change-Id: I08640a5ae62385b09e181eefafd4cc831e4de456 Reviewed-by: Olivier Goffart <ogoffart@woboq.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>
* QtBase: Doc: Fix links to STL-style iteratorsDavid Schulz2012-12-061-6/+6
| | | | | Change-Id: I2822c2a7e9bfc1949c20ff81e08961f641e961fb Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Remove qSort from QList/QSet docsGiuseppe D'Angelo2012-11-161-1/+1
| | | | | Change-Id: I82ac7cafbda3bb6d54a0ba26903ab11113640067 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/+3
| | | | | Change-Id: I19100755c97cc155c76a859e19940e9f9222d34e Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Remove use of ::free from qlist.hThiago Macieira2012-08-091-0/+6
| | | | | | | | | | | | | | | | | The memory is allocated in qlist.cpp, so it should be freed in qlist.cpp. Freeing it in qlist.cpp ties our hands about future improvements to the allocator. In addition, silence the warning by the too-smart-for-its-own-good GCC that we're trying to free a non-heap object: qlist.h:763:14: warning: attempt to free a non-heap object "QListData::shared_null" [-Wfree-nonheap-object] The warning is wrong. It should say "possibly" somewhere because GCC failed to account for all conditions in the path to free(). Change-Id: I34a6c16bba9a2197fc83eb3c7a63ae06fb25bf15 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* QtCore: remove \link usagesGiuseppe D'Angelo2012-05-291-2/+2
| | | | | Change-Id: I0de764b51a972de0b6eb2bf3c04d2b190f581f52 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Doc: Prepare for building modular QtCore docs.Casper van Donderen2012-04-191-29/+29
| | | | | | | | | | | | This change fixes most qdoc errors in QtCore. There are about 900 left. The main thing this change does is moving documentation from qtcore from /doc/src to /src/corelib/doc. Other issues resolved are mis-use of qdoc commands. Change-Id: I002d01edfb13575e8bf27ce91596a577a92562d1 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
* Merge master into api_changesKent Hansen2012-03-191-0/+18
|\ | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qvector.h tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp Change-Id: I877256e95f3788e617437f4e9661a88047f38cd6
| * containers: add C++11-style c{begin,end}() as alias for const{Begin,End}()Marc Mutz2012-03-171-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | C++11 adds cbegin()/cend() functions for the same reason Qt has constBegin()/constEnd(). This patch adds these functions to the Qt containers with the same implementation as constBegin()/constEnd(). It also fixes the return types in the documentation of existing constFind() functions (documentation only). C++11 only adds cbegin()/cend() (and crbegin()/crend(), which Qt doesn't have). In particular, it doesn't add cfind(), so I didn't supply these, even though Qt comes with constFind(). This is a forward-port of https://qt.gitorious.org/qt/qt/merge_requests/1365. Change-Id: Ida086b64246b24e25254eafbcb06c8e33388502b Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | Merge remote-tracking branch 'origin/api_changes' into containtersJoão Abecasis2012-03-081-3/+3
|\| | | | | | | | | | | | | | | | | Conflicts: src/corelib/kernel/qmetaobject.cpp src/corelib/kernel/qvariant.cpp src/tools/moc/moc.h Change-Id: I2cd3d95b41d2636738c6b98064864941e3b0b4e6
| * Remove the usage of deprecated qdoc macros.Casper van Donderen2012-03-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | QDoc now has support for Doxygen style commands for italics, bold and list items. This change applies that change in QDoc to the actual documentation. Task-number: QTBUG-24578 Change-Id: I519bf9c29b14092e3ab6067612f42bf749eeedf5 Reviewed-by: Shane Kearns <shane.kearns@accenture.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* | Base QList::setSharable on RefCount::setSharableJoão Abecasis2012-03-051-3/+1
| | | | | | | | | | Change-Id: I2acccdf9ee595a0eee33c9f7ddded9cc121412c1 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* | Merge remote-tracking branch 'gerrit/master' into containersJoão Abecasis2012-02-051-3/+3
|\| | | | | | | | | | | | | Conflicts: src/corelib/tools/qstring.cpp Change-Id: I23d214bf33c2badfae1876da3cc7d6d8f6e635fb
| * 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>
| * 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>
| * Remove QBool and use bool instead.David Faure2012-01-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | QBool was introduced with Qt-4.0, to detect Qt3-like code like if (c.contains(d) == 2) and break compilation on such constructs. This isn't necessary anymore, given that such code couldn't possibly compile in Qt4 times. And QBool was confusing developers, and creating compile errors (e.g. QVariant doesn't have support for it), so better remove it for Qt 5. Change-Id: I6642f43f5e12b872f98abb56600186179f072b09 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* | Don't use RefCount int operatorsJoão Abecasis2012-01-231-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | , as those are going away. The comment in QString/QByteArray::squeeze about shared_null was updated as it also affects other static data, such as that generated by QStringLiteral and QByteArrayLiteral. Change-Id: I26a757d29db62b1e3566a1f7c8d4030918ed8a89 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | Merge remote-tracking branch 'gerrit/master' into containersJoão Abecasis2012-01-161-4/+6
|\| | | | | | | Change-Id: I2d358b912f1055ee6021d13de2f66fd459aaa355
| * Remove all non-inline of qMalloc/qFree/qRealloc.Robin Burchell2012-01-061-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | We're trying to deprecate these, so don't use them anymore. The inline uses of these have been left intact, for the moment. Inline code will need to create their own non-inline allocation methods (for future-proofing to allow alterations in how e.g. individual containers allocate) Change-Id: I1071a487c25e95b7bb81a3327b20c5481fb5ed22 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@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>
* | Retire the generic Q_REFCOUNT_INITIALIZER macroJoão Abecasis2012-01-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This was only being used to initialize static read-only RefCount instances, where the value is hard-wired to -1. Instead of allowing initialization with arbitrary values (which for a reference count can be error prone) the intent of the macro is made explicit with its replacement Q_REFCOUNT_INITIALIZE_STATIC. Change-Id: I5b0f3f1eb58c3d010e49e9259ff4d06cbab2fd35 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* | Get rid of assignment operators in RefCountJoão Abecasis2012-01-041-2/+2
|/ | | | | | | | | | | | , and make it strictly a POD struct. Since this operator was only being used to set the initial (owned) value of the reference count, the name of the function introduced here to replace it makes that use case explicit. Change-Id: I2feadd2ac35dcb75ca211471baf5044a5f57cd62 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Revert "Use memmove in QListData::append(int) as regions overlap."Oswald Buddenhagen2011-10-261-1/+1
| | | | | | | | | | We have proven that the regions cannot overlap. The root problem must be somewhere else. This reverts commit d96b7b809e614dd416709acec768529457120b9f. Change-Id: I3446487f2a1a5bd322379b8adb788c26ff3e08e2 Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>
* Make QListData::shared_null constBradley T. Hughes2011-09-261-1/+1
| | | | | | | | | | Similar to QMap, QVector, QByteArray and QString, keep the shared_null in shareable memory and never modify it. Change-Id: I2b4bb8de564080021043f6ede6c903d567c686cf Reviewed-on: http://codereview.qt-project.org/4531 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Remove declarations for QListData functions removed by 36c29abBradley T. Hughes2011-09-011-1/+1
| | | | | | | | | | | | | This commit removed the function implementations, but not the declarations. This removes QListData::append2(T) but moves the optimized QListData::append2(T) implementation to QListData::append(T) Change-Id: I39b6dea31420a7cefe079b94a91a96eb16000d2a Reviewed-on: http://codereview.qt.nokia.com/4062 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Doc: Removed documentation for deleted code.David Boddie2011-07-211-42/+0
| | | | | | | Change-Id: Icdbc05decac3dfe3fc18ce073c494e1fce4ea347 Reviewed-on: http://codereview.qt.nokia.com/1824 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: David Boddie
* Use memmove in QListData::append(int) as regions overlap.Thiago Macieira2011-07-081-1/+1
| | | | | | | | | It's undefined behaviour to memcpy regions with overlapping area. You have to use memmove. Change-Id: I912c819bf7ab26ba1e60028ee9d7c833dfc5138a Reviewed-on: http://codereview.qt.nokia.com/1355 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
* Doc: Applied pending fixes to API documentation.David Boddie2011-05-231-2/+2
|
* Removed deprecated functions in QListEckhart Koppen2011-05-131-91/+0
| | | | | Removed detach, detach2, detach3 and append which were marked as required only up to 4.5.x
* Initial import from the monolithic Qt.Qt by Nokia2011-04-271-0/+1919
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