summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Use QPointer instead of QWeakPointer.Stephen Kelly2012-06-055-5/+5
| | | | | | | | The use of QWeakPointer for tracking QObject pointers is to be deprecated. Change-Id: If460ca7f515db77af24030152f4bd56e1a5fae7c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make QIODevice::seek() return false for sequential files.Mitch Curtis2012-06-051-7/+9
| | | | | | | Task-number: QTBUG-18173 Change-Id: Ie3a96d3a6f60995b8ba7823153778869d0c2dc58 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Expose the plugins meta data in the plugin loaderLars Knoll2012-06-052-0/+19
| | | | | | | | | add a metaData() method to QPluginLoader so that applications can query the plugins meta data without having to load the plugin. Change-Id: Ic3ebb35fd3c403926326e8dd1de4176b0c48dbef Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix QTemporaryFile::open() failing after remove().Mitch Curtis2012-06-051-1/+9
| | | | | | | | | | | | | If a QTemporaryFile is constructed using a template file path, the path is generated in QTemporaryFileEngine::open() and then filePathIsTemplate is set to false. If remove() and then open() are called on the same QTemporaryFile, the path is not regenerated. This change ensures that if the file path was generated, it will be generated again in the scenario above. Task-number: QTBUG-2557 Change-Id: I718ceb89daa9a9d46fdbe811fecc3d57d6dc08c2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make QString("inf").toFloat() return inf instead of zero.Mitch Curtis2012-06-051-2/+10
| | | | | | | | | | | Currently, QString::toFloat() returns 0 (and sets ok to false) if you try to convert "inf". This is because inf is greater than QT_MAX_FLOAT and there is currently no check to handle inf. Task-number: QTBUG-8629 Change-Id: I498daf4a7a6f880f928461fca628fcaf7d1d6d08 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Rename QVector::realloc and QVector::free.Jędrzej Nowacki2012-06-051-13/+13
| | | | | | | | These names were confusing and conflicting with standard C memory management functions. Change-Id: I6efe20665d2ec7ad3e00f3a806cc1843a57374d4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QProcess: Add accessors for program and arguments.Christian Kandeler2012-06-052-6/+30
| | | | | | | | Task-number: QTBUG-24550 Change-Id: I1ce26e584e39b0b58b1c9f78d8027b2479f2d92c Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add QDeferredDeleteEventBradley T. Hughes2012-06-054-12/+38
| | | | | | | | | | | Use this to store the loop-level counter needed by QCoreApplication when determining when it is safe to delete an object. This removes the hack to hijack the QEvent::d pointer (even though the pointer is unused). Change-Id: I91c0b1aa00235ec6e13feb30bf928e56d2f80026 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Allow 24:00:00 for ISO dates in QDateTime::fromString().Mitch Curtis2012-06-051-2/+10
| | | | | | | | | | | ISO 8601 section 4.2.3 states that "The end of one calendar day [24:00] coincides with [00:00] at the start of the next calendar day", so fromString() was updated to account for this. Task-number: QTBUG-25387 Change-Id: I391db0da755dbc822ba0820c302a2c10391e1f3b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Enter initial state before QStateMachine::started() is emittedKent Hansen2012-06-041-1/+3
| | | | | | | | | | | | | | | The documentation says that started() "is emitted when the state machine has entered its initial state", but the implementation didn't adhere to that. The consequence is that if you e.g. emitted a signal from a slot connected to started(), and that signal was used by a transition from the initial state, the signal would effectively get ignored and the state machine would remain in the initial state. Task-number: QTBUG-24307 Change-Id: Ibbeb627d517eaff821d88e256a949eacf6aae350 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Fix typos in QState sorting functionsKent Hansen2012-06-041-4/+4
| | | | | | | | | | | | | | A QObject can't be a child of itself, so the comparison always returned false. In practice, this was causing the entry/exit order of parallel states to be random. QObject::children() is documented to contain the children in the order in which they were added, so this fix actually achieves deterministic behavior. Task-number: QTBUG-25959 Change-Id: Id3f12d6bfbc249f1d4fed0bafb7d0217093e458e Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Fix endian detection for winceAndreas Holzammer2012-06-041-1/+1
| | | | | | | | | | | As the qsystemdetection.h is not included so Q_OS_WINCE is not defined here, so use the define from the mkspec. Change-Id: Ic170725d0da89f0c0e675c62bd2aa5c58803de9f Reviewed-by: Björn Breitmeyer <bjoern.breitmeyer@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Change testlib signal dumper hooks to use signal index rangeKent Hansen2012-06-042-8/+6
| | | | | | | | | | | | Another step towards getting rid of the class method offset computation in QMetaObject::activate(). Since QMetaObjectPrivate::signal() is private API, this also required adding a testlib dependency on core-private (and getting rid of the duplicated QSignalSpyCallbackSet struct). Change-Id: I0d830f35392a6b44fc321c5285877ec0bf437100 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Change QConnectionSenderSwitcher et al to use signal index rangeKent Hansen2012-06-032-6/+17
| | | | | | | | | | | | | First step towards getting rid of the signal_absolute_index variable from QMetaObject::activate() (which requires computation of the class's method offset). This also required changing the implementation of the public function senderSignalIndex() so it still returns an index in the full method range. Change-Id: I58571eb3c8099ea5b673682872c53875f5ea8c13 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Use QMetaObjectPrivate::signalOffset() where appropriateKent Hansen2012-06-031-19/+6
| | | | | | | | computeOffsets() was unnecessarily computing the method index, when only the signal index is needed. Change-Id: Id682d4447ba283a44cf0ea15cc47bd30edccb57b Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Pashto uses Arabic script and is written right to leftMike FABIAN2012-06-021-0/+1
| | | | | | | | | QLocale::textDirection() was missing Pashto as a right to left language. Change-Id: I1623abf711597a26f283a86708dc756696790b7d Reviewed-by: Lars Knoll Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Simplify the QObject::dumpObjectInfo() implementationKent Hansen2012-06-011-14/+1
| | | | | | | Use the new signal index-based API. Change-Id: If44e02e71b718bca5c18c486ca9ab95f836cd0f1 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Simplify connectSlotsByName() implementationKent Hansen2012-06-011-8/+3
| | | | | | | Use the new signal index-based API. Change-Id: I89263f5366726ef8213e45e5ab6575ebd6eab04a Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Add private API for working with meta-methods in signal index rangeKent Hansen2012-06-013-17/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Internally, QObject and QMetaObject already leave out non-signal methods when working with signals. This is possible because the signals always come before other types of meta-method in the meta-object data. Ignoring irrelevant methods is faster and can save memory. QMetaObject provides internal indexed-based connect() and disconnect() functions. However, these functions currently take an absolute method index as the signal specifier, instead of an absolute _signal_ index. Hence, QMetaObject and friends must convert from the method index range to the signal index range. By providing an API that only considers signal indices, clients of the index-based QMetaObject::connect()/disconnect() can provide the proper signal index directly. Similarly, for the qtdeclarative integration (QDeclarativeData hooks) the signal index can be passed directly. This will eliminate most of the conversions back and forth between signal index and method index, and some other redundant work done by qtdeclarative's custom connection implementation. There are some places where the behavior can't be changed; for example, QObject::senderSignalIndex() will still need to return an index in the method range, since that function is public API. Changing QMetaObject::connect()/disconnect() to take an index in the signal range will be done in a separate commit; this commit is only an enabler for porting existing usage of those functions to the new behavior. Change-Id: Icb475b6bbdccc74b4e7ee5bf72b944b47159cebd Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Socket FD are now of type qintptr.Jonas M. Gastal2012-06-012-2/+2
| | | | | | | | | | This should've been done together with the bulk of other changes in: bdce61002255b5f8b3213e93175cefdfebfde2cc and bf7f17060773803f332e8c729a70f47b94243890 Task-number: QTBUG-19004 Change-Id: I6d95a29140c1de5e6800812add9d7882511b909a Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Fix a bug in the case conversion codeLars Knoll2012-06-011-8/+4
| | | | | | | | | | | Chars that have a case conversion that converts them into several characters can't be handled by QChar::toUpper() etc and should get ignored. The code didn't do that correctly. Change-Id: I281d122e90bf49187b6449088d2fccef2ef75e86 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix the QVector build with C++11 initialiser listsThiago Macieira2012-06-012-5/+5
| | | | | | | | | | | | Initialiser lists were not tested before in the QVector rewrite, so the older malloc call was left behind. Also, std::initializer_list has const iterators returning const data and broke the build in a few places where const qualifiers were missing. Change-Id: I3c04e58361989aa7438621cda63c7df457d7dad8 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Make QVector compile with QT_STRICT_ITERATORS againThiago Macieira2012-06-012-86/+92
| | | | | | | | | | | | Move the iterator classes into QArrayTypedData and add constBegin() and constEnd() to that class. I also had to add an operator T*() to the strict iterators, since there are many places that expect the iterator to behave like a pointer (including in QVector itself). Change-Id: Icc5ed56ad47b013664a48eef9d31b5273aecb4e3 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Allow compare QLatin1String to QLatin1StringKonstantin Ritt2012-06-011-17/+17
| | | | | | | even if QT_NO_CAST_FROM_ASCII is defined. Change-Id: I8c4deceedb6f3e3cd5bdf72d6e9d189c509c9ff3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add missing QT_NO_CAST_FROM_ASCIIKonstantin Ritt2012-06-011-2/+2
| | | | | | | | | | | | to QLatin1String's compare operators that takes const char *s or QByteArray. Such comparison leads to a potential misuse since QByteArray could contain any arbitrary data in any arbitrary encoding and QLatin1String is used to only contain strings in UTF-8 - they are just a different beasts aimed for different purposes, and since QT_NO_CAST_*_ASCII disallow indirect conversions and require the user to know what he's doing, let's be consistent here too. Change-Id: I9bf5f326495157db8a6af064d6154961b7861a7e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Unconditionally enable Q_OF_ELF for any ELF platformPino Toscano2012-06-011-3/+1
| | | | | | | Just enable ELF stuff on any platform which uses ELF format, instead of a selected subsets of those. Change-Id: I0753c020c718bc67b4b50c3957fe8dc10afd2c61 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add clear() to QPointer for QWeakPointer compatibility.Stephen Kelly2012-06-012-0/+13
| | | | | Change-Id: I9efc162bf56775c7ebcff4e3b79a997edc4ceaeb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix some gcc warningsKonstantin Ritt2012-06-011-4/+4
| | | | | | | | | | | | These are: "enumeral and non-enumeral type in conditional expression", "comparison of unsigned expression >= 0 is always true", and "address requested for 't', which is declared 'register'" Change-Id: Ia9bab2e1e2c212a2889197e8dd5f7295dda9dadd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Get rid of MSVC compiler warnings from QVector codeFriedemann Kleint2012-06-011-2/+10
| | | | | | | Change-Id: I39b849721f3ba790c4a9197d69ac48e98cc2f5bd Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Remove debugging code from QVectorJędrzej Nowacki2012-06-011-9/+1
| | | | | | | It was depending on internals of Q_ASSERT Change-Id: I3dfc0ae0438135a30961f36808dbfc3e663a5538 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix crash in QStringBuilder when concatenating data-less QLatin1StringChris Adams2012-06-011-4/+8
| | | | | | | | | Previously, the append functions in QConcatenable in the QStringBuilder dereferenced the data() pointer of the argument QLatin1String without performing null check. Change-Id: I629f19fbce3113f1f80f4272fa7ae34e1dbc6bee Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Move implementation of QObject::senderSignalIndex() to QObjectPrivateKent Hansen2012-06-012-11/+20
| | | | | | | | In preparation of changing the implementation to return an index in the signals-only range, not all-methods range. Change-Id: Ib743a4bc9da27ad776ade262b215ebf988e7ab28 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Fix To-Do in qstatemachine (use QObject::senderSignalIndex())Kent Hansen2012-06-011-8/+2
| | | | | Change-Id: Id8a541878918f27a34595ff297d0f41b79275a96 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Remove the unnecessary comment about operator== not being necessaryThiago Macieira2012-05-312-9/+4
| | | | | | | | | | The mysterious comment was just suggesting that they weren't necessary. Turns out the comment is wrong: they are necessary for non-strict iterator modes. Task-number: QTBUG-25063 Change-Id: I20ada17035642ee656c431d6bf2152a5243cecdb Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Fix the confusion caused by the QT_ALWAYS_HAVE_xxx macrosThiago Macieira2012-05-313-6/+30
| | | | | | | | | | | | | | | | | | | | The QT_ALWAYS_HAVE_xxx macros are gone: they were hard to use and not defined properly. It indicated that the compiler was producing code that required that particular instruction set, so we could use it in our code unconditionally. Instead, let's use the GCC-style __SSE2__ and __ARM_NEON__. MSVC does not generate the __SSE2__ macro, so let's do it for the compiler. Also, define __AVX__ and the macros for the technologies leading to it when we manage to detect an /arch:AVX build (currently not possible, see note in the header). ICC and MSVC allow one to use the intrinsics anywhere, but for Qt all uses of the intrinsics are either in specially-built files, protected by runtime checks, or they are unconditional (qstring.cpp). So we only use the intrinsics when the compiler was instructed to generate code for that instruction set anyway. Change-Id: If8382f30422cee0e5831d051b003acf036824abf Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Overhaul the qsimd_p.h: rename macros and update conditionalsThiago Macieira2012-05-312-16/+37
| | | | | | | | | | | | | | | The QT_HAVE_xxx macros are replaced with QT_COMPILER_SUPPORTS_xxx. They indicate that the compiler supports those intrinsics, but not necessarily that they can be used right now. ICC and MSVC allow one to use the intrinsics anywhere, but for Qt all uses of the intrinsics are either in specially-built files, protected by runtime checks, or they are unconditional (qstring.cpp). So we only use the intrinsics when the compiler was instructed to generate code for that instruction set anyway. Change-Id: Ie58eebbc0518ad1d5420a85174fd84153bb9abaa Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* QtPrintSupport: Add CUPS printsupport pluginJohn Layt2012-05-311-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move CUPS code around to create a new CUPS printsupport plugin, this fixes QPrinterInfo for CUPS which depends on the plugin to work. It QT_NO_CUPS is defined then the plugin is not built and only Print to PDF is supported under Linux. * Move unused genericiunixprintersupport plugin to start new CUPS printsupport plugin * Split QPdfPrintEngine to create QCupsPrintEngine * Remove LPR related code from QPdfPrintEngine * Move CUPS specific code from plugin base class to derived CUPS class * Remove forcing CUPS print engine to use PDF mode as PDF is now Native * Move qt_getCupsPrinterPaperSizes from qprinterinfo_unix to QCUPSSupport * Remove qprinterinfo_unix as no longer used * Remove all QT_NO_LPR uses There is now no CUPS specific code left in printsupport/kernel except QCUPSSupport which is needed for the dialogs. Task-number: QTBUG-23060 Change-Id: Ie8fa4512a2424edc8943068e0fa9fb714cc42db9 Reviewed-by: Teemu Katajisto <teemu.katajisto@digia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: John Layt <jlayt@kde.org>
* Include qobject_p.h from qmetaobject_p.hKent Hansen2012-05-311-0/+3
| | | | | | | | Needed for QObjectPrivate::Connection. Since it's a nested class, it's not possible to merely forward declare it. Change-Id: Ie2ad1b3972df5433cdb49ee443f053ba2d613779 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Don't call metaObject() redundantlyKent Hansen2012-05-311-1/+1
| | | | | | | The desired meta-object is already stored in a local variable. Change-Id: I40c7840f07f5dbd67110e2f7d5bb618cbb269047 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Don't call metaObject()->method() redundantlyKent Hansen2012-05-311-1/+1
| | | | | | | The desired method is already stored in a local variable. Change-Id: Ibf0078813c7aebc83604b9c7ad9a8b6c596c5c65 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* remove QT_NO_SOUND and QT_NO_RASTERCALLBACKSTasuku Suzuki2012-05-312-20/+0
| | | | | | | These two defines are not used. Change-Id: Iec4ae95a8a2222d3c6e9f35b08954cf30aa15bda Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Implement QVector with QArrayData interface.Jędrzej Nowacki2012-05-303-257/+272
| | | | | Change-Id: I109f46892aed2f6024459812d24922b12358814d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTBF: fix the mandatory line breaks not being set in some casesKonstantin Ritt2012-05-301-4/+5
| | | | | | | | | e.g. for the text "Aaa bbb ccc.\r\nDdd eee fff." the \r\n wasn't treated as a hard line break or as a line break opportunity, ever. Quite ancient bug... Change-Id: I8d8497c55a3a4d51c27de99ccfe1e31f3bf4de77 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Introduce QUnicodeToolsKonstantin Ritt2012-05-304-27/+49
| | | | | | | | | | | | | Add QUnicodeTools namespace and rename qGetCharAttributes to initCharAttributes; Make it possible to disable tailoring globally by overriding qt_initcharattributes_default_algorithm_only value (useful for i.e. running the specification conformance tests); This is mostly a preparation step for the upcoming patches. Change-Id: I783879fd17b63b52d7983e25dad5b820f0515e7f Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove unnecessary forward declaration in std namespaceBradley T. Hughes2012-05-291-6/+0
| | | | | | | | | qiterator.h doesn't use std::bidirectional_iterator_tag or std::random_access_iterator_tag, so remove the forward declarations. (These actually confuse clang when building with C++11 support enabled). Change-Id: Idd0daa0840a0995e6e5b0ffc01ddcdf06f048149 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtCore: remove \link usagesGiuseppe D'Angelo2012-05-2921-60/+91
| | | | | Change-Id: I0de764b51a972de0b6eb2bf3c04d2b190f581f52 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* QMutex: de-inline lock(), unlock(), and tryLock()Bradley T. Hughes2012-05-292-7/+23
| | | | | | | | | | | | | | See the discussion of this topic on the mailing list: http://lists.qt-project.org/pipermail/development/2012-May/003943.html The consensus is to not have these methods have inline code to actually acquire the lock (i.e. no atomic test-and-set or similar). QBasicMutex is unchanged, and continues to have inlined lock(), tryLock(), and unlock(). QMutexLocker has been changed to always call QMutex::lock() (even though the constructor takes a QBasicMutex parameter). Change-Id: Ic7d2d9d581e6b254c84fdfdd8ce6c425535a8078 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Replace QVariant::typeToName usage by QMetaType::typeName call.Jędrzej Nowacki2012-05-281-1/+1
| | | | | | | | | Type information is kept in QMetaType class. QVariant is delegating operations, so it is better to use QMetaType directly. Change-Id: I91209fa1c9dc4303d6bd47c96824d3cd64ce5291 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Clarify QByteArray::size() documentation.Mitch Curtis2012-05-262-1/+25
| | | | | | | QTBUG-25438 Change-Id: I8cf9bfb295195548b6f7d4410682e4d675181a65 Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
* Itemviews: compile with QT_STRICT_ITERATORSThiago Macieira2012-05-261-1/+1
| | | | | | | Just a few mixed up iterators. Change-Id: I19f62457ee24bc844fadd182ba61866e259e9636 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>