summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* string.h is needed for memcpy()Oswald Buddenhagen2012-08-021-0/+2
| | | | | | | | ... which is used by some template code. apparently, the glibc on my rather recent system removed some implicit includes again. Change-Id: I9f85362e54a42cccc1e743f2b27bcdb6a90162e3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix some typos in static assert message.Stephen Kelly2012-08-011-1/+1
| | | | | Change-Id: I1abc79d86a4b101e6f32d37a58ac3c7d8cc16237 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtNetwork: Handle FD_CLOSE on WindowsMartin Petersson2012-08-013-6/+15
| | | | | | | | | | | | | We need to handle FD_CLOSE separately on Windows as this will be sent only once. When we get FD_CLOSE we need to check if there is more data available for reading. It there is this might indicate that there is another FD_READ that we need to handle after the FD_CLOSE. So in this case we will manually create another close event. Task-number: QTBUG-19409 Task-number: QTBUG-25386 Change-Id: Ie19906bc3f64fb6a85a508a5ab12caac5d70ccdb Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* fix a few qdoc command typosJeremy Katz2012-08-011-1/+1
| | | | | Change-Id: I5eb3a6d2bb7939f001f1fcb836660dd46a47c350 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* statemachine: Make states exit order spec-compliantKent Hansen2012-08-011-3/+3
| | | | | | | | | | The SCXML spec states that entry order should be equivalent to "document order" and exit order should be "reverse document order". Since QStateMachine uses child order for the entry order, the exit order should be reverse child order. Change-Id: Ia7b05fdd5c9261ccf202f64f8d23f5c88b20a8c3 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Make sure that the parsing mode reaches QUrlPrivate::setHostThiago Macieira2012-08-012-11/+11
| | | | | | | | | | | | Ensure that the parsing mode is cascaded down from setAuthority and setUrl so that the hostname parsing does not attempt to decode percent-encoded hostnames when it shouldn't. Take the opportunity to also remove the "Boolean Trap" from QUrlPrivate::setHost. Change-Id: Ia64754c4a4900182700b7af1382aea8410abc7e9 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Make QUrl::setScheme only parse in strict mode (no decoding)Thiago Macieira2012-08-012-16/+3
| | | | | | | | | | The URI RFC defines schemes as containing only a very restricted set of characters, none of which require encoding, so don't even try. Testing this behaviour in some web browsers indicate that they do not accept percent-encoded schemes either. Change-Id: I692dd20e1aac7e8a1bcb276cb5113b5802393d38 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix QUrl support for empty usernames and passwordsThiago Macieira2012-08-011-1/+1
| | | | | | | | | | | | | | | If the password is empty (but present), the userinfo component of the URL should end in a colon (":"). QUrl already supported that and it was tested (case "password-empty"). If the username is *also* empty but present, the userinfo component is just the colon (":"). Fix support for that case by checking if we stored the presence flag instead of checking the size of the component. Change-Id: Ie224493a997dbf76b2e44dd6d55fd9674ac83c1c Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix handling of encoded NULs (%00) in QUrl::fromPercentEncodingThiago Macieira2012-08-011-1/+2
| | | | | | | | | | | | | QString::fromUtf8, without an explicit size, (currently) defaults to stopping at the first NUL. That means we need to pass an explicit size. Also take the opportunity to test that QUrl::toPercentEncoding also works with the same data. Change-Id: I79362d67afda624b01ca07b0315b611c4aa3fdda Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: David Faure <faure@kde.org>
* Doc: QVarLengthArray::length is new in 5.0Christian Kamm2012-08-011-0/+1
| | | | | Change-Id: I796e67d677309460d79a7a64a6890dfbcfbace69 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use QtCore instead of QtGui for the standardpaths comments to be correctLaszlo Papp2012-08-017-7/+7
| | | | | | | Change-Id: I98004fed565ac9653947ec70a3197b0372abcf2b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: David Faure <faure@kde.org>
* Lazy initialize library pathsHarald Fernengel2012-08-011-7/+4
| | | | | | | | | | For a lot of command line tools, library loading is not required, so don't waste a lot of time computing them. According to callgrind, this makes the QCoreApplication constructor factor 6 faster, and also removes a lot of stat() calls and other file system access. Change-Id: I0211f5303712fa0dcfc4168cce7025283c63c9d1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix compilation: Move qHash(const T &t, uint seed) up.Friedemann Kleint2012-08-011-2/+2
| | | | | | | | | It needs to be visible from qHash(const QPair<T1, T2> &key, uint seed). Change-Id: Ibb63ce6da1e655bfb841c5e580e184ef66c5b766 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Fix reloading of pluginsLars Knoll2012-08-011-0/+1
| | | | | | | | | Unloading and reloading a plugin didn't work correctly, because we didn't reset instance to 0 on unload. Task-number: QTBUG-26098 Change-Id: Ic3e4497f359b1ca455be949dce9cafa9d67d8039 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix some syncqt warnings.Lars Knoll2012-08-013-0/+10
| | | | | Change-Id: I6f432ee991f4bde217fa27d4004ef318f1d480e0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Mac: Don't crash if language preferences can't be retrieved.Eike Ziller2012-07-311-1/+1
| | | | | | | | | That can happen when e.g. running an application with sudo. Task-number: QTBUG-26547 Change-Id: Ib16ef7798ebcd1c9b8d661dd2e3ce3aadc393489 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
* Align the CP949 codec name with ICULars Knoll2012-07-312-6/+9
| | | | | | | | It's name is windows-949 according to ICU. Keep CP949 as an alias for compatibility with Qt 4. Change-Id: I115ba2593da6f7b47e25136c3fadb19c7f798ff0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Small doc fixes about the list of supported codecs.Lars Knoll2012-07-311-3/+3
| | | | | Change-Id: I98b8ec9d5de9e69f1bb6187b4d820d61f7ce03e5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Do not preload any codecs anymore when using ICULars Knoll2012-07-314-30/+81
| | | | | | | | | When using ICU we can now avoid pre loading any codecs at startup. Instead QTextCodecs will always be created lazily when first asked for. Change-Id: Ic668f2824700896d2eca7d0de54f978404826163 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add a factory method to QIsciiCodec and fix the namesLars Knoll2012-07-312-9/+21
| | | | | | | | | Make the names all lower case to be in line with what ICU reports. Add a factory method to create the codecs according to their name. Change-Id: Ia3dddaa7701a0645d9d8fbcb52f1f8d58f79cf98 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use ICU instead of iconv/windows codecs for the localeLars Knoll2012-07-314-35/+50
| | | | | | | | With ICU there's no need to use the windows locale or iconv codecs anymore as locale codecs. Change-Id: I50c94a97ed6acbf4c6f05b2a88593a57ebfa8342 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make codecForLocale atomicLars Knoll2012-07-312-37/+36
| | | | | Change-Id: I8017b1c2aa1df8d613e83919a945fd5f320713d6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* ICU code page conversion supportLars Knoll2012-07-315-24/+791
| | | | | | | | | | | | | Use ICU to do code page conversion instead of the builtin text codecs. With this QTextCodec simply becomes a wrapper around ICU's ucnv_* methods. We only keep our own codecs for UTF-*, ISO-8859-1, ISO-8859-15 for performance reasons, and for TSCII and iscii-* because they aren't supported by ICU. Change-Id: I4fc49eba55cf772b9772c6dac606a47a44346a60 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Rename some codecs to be in line with ICULars Knoll2012-07-311-2/+2
| | | | | Change-Id: If523d2a12ef64c79e3860da1f430f128d24ff600 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Disable iconv on utf-8 based platformsLars Knoll2012-07-312-4/+5
| | | | | | | | | There's no need to use iconv on Mac, iOS, Android or QNX, as all these platforms are fully utf-8 based. Change-Id: I2a03c8dea72ad91f6ec83da0a838de20e46babef Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Lazily initialize iconv in the iconv codecLars Knoll2012-07-312-4/+12
| | | | | | | | | | | | | | | Avoid dlopen'ing libiconv and initializing it's members until the codec gets used for the first time. This avoids some memory and startup time overhead in case we can use the utf8 codec instead of iconv. It also removes a circular dependency between codec initialization during app startup. Change-Id: I119c010c288dc59ab32279d8a213ae1f4347cace Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use utf-8 as the locale codec where it makes senseLars Knoll2012-07-311-6/+8
| | | | | | | | | Use utf8 as the fallback codec in case we can't determine something else instead of latin1. Also use utf8 for Mac, iOS, Android and QNX. Change-Id: I15dc85d2406b1ebdfacff25f45f8b6854c52b97e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove encoding detection according to LANGLars Knoll2012-07-311-142/+0
| | | | | | | | | This code is left over from the 90's, and should not get used anymore. In all relevant cases we will use UTF-8 or iconv nowadays. Change-Id: Ie3776f671de33f782fa77f6359bf6e105bd9c1b8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move the text codec list to qcoreglobaldata.Lars Knoll2012-07-314-195/+115
| | | | | | | | | | | This removes some global statics in QTextCodec and makes the code better to maintain in the longer term. Remove QT_NO_THREAD defines around mutexes as this isn't required in Qt 5 anymore. Change-Id: I15ede75f53b16f134f4053f3188c4b47e86fcd8a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QUrl: document that setIdnWhitelist isn't thread-safeMarc Mutz2012-07-301-0/+3
| | | | | | | This is a forward-port of 6b10fc91 from Qt 4. Change-Id: I58878bf24e4f1b50ebfd0457c37eef58696f4a4c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* fix QEventLoop qdoc errorsJeremy Katz2012-07-301-3/+6
| | | | | Change-Id: I17bb720d539a7ccf5d9a3b20853897ff052fc8a6 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Document QEvent::EnterEditFocus and QEvent::LeaveEditFocus properly.Mitch Curtis2012-07-281-2/+2
| | | | | | | | These enums are only accessible if QT_KEYPAD_NAVIGATION is defined. Task-number: QTBUG-15631 Change-Id: Ifa826ac8f2bf28225572e0c664f18ffa5e78c302 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* removed duplicated docs in android qsharedmemory and systemsemaphoreJeremy Katz2012-07-282-27/+0
| | | | | | | | | | | | | Qdoc sees all source and header files, rather than the subset selected by qmake. This leads to qdoc errors when the same functions are documented in multiple implementations. In the cases fixed here, all documentation was duplicated, so no information was lost. Change-Id: Id7f8e2e617862a3778d0b05b38d8811aad456ac5 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Specialize QTypeInfo for QUrlTwoFlags to mark it PRIMITIVE.Stephen Kelly2012-07-281-0/+3
| | | | | | | | QTypeInfoMerger combines the typeinfos for the (PRIMITIVE) flag arguments. Change-Id: I5abf00489491d099f2bf7ba25c191a771a383d78 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Mark the QFlag and QIncompatibleFlag as primitive.Stephen Kelly2012-07-281-0/+3
| | | | | | Change-Id: I7dab4d029e7840fe4778a750a8dd7367675d7a27 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDebug: Add getter/setter for auto-insert-spaces.David Faure2012-07-272-0/+21
| | | | | | | | | | | | This is useful for inserting a string without space-handling, given that dbg.nospace() followed by dbg.space() inserts a space. It's also useful for QDebug operators for custom types, so that they can disable space handling and then restore to whatever it was before (rather than forcing it to space() mode). Change-Id: I9d72e9ffbcbc581ed093168752c29af924405b33 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDebug: adjust documentation of space(), nospace() and maybeSpace()David Faure2012-07-271-9/+5
| | | | | | | | Reality is that they control a "current mode" in the stream, not a "bool that remembers if the last character was a space". Change-Id: Ic907c34bcb458039b73ddff48021e19f0c24c78c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix crash in QVariant::canConvert().Volker Krause2012-07-271-1/+4
| | | | | | | | | When containing a QObject (or sub-class) pointer and trying to convert to a QObject pointer canConvert() did dereference the pointer without checking for it being null. Change-Id: Ie274e54f2f817f2b6c5df64504f8af6359b8f38d Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* fix QVariant qdoc error - mark const QVariant::data_ptr() internalJeremy Katz2012-07-271-0/+5
| | | | | | Change-Id: I1df93780f271ce06c3aa10c4bdcc1c2a43097b72 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Fix QUrlQuery qdoc errorsJeremy Katz2012-07-271-5/+28
| | | | | | | | | Add missing documentation for toString() and operator!= Mark data_ptr() and associated typedef internal and some qdoc tag usage issues Change-Id: I0ad5a2c767fb742d9a86ae259c0c11a0f5db64b4 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Introduce QTypeInfoMerger.Jędrzej Nowacki2012-07-273-12/+47
| | | | | | | | | | | | QTypeInfoMerger class was created to allow "inheriting" QTypeInfo traits. The class implementation was based on the QTypeInfo<QPair<>> specialization, therefore the specialization was refactored to use the new class. Change-Id: I4ff3e5eac1d55da086dad84274cce2b2c0a721be Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Implement implicit constructors for built-in classes.Stephen Kelly2012-07-272-0/+138
| | | | | | Change-Id: I6b0b104bc1da3252d014615c50b81830de42e722 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* fix QMimeDatabase qdoc errorsJeremy Katz2012-07-271-2/+28
| | | | | | | | Some of the \sa lines were missing () after function names. Document MatchMode and the deprecated mimeTypeForNameAndData() Change-Id: I468b9741908beb7be5723a8bb927e5418fc1c344 Reviewed-by: David Faure <faure@kde.org>
* Fix several QUrl qdoc errorsJeremy Katz2012-07-262-7/+27
| | | | | Change-Id: I2b89751ed2ec54f3b992c5fc4b39539d521c3404 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Fix MSVC 64bit warnings about truncation from size_t to int.Friedemann Kleint2012-07-261-2/+2
| | | | | | Change-Id: I9aea91aeb9f71817e9cc612d41351dbc98056500 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* QMetaTypeId2::IsBuiltIn: (new) template meta-function to check for built-in ↵Marc Mutz2012-07-261-2/+2
| | | | | | | | | | | | | | | types This allows to check whether QMetaTypeId2::MetaType exists, and can help turn run-time into compile-time expressions, even without constexpr support, or in situations where constexpr can't be used (because you can't overload on it). This was designed for the QMetaType::registerConversion feature, but it's much more widely applicable. Change-Id: Iafa04add04bcb531b3f7fe3e751c7e91ee6a3bc0 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* QFileInfo: remove synchronisation macroMarc Mutz2012-07-261-1/+0
| | | | | | | | | Staged after all other modules have removed their Q_DECLARE_METATYPE(QFileInfo) copies. Change-Id: I9ac42fcc5f333dd6e8b92c8755610f88cb7267a0 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Fixup the plugin documentationLars Knoll2012-07-264-0/+480
| | | | | | | | | | Move the plugin howto from qtdoc to corelib where it belongs. Fix the snippets and remove all remaining references to Q_EXPORT_PLUGIN Task-number: QTBUG-26237 Change-Id: I43dce2ffa42193b7a992fa1a0f2fcb2f633037b2 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Make the operator| for QUrl with QIncompatibleFlag constexpr.Stephen Kelly2012-07-251-1/+1
| | | | | | Change-Id: I7780af7ef0d5e191e2715c40bf0ffbb6d376f1a2 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QObject: add a macro for conveniently setting the object nameMarc Mutz2012-07-252-0/+19
| | | | | | | | | | | | | | | | | | This is a simplified port of KDTools' KDAB_SET_OBJECT_NAME. It simply assigns the variable name as the objectName of a QObject, uic-style. It uses a small helper function so that it works on references as well as pointer variables. QLabel label; QLabel *pLabel = new QLabel(); Q_SET_OBJECT_NAME(label); Q_SET_OBJECT_NAME(pLabel); Change-Id: I25fec0c90f33249a3ea5d2dd622ab708019fd101 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>