summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix QFileInfo::isHidden on MacJoão Abecasis2010-09-102-4/+7
| | | | | | | | | | | | | Having HiddenAttribute as part of PosixStatFlags, meant that we would assume we knew about it whenever we stat'ed, which wasn't the intent. As that is just one of the queries we do on Mac OS to determine if a file is considered hidden. Instead, we explicitly ask for a stat anytime the attribute is queried for. The proper fix will be to perform the cheap operations (e.g., file name begins with '.') first and only stat if we still haven't got an answer.
* QFileinfo: fix isSymLink on MacJoão Abecasis2010-09-102-3/+6
| | | | | | | | On Mac OS X, we also flag Alias Records as symbolic links. Since we now make the distinction in the engine, we need to query for it explicitly. Added a new type LegacyLinkType to QFileSystemMetaData to document this old behavior.
* Minor clean up on QDirIteratorJoão Abecasis2010-09-101-21/+4
| | | | Removing unnecessary garbage, inlining a destructor.
* Fixing QDir/tree traverseDirectory benchmarkJoão Abecasis2010-09-101-0/+1
| | | | Was missing counter initialization at the start of QBENCHMARK loop.
* Set file metadata variables to known values when stat failsShane Kearns2010-09-092-1/+10
| | | | | | | | | For unix port, set file times and size to 0, and owner/group id to -2 (nobody) for files that don't exist. Also implemented saving owner and group ids in fillFromStatBuf, which was missing. Reviewed-by: joao
* Set size and modification time to 0 if file does not existShane Kearns2010-09-091-0/+4
| | | | | | | | Since we report the size and modification time as known in the knownFlags() for non existant files, they need to be set to something. In particular, size is used in QFileInfo comparisons. Reviewed-By: joao
* Create QFileSystemEntry objects with / as directory separatorShane Kearns2010-09-091-1/+1
| | | | | | | | It simplifies the code for users of QFileSystemEntry to assume that filePath() returns / seperated paths, and nativeFilePath returns paths using the native dir separator (e.g. \) Reviewed-By: joao
* backward compatibility fix for QFileInfo::isRoot()Shane Kearns2010-09-091-2/+14
| | | | | | | | | In the old system, QFileInfo("p:/").isRoot() would return false because the file engine first checks exists(). Assuming P: is not mounted that would return false. This change makes QFileInfo::isRoot() check the drive exists. Reviewed-By: joao
* Fix tst_qdiriterator for symbianShane Kearns2010-09-092-6/+1
| | | | | | | | | | Since 21e0423a, the directory structure for iteration is created by the test on initialisation. Furthermore the directory structure no longer exists in git, causing a build error at the deployment stage. Also, defined Q_NO_SYMLINKS to disable test cases related to symlinks Reviewed-By: joao
* Make compile on symbian / armccThomas Zander2010-09-094-4/+6
|
* Fix warning of unused variable on non-symbianThomas Zander2010-09-091-1/+1
|
* Make QFileInfo use the new filesystemengineThomas Zander2010-09-094-50/+195
| | | | | | | | | | | | | | The creation of a QAbstractFileEngine derived class will now be avoided if the file we are watching is on the native file system and from then on all access will be through the direct API Notice that for QFileInfo::path, isRelative, filePath, fileName, baseName, completeBaseName, completeSuffix and suffix we now use the QFileSystemEntry instead of asking the engine. This means that some buggy or just weird user provided engines no longer get used and as such we might not be bug compatible. Reviewed-by: João Abecasis
* Various fixes in suffix and other entry methods.Thomas Zander2010-09-092-7/+150
| | | | | | | Added lots of unit tests (inspired from qfileinfo) and found plenty of bugs that I fixed. Reviewed-by: João Abecasis
* Add baseName and completeBaseName gettersThomas Zander2010-09-093-16/+52
| | | | | | | | Using the definition of the concepts from QFileInfo, allow us to use the already calculated indexes to fetch the baseName and the completeBaseName on a QFileSystemEntry. Reviewed-by: João Abecasis
* Update Symbian DEF filesShane Kearns2010-09-094-16/+197
| | | | | | To allow file-engines-refactor branch to build. Reviewed-By: Trust Me
* Implement basic symbian native file IO to QFsFileEngineShane Kearns2010-09-092-1/+100
| | | | | | | Enough functionality to be able to read/write files for the tst_qfileinfo autotest to pass. Reviewed-By: joao
* Fixes for isRoot() on symbianShane Kearns2010-09-091-4/+6
| | | | | | | | Because "/" is considered to be a root directory, root paths must be converted to absolute paths before volume info can be retrieved. Also special handling in absoluteName is needed to avoid creating "c://" Reviewed-By: joao
* Fixes for tst_qfileinfoShane Kearns2010-09-091-5/+5
| | | | | | | | | | | Use case insensitive comparison on symbian/windows for the absFilePath test. - it expected "c:\\home\\andy\\tmp.txt" to resolve to "C:/home/andy/tmp.txt" - but there is no reason for the drive letter to be changed to uppercase - however it's not wrong either since the FS is case insensitive. Enable isWritable test on symbian - it was skipped for no good reason Reviewed-By: joao
* Enable symbian IO code in the buildShane Kearns2010-09-087-163/+250
| | | | | | | | | | | | | This patch contains several changes that needed to be done atomically. The native file path im QFileSystemEntry is changed from 8 bit to 16 bit character set. QFsFileEngine has some new symbian specific code (as the unix code does not compile with the above change), and forwards more calls to the new QFileSystemEngine. Unix implementations of link, rename and remove are moved to the unix version of this class, so less ifdef'ing is needed. Finally, io.pri now selects the _symbian.cpp source files instead of the _unix.cpp equivalents when building for symbian.
* Disable tst_qfileinfo symlink tests on symbianShane Kearns2010-09-081-0/+7
| | | | Reviewed-By: joao
* Implement QFileSystemEngine::absoluteName for symbian OSShane Kearns2010-09-081-7/+24
| | | | | | | | | | Updated this function so that it passes the QFileInfo autotests. Now deals with raw drives "x:" Drive relative paths "x:foo.txt" Absolute paths missing a drive letter "/sys" Dirty absolute paths "c:/bar/../foo" Reviewed-By: joao
* Add missing function parameter to implementationShane Kearns2010-09-071-1/+1
| | | | | | To fix compile error due to header changes upstream Reviewed-By: Trust Me
* Symbian OS implementation for QFileSystemMetaDataShane Kearns2010-09-074-68/+187
| | | | | | | | | | | | There are three possible sources for metadata: RFs::Entry() - for files or directories in the filesystem (except roots) RFs::Volume() - for mounted drives (used for root directory) ::fstat() - for Open C file handles adopted via QFile::open(int, OpenMode) As a result of the ::fstat requirement, the code dealing with stat buffers is moved from qfilesystemengine_unix.cpp to the common qfilesystemengine.cpp Reviewed-By: joao
* Helper functions for converting Symbian OS TTimeShane Kearns2010-09-072-0/+41
| | | | | | | | | convert to/from QDateTime convert to/from time_t These functions are required for dealing with timestamps in native files, however they are generally useful for Qt/Symbian port as well. Reviewed-By: joao
* Move resolving a symlink to the qfilesystemengine_unixThomas Zander2010-09-064-72/+76
| | | | Reviewed-by: João Abecasis
* Fix over-stating in QAbstractFileEngine::createJoão Abecasis2010-09-061-16/+32
| | | | | | | | | | | With recursive entry resolution, we might end up querying the engine for an entry once per recursion level. There was also the possibility that stale data would remain in the meta data instance. When resolving an entry, we now check for its existence at the leaf level and handle clean-up right away. Reviewed-by: Thomas Zander
* Split QAbstractFileEngine::createJoão Abecasis2010-09-033-41/+102
| | | | | | | | | | | | The new, ugly-named resolveEntryAndCreateLegacyEngine will never instantiate QFSFileEngine and uses the QFileSystemEngine API to check if files exist, when necessary. This way, we reduce allocations of QFSFileEngine when resolving paths. Clients of the QAbstractFileEngine API will be able to opt-out of using QFSFileEngine altogether. Reviewed-by: Thomas Zander
* QAbstractFileEngine: Exposing custom file engine handlersJoão Abecasis2010-09-032-10/+27
| | | | So we can invoke custom handlers from QFileSystemEngine.
* QFileSystemEngine::fillMetaData for Unix platformsJoão Abecasis2010-09-035-235/+324
| | | | | | | | | | | | | | | | | | | | | This shuffles a lot of code out of QFSFileEngine. fillMetaData, however is almost a reimplementation of the logic. Goals for this function are to maximize data gathered and minimize file system queries. Symbian had an optimization to lstat first and only stat again on links, having noticed a lot of lstat were being done that weren't really necessary. That optimization was also made in the new fillMetaData function and extended to all platforms, whenever the LinkType attribute is requested (QFSFileEngine will now typically request this in reply to a fileFlags request). We now try to cache all meta data we get from the file system, while still requesting "refreshes" as often as we did before. Client code going straight to QFileSystemEngine API can choose it's behaviour by clearing and querying specific flags in the QFileSystemMetaData instance. Reviewed-by: Prasanth Ullattil
* QFileSystemMetaData: filling upJoão Abecasis2010-09-032-15/+172
| | | | | | | | | | | | | | | | | | | | Changes to QFileSystemMetaData resulting from implementing QFileSystemEngine::fillMetaData on Unix -- commit to follow. * Added missing operators for MetaDataFlags * Tentatively sharing entryFlags and size across platforms; times and owner IDs are candidates * Flags definition simplified and made stricter; unused bits are no longer set in masks, either * New AliasType for Mac; AliasType and BundleType on other platforms are 0 so they can be optimized out * New SequentialType for files that are not regular files * LocalDiskAttribute (LocalDiskFlag in QAbstractFileEngine) was only used to flag the use of a native file engine, so it's useless here * New flags for querying owner IDs * New method: missingFlags, to help with incremental queries * Added accessors for known data * New method to fill metaData from struct stat
* QFileSystemEngine/Mac: keep it empty until neededJoão Abecasis2010-09-035-76/+8
| | | | | | Added qfilesystemengine_mac to the build system, but hollowed it out. This way, it is ready for immediate use without having unnecessary stubs that can be found in the _unix version already.
* Implementation of QFileSystemEngine for Symbian OSShane Kearns2010-09-031-0/+213
| | | | | | Code comes from QFile, QDir and QFileInfo in the native IO branch Reviewed-By: joao
* Port over QFileSystemIterator for Symbian OSShane Kearns2010-09-034-3/+152
| | | | | | | | | Also added the QDirIterator::IteratorFlags iteratorFlags as a parameter for QFileSystemIterator, as it impacts what kind of filtering we can do via the OS. i.e. filename filtering isn't compatible with recursive iteration. Reviewed-By: joao
* Move rmdir code to createDirectory for unix'Thomas Zander2010-09-032-23/+22
| | | | | | | migrate the QFSFileEngine::rmdir code to QFileSystemEngine::removeDirectory and make the former call the latter. Reviewed-by: João Abecasis
* Move mkdir code to createDirectory for unix'Thomas Zander2010-09-032-32/+33
| | | | | | | migrate the QFSFileEngine::mkdir code to QFileSystemEngine::createDirectory and make the former call the latter. Reviewed-by: João Abecasis
* Implement bundleName() in QFileSystemEngineThomas Zander2010-09-033-13/+13
| | | | | | | Move the code from the qfsfileengine_unix.cpp to the new place and make the old place just call the new one. Reviewed-by: João Abecasis
* Updated comment in tst_QFileSystemEntry autotestPrasanth Ullattil2010-09-011-2/+2
|
* Fix tst_QFileSystemEntry auto tests on windowsPrasanth Ullattil2010-09-011-29/+83
| | | | | | | | | While resolving the native path, Windows implementation saves it as long absolute path. The tests are updated for this. This patch also splits the windows & unix code paths. Reviewed-by: Joao
* QFileSystemIterator: added destructor and placeholder for dataJoão Abecasis2010-09-013-0/+15
| | | | Reviewed-by: Prasanth Ullattil
* Make QFileSystemEngine::slowCanonicalized privateThomas Zander2010-09-012-1/+2
|
* Expanding the stub QFileSystemMetaDataJoão Abecasis2010-09-015-8/+75
| | | | | | | | Renamed FileFlags to MetaDataFlags. Added barebones structure and enum values to be shared across different implementations, with placeholders for platform-specific #includes and data members. Reviewed-by: Thomas Zander
* Breaking changes to QFileSystemEntry's constructorsPrasanth Ullattil2010-09-015-29/+21
| | | | | | | | | | | | | | | Since we are using a QString for the native file path on windows, the constructors we had on other platforms didn't make sense: we can't have two constructors taking a single QString parameter, and it would be error prone to have the two argument constructor (taking two QString parameters, on Windows) change the meaning of the first argument. This patch introduces a typedef for the NativePath type being used; the constructor taking the native path now requires a dummy parameter that makes the intent expliciti; and the order of the arguments on the constructor taking both native and Qt paths had the order switched. Done-with: João Abecasis
* Finish canonicalized for all platformsThomas Zander2010-09-016-77/+35
| | | | | | | QFSFileEnginePrivate::canonicalized is now removed and spread out over the qfsfileengine_unix.cpp and qfsfileengine.cpp Reviewed-by: João Abecasis
* QDir: Removed checks for existance of fileEngineJoão Abecasis2010-08-311-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-08-314-20/+176
| | | | | | | | | | | | | 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-08-311-0/+1
| | | | Must clear file lists when changing the name filters.
* Reverting QDir::detach introduced earlierJoão Abecasis2010-08-312-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-08-312-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
* Adding minimal QFileSystemIterator APIJoão Abecasis2010-08-3112-5/+229
| | | | | | Only stubs, for now, but it's a start. Reviewed-by: Thomas Zander
* Removed QFileInfoPrivate::initFileEngineJoão Abecasis2010-08-312-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