summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Fix bug in qsslsocket peek()Kalle Viironen2012-04-231-0/+5
| | | | | | | | | | | | | | | | | | Calling peek() for qsslsocket caused socket data to be copied into qiodevices buffer and therefore make it unaccessible in qsslsocket. Cherry picked form 4.8-branch & modified to Qt5 API changes (int -> qintptr) Original commits: commit 621f18955082fc73471e75d1f8c35c2dcd4befeb Author: Shane Kearns <ext-shane.2.kearns@nokia.com> commit 68b1d5c17aa38d5921bdade2b0e0cb67c6c90513 Author: Kalle Viironen <kalle.viironen@digia.com> Task-number: QTBUG-18498 Change-Id: I6be4b19baec2f3197537f5e7b61432040ec84ad2 Reviewed-by: Shane Kearns <shane.kearns@accenture.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Removed invalid C-style license header from .pro fileRohan McGovern2012-04-231-40/+0
| | | | | | | | | | | /* C-style comments */ cannot be parsed by qmake. Additionally, Qt Project legal has agreed that .pro files do not need to be covered by license headers. Change-Id: Ie4d75ee09c2fc85a2f954ec4a931b36ea9d51d93 Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com> Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* Don't assume QAbstractDeclarativeData::objectNameChanged is available.Michael Brasser2012-04-231-1/+1
| | | | | | | | Preparation for removal from declarative now that a proper NOTIFY signal exists. Change-Id: If0acb73b73d17c49dc8de211d95ecd1e8e80ff1b Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Ensure that qXXXdetection.h can be included directlyThiago Macieira2012-04-213-0/+12
| | | | | | | | | Those files might have dependency on one another, on qconfig.h and on early qglobal.h definitions, so ensure that the only correct include order is that of qglobal.h. Change-Id: I89098bacaf16353ee8b51604ee885508dc8e201a Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Make the fallback Q_ASSUME and Q_UNREACHABLE be qt_noopThiago Macieira2012-04-211-2/+2
| | | | | | | | That way, we can properly add ; after them, and I can use Q_ASSUME in Q_ASSERT's else condition. Change-Id: Iad35819fbb06714116b7dd0f952e1c2c89044c72 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Move Q_DECL_{IMPORT,EXPORT,HIDDEN} to qcompilerdetection.hThiago Macieira2012-04-212-29/+29
| | | | | | | | | | | | | | Mindful of QT_VISIBILITY_AVAILABLE and Q_OS_WIN for GCC: when GCC is used on Windows (i.e., MinGW or potentially Cygwin), use the declspec variant so we produce proper DLL imports and exports. When used on other platforms, rely on configure adding QT_VISIBILITY_AVAILABLE to qconfig.h, which confirms that the -fvisibility argument is available. That flag has been available since GCC 4.0 on ELF targets, but it could be missing on some other targets. Change-Id: I3dbc0043c1eaee0c469c5b1dc8bf05842fe9cd47 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Move some compiler macro definitions into the compiler sectionsThiago Macieira2012-04-211-26/+12
| | | | | | | Makes for a couple of cleaner definitions of fallbacks. Change-Id: I9b1a6f77bab986514e1862ae1f431ea37b89c1b5 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Move the compiler-related macros to qcompilerdetection.hThiago Macieira2012-04-212-109/+110
| | | | | | | | This cleans up qglobal.h a little further and organises things a bit more. Change-Id: Ic025e720941cdf59b8a1a0baf515b29f25eba0f1 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Compile on Windows.Jan-Arve Saether2012-04-211-2/+8
| | | | | | | | | | | The previous code was trying to sum one pointer with one string literal... Using QVarLengthArray should also potentially speed things up a bit, since it will avoid a malloc if className is small enough (less than 15 bytes). Change-Id: I41218babb3030e7e6f9c31fc77e4af1c209ae0a5 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* QDataStream: Update Version info for docAurindam Jana2012-04-201-1/+1
| | | | | | | | | | QDataStream::Qt_5_0 was modified in aee1f6cc413f56bf4962324799ee3887c3dd037f but the documentation was not updated. Change-Id: I520798a7572b0f21cd275290bcd689e1b686d098 Reviewed-by: Kai Koehne <kai.koehne@nokia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Don't push unnecessary data to a data stream for QVariant()Thiago Macieira2012-04-202-6/+6
| | | | | | | | Adjust the test because we don't read past the end anymore. Task-number: QTBUG-25108 Change-Id: I8243f1d5ae79d1256aab2cb1132598a716a7eeeb Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Fix MSVC conversion warnings in new bytearray code.Friedemann Kleint2012-04-203-12/+13
| | | | | | Change-Id: Ifc81564daf3fef0d7f08ae8d250ba41d3b1d5b0f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* mingw: fix a lot of annoying warningsKonstantin Ritt2012-04-204-166/+166
| | | | | | | | | like "QRect::intersected() redeclared without dllimport attribute after being referenced with dll linkage" (-fno-keep-inline-dllexport) Change-Id: Id24e5ee857579ee9f97a60de0ab88ce3db8385cf Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Provide versions of qRegisterMetaType() that do not normalize typename.Martin Jones2012-04-202-12/+70
| | | | | | | | | QML is quite capable of providing typenames in the correct format. qRegisterNormalizedMetaType() does not normalize the typename, so avoids the huge overhead. Change-Id: I96c9a42fe0b5d36ac05a9247f6507dbf9583fa67 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Minor QObject::receivers() optimization.Michael Brasser2012-04-201-0/+3
| | | | | | | | Don't lock if there are no receivers. Change-Id: I922fad10436adeb27aa4f193cc0dcbaa3f0c0f1e Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Minor QObject::receivers() cleanup.Michael Brasser2012-04-201-2/+1
| | | | | | | | Return 0 rather than false; remove extra Q_D(). Change-Id: I3dac733c3fae27c76790f09fd6b63356767a0363 Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Add a receivers callback to QAbstractDeclarativeData.Michael Brasser2012-04-202-0/+7
| | | | | Change-Id: I767fabd66c7de535db26e779855d21ec5b94e947 Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Mark qt_assert and qFatal as non-returning functions (excpt. MSVC)Thiago Macieira2012-04-193-0/+14
| | | | | | | | | | | | | | | | | | | This allows the compiler to optimise the code a bit better: since they don't return, it can assume in the code after the Q_ASSERT that the condition was true. MSVC is the exception: with MSVC, we have the CrtDbgReport dialog, which allows the developer to continue execution, inside the debugger. Therefore, we can't mark any of those functions as non-returning because they can, after all, return. Unfortunately, the Q_ASSERT usually expands to no code in release mode, so the improvement in code generation happens in debug mode only... Change-Id: I4d542d6853cd51c71ffab1d563ed64ef7c419115 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fixed QSimd WindowsCE buildBjoern Breitmeyer2012-04-191-1/+8
| | | | | | Change-Id: I94de251cf1f283d30f92d0fb9d37a1646765cbdd Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* fix undefined behavior issue on IntegrityKonstantin Ritt2012-04-191-7/+0
| | | | | | | | in contrast to ::strdup(), qstrdup() allocates memory via new[]; deallocating this memory with free() leads to undefine behavior. Change-Id: I0692c4bef010c05de547283b00b6c6043ac24c79 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* optimize canonicalOrderHelper() for generic caseKonstantin Ritt2012-04-191-5/+21
| | | | | | | | | | | if there is no need to swap codepoints A and B, then we proceeding with advance to the next codepoint B that becomes A, and some next codepoint C becomes B; in such case we can easily skip the re-calculations for A by using previously calculated results for B Change-Id: I5c63589c274acaddf0f6a4cb1e0608d352a0c1b3 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Don't use QByteArrayLiteral for a non-stored QByteArrayThiago Macieira2012-04-191-1/+1
| | | | | | | | | Unless you're creating a QByteArray that you will store, don't use QByteArrayLiteral. Using it for 1 byte that is always concatenated to something else is an extreme waste. Change-Id: Icc29e4c4cb1d0aad1714bdeec8ff41da7c301af9 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* replace getenv("HOME") with a "centralized" QDir::homePath()Konstantin Ritt2012-04-191-1/+1
| | | | | | | | Task-number: QTBUG-4902 Change-Id: Ie9124de45be2d8e859f8b0aaea246e660145a1c5 Reviewed-by: John Layt <jlayt@kde.org> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Doc: Prepare for building modular QtCore docs.Casper van Donderen2012-04-19343-1504/+19432
| | | | | | | | | | | | 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>
* Change coreservices -> iosIan Dean2012-04-1911-26/+26
| | | | | | | | Replace "contains(QT_CONFIG, coreservices)" with "!ios" in config files. Replace "QT_NO_CORESERVICES" with "Q_OS_IOS" in source files. Change-Id: Id3b02316b245a24ce550e0b47596d18a4a409e4f Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Do not assert when QVariant is constructed from an invalid type idJędrzej Nowacki2012-04-192-3/+4
| | | | | | | | | | That change also fix moduleForType() which was wrongly recognizing negative ids as belonging to Core. New tests were added. Change-Id: I40a5819effb32489a45937011980457387c9f8be Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Fix some unused variable warnings.Stephen Kelly2012-04-181-0/+3
| | | | | | Change-Id: I3ffbb155c0efa65bb33a0e2ce80dbd75dc56f3fc Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* QThreadPool: unify waitForDone() overloadsKonstantin Ritt2012-04-173-19/+5
| | | | | Change-Id: I1515a65fab37588372794422a43ed09ac076e108 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* QThreadPool: optimize enqueueTask() for common caseKonstantin Ritt2012-04-171-12/+10
| | | | | | | | | | | the most-common case is: queue is empty or filled with tasks of the same priority; so the runnable would be put at the end of queue. both checks are cheap for us. also avoid detach()'ing by using const iterators Change-Id: Iab2255f852211f9accc8d717f778671661210ef3 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* fix QChar::decompositionTag() returns wrong result for Hangul syllablesKonstantin Ritt2012-04-171-0/+2
| | | | | Change-Id: I28e7b14b6a90aa539f8a50107737a66b3484fc00 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* fix QChar::isPrint() returns an incorrect result.Konstantin Ritt2012-04-171-4/+12
| | | | | | | | results are now equals to results of ICU's u_isprint() for the entire set of the Unicode code points Change-Id: I763f4b37cccd285eb01543d486f25bd7ea011241 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Merge remote-tracking branch 'origin/api_changes'Lars Knoll2012-04-17144-12510/+15760
|\ | | | | | | Change-Id: I964b0a6f5c38351fdfafb8a2a128a349ff8c89d1
| * Merge "Merge remote-tracking branch 'origin/master' into api_changes" into ↵Sergio Ahumada2012-04-1731-959/+1175
| |\ | | | | | | | | | refs/staging/api_changes
| | * Merge remote-tracking branch 'origin/master' into api_changesLars Knoll2012-04-1631-959/+1175
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure src/corelib/io/qurl.cpp src/gui/kernel/qwindow.cpp src/tools/moc/generator.cpp src/widgets/kernel/qwidget_qpa.cpp src/widgets/styles/qstyle.h src/widgets/widgets/qtabbar.cpp tests/auto/corelib/codecs/utf8/tst_utf8.cpp Change-Id: Ia457228d6f684ec8184e13e8fcc9d25857b1751e
| * | | Make reallocData use QArrayData::AllocationOptionsJoão Abecasis2012-04-162-24/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Growth computations are deferred to QArrayData::allocate, except in the case of realloc as that functionality is currently lacking in QArrayData. Since that sits in library code, anyway, it can be changed later to use a future QArrayData::reallocate. As it is, reallocData is becoming a model for QArrayData::reallocate and what it can offer to containers of POD/movable types. Change-Id: I045483f729114be43e4818149d1be1b333bcbe13 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | | Drop unnecessary assignmentJoão Abecasis2012-04-161-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In this branch, !IS_RAW_DATA has already established that offset is sizeof(QByteArrayData) and realloc maintains the assumption. Change-Id: Ic160e36d7781d4c4f64a3b2ebec98c9cb605b3eb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
| * | | Migrate QByteArray over QArrayData.Jędrzej Nowacki2012-04-162-60/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the time being QByteArrayData keeps its independent existence, for the sake of other modules. Once they have been ported to use the new initializer macros it can be changed to: struct QByteArrayData { QArrayData array; }; Extra braces can then be added to the macros. With respect to source compatibility, the only concern is with other modules, as QByteArrayData has already changed in incompatible ways with Qt 4.x Done-with: João Abecasis Change-Id: I044e2a680317431777a098feec8839a90a3d3da3 Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | | Remove explicit checks for shared_null/emptyJoão Abecasis2012-04-161-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This eases porting to QArrayData and retains semantics. In append() and prepend() a conditional was generalized so that no work is done if there is nothing to add. Done-with: Jędrzej Nowacki Change-Id: Ib9e7bb572801b2434fa040cde2bf66dacf595f22 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
| * | | Make QByteArray and QString keep track of terminating nullJoão Abecasis2012-04-164-46/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In conceptual terms, this change increments the Data::alloc member by one for all strings allocated and maintained by these classes. Instances initialized with fromRawData retain 0 as the member value, so they are treated as immutable. This brings QByteArray and QString closer to QVector, making it possible for them to reference and share the same data in memory, in the future. It also brings them closer to QArrayData. In practical terms all comparisons to the alloc member were changed to take into account that it also tracks the terminating null character. Aside from the increment in the alloc member, there should be no user visible changes. Change-Id: I618f49022a9b1845754500c8f8706c72a68b9c7d Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | | Show the type and address of QObjects in debug output.Stephen Kelly2012-04-161-1/+7
| |/ / | | | | | | | | | | | | Change-Id: I9f44ab80a6fb763adc9cbaf47de8e1b97212332d Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
| * | QHash security fix (2/2): enable QHash random seedGiuseppe D'Angelo2012-04-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Algorithmic complexity attacks against hash tables have been known since 2003 (cf. [1, 2]), and they have been left unpatched for years until the 2011 attacks [3] against many libraries / (reference) implementations of programming languages. This patch makes qHash use the QHash seed introduced in the previous commits, thus truly randomizing bucketing in QHash. [1] http://www.cs.rice.edu/~scrosby/hash/CrosbyWallach_UsenixSec2003.pdf [2] http://perldoc.perl.org/perlsec.html#Algorithmic-Complexity-Attacks [3] http://www.ocert.org/advisories/ocert-2011-003.html Task-number: QTBUG-23529 Change-Id: Ibee9cf6aa820af5d777fcde478647665c728052a Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
| * | QHash: remove optimization for QHash<int, T>Giuseppe D'Angelo2012-04-141-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QHash employs an optimization for int/uints, squashing the hash value and the key value inside an union. This obviously works iff qHash(int k) = k. If the hash value gets salted, the hash table is corrupted. This patch removes that optimization by means of a #if 0, so if further research finds out that we want those 4 bytes back it's pretty simple to revert. Change-Id: If273f0bf2ff007f4f2f7c46d2aab364a3b455cf1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | qHash: qHash(T*) two arguments supportGiuseppe D'Angelo2012-04-141-2/+2
| | | | | | | | | | | | | | | Change-Id: I1b78914fe9c6ee9251d68af1f2e95f1e3e0f1db5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | qHash: two arguments support for simple integer types (and QChar)Giuseppe D'Angelo2012-04-141-16/+16
| | | | | | | | | | | | | | | | | | Change-Id: I24bed73422fb1d2e90cf3dd4e5375e249b3dcac4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
| * | Removed QXmlStreamReader::readElementText overloadThorbjørn Lindeijer2012-04-142-13/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | The version without argument was kept for binary compatibility when the configurable ReadElementTextBehaviour was introduced. It is now dropped in favour of using a default argument value. Change-Id: Ic08c41d5a5aad9f22df7fc37a2d53ffbc6df1fe9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | QSharedPointer: qHash two arguments supportGiuseppe D'Angelo2012-04-131-3/+3
| | | | | | | | | | | | | | | | | | Change-Id: I800de3fd9769e4829018360c25a8cf2ee2e2e08b Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | Style: Don't put an else after a return.Stephen Kelly2012-04-131-2/+1
| | | | | | | | | | | | | | | Change-Id: I41d031d92489e5539f293c30a6257310f2a1c657 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
| * | Re-add the Qt 4 compatibility methods for QUrl encoded query itemsThiago Macieira2012-04-122-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | I forgot to re-add those when I re-added the non-encoded (QString) forms. Change-Id: I9d635d40106273177df2c332f09d66415efc15a3 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
| * | Ensure proper handling of empty-but-present URL componentsThiago Macieira2012-04-121-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new QUrl is able to distinguish a URL component that is empty from one that is absent. The previous one already had that capability for the port, fragment and query, and the new one extends that to the username, password and path. The path did not need this handling because its delimiter from the authority it part of the path. For example, a URL with no username is one where it's set to QString() (null). A URL like "http://:kde@kde.org" is understood as an empty-but-present username, for which toString(RemovePassword) will return "http://@kde.org", keeping the empty-but-present username. Change-Id: I2d97a7656f3f1099e3cf400b199e68e4c480d924 Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
| * | make QStringList::sort() to take a Qt::CaseSensitivity paramKonstantin Ritt2012-04-122-8/+19
| | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-12892 Change-Id: I402e6fb12ff24ac26c5a8103bf81547946f9cc58 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>