summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright year to 2011.Jason McDonald2011-01-1075-75/+75
| | | | Reviewed-by: Trust Me
* QUrl::setUrl should call detachOlivier Goffart2011-01-061-0/+1
| | | | | | Task-number: QTBUG-16425 Reviewed-by: Gabriel Reviewed-by: Markus Goetz
* Doc: Fixed a link to the correct searchPaths() function.David Boddie2010-12-071-1/+1
|
* Merge branch '4.7-upstream' into 4.7-docA-Team2010-11-272-107/+97
|\
| * Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into ↵Qt Continuous Integration System2010-11-272-107/+97
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4.7-integration * '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (21 commits) Fix strict-aliasing violation warning. Fix warning about %x parameter type mismatch in EGL Fix warning about address of a function being constant. Fix warnings related to unused variables. Fix silly "will be initialised after" warning. Fix warning about mixing integral with non-integral type in ?: Fix warning about use of uninitialised variable Fix "value not in enum" warning with GCC 4.5. Fix warnings with GCC 4.5: some cases are not part of the enum Fix a race condition related to service acquisition. QNetworkReply autotest: fix possible crash QKqueueFileSystemWatcher: don't stop thread that isn't running Fix QSettings auto test to use QTRY_VERIFY tst_QFileSystemWatcher: Don't exit the event loop on first signal. QPollingFileSystemWatcherEngine: Fix double report of directory change. QKqueueFileSystemWatcherEngine: Use higher file descriptors. QKqueueFileSystemWatcherEngine: Unlock mutex between two events. QKqueueFileSystemWatcherEngine: Unlock mutex before calling write(2). QKqueueFileSystemWatcherEngine: Handle kevent(2) returning EINTR. QKqueueFileSystemWatcherEngine: Deleting kevent is handled by close(). ...
| | * QKqueueFileSystemWatcher: don't stop thread that isn't runningJoão Abecasis2010-11-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When removing paths from the watch list, if we end up with an empty watch list, we would send a request to the processing thread to quit. In the case where the watch list was empty to begin with (the paths being removed weren't actually being watched) the request to quit would still be queued. If the processing thread wasn't running (and it shouldn't if there weren't any paths being watched) the request to quit would still be posted but not processed. The next time paths were added and the thread started, the request would be processed and the thread would quit at once. When removing paths from the list, we now check whether the watch list is empty to begin with and exit early without asking the processing thread to quit itself. Task-Number: QTBUG-14435 Reviewed-by: Bradley T. Hughes
| | * QPollingFileSystemWatcherEngine: Fix double report of directory change.Tijl Coosemans2010-11-261-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The polling engine first retrieves a QFileInfo for a given path, then tests whether it's different from before and if so, stores the new file info and emits a signal. In case path is a directory the test also checks if the list of directory entries has changed. This creates a window between retrieving the file info and the test in which a file can be added/removed from the directory or the directory itself can be removed. In that case the test returns true, because the list of entries has changed, but outdated file info is stored which means that on the next timeout the same change will be reported a second time. Therefore, refresh the file info after the test for changes. Merge-request: 2425 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
| | * QKqueueFileSystemWatcherEngine: Use higher file descriptors.Tijl Coosemans2010-11-261-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A file descriptor is used for every path to be monitored, but descriptors below FD_SETSIZE (typically 1024) are precious, for use with select(2). To allow the application (and other parts of Qt) to use select(2), try to duplicate the descriptor returned by open(2) above FD_SETSIZE and close(2) the original. However, only do so when the descriptor table is already fairly large (FD_SETSIZE / 2). This keeps the descriptor table small for applications that use only a few descriptors. While here, also set the close-on-exec flag on the (new) descriptor. Merge-request: 2425 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
| | * QKqueueFileSystemWatcherEngine: Unlock mutex between two events.Tijl Coosemans2010-11-261-13/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the worker thread unlock the mutex between processing two events. Otherwise it's possible for the worker thread to block the application thread when many events occur. Also, there's no need to lock the mutex when processing a pipe event. Generally the worker thread should hamper the application thread as little as possible, so only lock the mutex where needed. Merge-request: 2425 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
| | * QKqueueFileSystemWatcherEngine: Unlock mutex before calling write(2).Tijl Coosemans2010-11-261-65/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calls to write(2) potentially block, so make sure the application thread unlocks the mutex before it writes to the pipe between itself and the worker thread, so the latter can continue to process events and eventually unblock the write call (if needed) by emptying the pipe. Merge-request: 2425 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
| | * QKqueueFileSystemWatcherEngine: Handle kevent(2) returning EINTR.Tijl Coosemans2010-11-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The worker thread exits whenever the kevent call returns an error, but in the case of EINTR (interrupted by signal) it should just call kevent again. Otherwise for instance, attaching a debugger to the process causes the worker thread to exit because of the SIGSTOP it receives. Merge-request: 2425 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
| | * QKqueueFileSystemWatcherEngine: Deleting kevent is handled by close().Tijl Coosemans2010-11-261-13/+1
| | | | | | | | | | | | | | | Merge-request: 2425 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
| | * QKqueueFileSystemWatcherEngine: Use EV_CLEAR instead of EV_ONESHOT.Tijl Coosemans2010-11-261-14/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Using EV_ONESHOT and re-enabling the kevent after emitting the signal allows for a window in which file system changes can go undetected. By using EV_CLEAR instead the kevent can stay enabled. Merge-request: 2425 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* | | Merge branch '4.7-upstream' into 4.7-docA-Team2010-11-261-0/+1
|\ \ \ | |/ /
| * | Fix minor memory leakMiikka Heikkinen2010-11-261-0/+1
| |/ | | | | | | | | | | | | QProcessPrivate::startDetached() in qprocess_symbian.cpp was leaking RProcess object. Reviewed-by: Janne Koskinen
* | Doc: Removed two warnings from QDirIterator docsGeir Vattekar2010-11-261-6/+0
|/ | | | Task-number: QTBUG-15492
* doc: Stated that the destructor does not call close().Martin Smith2010-11-121-1/+4
| | | | Task-number: QTBUG-15277, QTBUG-8231
* Fix tst_symbols auto testHarald Fernengel2010-11-041-5/+5
| | | | | Prefix isLikelyToBeNfs with a "q", even though it's only autotest-exported.
* Export isLikelyToBeNfs only if we have an internal buildHarald Fernengel2010-11-021-4/+10
|
* Fixed QFileInfo autotest to skip on NFS.Dominik Holland2010-11-021-4/+4
| | | | | Exported the isLikelyToBeNfs() function to skip the fileInfo Test on NFS. Otherwise the Test will fail, because the FileSystemTimes are not synchronized.
* Fix memory leak on exitHarald Fernengel2010-10-291-8/+13
| | | | | | | The confFile was lost if the cache was already gone (e.g. on app exit). This patch ensures that the confFile is always deleted. Reviewed-by: João Abecasis
* Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into ↵Qt Continuous Integration System2010-10-251-1/+1
|\ | | | | | | | | | | | | | | | | | | | | 4.7-integration * '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Simplify calculation of center point and scale for PinchRecongizer Doc: Fixing typo QtDFB: Make transparent windows behave better For meego graphics system, use floyd-steinberg dithering when converting to 16bit. Added support for blitting to native child widgets in GL window surface.
| * Doc: Fixing typoSergio Ahumada2010-10-251-1/+1
| |
* | Fixed many spelling errors.Rohan McGovern2010-10-252-2/+2
|/
* Merge branch '4.7-upstream' into 4.7-docA-Team2010-09-221-1/+0
|\
| * remove extra includesRitt Konstantin2010-09-211-1/+0
| |
* | Merge branch 'doc-4.7' of scm.dev.nokia.troll.no:qt/qt-doc-team into doc-4.7Jerome Pasion2010-09-201-2/+3
|\ \ | |/
| * Restore 4.7.0 behavior that non-existing paths are possible.Thomas Zander2010-09-161-2/+3
| | | | | | | | | | | | | | Changing a relative path to a non-existing absolute path used to work, this should work again after this patch. Reviewed-by: João Abecasis
* | Added default value documentation for two variables.Jerome Pasion2010-09-171-3/+4
|/ | | | Reviewed-by: David Boddie:
* Fix the bug for QSettings on Windows, to store qint32/quint32, ↵Liang Qi2010-09-101-3/+21
| | | | | | | | | qint64/quint64 in Windows registry. Reviewed-by: Prasanth Ullattil Reviewed-by: Joerg Bornemann Task: QTBUT-13249 AutoTest: Included
* Update the error handling of invalid hostnames in QUrl.Thiago Macieira2010-09-101-6/+19
| | | | | | | | | | | | This should let QUrl::errorString() show the original, invalid hostname in the URL it reports to be invalid. There may be a side-effect that QUrl::toEncoded() may include the broken hostname on the first call, then miss it in the next calls. But since QUrl::isValid() is returning false, we can consider that the result of toEncoded() is undefined, so anything goes. Reviewed-by: Olivier Goffart
* Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into ↵Qt Continuous Integration System2010-09-086-449/+387
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4.7-integration * '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (27 commits) Work around a compiler bug on 64-bit. Fix handling of braces/no-braces in QUrl::host / setHost. Changes (and minor corrections) to QByteArray documentation. QtWebKit: Update tag files to match the same content on qtwebkit.git QtWebKit: Downstream patch 2 fixing a crash on MSVC 64bit. QtWebKit: Downstream patch 1 fixing a crash on MSVC 64bit. uic: Fix compile breakage in case QT_NO_QT3_SUPPORT. uic: Improve messages. Tools (uic/rcc): Improve warning messages. QDir: Removed checks for existance of fileEngine QDir and QFileInfo shouldn't lose properties when detaching Another bug-o introduced in fixing QDirPrivate refactoring Reverting QDir::detach introduced earlier QFileInfo: Prepare for engine-less implementation Removed QFileInfoPrivate::initFileEngine Simplify QDir::cd QDir::makeAbsolute could self-destruct on failure QDir::operator= simplification QDirPrivate refactoring QDirPrivate refactoring ...
| * Fix handling of braces/no-braces in QUrl::host / setHost.Thiago Macieira2010-09-081-0/+4
| | | | | | | | | | | | | | | | | | The hostname is supposed to be stored in canonical form, with the braces. However, if you call url.setHost("::1"), then a non-canonical hostname is stored. So make the canonicalisation function correct this. Task-number: QTBUG-13464 Reviewed-by: Markus Goetz
| * QDir: Removed checks for existance of fileEngineJoão Abecasis2010-09-071-49/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Directly or indirectly, all instances of QDir call QDirPrivate::setPath, which allocates a file engine and dereferences it. Any failures there should already lead to a crash or a bad_alloc exception being thrown in case of failure. Given that, QDir may be (and was) broken when compiling Qt with QT_NO_FSFILEENGINE, if no custom file engine and handler are provided. This being the case, it's pointless to check fileEngine for null all over the place. This simplifies the code and should allow for easier transition to file-engine-less implementation. Reviewed-by: Thomas Zander
| * QDir and QFileInfo shouldn't lose properties when detachingJoão Abecasis2010-09-072-20/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | For QFileInfo, the caching state was being lost on the different setFile overloads. QDir::cd and ::makeAbsolute were losing filters and sorting flags. QDir issues were introduced with these patches: "Simplify QDir::cd" "QDir::makeAbsolute could self-destruct on failure" Reviewed-by: Prasanth Ullattil
| * Another bug-o introduced in fixing QDirPrivate refactoringJoão Abecasis2010-09-071-0/+1
| | | | | | | | Must clear file lists when changing the name filters.
| * Reverting QDir::detach introduced earlierJoão Abecasis2010-09-072-51/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | From the client API it is a broken concept, because it could leave the user with an uninitialized file engine. Fixing to initialize the file engine, would mean it is useless for internal use where file engines are initialized separately. In the end, removing both the QDir::detach introduced earlier and throwing away the private d_func'tions altogether is a binary-compatible change that should allow us to push this change in a patch release (fingers crossed!) Reviewed-by: Thiago Macieira
| * QFileInfo: Prepare for engine-less implementationJoão Abecasis2010-09-072-46/+59
| | | | | | | | | | | | | | | | | | The absence of a file engine was being interpreted as a synonym for a default constructed instance (or failed engine creation with QT_NO_FSFILEENGINE). By having an explicit flag, we open the door for bypassing file engine creation. Reviewed-by: Thomas Zander
| * Removed QFileInfoPrivate::initFileEngineJoão Abecasis2010-09-072-13/+4
| | | | | | | | | | | | | | | | As it served no real purpose. Instead, the relevant bits were inlined in the constructor that used it and makeAbsolute was adapted to use operator=. Reviewed-by: Thomas Zander
| * Simplify QDir::cdJoão Abecasis2010-09-071-2/+1
| | | | | | | | | | | | | | Copy constructing a QDir instance from this and then detaching it in setPath doesn't get us anything so we might as well do it all in one go. Reviewed-by: Prasanth Ullattil
| * QDir::makeAbsolute could self-destruct on failureJoão Abecasis2010-09-071-7/+4
| | | | | | | | | | | | | | | | | | | | | | makeAbsolute would return false if the newly constructed file engine reported it wasn't referencing a directory. At this point, the private data has already been updated, rendering the instance unusable. Instead, we now create a separate QDir instance and reset our private data only on success. Similarly to what's done in QDir::cd. Reviewed-by: Prasanth Ullattil
| * QDir::operator= simplificationJoão Abecasis2010-09-071-3/+0
| | | | | | | | | | | | | | | | With the recent changes to QDirPrivate and how d_ptr is now a QSharedDataPointer, we no longer need to worry about self-assignment, as that is already handled by the d_ptr. Simplifying code here. Reviewed-by: Prasanth Ullattil
| * QDirPrivate refactoringJoão Abecasis2010-09-071-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | While refactoring, a bug was introduced where shared data would be updated before detaching in setNameFilter. Further refactoring turned this into a double-detach, instead. Now the issue is fixed by adding the appropriate initFileEngine and nameFilters assignment, instead of calling setNameFilters to finish the job. Reviewed-by: Thomas Zander
| * QDirPrivate refactoringJoão Abecasis2010-09-071-20/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | Some renaming to make intent clearer and improve consistency: listsDirty => listsInitialized (logic inverted) updateFileLists => initFileLists clear => clearFileLists Also note that initializing file lists shouldn't trigger detach, because no previous version of the cached data has been seen. Reviewed-by: Thomas Zander
| * QDirPrivate refactoringJoão Abecasis2010-09-071-25/+24
| | | | | | | | | | | | Moved common initialization code from QDir ctor to QDirPrivate. Reviewed-by: Thomas Zander
| * Removed QDirPrivate layer of indirectionJoão Abecasis2010-09-072-229/+216
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merged QDirPrivate with QDirPrivate::Data, as QDirPrivate served no purpose by itself, only adding an additional layer of indirection to the potentially shared private data, and an unnecessary allocation. Now, QDir holds a QSharedDataPointer to its private data. Private data will be shared among copied instances with COW semantics. Still, this sharing is very limited as plenty of regular use cases will cause the shared data to detach, such as refreshing the file lists. As the use QSharedDataPointer breaks usage of the Q_DECLARE_PRIVATE macro, we manually define the d_func'tions. Non-const d_func detaches on shared data. A detach function was added to the public interface to support this. (On a side note, QFileInfo already exposes a similar detach function). As much as possible, detach is handled implicitly inside the Q_D macro, through the d_func() non-const overload. On the other hand, implicit creation of file engines through detach was made explicit with a call to a new initFileEngine function. Reviewed-by: Thomas Zander
| * Refactor QFileInfoPrivate::Data (Round 2)Prasanth Ullattil2010-09-073-178/+161
| | | | | | | | | | | | | | The QFileInfoPrivate::Data member class is removed now. All the methods moved to QFileInfoPrivate. QFileInfoPrivate becomes a QSharedData type. Reviewed-by: Joao
| * Refactoring QDirPrivate::DataJoão Abecasis2010-09-071-84/+98
| | | | | | | | | | | | | | | | There was an unnecessary split of QDir's private data between QDirPrivate and QDirPrivate::Data. As a stepping stone towards merging the two, this moves everything into QDirPrivate::Data. Reviewed-by: Thomas Zander
| * Move QFileInfoPrivate methods to QFileInfoPrivate::Data (1st Round)Prasanth Ullattil2010-09-072-89/+90
| | | | | | | | Reviewed-by: Joao
* | Merge remote branch 'origin/4.6' into qt-4.7-from-4.6Thiago Macieira2010-09-072-6/+7
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/Makefile.win32 src/corelib/io/qfsfileengine_win.cpp src/corelib/kernel/qeventdispatcher_win.cpp src/gui/dialogs/qfiledialog_win.cpp src/gui/inputmethod/qcoefepinputcontext_s60.cpp src/gui/text/qfontdatabase_win.cpp src/gui/util/qsystemtrayicon_win.cpp src/script/utils/qscriptdate.cpp tests/auto/qinputcontext/tst_qinputcontext.cpp tests/auto/qscriptengine/tst_qscriptengine.cpp