summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Fix QIODevice warning when running rcc.Mitch Curtis2012-06-261-10/+10
| | | | | | | | | | | | | | | | | | When opening a QFile on stdout, for example, we must not call seek as it is a sequential device. This has been flagged as a warning since commit Ie3a96d3a and has resulted in spurious warnings being emitted. In the case of opening a QFile in Append mode, QIODevice::open already sets the position marker, so calling seek is redundant. This is also true for the file engine's open function (called through openExternalFile()), which also ensures the handle or descriptor is repositioned appropriately. Task-number: QTBUG-26104 Change-Id: I71040c399efe54e7538f54433368b432e959e08d Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* QIODevice: free memory when buffer is clearedMartin Petersson2012-06-262-5/+9
| | | | | | | | | | | | | | | The QIODevicePrivateLinearBuffer does not deallocate any data on readAll or clear. This fix will change the buffer so that data is deallocated on clear, readAll and when read emptied the buffer. This is needed for QAbstractSockets that don't have readBufferMaxSize set, as the buffer will grow but never decrease in size when you read from it. Change-Id: Iab42e40182f9ebe0739c99b2d1e820ce287dc931 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* QAbstractSocket: Enable readNotifier on read from bufferMartin Petersson2012-06-263-1/+19
| | | | | | | | | | | | | | This is needed for the QSslSocket. When we read on that socket we will only read from the QIODevice buffer to get the unencrypted data. So when the readNotifier has been turned off on the plainsocket there is nothing to trigger it to be turned on again. This will add a readData with zero size when we have read everything from the buffer. This is so that we get a call into the socket to check if the readNotifier should be turned on again. Change-Id: I3b63e33de007db823e964480903186eb1b8caac2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTBUG-26035: Remove positive sign from start of stringTarja Sundqvist2012-06-261-1/+1
| | | | | | | | | | | | Updated removeGroupSeparators(QLocalePrivate::CharBuff *num) so that it removes also positive sign ('+') at the start of the string. Auto test included. Task-number: QTBUG-26035 Change-Id: I8e0e071d6c682d9192a8c6bb2f282510e21b3c48 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
* Small documentation fix about the text streams default encoding.Lars Knoll2012-06-251-2/+2
| | | | | | | | It's UTF-8, not Latin1 on most systems nowadays. Only Windows still living in the past... Change-Id: I70f1bd7a49bed6dcc8e39bbc0f0613475791afdb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove the font codecsLars Knoll2012-06-2512-902/+2
| | | | | | | | These codecs have only been used for XLFD based fonts. These are not supported anymore by Qt 5. Change-Id: I7dc083f2efcd42363b144b24bd62c169d83390cf Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* The codecForTr() should be utf8Lars Knoll2012-06-251-1/+1
| | | | | | | | tr() assumes utf8 as input encoding, not latin1. Change-Id: If834f8c169bdb431d78713d14b03542d3a7ca8e4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix docs mentioning Q_EXPORT_PLUGIN2Lars Knoll2012-06-251-1/+1
| | | | | | | | Fix all remaining places where Q_EXPORT_PLUGIN2 was being used in the documentation. Change-Id: I7be67b83c18545d0e74f250b4b26583444b01909 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Ensure that no extra bits can leak into QUrl::toEncoded.Thiago Macieira2012-06-241-1/+1
| | | | | | | | | | Technically, this function should take QUrl::UrlFormattingOptions, but that doesn't exist. So we just mask out the high bits that determine the encoding options. toEncoded only supports one encoding way: fully encoded. Change-Id: I1445ad7c292500921ec2672be4524d7d76a39f98 Reviewed-by: David Faure <faure@kde.org>
* Wrap QObject usage in qsharedpointer_impl.h with ifndef QT_NO_QOBJECTThiago Macieira2012-06-241-0/+2
| | | | | | | | Otherwise, bootstrapped tools like qmake and moc won't compile, unless QObject is forward-declared (which it isn't anymore). Change-Id: If67ca1cd8fdb7b29628f9dc4b454595d26a715d0 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Don't operate on bogus data, assert on preconditions insteadJoão Abecasis2012-06-231-5/+6
| | | | | | | | | | | | | | | | | | | | | | QVector::erase shouldn't try to make sense of iterators it doesn't own, so the validation being done here is bogus and dangerous. Instead, it's preferrable to assert, the user needs to ensure proper ownership. The case of erasing an empty sequence is not checked for preconditions to allow QVector v; v.erase(v.begin(), v.end()); , while being stricter on other uses. Autotests were using ill-formed calls to the single argument erase() function on an empty vector and were fixed. This function erases exactly one element, the one pointed to by abegin and require the element exist and be valid. Change-Id: I5f1a6d0d8da072eae0c73a3012620c4ce1065cf0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Forward-port change to QT4_ADD_RESOURCES macro for missing rcc files.Stephen Kelly2012-06-231-16/+24
| | | | | | | | Forward-port of commit 9ce67d30011db4528d3d0bbee36412e13cfb80cc in cmake.git. Change-Id: I2d6c14f68f1630fc0835b3103e5058f52c2d0d13 Reviewed-by: David Faure <faure@kde.org>
* QUnicodeTables: some internal API renamingsKonstantin Ritt2012-06-223-81/+81
| | | | | | | | | | | | enums GraphemeBreak, WordBreak, and SentenceBreak has been renamed to GraphemeBreakClass, WordBreakClass, and SentenceBreakClass respectively, their values has been renamed to contain a '_' as logical enum-value separator (just like many other nums in Qt, e.g. LineBreakClass); *BreakFormat has been replaced with *Break_Extend (some format characters are kind of subtype of the extender characters, not vice versa). Change-Id: I9ddbcf8848da87409736c2d6d1798a62fa28cab8 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Clean-up the Unicode tables generator code and the generated headerKonstantin Ritt2012-06-221-204/+200
| | | | | | | | | | | | This fixes the blocks and memory consumption reports, the whitespace issues and makes the code a bit cleaner. Since I'm the only one who does change this code, such a no-op commit could not hurt anyone or even git blame ;) Change-Id: Ib069f925a3791c82e16c368c8392bcffbfd68c53 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Fixes high CPU usage on timer expiration when using glib event loop.Daniel Thor Kristjansson2012-06-211-1/+1
| | | | | | | | | | | GTimerSource has 1ms accuracy, QTimerInfoList::timerWait() has 1us accuracy. So when there is less than 1 ms left on the timer we enter a tight loop checking for timer expiration since we don't round up the timerWait() timer to the nearest millisecond. Task-number: QTBUG-7618 Change-Id: I684c9236324f598bc69c6810be270aa47c791f91 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update the docs about setRoleNames deprecation.Stephen Kelly2012-06-211-0/+2
| | | | | | Change-Id: I5aff626979238014d34cba1d383051cd4b048499 Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Doc: tmake -> qmake, it's about timeDaniel Molkentin2012-06-211-8/+8
| | | | | | | | | Pushing this before 5.0 since it will most certainly trigger a major recompile, which is probably why this has never been changed. Change-Id: I5fd90537d3b754d0a8a1b522d66183513693e0af Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Record if a metatype is a smart pointer to a QObject derived.Stephen Kelly2012-06-202-4/+46
| | | | | | | | | | | | 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-203-1/+47
| | | | | | | | | | | | | 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>
* Make QUuid compile with QT_NO_QUUID_STRING without breaking QDebug <<Jeremy Katz2012-06-201-1/+6
| | | | | | | | | | | | | | Change I0cbb0581a1c3abefdde75b7cd45fdafd31640f0d breaks the use of operator<< for QDebug, which shows up when trying to link QtCore in the small qconfig. Instead, render QUuid as "QUuid(QT_NO_QUUID_STRING)". Task-number: QTBUG-24816 Change-Id: Ia52283d7461a9907bcec7a110e41c9f830895efe Reviewed-by: Tasuku Suzuki <tasuku.suzuki@nokia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* define QT_NO_ICONV if QT_NO_TEXTCODECJeremy Katz2012-06-203-10/+29
| | | | | | | | | | | | This also updates qfeatures.h with various other things that have been neglected. Run $QTSRCDIR/util/scripts/make_qfeatures_dot_h after changing qfeatures.txt Task-number: QTBUG-24816 Change-Id: I18b71fcec71efa9cfe3425fb1a7833456ec411b9 Reviewed-by: Tasuku Suzuki <tasuku.suzuki@nokia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Make QVariant compile with QT_NO_QUUID_STRINGJeremy Katz2012-06-201-0/+4
| | | | | | | | Task-number: QTBUG-24816 Change-Id: I76e6a6bcf1a2381e14f400648e3cb8ba554772a6 Reviewed-by: Tasuku Suzuki <tasuku.suzuki@nokia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Merge "Merge branch 'buildsystem'" into refs/staging/masterOswald Buddenhagen2012-06-203-16/+87
|\
| * fix misnomer: qt_module.prf => qt_build_config.prfOswald Buddenhagen2012-06-191-1/+1
| | | | | | | | | | | | qt_module suggests to be congruent to qt_plugin. Change-Id: I629530bcbe2ba6c0adbdc11a275119c8aff0c953
| * automatically add QT_BUILD_FOO_LIB to DEFINESOswald Buddenhagen2012-06-191-1/+1
| | | | | | | | | | Change-Id: I35d9861e48469eb5cc8824e361450684047e6559 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
| * clean up projects from QPRO_PWD nonsense, etc.Oswald Buddenhagen2012-06-191-1/+0
| | | | | | | | | | Change-Id: I4c41aedf5bfb37e31ad202cacd2312b0bdb168e2 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
| * move QMAKE_PKGCONFIG_VARIABLES stuff out of qt_module_config.prfOswald Buddenhagen2012-06-191-1/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | this only needs to be set in one module each - the one which provides the relevant tool. this is moderately source-incompatible, in that a package which queries a given variable from the wrong library won't get the path it looks for any more. as it's likely that everyone was using QtCore as a reference anyway, this will only affect uic - which is in the new QtWidgets library, to which people need to adjust anyway. Change-Id: If05d3c33fda6cd12466e261391b825c59651d3e4 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
| * auto-generate module prisOswald Buddenhagen2012-06-191-1/+1
| | | | | | | | | | Change-Id: I654428771034221ccf424be34d5d9c7764daf3b4 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
| * automatically add the version header to HEADERSOswald Buddenhagen2012-06-191-2/+0
| | | | | | | | | | Change-Id: I7c2e1d852ebdbc5cca7a3a31ab2b4c9ab9faffd9 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
| * make qt_module_config.prf install the module pri fileOswald Buddenhagen2012-06-191-1/+1
| | | | | | | | | | | | | | | | | | absorb module.prf into qt_installs.prf, as that's where it belongs. add qt_install_module option and automatically set it in qt_module_config. make qt_installs use that option. Change-Id: I860616f3a29a456f7b88ddaffa09375400c8911e Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
| * introduce /get property variantsOswald Buddenhagen2012-06-192-9/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | properties are now split into a write location $$[FOO] and a read location $$[FOO/get]. the write locations are hard-coded and configurable via qt.conf/Paths as before, while the read locations are configured via qt.conf/EffectivePaths. this finally provides a clean solution to the problem that during the qt build itself tools and libraries need to be taken from somewhere else than they are installed to. Change-Id: I956c43bd082afd465e690fe75d0bee3c2c0f7c25 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
| * move moc, rcc and uic CONFIG additions to the respective qt modulesOswald Buddenhagen2012-06-191-1/+1
| | | | | | | | | | | | | | they don't belong into the global scope Change-Id: I27a3de5f706392b3c4a84035521bc3b4e4055740 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
| * clean up path normalization in configure.exe and QLibraryInfoOswald Buddenhagen2012-06-191-0/+2
| | | | | | | | | | | | | | | | | | always use normalized path separators, except when running native commands or printing (note however that the qmake -query output will now be consistently normalized). Change-Id: I6ae920c3bc656cb517d1f4e4e5518cf79e002169 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* | Make QDateTime::fromString()/Time::fromString() adhere to ISO 8601.Mitch Curtis2012-06-201-39/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently QDateTime::fromString and QTime::fromString do not correctly handle fractional minutes and, in some cases, fractional seconds. In the case of reading fractional minutes, it has been decided to ignore invalid characters outside of the 5 character portion that we're interested in (see code comments in fromStringImpl() for info on why we read 5 digits). The motive is that there is a performance penalty for calling mid to get the portion of surplus string and also for converting to it to a float. This is also in line with what QDate does with surplus characters, for example. Task-number: QTBUG-14418 Task-number: QTBUG-25387 Change-Id: Ib742fe80686aff3c3770b995678cf838fb4e3bb4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Add leading zeros to years below 1000 in QDate::toString().Mitch Curtis2012-06-201-1/+2
| | | | | | | | | | | | | | | | | | QDate::toString(Qt::ISODate) lacks prefixed 0's on years below 1000. The ISO 8601 standard dictates that this should be the case. Task-number: QTBUG-16476 Change-Id: I7e73152bba0f5894bcbaa3f4418732b74ce86bc5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Use the POSITION_INDEPENDENT_CODE property on targets using Qt.Stephen Kelly2012-06-202-10/+19
| | | | | | | | | | | | | | | | | | This property is only set if Qt is configured with -reduce-relocations (which is the default). Change-Id: If2f0ab92448f03bbc3f7c828d3bca60107229072 Reviewed-by: Brad King <brad.king@kitware.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* | QUrl::setEncodedQueryItems should replaceMartin Petersson2012-06-201-1/+1
| | | | | | | | | | | | | | | | | | If there is already a query string present in the url. It should be replace when setEncodedQueryItems is called again. Task-number: QTBUG-26148 Change-Id: I2bd4e1f5d9b4161d64556062e97141888ad89b3b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QMetaMethod::invoke: Use normalizedType() to normalize return typeKent Hansen2012-06-201-14/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The code was probably written before QMetaObject::normalizedType() was introduced. The behavior is covered by the existing tests tst_QMetaObject::invokeMetaMember and tst_QMetaObject::invokeBlockingQueuedMetaMember. Change-Id: Ib1c3b3e4dff37947defd1dfdcc860df44539aa3a Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | Fix compile-time error macro when building with -fPIEGabor Ballabas2012-06-201-1/+1
| | | | | | | | | | | | | | | | This macro causes a compile-time error using LLVM with Clang when the target that includes qglobal.h is built with -fPIE. Change-Id: I2e82e1a8feed9009c814f187b06501b26ea3b3b7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Fix access to uninitialized pointerTobias Hunger2012-06-201-1/+1
| | | | | | | | | | | | | | | | | | | | The C++ standard says in 9.4..2 that the object expression is evaluated, so any compliant compiler may access d. So this syntax is a bug in this place. Change-Id: I37d2c4ea54febd40410ca473c906bcb1c66c4974 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* | Add qMove macro to support std::moveOlivier Goffart2012-06-202-0/+14
|/ | | | | Change-Id: I373e07f479c11b172dab35ed7e5b62724aa50a1a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QEvent: Don't give DeferredDelete special treatmentBradley T. Hughes2012-06-191-12/+8
| | | | | | | | | | After commit 9b07fd0d5cae6846f0eaccf3dc51bc9e78559a05, Qt no longer keeps the loop-level in QEvent's d-pointer. This means we no longer need to special case this event type in the QEvent copy constructor, assignment operator, and destructor. Change-Id: Iff71713d38303674f4517fdfa169cc448ed41dd4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make QUuid compile with QT_NO_QUUID_STRINGJeremy Katz2012-06-181-1/+1
| | | | | | | Task-number: QTBUG-24816 Change-Id: I0cbb0581a1c3abefdde75b7cd45fdafd31640f0d Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Improve the code generation by using Q_LIKELY/Q_UNLIKELYKonstantin Ritt2012-06-161-36/+34
| | | | | | | + reorder conditions in getWordBreaks() to make further updates more clear Change-Id: I1ca9adde066c3a48830f310202f7181585fac194 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Add automatic metatype declaration for QPointer and QWeakPointer.Stephen Kelly2012-06-151-26/+34
| | | | | Change-Id: Ic9a04fa68d0bb14ef07455a6559e59f4b887f38b Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Forward-declare QLatin1String tooThiago Macieira2012-06-151-1/+1
| | | | | | | | | | | | qhash.h doesn't include qstring.h and was depending on an indirect inclusion (probably via qpair.h -> qdatastream.h -> qiodevice.h -> qobject.h -> qstring.h, which I've broken). Since it forward-declares QString and QStringRef, let's add QLatin1String too. Change-Id: I179ebb22f761b88423ef13643afa2e5ce91ef6a2 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Make qurlinfo private, now that QFtp is private.David Faure2012-06-143-14/+2
| | | | | | Change-Id: I0bb641b397b7087c89009f92d9973e0922dce653 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Extend JSON QStandardPaths to support multiple paths per locationJeremy Katz2012-06-141-32/+77
| | | | | | | | | | | | | | | | | Allow a location to be specified as an array of paths. LOCATION: ["first", "second"] The first value is selected for writableLocation(). Define the first entry as an empty string for no writable path. LOCATION: ["", "second"] A single path may be expressed as a string. LOCATION: "only" Change-Id: I897cf40a039ad7cb680bdf643bfa78020e8eb1cb Reviewed-by: Lincoln Ramsay <lincoln.ramsay@nokia.com> Reviewed-by: David Faure <faure@kde.org>
* Add since 5.0 markers to new QCryptographicHash enums/functionsAlbert Astals Cid2012-06-141-4/+5
| | | | | | Change-Id: If367d365510cc7f6bf8f87808f5843c4a41d13e1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* disable codecs for asian language when QT_NO_BIG_CODECS definedTasuku Suzuki2012-06-1425-60/+71
| | | | | Change-Id: I45025b13bacc5f63946b02a87c742beff1946c0b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>