summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* QWinOverlappedIoNotifier introducedJoerg Bornemann2012-01-243-1/+334
| | | | | | | | | | | For asynchronous (overlapped) I/O notification on Windows one can now use the convenience class QWinOverlappedIoNotifier. It's using one global I/O completion port and a watching thread to get notified when a read or write operation completes. Change-Id: If6f904b364be0405580c7e50355529ab136ae3cb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Add missing documentation to QTemporaryDir constructorsDavid Faure2012-01-241-0/+20
| | | | | | Change-Id: Ic7dea331695fa4653e4b963fef8383f44c3b1fb8 Reviewed-by: Jonas Gastal <jgastal@profusion.mobi> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Remove uses of qMalloc/qFree from out of line code.Robin Burchell2012-01-231-4/+4
| | | | | | | | There is no need to use these, and we are trying to deprecate them. Change-Id: I70e6f27aca322fe74c31d8ad8496f230cd29e503 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* qfilesystemengine_win.cpp: compile with namespaced QtJoerg Bornemann2012-01-231-7/+6
| | | | | | | | SidCleanup struct must not be in the INCLUDE_NAMESPACE. Change-Id: Ic51f1734af583c0ba7f715f7b27f314211e698c5 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com> Reviewed-by: hjk <qthjk@ovi.com>
* Update obsolete contact address.Jason McDonald2012-01-231-1/+1
| | | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: Id689fdb78727abafba033bed7b0402e2cf27aba1 Reviewed-by: Jonas Gastal <jgastal@profusion.mobi> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-2392-92/+92
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fix incorrect check for error when monitoring a path using inotify.Robin Burchell2012-01-211-1/+1
| | | | | | | | | | | Per the manpage, inotify_add_watch will return -1 in the case of error, 0 is a valid watch descriptor. Task-number: QTBUG-12564 Change-Id: I56a54de2f5cf18b40aaeddc6de51d18dacbf8daf Reviewed-by: Jonas Gastal <jgastal@profusion.mobi> Reviewed-by: Giuseppe D'Angelo <dangelog@gmail.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Remove QBool and use bool instead.David Faure2012-01-204-19/+0
| | | | | | | | | | | | QBool was introduced with Qt-4.0, to detect Qt3-like code like if (c.contains(d) == 2) and break compilation on such constructs. This isn't necessary anymore, given that such code couldn't possibly compile in Qt4 times. And QBool was confusing developers, and creating compile errors (e.g. QVariant doesn't have support for it), so better remove it for Qt 5. Change-Id: I6642f43f5e12b872f98abb56600186179f072b09 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove Q_CC_MWERKS.Robin Burchell2012-01-192-2/+2
| | | | | | | | This is no longer supported. Change-Id: I3914f5007595fd699fa1e9a565a0a3f59a0e135e Reviewed-by: Jonas Gastal <jgastal@profusion.mobi> Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* Remove QDir::convertSeparators()Lars Knoll2012-01-192-15/+0
| | | | | | | | | This method has been deprecated since Qt 4.2. QDir::toNativeSeparators() replaces it since then. Change-Id: I49e6e1bfd50f26aa30134e599ee82067709549a7 Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Revert "fix NTFS mount points"Joerg Bornemann2012-01-193-24/+11
| | | | | | | | | | We agreed on treating neither junctions nor mount points as symlinks. This will be handled in another commit. This reverts commit 1656c4780cc6c1d96f47522046f3f53b1eebb95a. Change-Id: I41a87b6df9f7fba333df4c967ee9f0c1f3940952 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* fix NTFS mount pointsJoerg Bornemann2012-01-173-11/+24
| | | | | | | | | | | | NTFS mount points are not treated as symlinks, because they might not have a link target. This is the case when a volume is mounted as a single mount point without a drive letter. This patch fixes building Qt in an NTFS mount point. Task-number: QTBUG-20431 Change-Id: Ie2e15212e1a7ca7fa0067b7ca8857e243e42c21a Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
* Fixed QFile::link behaviour for WinCE devices.Janne Anttila2012-01-131-0/+1
| | | | | | | | | | In WEC7 both arguments given for ScCreateShortcut needs to be given in Windows format. Apparently older WinCE devices has accepted also Unix format but this is not anymore true for WEC7. The Windows format works for older WinCE versions as well. Change-Id: Ic1f394e20bae8ad42acb46929d3ff4af92daf310 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Windows: Fix qt_ntfs_permission_lookupMiikka Heikkinen2012-01-131-11/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | Specifying qt_ntfs_permission_lookup++ in application code didn't make qfilesystemengine_win.cpp respect Windows ACL as it was supposed to. This was because GetTokenInformation for TokenUser failed always in resolveLibs() function, because the TOKEN_USER struct that was given to it wasn't large enough to contain both TOKEN_USER and SID structs that GetTokenInformation wants to return in this case. Fixed by calling GetTokenInformation twice, first to determine the required size, and then another time to get the actual token info. Additionally, the SID returned as part of the token info needs to be stored for the lifetime of the application, as the TRUSTEE_W struct has a pointer to it (currentUserTrusteeW). The worldTrusteeW initialization also required a change to properly store the SID. Note: The dynamic resolution of FreeSid and other SID manipulating functions doesn't appear to be necessary, as they are found on the same ifdef level (in winbase.h) as the GetTokenInformation, which already isn't dynamically resolved. Task-number: QTBUG-247 Change-Id: I0294c85ea903c86d03c2fcd3d801502b378dc0e5 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Build fix for WINCE to qfsfileengine_win.cppJanne Anttila2012-01-131-1/+1
| | | | | | | | | | | | | | | QFileSystemEngine::currentPath() returns QFileSystemEntry, but this method expects QString return value. -> Code does not compile for WinCE Switched code to use "QFileSystemEngine::currentPath().filePath()" correspondigly as Windows desktop does if filename does not contain drive letter. This is ok, since WinCE does not support drive letters. Task-number: QTBUG-22499 Change-Id: Ic4935357c40cda30efcd2e1c7d69bf2ef7b31dd0 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com> Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
* Make QFtp private.Jonas M. Gastal2012-01-122-7/+3
| | | | | | | | | All references to QFtp in documentation have been removed, QFtp's documentaiton was marked internal. The QFtp example was removed. Task-number: QTBUG-23199 Change-Id: Ifff83cac069fb350e8ebeae63e605850e65c0c30 Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Make QFileSystemWatcherEngines children of QFileSystemWatcherBradley T. Hughes2012-01-129-36/+33
| | | | | | | | | | To support moving QFileSystemWatcher to another thread, the engines need to follow when the watcher is moved. The easiest way to do this is by parenting the engines to the watcher. Change-Id: Ie2bb701c0c148da9cc2302d4de23286b8ef42c4d Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Do not call moveToThread(this) in QWindowsFileSystemWatcherEngineThreadBradley T. Hughes2012-01-121-1/+0
| | | | | | | | | This is considered bad practice, and gives no benefit as the threads do not use an eventloop. Change-Id: I0de9eca97948571cf5091e2f1b19bb1faab3e2ac Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* QFileSystemWatcher/Windows: Output paths if FindNext fails.Friedemann Kleint2012-01-121-3/+15
| | | | | Change-Id: I72bd28868c84d37e3dd4ea8ab892fa092d853d4a Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Remove unnecessary QMutexes in QFileSystemWatcher implementationsBradley T. Hughes2012-01-127-90/+69
| | | | | | | | | | | | | The polling, inotify, and kqueue implementations are no longer threaded, and as such, do not need mutexes to protect their internal data (since QFileSystemWatcher itself is not documented as a thread-safe API). The Windows implementation is unchanged as it uses multiple threads explicitly. Change-Id: Ia82510397e576bf704ce3aed3d776b58b39f7ff3 Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Avoid races when destroying QFileSystemWatcherBradley T. Hughes2012-01-122-0/+2
| | | | | | | | | | | | | | | On Mac OS X, socket notifiers need to be disabled/destroyed before closing their associated file descriptor, otherwise we cause races inside the CFSocket system. The documentation for CFSocketInvalidate() says that we close the file descriptor after calling this function when the kCFSocketCloseOnInvalidate flag is explicitly cleared (QCocoaEventDispatcher clears this flag). Do the same on the Linux inotify watcher as well, for symmetry. Change-Id: I5592cc4bb5be4b752e48d895a685d3c92826acc7 Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Docs: Forward-ported typo and link fixes from Qt 4.8Janne Anttila2012-01-111-1/+1
| | | | | | | | | | | | | This commit brings already accepted doc fixes to Qt5. Task-number: QTBUG-9224 Task-number: QTBUG-13442 Task-number: QTBUG-19858 Task-number: QTBUG-21447 Change-Id: I2ebc7c3e74427545367bdcec51e9e710a4925747 Merge-request: 1402 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Remove unused QT_NO_TEXTSTREAM.David Faure2012-01-111-2/+0
| | | | | | | | It was checked in a few places, but it didn't actually remove QTextStream, so it was pretty useless. Change-Id: I8eaf28893cd6c7acbe1c0b69d58de90742aee755 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Remove thread from QFileSystemWatcherEngine implementations.Robin Burchell2012-01-1010-184/+71
| | | | | | | | | | | | | | | | | | | | | | These threads are actually counterproductive, as generally speaking, processing watches is not that expensive an operation, so instead, they process at full speed and can (in the case of slow processing in the thread processing the events) stack up and consume resources for no good reason. Threads also have an additional resource consumption per engine (some ~8mb of thread stack on Linux), so doing away with them is nice. A side effect of this change is that events are now effectively rate-limited by the eventloop speed of the thread they run in, so if your thread runs too slow, and you recieve a lot of events, on some platforms, events may be dropped now where in the past, they would be read by the monitor thread and turned into Qt signals (thus not visibly showing as a problem, apart from invisibly bloating memory usage). Task-number: QTBUG-20028 Change-Id: I345a56a8c709f6f778ca9a0b55b57c05229ba477 Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Remove the Q_TYPENAME define.Stephen Kelly2012-01-081-1/+1
| | | | | | | | | | | | | It is mostly not used (most places in Qt use typename directly), so is already not very useful. For example typename is used in: QDataStream& operator<<(QDataStream& s, const QVector<T>& v) Change-Id: I85337ad7d8d4ebbb424bfa2ab9a356456ff3e90f Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* QProcess/Win: direct forwarding of stdout and stderrJoerg Bornemann2012-01-082-26/+22
| | | | | | | | | | | | | We are now directly passing the standard out/err handles to CreateProcess instead of reading the output and writing it. The downside is, that we cannot automatically forward the process output of GUI applications anymore. This behaviour is intended by the CreateProcess API. Change-Id: Ic6e35c8c338dbea1a9f345567a37d938da1f34a2 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* split qprocess_win.cpp into Windows and WinCE partsJoerg Bornemann2012-01-063-75/+345
| | | | | Change-Id: I7f2cf2c42dd24ca162238e6dc6408ac39dfcd790 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Remove all non-inline of qMalloc/qFree/qRealloc.Robin Burchell2012-01-061-2/+2
| | | | | | | | | | | | We're trying to deprecate these, so don't use them anymore. The inline uses of these have been left intact, for the moment. Inline code will need to create their own non-inline allocation methods (for future-proofing to allow alterations in how e.g. individual containers allocate) Change-Id: I1071a487c25e95b7bb81a3327b20c5481fb5ed22 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Remove duplicate fnctl() call.Robin Burchell2012-01-061-1/+0
| | | | | | | | QInotifyFileSystemWatcherEngine's constructor calls this, there's no need to do it twice. Change-Id: Ic19e758a3f87f2e3a885e5b834f59a5a0fe13f4b Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Fix compile error with qWarning() << myDateTime and QT_NO_DEBUG_OUTPUTDavid Faure2012-01-051-7/+8
| | | | | | | | | | | | | | | | All QDebug operator << in custom classes were disabled by QT_NO_DEBUG_STREAM, which was set by QT_NO_DEBUG_OUTPUT. Now QT_NO_DEBUG_STREAM is never set automatically, but remains available for reducing the feature set altogether (qconfig.h). Remove check on QT_NO_TEXTSTREAM: this define is meaningless, it doesn't even undefine QTextStream, and this is unrelated to QDebug streaming anyway. Change-Id: I5eeed0144fa684d0e790e9dfd9a4aeb956218c39 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove OS X FSEvents watcher.Robin Burchell2012-01-054-635/+2
| | | | | | | Per QTBUG-9249, this backend is buggy, and not recommended for use by Apple. Change-Id: I72ce88006a4badbbfdd825717020078778d16a36 Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-0593-93/+93
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Split polling watcher out to its own seperate files.Robin Burchell2012-01-044-178/+291
| | | | | | | | Just helps maintain sanity and clarity a bit. Change-Id: Iaf00f9ecf2d959afcd8fe18bbca71a403cf9818d Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Pass notification of failure of watches onto the caller.Robin Burchell2012-01-042-31/+76
| | | | | | | | | | | | | | This is particularly useful for situations where the user might really want to be notified about a failure, for instance, in a backup application. Empty paths are not treated as an error in calling, as the user code cannot really do anything sensible to handle this error, but empty paths should not be used. Change-Id: Iddb44fd39f4e3fac5c3f9f60fb7999e1833280a8 Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* QStandardPaths: add GenericCacheLocation.David Faure2012-01-035-6/+17
| | | | | | | | | | | Much like DataLocation = GenericDataLocation + domain + appname, this makes CacheLocation = GenericCacheLocation + domain + appname. This way a framework library can have an application-independent cache (like ksycoca). Change-Id: I6a8c47ff85b7d5c68b594cc8b071a752d96b029d Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove support for dnotify QFileSystemWatcher.Robin Burchell2012-01-025-648/+7
| | | | | | | | | | Inotify has been available in Linux for some ~6 years now, 7 when Qt 5 will actually be released, so I'd say it's safe to remove this fallback path now, particularly as the autotest notes that it's broken. Change-Id: I49dbb161d4765d63e92f512a6375323c7d37ccbe Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Merge integrity support into unix.Robin Burchell2012-01-021-7/+2
| | | | | | | | | | | | | | | Similarly to ec9ea7f3e819cb0c2da8c8977f9cc44688c9b6f6, the code in unix (non-Linux/OS X) is actually the same as for integrity, so merge the conditionals together to save duplication. This should have the side-effect of unbreaking Qt 5 on integrity wrt the new QStandardPaths introduction, which was not added to the integrity block. Change-Id: Ib512fa781f5ceb240069888ce6958c9af2990d37 Reviewed-by: Rolland Dudemaine <rolland@ghs.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Remove Symbian support from src/corelib/io/.Robin Burchell2012-01-027-2030/+7
| | | | | | | | Change-Id: I52c2a58396e03f29ca478de34c914535c7ae1012 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Make qDecodeDataUrl return bool.Jonas M. Gastal2011-12-292-35/+33
| | | | | Change-Id: I23b9fed39af7bea6c171b35e10bd72c424bd903e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove unused qInitResourceIO() method.Robin Burchell2011-12-201-2/+0
| | | | | | | | Was effectively removed in 4.x's 2e7d5def1fdabb5949fbffc629da500aa2bb78d7, but couldn't be removed due to it being exported. Change-Id: I5061f50deaeae7f53e8b688633e377095b4463c2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix QDir::removeRecursively so it doesn't follow symlinks to directories.David Faure2011-12-191-1/+1
| | | | | | | | Critical bug... Good thing I had backups of my $HOME. Change-Id: I43b3a80786c946b0aec797036c1164d436d521f8 Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* extract QWindowsPipeReader from qlocalsocket_win.cppJoerg Bornemann2011-12-163-0/+439
| | | | | | | | The code for reading named pipes can now be used in other places as well. Change-Id: Id734617a3927e369491a6c5daf965169ceb01f74 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* QTemporaryDir/File: cleanups (static internal function, QScopedPointer)David Faure2011-12-083-13/+10
| | | | | Change-Id: I61311d151e2ae94a22df58297bbfb7a636a01c4a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove unused includeDavid Faure2011-12-071-1/+0
| | | | | Change-Id: Idec12079fdc7ad29e780b537577050f01d8d076c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* New class QTemporaryDir.David Faure2011-12-024-3/+347
| | | | | | | As discussed on qt5-feedback / development lists. Change-Id: If1733369d12daa29054776ec2cbd78e63679768e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Implement QDir::removeRecursivelyDavid Faure2011-12-022-0/+48
| | | | | | Task-number: QTBUG-4592 Change-Id: I363e2c24d1c0ada975b8b927d7c6e776b8aae579 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Make QWinEventNotifier part of the public APIDebao Zhang2011-12-012-2/+2
| | | | | | | | | | | | QWinEventNotifier is an essential class if you're using native Windows Overlapped IO and need to convert it to Qt signals. However the header is marked private. Task-number: QTBUG-68 Change-Id: I22e9a84da97f969ddb82e9ba15e604a01abd80d0 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>