summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
Commit message (Collapse)AuthorAgeFilesLines
* Doc: Add \inmodule QtCore to all QtCore class doc bodiesThiago Macieira2012-08-2323-4/+29
| | | | | Change-Id: I19100755c97cc155c76a859e19940e9f9222d34e Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Fix decoding of QByteArray in the deprecated "encoded" setters in QUrlThiago Macieira2012-08-205-14/+78
| | | | | | | | | | | | | | The asymmetry is intentional: the getters can use toLatin1() because the called functions, with a QUrl::FullyEncoded parameter, return ASCII only. This gives a small performance improvement over the need to run the UTF-8 encoder. However, the data passed to setters could contain non-ASCII binary data, in addition to the percent-encoded data. We can't use fromUtf8 because it's binary and we can't use toPercentEncoded because it already encoded. Change-Id: I5ecdb49be5af51ac86fd9764eb3a6aa96385f512 Reviewed-by: David Faure <faure@kde.org>
* tst_qurlinternal: use qurl_p.h instead of declaring the functionsThiago Macieira2012-08-201-1/+1
| | | | | | | | Just in case someone (like me) changes the function signatures or adds new functions. Change-Id: I1025fea012d95ffe89acaf799aa58fd2b0babc80 Reviewed-by: David Faure <faure@kde.org>
* Add Q_DECL_NOTHROW to some qHash functionsThiago Macieira2012-08-202-2/+2
| | | | | | | | | | | | The hashing functions for QDateTime and QHostAddress did not get the noexcept keyword because they might allocate memory. QDateTime doesn't do it now, but it could in the future. QHostAddress does allocate memory today. Change-Id: Ia5f80942944bfc2b8c405306c467bfd88ef0e48c Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Misc documentation fixes triggered by qdoc errors/warningsShawn Rutledge2012-08-201-5/+4
| | | | | Change-Id: I6ca3b138114fe957a09e8ec2f22273865635fc8b Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Speed up sorting of dir entries when sorted by dateRobin Burchell2012-08-201-2/+13
| | | | | | | | | | | | | | | | | | | | | | QDateTime will attempt to convert unknown types of date to UTC time, which isn't exactly a fast process. As we don't care about local timezones in the process of sorting (as this is purely for ordering, not display to the end user), we can force the dates to use UTC time, avoiding the unnecessary local timezone lookup. This also adds a benchmark covering this case. Benchmark results, Qt 5: - before: 11, 489ms - after: 273ms Qt 4.8: - before: 20, 848ms - after: 278ms Change-Id: I87fa6260e820b5b172d3306ff395dafe767c33ff Reported-by: Thomas Perl <m@thp.io> Reviewed-by: Alberto Mardegan <mardy@users.sourceforge.net> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix a couple of qdoc errors.Lars Knoll2012-08-201-1/+2
| | | | | Change-Id: I0770fc61e265face4fa061be9e110814effee181 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Modernise, update and fix errors in the QUrl documentationThiago Macieira2012-08-181-44/+65
| | | | | | | | | | | | | | Update the documentation of the deprecated API to match the current behaviour. Notably, the current behaviour is to check the correctness of the percent-encoding even in the "encoded" functions. Also, the use of QUrlQuery makes the matching work on canonical forms, so "%73earch" does match "search". Elsewhere, make sure we do not refer to the deprecated API in the documentation of non-deprecated functions. Change-Id: If3505ac3c6121177ad6ab18199e143775bef44b9 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Bring back the documentation on QUrl deprecated methodsThiago Macieira2012-08-181-0/+433
| | | | | | | | | | | | | | | | The deprecated query methods were removed along with their documentation in commit 1c2144c39fa0069bf496e8f77389a9c2f8a31acf, so restore it from before that commit. The rest of the encoded methods were removed along with their documentation in commit 1372d60bde04a31c8036601076d1093a67c6bd46. Restore their documentation from the previous commit to that one. All the documentation from this commit is brought back unchanged, except for the addition of \deprecated. Change-Id: I1851b0dc922c681e1623359b35dfd0f505d258d2 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix a couple of qdoc errorsLars Knoll2012-08-183-3/+3
| | | | | Change-Id: I79f689e08ed4a496052529af38fca72c3d4e04cb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix qdoc erros in qfile and related classesLars Knoll2012-08-185-9/+8
| | | | | Change-Id: I56b66e6eeb06c84e1157a701a814aebb1ddf4845 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make the "\internal" qdoc command stand on its own lineLaszlo Papp2012-08-156-35/+70
| | | | | | | | | | The qdoc manual currently claims that the command must stand on its own line. The change follows the consistency with the rest and how the example looks like inside the qdoc manual for this command. Change-Id: I6b653dc95cf9d84e4adf32220dace5d313678419 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Document QFile::open() argument "handleFlags"Jeremy Katz2012-08-141-0/+2
| | | | | Change-Id: I5ef909b21ddd4782062dd4ebd0ea7bca33f3387f Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Remove code duplication in QStandardPaths implementationsDavid Faure2012-08-096-68/+20
| | | | | | | | Using the new getter to access the "test mode" setting. Change-Id: Id26a350cd3fab4bf2e5f58ba67bc7323f99c9cc3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Add bool QStandardPaths::isTestModeEnabled()David Faure2012-08-097-0/+35
| | | | | | | | | Library code might need to know this, e.g. when calling an external process, to give it the right configuration. (For instance when ksycoca code calls kbuildsycoca to recreate the DB at the right place). Change-Id: I343ddefff816586f9d391973c08ff1e1ad86bf0e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QUrl::idnWhiteList(): add QList::reserve() callMarc Mutz2012-08-071-2/+4
| | | | | | | | Avoids reallocation. Change-Id: I3238574590463596a797d237b066ef60214392a7 Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtNoDebug: remove special member functionsMarc Mutz2012-08-071-3/+0
| | | | | | | | These are better generated by the compiler. Change-Id: I5afa9fd17997c220622ed0e5990c33e52700840f Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* ifdef drivespec handling in relativeFilePath to windowsOswald Buddenhagen2012-08-071-9/+4
| | | | | | | on unix, the code wouldn't do anything except burning cycles anyway. Change-Id: I1c28b1a7014af93ca70a17e0bd669debad8003c2 Reviewed-by: Joerg Bornemann <joerg.bornemann@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>
* 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>
* 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>
* 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>
* 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 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>
* Fix several QUrl qdoc errorsJeremy Katz2012-07-261-6/+11
| | | | | Change-Id: I2b89751ed2ec54f3b992c5fc4b39539d521c3404 Reviewed-by: Casper van Donderen <casper.vandonderen@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>
* 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>
* QtWidgets: use nullary version of qRegisterMetaType<T>("T")Marc Mutz2012-07-251-0/+4
| | | | | | | | | | | | | | | | | | | Using qRegisterMetaType<T>() has the advantage that multiple calls during a program run are much more efficient, since an inlined atomic is used to store the result. It also ensures that Q_DECLARE_METATYPE(T) has been used, whereas qRegisterMetaType<T>("T") will happily register anything. Had to add Q_DECLARE_METATYPE to QFileInfo, for QList<QPair<QString,QFileInfo>> of QFileSystemModel to work with the partial specialisations of Q_DECLARE_METATYPE for QList, QPair. In order to synchronize this change with other modules that did their own Q_DECLARE_METATYPE(QFileInfo), a sync macro is defined that can be tested in other modules, and will later be removed again. Change-Id: I3004664e07e64cd885d5a03a57ff4e4379804aec Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Doc: Fix QUrl::isLocalFile documentationSergio Ahumada2012-07-201-1/+1
| | | | | | | | | | This function was introduced in 4.7 by a2f797b52c4274a62a7cf1f0939aca1429afe211 but then reverted by 98e935eed5549e479f6666680aed1711dc42111c Task-number: QTBUG-21293 Change-Id: I6ec9c6696e5c85e44774184010eb9135ef7f3365 Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Windows: Do not return short path names for QDir::tempPath().Friedemann Kleint2012-07-171-1/+11
| | | | | | | | WinAPI GetTempPath() sometimes returns short names for C:/Users/<user>/AppData/Local/Temp. Change-Id: I33f991acc06e652ccd484d36a5a384eb776f8395 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Remove Qt3Support enums for q{dir,filedevice,settings,variant} in docsJeremy Katz2012-07-173-8/+0
| | | | | | Change-Id: I07942447bb756561e5c502c9a0c03b6aaf8133d1 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Fix some spelling errorsSergio Ahumada2012-07-111-1/+1
| | | | | | Change-Id: I19d3b2e9a5180b13deb828b55195404ef20be295 Reviewed-by: Daniel Teske <daniel.teske@nokia.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QNX: fix linking by implementing QStandardPaths::enableTestMode()Marc Mutz2012-07-111-3/+20
| | | | | | | Change-Id: Ia223ff598d816dd6420437a9a58be26da55d7c07 Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com> Reviewed-by: David Faure <faure@kde.org>
* Q_DECLARE_SHARED: mark the type movableMarc Mutz2012-07-103-3/+1
| | | | | | | | | | All implicitly shared classes are by definition movable, so this patch adds Q_DECLARE_TYPEINFO(Type, Q_MOVABLE_TYPE) to Q_DECLARE_SHARED. Change-Id: Idf8989ae1a7ed6d1ac13fccb7eaef7395a875350 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QtCore: mark some classes as sharedMarc Mutz2012-07-103-0/+5
| | | | | Change-Id: I811d3eebd87c230883cc579c20f9fa4e14ff9521 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtCore: add member-swap to shared classesMarc Mutz2012-07-039-0/+50
| | | | | | | | | | Implemented as in other shared classes (e.g. QPen). Special case: QUrlQuery: document existing swap(). Change-Id: I4b36cc9577fbf2232d4b2a2d8822d26e41e22cad Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move the QDataStream operator<< for QPair to qdatastream.hThiago Macieira2012-06-281-1/+17
| | | | | | | | | | QPair is small and is no problem to include from qdatastream.h. However, including QDataStream from qpair.h means including QIODevice and QObject too. Change-Id: I344321e9f68438008ec329a165135c3a346c6058 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Include QScopedPointer in qsettings.hThiago Macieira2012-06-281-0/+1
| | | | | | | | qobject.h includes it, but only if QT_NO_QOBJECT isn't defined. It is during the build of the bootstrapped tools. Change-Id: I8fc921fb17c283358af263a6932b763a21209d40 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Add \since 5.0 to QDir::removeRecursivelyShane Kearns2012-06-271-0/+1
| | | | | Change-Id: I2392f26e666d5e01e71932f1afa48a65704f6d48 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* 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>
* 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>
* 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>
* 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>
* Make qurlinfo private, now that QFtp is private.David Faure2012-06-141-2/+0
| | | | | | Change-Id: I0bb641b397b7087c89009f92d9973e0922dce653 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>