summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* QtCore: add constexpr to geometric classesMarc Mutz2012-02-225-363/+331
| | | | | | | | | | | | | | This turns code like QPoint(12, 12) into a compile-time expression, under a C++11 compiler, and allows to define arrays of these types that end up in read-only memory, just like PODs would. Some constructors and QLine::pointAt() needed to be adjusted to fit into the empty-body/only-return-expression requirement for constexpr constructors/functions. Change-Id: Id11ee2752c948930c3e40a91d1f6d7c97db7a373 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Drop file-engine abstraction from public APIJoão Abecasis2012-02-2223-402/+276
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This abstraction imposed serious performance penalties and is being dropped from the public API. In particular, by allowing file names to be arbitrarily hijacked by different file engines, and requiring engines to be instantiated in order to decide, it imposed unnecessary overhead on all file operations. Another flaw in the design with direct impact on performance is how engines have no way to provide (or retain) additional information obtained when querying the filesystem. In many places this has meant repeated operations on the file system, where useful information is immediately discarded to be queried again subsequently. For Qt 4.8 a major refactoring of the code base took place to allow bypassing the file-engine abstraction in select places, with considerable performance gains observed. In Qt 5 it is expected we'll be able to take this further, reaping even more benefits, but the abstraction has to go. [Dropping this now does not preclude that virtual file systems make an appearance in Qt at a later point in Qt 5's lifecycle. Hopefully with a new and improved abstraction.] Forward declarations for QFileExtension(Result) were dropped, as the classes were never used or defined. Tests using "internalized" classes will only fully run on developer builds. QFSFileEngine was removed altogether from exception safety test, as it isn't its intent to test internal API. Change-Id: Ie910e6c2628be202ea9e05366b091d6d529b246b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix potential race condition in data structure of adopted thread watcherjian liang2012-02-221-1/+3
| | | | | | | | | | | | Fix potential race condition in data structure of adopted thread watcher in Windows. Since QVector is not thread safe, it is not safe to read and append data to qt_adopted_thread_handles or qt_adopted_qthread simultaneously in qthread_win.cpp. This patch fix this race condition. Change-Id: I2d0c7a4cdde5390d38d15c98343f0fc6ddd24aba Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Merge overloadsRichard Moore2012-02-222-83/+2
| | | | | | | Fixes ### Qt 5 Change-Id: I2846593616635440e17c8a9ce518780561992b84 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge overloads.Richard Moore2012-02-222-28/+1
| | | | | | | Fixes a Qt 5 TODO Change-Id: Ide3159a5b979bd8e8a1edefff7fccb98dbe9a78e Reviewed-by: Pierre Rossi <pierre.rossi@nokia.com>
* QElapsedTimer/Win: Fix 64-bit integer overflowJonathan Liu2012-02-221-1/+3
| | | | | | | | | | | | | The ticksToNanoseconds function in qelapsedtimer_win.cpp multiplies ticks from performance counter with 1000000000 which can sometimes result in 64-bit integer overflow. This can cause the elapsed time to reset or jump around. Task-number: QTBUG-23150 Change-Id: I464503e03cbe64e13906e773beafbf88e7dc256a Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit f30a91ba9d98de1a0ebee5608ba289ac35871a8c)
* Fix error in addrlen fieldAndrew Stanley-Jones2012-02-211-1/+1
| | | | | | | | addrlen must be initialize to the amount of space available in the buffer. Change-Id: I52945d780bba9d22aeaa7ac5a35a0e54dbea60dc Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Give the compile flags an EXECUTABLE_ prefix.Stephen Kelly2012-02-211-1/+1
| | | | | | | | The fPIE flag should only be used with executables. Change-Id: If799ae4a7fe2492af3aac67651659a52d365024a Reviewed-by: Alexander Neundorf <neundorf@kde.org> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Add GL_BGR to the list of defined GL constants, right next to GL_BGRASimon Hausmann2012-02-211-0/+3
| | | | | | | | We use this one in WebKit's OpenGL texture mapper and it would be convenient to have it here if it's not defined by the platform. Change-Id: Idae33e49773e21c6290b164bccd4f209cf9820a2 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* regenerate unicode tables after rittk's patchesOswald Buddenhagen2012-02-211-196/+196
| | | | | Change-Id: I60b416fc2dc2f0ccbcf13288a9ba2a42547269ec Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* optimize QString::toLower()/toUpper() for special cases, step 2Konstantin Ritt2012-02-211-3/+3
| | | | | | | | | | | from now, QUnicodeTables::specialCaseMap[] starts with a placeholder; so, if somethingCaseSpecial is true, then somethingCaseDiff is always greater than 0 Change-Id: Ibb1870512836eee71b1521564c0745096c05b2f9 Merge-request: 70 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Olivier Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* optimize QString::toLower()/toUpper() for special cases, step 1Konstantin Ritt2012-02-211-8/+8
| | | | | | | | | | | reorganize QUnicodeTables::specialCaseMap as follows: specialCaseMap contains sequence entries in form { length, a, b, .. } Change-Id: Iea1f80bc2f4dc1f505428dad981cde26daaa52c7 Merge-request: 70 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Olivier Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* optimize QString::toCaseFolded()Konstantin Ritt2012-02-211-16/+36
| | | | | | | | | | use the codepath similar to QString::toLower() Change-Id: Ica1948c5e9c82199307d9f823e07d42b50d59480 Merge-request: 70 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Olivier Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* optimize handling of surrogate pairs in toLower()/toUpper()Konstantin Ritt2012-02-211-33/+51
| | | | | | | | | | | | high surrogate part never changes on upper/lower casing (which tested explicitly in the qunicodetables generator), thus we can copy the high surrogate part in the loop Change-Id: I24642b35eea7596c6ad494f2a7bc670f10b759a8 Merge-request: 70 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Olivier Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* replace 'const QChar &' with 'QChar ' where appropriateKonstantin Ritt2012-02-2119-30/+30
| | | | | | | | | as QChar is actually an ushort and there is no point in taking its address. Merge-request: 69 Change-Id: Idcc9d621e5627514ade006aa12a789a88929d48b Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Move QSysInfo out of qglobal.h and into a separate headerBradley T. Hughes2012-02-213-102/+157
| | | | | | | | | qsysinfo.h is still included by qglobal.h, but it may be possible to remove the include from qglobal.h and instead include qsysinfo.h only where needed (e.g. qendian.h, qdatastream.h). Change-Id: Ifa2c72e0dae206d88eaa192e15a906297673c048 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QEasingCurve: implement copy assignment operator inlineMarc Mutz2012-02-212-15/+3
| | | | | | | | | | Implement the copy-assignment operator inline, using the copy-swap idiom. This makes assignment strongly exception safe, but also simplifies maintainence, because op= is formulated in terms of the copy constructor now. Change-Id: I803c9100a520d659b685992237cb76fd114222c8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Test for QT_NO_SSL instead of QT_NO_OPENSSLShane Kearns2012-02-2121-65/+65
| | | | | | | | Change the ifdefs in our own code (except openssl backend) to use the new configure flag. Change-Id: I8774734771c66b22164b5fae8fdb27814ac3df7b Reviewed-by: Richard J. Moore <rich@kde.org>
* Make https requests fail fast when configured without ssl supportShane Kearns2012-02-212-1/+8
| | | | | | | | | | | | Restored the Qt4 behaviour where attempting a https request using QNetworkAccessManager fails with ProtocolUnsupportedError instead of timing out or hanging. Covered by existing autotests. Task-number: QTBUG-17189 Change-Id: Iceb1ba6558c7d2b1af8ddf8d4ea9315a5b44d970 Reviewed-by: Richard J. Moore <rich@kde.org>
* QEasingCurve: simplify and fix copy constructorMarc Mutz2012-02-211-4/+6
| | | | | | | | | | | | | | | | | | | | | | The copy constructor used the default Private constructor, followed by the application of the compiler-generated copy assignment operator, and finally replaced the config member with a copy of itself. This is needlessly inefficient. Worse: it's incorrect: if config->copy() throws, then *d_ptr is leaked. Solution: implement the copy constructor for Private, and use it in the copy constructor of the public class. Effect: everything that can throw now prevents the new Private class from being created, and the compiler ends up cleaning up after us. Change-Id: I09ed18bb39ee7cd81aaa8ba01676fc202502a8e3 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* QHash: more robust use of qDebug()Marc Mutz2012-02-211-1/+1
| | | | | | | | I'm sure 'line' can't contain anything resembling a format string, but better safe than sorry. Change-Id: I0aa0f4a5a03d97b18d6a866c27fa721fcbe0f77b Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
* QEasingCurve: implement move constructorMarc Mutz2012-02-211-0/+1
| | | | | | | | | | | | | | | | | | | | | The move constructor sets other.d_ptr to zero. This is safe, because after being moved from, the object is left in a state in which it can be safely destroyed (delete nullptr is a no-op). It cannot meaningfully be used anymore (most members will crash with a nullptr dereference), but in most cases, the moved-from object cannot be accessed anyway (not a named object), and if a named object is moved from, it must have been through explicit std::move(), as in the test case. The STL makes better guarantees (moved-from containers are .empty()), but I don't think it's worth introducing a null state into QEasingCurve just for supporting a use-case that should be considered a bug anyway. Change-Id: I4115b7386cdea6960507da6843a0d0196d8e4139 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QEasingCurve: implement move-assignment operatorMarc Mutz2012-02-211-0/+4
| | | | | | | | Implemented as in QPen etc. Change-Id: I65b43c6ec7308ca4b44f614594c15c41ab2f89f9 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QEasingCurve: add member-swapMarc Mutz2012-02-212-0/+10
| | | | | | | | Implementated as in QPen etc. Change-Id: Ia08551bf7902b60e115d1b1d2353030597e34841 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QEasingCurve: mark as Q_MOVABLE_TYPEMarc Mutz2012-02-211-0/+1
| | | | | | | | | The private data doesn't contain any back-links to the public class, afaics. So QEasingCurve qualifies for movable. Change-Id: Id8ab186fc0a25740458341256b53425dc40bce37 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Use requested window format to match rest of the patch in 38257651Tor Arne Vestbø2012-02-211-1/+1
| | | | | | | | | Otherwise we end up with an error at runtime: QEGLPlatformContext::makeCurrent: eglError: 3009, this: 0x4b5c58 Change-Id: I1e794f427243e40f0a8f572a936b9fb756e89f8a Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Rename Q_MUTEX_LINUX to QT_LINUX_FUTEXHarald Fernengel2012-02-212-6/+6
| | | | | | | As requested by Thiago Change-Id: Ie5b00cf4e530e19d360d0bc588f0f051e04b338f Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* moc: Fix loading of plugins in release mode.Friedemann Kleint2012-02-211-26/+40
| | | | | | | | | | | | Generate the plugin meta data with "debug" set to false/true in two code sections #ifdefed QT_NO_DEBUG. Do not use the value of QT_NO_DEBUG set at moc compile time which does not work in release mode/Windows. Change-Id: I0252795ed063bebb2c3b3784f880e64845b5b7e7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Streamline QPalette initialization code.Friedemann Kleint2012-02-211-26/+32
| | | | | | | Share the brushes to reduce memory usage by QBrushData. Change-Id: I04044b4c54b1f6a35a73d8bb4d299661ec0136a5 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Use new plugin system for Input Context plugins.Friedemann Kleint2012-02-217-5/+21
| | | | | Change-Id: Ifd1f63499afba546a745815762263a58ebf66460 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* QHeaderView - create a union to save some space.Thorbjørn Lund Martsum2012-02-211-3/+5
| | | | | | | | | Beside saving some space it also ensures a bit faster vector operations (remove and insert memcpy) - and lower the risk for a cache-miss. (Many operations seems to be about 5-10% faster in the benchmark). Change-Id: If8109e2146c25f642015906375dfbb449706ce8e Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* QHeaderview - many sections removed performance boost.Thorbjørn Lund Martsum2012-02-212-2/+23
| | | | | | | | | | | | | | | | | | | When the QHeaderView model rowCount is decreased then the headerview needs to remove some sections. If e.g swapSections had occured then qheaderview before this patch did a very slow removal by removing one section at a time and for each section it restored visual and logical indexes. By temporarily storing the logical index on the section we can reduce the execution time of this a lot. The old code is only faster when we remove one index (and is kept for that situation) There is a complexity in difference (and many factors in our qheaderview benchmark (the trunc part)) Change-Id: If45eab17fbca3364d458b004980570b5d013e4bd Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Remove qMacVersion()Bradley T. Hughes2012-02-213-16/+11
| | | | | | | | Add QSysInfo::macVersion() instead, to match the windowsVersion() function. Change-Id: I783e59583ca21653d25586156cbb0cb1f301868b Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove many unneeded virtuals.Richard Moore2012-02-201-28/+16
| | | | | | | Cleanup a ### Qt 5 TODO. Change-Id: I384e868ecc3ca4d80e4e71bb54d402f4ec1337a8 Reviewed-by: David Faure <faure@kde.org>
* convert length functions in QDom from uint to int.Richard Moore2012-02-202-16/+15
| | | | | | | Fixes a ### Qt 5 Change-Id: I7a385f2b704d38ae626094f27b06a918d4a9bc48 Reviewed-by: David Faure <faure@kde.org>
* Merge overloads.Richard Moore2012-02-202-19/+11
| | | | | | | Fix a ### Qt 5 by merging the overloads. Change-Id: If33e7592191c81b32caa6d68c73dbf2282437886 Reviewed-by: David Faure <faure@kde.org>
* Include qt_windows.h for Windows CE.Andreas Holzammer2012-02-201-0/+3
| | | | | | | | | The include is needed for OutputDebugString, as it is defined in winbase.h. To include use the centralized header. Change-Id: I486da20d7b054cee352be085e65a0ede1394653d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Merges several overloaded functions in QCoreApplication.Xizhi Zhu2012-02-202-63/+6
| | | | | | | | The source compatibility is kept. Change-Id: If66053b271d65062b3c0ce6ec66c8394a37b4e3e Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Windows - fix connecting to a socket using IPv4 mapped IPv6Shane Kearns2012-02-201-0/+10
| | | | | | | | | | | | Connecting to an IPv4 mapped IPv6 address (e.g. ::FFFF:127.0.0.1) requires the IPV6_V6ONLY socket option to be cleared. This was causing tst_qtcpserver::ipv6ServerMapped autotest to fail. The same change is not required on MacOS X - the test passes there. Task-number: QTBUG-24351 Change-Id: I6c08b19f0daa12765da2d44792ffb17299322695 Reviewed-by: Markus Goetz <markus@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove QPlatformIntegration/QPlatformTheme from QGuiAppPrivate.Friedemann Kleint2012-02-2025-2/+27
| | | | | | | Forward-declare instead. Change-Id: I3851994e8bc05b389e94e948478339ba33d521c1 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Remove QAccessibleInterface::relationTo().Jan-Arve Saether2012-02-202-43/+4
| | | | | | | | QAccessibleInterface::relations() replaces both relatedTo() and some of the RelationFlags that navigate() handled before. Change-Id: I4b9d2c28ba3d753efe7cc9bfa0ad68bed3ee02fd Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* Port QDBusAdaptorConnector meta-object to revision 6Kent Hansen2012-02-202-21/+53
| | | | | | | | | | | | | | | | We want to drop support for old revisions in Qt 5. This commit brings the QDBusAdaptorConnector meta-object in sync with current moc output. The QtDBus implementation was assuming that the relaySlot() slot would be created at index methodOffset() in the meta-object, but since revision 4 that's no longer the case (signals always come first). Made the code more robust by actually querying the meta-object what the index is. Change-Id: Ie0791680cc2e9e5fb1472c4462c391f92ea22ea6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove unused QtDBus meta-object extensionsKent Hansen2012-02-202-33/+4
| | | | | | | | | | The inputSignature and outputSignature fields were not being used anymore. All tests still pass. Change-Id: Icbc8fdcd5179a2b1b4843d58b90af925f6bef133 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QPoint/QPointF: inline manhattanLength(); QLineF: inline isNull()Marc Mutz2012-02-204-14/+18
| | | | | | | | | There's no reason for them not to be, and it's a prerequisite for making these functions constexpr. Change-Id: I03c9965147b51014c7af60a4c2d7f25a3f6e21a7 Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Move QTypeInfo out of qglobal.h and into a separate headerBradley T. Hughes2012-02-203-165/+220
| | | | | | | | | qtypeinfo.h is still included from qglobal.h, and defines QTypeInfo as well as all the specializations for built-in and default Qt types. Change-Id: I24116174de288a730cbb7aa2f80d346d2b2f9408 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Added note in QPlatformWindow::setGeometry() docs about position policy.Samuel Rødal2012-02-201-0/+4
| | | | | Change-Id: I0ac76b7aac1aa717592c34f414b1dd8fbee92be2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* uic: use QStringLiteral() instead of QString::fromUtf8() where applicableMarc Mutz2012-02-202-29/+41
| | | | | | | | | | | | | | | | | | | | | | | Many (most?) strings written aren't in fact UTF-8, and we can check at compile-time which are and which aren't, so don't hard-code fromUtf8() but use the much more efficient QStringLiteral() where applicable. This is low-hanging fruit. This patch only optimises US-ASCII string literals, not those that are latin-1 or even UTF-8, because that would require more extensive changes to the original fixString() function. Likewise, there are also other calls to QString::fromUtf8() being generated (e.g. in the pixmap code) that could benefit from being turned into QStringLiterals, but their code paths are more involved than those this patch fixes. This patch at least suffices in turning all the setObjectName() arguments into QStringLiterals, which was the main goal. The autotest baseline has been updated with the new expected results. Change-Id: Ic1ef67f500f9ff92d36164d515f4e004ef2a10bc Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* fix QProcess for Windows XPJoerg Bornemann2012-02-201-1/+4
| | | | | | | | | | | | CreateNamedPipe supports the flag PIPE_REJECT_REMOTE_CLIENTS since Windows Vista. On earlier Windows versions the system call would fail with ERROR_INVALID_PARAMETER. This does not open a security hole on Windows XP as there can be only one pipe instance. Change-Id: I5a1c7fdf756678009857317c7b563c884afeef2c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Remove QAccessibleInterface::navigate()Jan-Arve Saether2012-02-202-59/+4
| | | | | | | This is replaced by parent(), child() and relations() Change-Id: Iabff6ec56176a1ca8465d6480860f6e0174fd134 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* Use standard unix mutexes on LSBHarald Fernengel2012-02-203-9/+19
| | | | | | | | LSB doesn't allow syscalls, so fall back to the normal _unix implementation Change-Id: I8aba6147da8b46e3f85b0454cf9aca219811c9fe Reviewed-by: Olivier Goffart <ogoffart@woboq.com>