summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
Commit message (Collapse)AuthorAgeFilesLines
* replace 'const QChar &' with 'QChar ' where appropriateKonstantin Ritt2012-02-211-2/+2
| | | | | | | | | 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>
* 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>
* QProcess documentation typo fix and improvement.Rafael Roquetto2012-02-171-4/+4
| | | | | | | | | The word 'momentaneously' does not exist. Change-Id: I3d2201d5b7b3a01af5989bb1c3fcd55110d5482c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Till Adam <till@kdab.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* No need to stat with QFile::exists before QFile::open, for reading.David Faure2012-02-171-1/+1
| | | | | | Change-Id: I14ca7f8a377bca39004defc96d69d62c151181f5 Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Jeremy Katz <jeremy.katz@nokia.com>
* QStandardPaths implementation configured using JSONJeremy Katz2012-02-172-0/+186
| | | | | | | | | | | | | | | | | | The default JSON file is /etc/user-dirs.json, but may be overridden by setting PATH_CONFIG_HOME to the file to be used. This provides functionality similar to the XDG based QStandardPaths, but uses a JSON file to define paths, rather than the XDG A=B format. Values other than HomeLocation and TempLocation may be specified by removing the "Location" postfix, converting to upper case, and separating words with _. Values are independent. For example, CacheLocation does not depend on GenericCacheLocation. Variables specified as ${[^{]*} will be replaced with environment variables. Change-Id: I374f5e6bae498dbfa9cb4ecadf915b05fb91fc34 Reviewed-by: David Faure <faure@kde.org>
* Enables QProcess back on QNX.Rafael Roquetto2012-02-173-16/+160
| | | | | | | | | | Because fork()/vfork() on QNX are not supported on multithreaded applications, QProcess had been disabled on this platform. The corresponding code has now been replaced with functions that wrap around spawn(). Change-Id: I46091b7d41f322a5cad07d17893aa929c84941ef Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Some small doc fixes, typos and removal of one incorrect paragraphAndy Shaw2012-02-171-5/+0
| | | | | | | | | The QTextStream paragraph that is removed referred to something that is incorrect. This was confirmed for Windows, Linux and Mac. Change-Id: Ibac8f82482f2060308b5b8485d6da228bdf52fe6 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com> (cherry picked from commit 80cebfde10cf34dcc0777c24f1b3ff37cad20181)
* Drop QFile::fileEngineJoão Abecasis2012-02-165-51/+48
| | | | | | | | | | | | | | | The function was already marked as internal. By moving access to the underlying file engine to private API this supports the effort to completely drop file engines from public API. In the future, the goal is to completely drop the file-engine abstraction as it exists today. Change-Id: I332fa56e70c87e83c1e08bb9f75e04df7c93fec7 Reviewed-by: Jonas Gastal <jgastal@profusion.mobi> Reviewed-by: Anselmo L. S. Melo <anselmo.melo@openbossa.org> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Fixes QTemporaryDir compilation error under QNX.Rafael Roquetto2012-02-151-1/+1
| | | | | | | | Checking for Q_OS_QNX as well upon QFileSystemEngine inclusion. Change-Id: Ia0e0d7344abaae6dd6375528f0cc17dbefafe8d8 Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Add QFileInfo::isNativePathJoão Abecasis2012-02-142-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | This function returns true if the file path can be used directly with native APIs, modulo encoding and path separator conversions. This is important for applications that interface with other libraries or simply need to use native APIs together with Qt. Traditionally, this information was available in QAbstractFileEngine and forced users to explicitly create an engine or use internal API such as QFile::fileEngine to access the underlying engine and this piece of information. Given its usefulness, exposing the information in a more visible place is more appropriate. This reduces the need for people to know or care about implementation details, like file engines... The existing isLocalFs test was updated and repurposed to use the new API, instead of relying on file engines and internal implementation details of QFileInfo. Change-Id: I65f497bb25741f6f7ea4d2c3b3562c8c4aab8bea Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Use toDisplayString when debugging urls (no passwords in logs)David Faure2012-02-121-1/+1
| | | | | | | Change-Id: I618027c5913438bf341864d07d4831f9e33633b6 Reviewed-by: Jonas Gastal <jgastal@profusion.mobi> Reviewed-by: Giuseppe D'Angelo <dangelog@gmail.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Add QUrl::toDisplayString(), which is toString() without password.David Faure2012-02-112-6/+22
| | | | | | | | | | | And fix documentation of toString() which said this was the method to use for displaying to humans, while this has never been true. Change-Id: Iff6df92e32b2517e1481d4992d80cae2d58da427 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Jonas Gastal <jgastal@profusion.mobi> Reviewed-by: Giuseppe D'Angelo <dangelog@gmail.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Initializes seqDumpPos on qiodevice.cppNick Ratelle2012-02-091-1/+2
| | | | | | | | | | | | | This was spotted by RIM static code checking team. seqDumpPos is a dummy variable which is only used on sequential mode. It is used as a simultaneous storage area of both pPos and pDevicePos when in sequential mode, to keep both in sync. They just suggested that it would be a good practice to initialize the variable, since it does not have any side effect, and there's not much value on not doing it. Change-Id: I8138729eb31df5779c91b368c2cfaecd39788f29 Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
* Various documentation fixes ported from 4.8Teemu Katajisto2012-02-091-0/+1
| | | | | | | | | | | | | | | | | | | Selected documentation fixes for qtbase from 4.8 commit 40fb4750910e23d3e7128ca8e0f1c5920b05bd5a Task-number: QTBUG-8625 Task-number: QTBUG-19808 Task-number: QTBUG-1231 Task-number: QTBUG-21073 Task-number: QTBUG-8939 Task-number: QTBUG-20399 Task-number: QTBUG-20944 Task-number: QTBUG-22095 Task-number: QTBUG-11278 Task-number: QTBUG-15653 Change-Id: Ia4f59fce7c85f04b6da953a3988f705d9d9a658a Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* realpath(X,0) IS supported on QNX.Nick Ratelle2012-02-081-1/+1
| | | | | | | | | Adds check for Q_OS_QNX to force QFileSystemEntry QFileSystemEngine::canonicalName() use realpath(X, 0) on QNX as well. Change-Id: Id0a32277e6d043753c42101c91a393ebedb48a0a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix compilation with -Werror -WshadowDavid Faure2012-02-081-4/+4
| | | | | Change-Id: I2ef8f288415820fa08e5bab8b99a00b1ad0f2988 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix QProcess compile for Windows CE.Andreas Holzammer2012-02-082-4/+6
| | | | | | | | There are no Pipes under Windows CE, so take out the pipereader. Change-Id: I3e6afd403ed36e86a8694674f6c4798f1226ff74 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Don't include qguifunctions_wince.h in QtCore.Andreas Holzammer2012-02-081-1/+0
| | | | | | | | | | qguifunctions_wince.h does not live anymore in QtCore, but instead in QtGui, so do not include them in QtCore. Change-Id: I22222ae7045ee0140924197ac583a3bf2e0f3d36 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Don't allow cd'ing to above root.Jonas Gastal2012-02-071-6/+15
| | | | | | | Task-number: QTBUG-23893 Change-Id: Ifc6e22f135a1f6bff7c0fa8bef3ea7e1042ae819 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: David Faure <david.faure@kdab.com>
* Use Q_OS_WINCE instead of Q_WS_WINCEAndreas Holzammer2012-02-071-1/+1
| | | | | | | | | Window system defines have been deprecated, so use Q_OS_WINCE instead. Change-Id: I52059d0f854fe783ac20610ab248800c3e1e827c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Use the QNX implementation of mkdtemp for win and wince.Andreas Holzammer2012-02-071-23/+14
| | | | | | | | | | There is no mktemp for Windows CE, nor mkdtemp. So use the implementation for QNX for Windows CE too, to simplify the implementation use it for windows too. Change-Id: Icddaf474a2d696752d8f9774fb4f033454e34e83 Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Inline information about FS case sensitivityJoão Abecasis2012-02-063-11/+8
| | | | | | | | | | | As far as Qt is concerned, this information is static and depends only on the platform. By moving the definition to the header we allow the information to be directly used by the compiler, forgoing the need to export the function to interested users. Change-Id: I43de585391d41204d3c3560ac6e65e5a88aee11c Reviewed-by: Jonas Gastal <jgastal@profusion.mobi> Reviewed-by: Shane Kearns <ext-shane.2.kearns@nokia.com>
* MinGW: Fix warnings.Friedemann Kleint2012-02-042-4/+4
| | | | | | | | - Special #define to access HB seems no longer necessary (it was causing about mismatching DLL import attributes). Change-Id: I57cc7d57b12a67c1d549b053db81e1f198f87786 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Build with QT_NO_CAST_FROM_BYTEARRAYStephen Kelly2012-02-021-2/+2
| | | | | Change-Id: Ibb79e372a3adf90c9f982f50ab711066063eff4a Reviewed-by: David Faure <faure@kde.org>
* Fix QTextStream and QDebug operator<< for QLatin1StringKent Hansen2012-02-023-1/+17
| | | | | | | | | QLatin1String now has a constructor that takes explicit length, which makes it possible to create a QLatin1String that isn't null-terminated. Made the QTextStream and QDebug << operators work in that case. Change-Id: I94d051ce2ebfb2d2a403b96d25e040c80a54bf7c Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Use QBasicMutex instead of Q_GLOBAL_STATIC QMutexOlivier Goffart2012-02-012-17/+14
| | | | | | | | | | | | | | QBasicMutex is a POD and can be used as a static global object. in qpicture.cpp factoryLoader is used only once, and under the mutex, so there is no need for Q_GLOBAL_STATIC for it, it can be a function static in qhostinfo_unix.cpp the code seemed wrong while compiled with namespace and QT_NO_GETADDRINFO. I also could get rid of one include because it was included earlier. Change-Id: I3c700203c3e067266c20733f4bda8031446dbb86 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Fix parsingMode not used anymore, detected by compiler warningDavid Faure2012-02-011-2/+3
| | | | | | | | This came from replacing d->parsingMode with parsingMode when moving the method to the Private class. Change-Id: I5a025ea1128dacda97d265d401a329dbbbfb0ff7 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Windows: Fix inclusion of <windows.h>Friedemann Kleint2012-02-019-29/+26
| | | | | | | | | | | | | - Always use <qt_windows.h> as the last file to be included. - Remove it from some headers, use Qt::HANDLE instead of HANDLE. - Clean up #ifdef, use Q_OS_WIN for Windows/Windows CE. - Add NOMINMAX to qt_windows.h to avoid problems with the min/max macros. - Remove <windows.h> from qplatformdefs.h (VS2005) Change-Id: Ic44e2cb3eafce38e1ad645c3bf85745439398e50 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* QtDebug: Include file, line, function informationKai Koehne2012-02-011-22/+5
| | | | | | | | | | | | | | Record the file, line, and function where a qDebug, qWarning, qCritical or qFatal call happens, and make this information available in a custom message handler. The patch uses the C preprocessor to replace qDebug, qWarning, ... with a line that also records the current file, line, and function. Custom message handlers can access this information via a new QMessageLogContext argument. Change-Id: I0a9b89c1d137e41775932d3b1a35da4ebf12d18d Reviewed-by: David Faure <faure@kde.org>
* QDir::NoDotAndDotDot is now QDir::NoDot|QDir::NoDotDot.Jonas M. Gastal2012-01-313-4/+1
| | | | | | Change-Id: I8ef7782258c2ec02ad2ec2a5d5cab90f53c62aa3 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Allow function types to be registered without workaroundsJoão Abecasis2012-01-311-6/+0
| | | | | | | | | | | | | | | | | Commit 4b8ceb41aed352f10d36db5284453f425dbc5f3f added the requirement that pointed-to types need to be registered when registering pointer types. Unfortunately, the implementation also affects function pointer types. This change whitelists 0, 1, 2 and 3 argument functions as not deriving from QObject, forgoing the need to workaround details of the type registration implementation when registering those function pointer types. Change-Id: I4d855e9d70a8179a6e31b84623ad5bf063e0d6d8 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* MinGW build fixes for QWindowsPipeReader and friendsJoerg Bornemann2012-01-313-3/+6
| | | | | Change-Id: Ie4d6017c6fb918e7796d1a5e8863e9368e4e1894 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* mkdtemp() support for QNX platformRafael Roquetto2012-01-311-0/+36
| | | | | | Change-Id: I30feebbbcdbe065e899a048da20ac887d4d48a4f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: David Faure <david.faure@kdab.com>
* Update contact address in license headers.Jason McDonald2012-01-312-2/+2
| | | | | Change-Id: I35bf916087511f26bfeb49ceb3256d9a20fbc1c0 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove Symbian specific code from QtCore.Xizhi Zhu2012-01-3022-742/+45
| | | | | Change-Id: I131303e28a12dccb96de3de4ca0073b389a9bbae Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Removing Qt5 note that would break SC.Jonas Gastal2012-01-301-2/+0
| | | | | | | | | | This would be a silent behaviour change and is not particularly needed. Change-Id: Iee1e48408e605d671dfe0402880df3c93a14a8c7 Reviewed-by: David Faure <faure@kde.org> Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-3094-94/+94
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fix BC break with QAbstractFileEngine "mount points"Shane Kearns2012-01-291-0/+5
| | | | | | | | | | | | | | | | | | File system cached metadata can't be trusted when custom file engines are in use, because the custom file engine may want to override the metadata. (e.g. present an archive file as a directory) Therefore, check if a file engine should be instantiated for each result in QDirIterator. This is a fast check if no custom file engines are registered. When pushing a directory (using QDirIterator::SubDirectories) the file engine needs to be instantiated also. Task-number: QTBUG-23688 Task-number: ou1cimx1#965023 Change-Id: I0114c8df6258535553783a2486131c4194926649 Reviewed-by: João Abecasis <joao.abecasis@nokia.com> (cherry picked from 3864ad09d578210b52e5f58fca2ee8a1144f5be2)
* QUrl: deprecate setEncodedUrl() and fromEncoded(), add url().David Faure2012-01-282-30/+48
| | | | | | | | | setEncodedUrl() isn't necessary anymore now that setUrl can handle encoded (and partially encoded) urls. url() is added for symmetry with setUrl(). Change-Id: I4e671482a5635a86797421ca50882db9cd60d852 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QUrl: use partially-decoded data in toString and QUrl(QString)David Faure2012-01-281-9/+34
| | | | | | | | | | | | | This fixes round-trip bugs. People expect to be able to do QUrl u(...); QString s = u.toString(); QUrl u2(s); and have u==u2. This was not true for paths containing a '#', for instance, which would be parsed back as a fragment. The solution is to make toString output partially decoded data (more readable than toEncoded, but not decoded to the point of changing the meaning, if parsing it back later as a QUrl), and to make the QUrl constructor work with partially decoded data. Change-Id: I013c01e8947d538435f3c20fc4ec57cd9ccbba6c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QProcess/Win: use asynchronous I/O for reading stdout and stderrJoerg Bornemann2012-01-265-59/+116
| | | | | | | | This saves us from using the 100 ms polling timer to read process output. Task-number: QTBUG-23012 Change-Id: I3f9398d7a4d30826d2d89ac04bd2fd031500ff57 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* QProcess/Win: use named pipes for redirecting standard I/OJoerg Bornemann2012-01-261-21/+51
| | | | | | | | Named pipes allow us to make use of overlapped I/O for redirected stdin, stdout and stderr. Change-Id: I50191b036bce696147139b200ddbc6c31c16112b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* QStandardPaths: remove unused includes (leftovers from qdesktopservices)David Faure2012-01-262-6/+0
| | | | | Change-Id: I6fe23ecd04adc7dd68573dd0d6d01888c0cf71b6 Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* QUrl: Implement a number of ## Qt5 TODOs (merging overloads)David Faure2012-01-262-84/+22
| | | | | Change-Id: I629c20f10e3667937d488ea30f93bf86f980ee1a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Cleanup mess in public type ids.Jędrzej Nowacki2012-01-252-2/+2
| | | | | | | | | | | | | | | | | | There is no reason to keep two separated core types sets. It couldn't be fixed before Qt5 because of binary compatibility promise. This patch merges QMetaType core types with ext core types. This "simple" operation consists of: - QDataStream version was incremented, because type ids are saved in QVariant's data stream. - QMetaType LastExtCoreType and FirstExtCoreType were replaced by LastCoreType, FirstCoreType and new QMetaType::HighestInternalId. - New tests checking QVariant data stream for Qt4 and for Qt5 versions were added. Change-Id: I02dd74d29317365c297a789a4eb7c9c5edc3b231 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Fixed fileiterator issue for WEC7.Janne Anttila2012-01-251-0/+2
| | | | | | | | | | | | | | WEC7 does not support FIND_FIRST_EX_LARGE_FETCH with FindFirstFileEx, but windowsVersion for WEC7 is still resolved as WV_WINDOWS7. If the FIND_FIRST_EX_LARGE_FETCH flag is passed to FindFirstFileEx in WEC7, the method does never find any files from given directory. Changed FIND_FIRST_EX_LARGE_FETCH flag to apply only when Q_OS_WINCE is not defined. Task-number: QTBUG-22503 Change-Id: Ic38cf745cda7ee7b23da67dc390ac0e6d04158cd Reviewed-by: Prasanth Ullattil <prasanth.ullattil@nokia.com>
* Remove use of QT_MODULE from libraryGunnar Sletta2012-01-2521-21/+0
| | | | | | | | | | These defines were there to aid in the commercial licensing scheme we used long ago, and are no longer needed. Keep a QT_MODULE(x) define so other modules continue compiling. Change-Id: I8fd76cd5270df8f14aee746b6cf32ebf7c23fec7 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Store the is-a QObject fact with the metatype declaration.Stephen Kelly2012-01-241-0/+7
| | | | | | | | | | | | | | This is a source incompatible change for Q_DECLARE_METATYPE(T*), which now requires T to be fully defined. The consequences of this are: * Forward declared types can no longer be declared as a metatype. (though this is a very uncommon thing to do). There is a trivial workaround where necessary. Change-Id: Id74c40088b8c0b466fcd7c55abd616f69acc82c8 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Make QUrl always lowercase the scheme().David Faure2012-01-241-3/+4
| | | | | | | | | | | | URL schemes can only contain alphanumeric characters and all protocols specify that they are case-insensitive. So instead of doing case-insensitive comparison everywhere and then get it wrong sometimes, better to lower-case it here. Change-Id: I61f51a3f4c85b90af1586ebcf69608987fbe2ec3 Reviewed-by: Jonas Gastal <jgastal@profusion.mobi> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* use QWinOverlappedIoNotifier in QWindowsPipeReaderJoerg Bornemann2012-01-242-91/+83
| | | | | Change-Id: I71d5feaa07e8febd6c562be1dc6d7790e3a1606c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>