summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qsharedpointer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-01-221-1/+1
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qsavefile_p.h src/corelib/tools/qregularexpression.cpp src/gui/util/qvalidator.cpp src/gui/util/qvalidator.h Change-Id: I58fdf0358bd86e2fad5d9ad0556f3d3f1f535825
| * Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | | | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Doc: Update the info on the QSharedPointer internalsThiago Macieira2013-01-151-31/+24
| | | | | | | | | | | | | | Some of it still referred to classes that were cleaned up in Qt 5.0 Change-Id: Ief4ed4b4fce074884f755b0d18a526ac40ad1b0b Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | Fix the \since version for QSharedPointer::create().Stephen Kelly2013-01-071-1/+1
| | | | | | | | | | | | | | | | | | | | It is not relevant that it has been part of the class since Qt 4.6. It has always been internal until now. The release where it became public API (5.1) is what is relevant. Change-Id: Ib740f3ed6df190884a94fb2c11dd74cd7edb7b1a Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Add support for multiple arguments to QSharedPointer::create()Thiago Macieira2012-12-231-0/+31
|/ | | | | | | | Requires C++11 rvalue references and variadic templates so we can implement perfect forwarding. Change-Id: I62e47d1ffd0c61e8386f9f246aa79031b7430b46 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Optimise the deletion of a QSharedPointer with no custom deleterThiago Macieira2012-10-101-0/+7
| | | | | | | | | | | | | | | | When QSharedPointer is created with no user-specified custom deleter, instead of storing a pointer in ExternalRefCount::destroyer to a static function which, in turn, calls normalDeleter<T> indirectly (via another function pointer), specialise the CustomDeleter class and make it not store the pointer, but instead do the deleting directly. The benefits are: - the QSharedPointer's private data is smaller - there is no double-indirection via indirect jumps to the actual deleter Change-Id: Ice5653c144912efb1226e432267a047b9799aaca Reviewed-by: Olivier Goffart <ogoffart@woboq.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>
* Doc: Add \inmodule QtCore to all QtCore class doc bodiesThiago Macieira2012-08-231-0/+2
| | | | | Change-Id: I19100755c97cc155c76a859e19940e9f9222d34e Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Record if a metatype is a smart pointer to a QObject derived.Stephen Kelly2012-06-201-0/+2
| | | | | | | | | | | | This allows QVariant/QMetaType software (such as QtDeclarative) to deal with smart pointers in a similar way to how they can deal with naked pointers (accessing properties etc). This also adds a requirement that T be fully defined when QSharedPointer<T> is inserted into a QVariant. Change-Id: I29e12b8a6aa5f4aadbd62f92b89bc238f64b5725 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Add some internal API for extracting a QSharedPointer<T> from QVariant.Stephen Kelly2012-06-201-0/+20
| | | | | | | | | | | | | The T must be derived from QObject, or it will fail to compile. This will allow scripting or other 'wrapping' and runtime environments like QtDeclarative to handle QSharedPointers to types derived from QObject properly. A QSharedPointer<T> can be inserted into a QVariant, and where T derives from QObject, a QSharedPointer<QObject> can be extracted from the QVariant, and its properties are then accessible. Change-Id: I68d6d89aceceb019267bd7301baa2047f9c09b90 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge two internal classes of QSharedPointer and de-virtualise themThiago Macieira2012-06-121-83/+40
| | | | | | | | | | | | | | | | | | | | | The two classes are QtSharedPointer::ExternalRefCountData and ExternalRefCountWithDestroyFn. The split existed because of what Qt 4.5 did before custom deleters existed: the ExternalRefCountData class was a virtual class that contained a destroy() virtual, which was in charge of deleting the data or returning false if it didn't. Turns out that virtual classes was a mistake. This commit de-virtualises them -- we couldn't do it in Qt 4 because of binary compatibility. This saves us one pointer-size in the size of the private, plus the fact that fewer symbols are required (there is no virtual table to be initialised). Additionaly, since a deleter is always stored with the reference count, we don't need the split between the two classes anymore. Change-Id: I1cd9400561dcee089a406a57bd856b1730f18afc Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Deprecate the use of QWeakPointer to track QObjects.Stephen Kelly2012-06-071-48/+8
| | | | | | | | | | | | | | The main problem with using QWeakPointer to track QObjects is that it has API to convert to QSharedPointer, which is undefined behavior. There is no need to overload the meaning of QWeakPointer with QObject tracking. QPointer is more suitable and should be used instead. Because QPointer is implemented in terms of QWeakPointer, we need to add some overloads which are not deprecated. Change-Id: If0333e4800c9fd277629cc69185c9ca3e4e7e81d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QSharedPointer: add reset() member functionsMarc Mutz2012-03-161-0/+29
| | | | | | | | | | These have been added for std::shared_ptr compatibility, but in particular to allow tst_qnetworkreply && friends to drop the implicit conversions added to QSP by inheritance, so QSP can become final. Change-Id: I0f0401b02125d65622e52393b40a3b10bd9a850c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QSharedPointer: remove two emtpy functions.Debao Zhang2012-03-151-35/+2
| | | | | | | | | As the comments says:they are broken by design, and replaced with other functions. The purpose of their existence is for BIC with Qt4.5. Change-Id: I9453f816a7b7c6812499b89b7c60f0fd99dea27c Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make it possible to put QObject tracked with QWeakPointer inside QSharedPointerOlivier Goffart2012-02-101-15/+13
| | | | | | | | | | | | | | | | Do that by keeping the QWeakPointer that track QObject independent of the ones that track QSharedPointer. QSharedPointer do not touch the sharedRefCount in QObjectPrivate anymore When converting a QWeakPointer constructed from a QObject to a QSharedPointer, it will display a warning saying one should not do that. Task-number: QTBUG-22622 Change-Id: I3595e3e7401702410776c458687ab357ad9366ab Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.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>
* 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>
* Replace implicit QAtomic* casts with explicit load()/store()Bradley T. Hughes2011-10-271-5/+6
| | | | | Change-Id: Ia7ef1a8e01001f203e409c710c977d6f4686342e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make all uses of QBasicAtomicInt and Pointer use load() and store()Thiago Macieira2011-10-031-3/+3
| | | | | | | | | | | | | | Most of these changes are search-and-replace of d->ref ==, d->ref != and d->ref =. The QBasicAtomicPointer in QObjectPrivate::Connection didn't need to be basic, so I made it QAtomicPointer. Change-Id: Ie3271abd1728af599f9ab17c6f4868e475f17bb6 Reviewed-on: http://codereview.qt-project.org/5030 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@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/+1501
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