summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Disable symlink and memory mapped files tests on symbianShane Kearns2010-09-152-1/+25
| | | | Reviewed-By: joao
* Don't compute canonical paths when not neededShane Kearns2010-09-151-1/+2
| | | | | | | | This optimisation saves 20% on symbian recursive iteration, and should help on other OS when the FollowSymlinks flag is not specified for directory iteration. Reviewed-By: joao
* Fixed QFile::setSize on symbianShane Kearns2010-09-151-3/+3
| | | | Reviewed-By: joao
* Fix for QFile::remove autotestShane Kearns2010-09-151-0/+1
| | | | | | | After removing a file, invalidate the cached metadata to force any calls that require metadata to fetch it from the file system. Reviewed-By: joao
* Pass QFileSystemMetaData reference into QFileSystemEngine::canonicalNameShane Kearns2010-09-157-9/+14
| | | | | | | | On symbian, this allows us to use the cached ExistsAttribute On symbian and unix, this allows us to update the caller's knowledge of ExistsAttribute (potentially saving a stat later) Reviewed-By: joao
* Test QDirIterator using UNC paths on Windows.Prasanth Ullattil2010-09-141-0/+30
| | | | | | | Adding the test tst_QDirIterator::uncPaths(). Currently this traverses the shares & folders in test-server for all entries except '.' & '..' Reviewed-by: Denis
* Make compile for symbianThomas Zander2010-09-141-1/+1
| | | | Reviewed-by: Shane Kearns
* Fix the tst_QFileInfo::canonicalFilePath() on windows.Prasanth Ullattil2010-09-141-2/+2
| | | | | | | | | | This was trying to load a wrong Win32 function to test the symbolic links on windows. Some Win32 APIs have to be resolved against either a Wider Character version('W') or an ANSI version('A'), the function names without these character appended are usually '#define's in the header files. Reviewed-by: Zeno Albisser
* Make QFSFileEngine & QFileInfo use the new filesystemengine on WindowsPrasanth Ullattil2010-09-146-1002/+1211
| | | | | | | | | | | | | | QFSFileEngine now uses the QFileSystemEngine static functions to implement most of the file system related quries. All the Win32 specific code is now moved from the QFSFileEngine to QFileSystemEngine. This implements all the fillMetaData and filename query functions. These new functions behave exactly like their previous implementations in QFSFileEngine. Following optimizations are done with this. * GetFileAttributesEx() instead of GetFileAttibutes(). * GetFileInformationByHandle() instead of POSIX functions. Reviewed-by: Joao
* QFileSystemEngine: Fix stupid bug-o in engine creationPrasanth Ullattil2010-09-141-1/+1
| | | | Reviewed-by: Joao
* Fixes for canonicalPath and exists on symbianShane Kearns2010-09-131-19/+42
| | | | | | | | | | | | | QDir::cleanPath does not do what we need for some types of path, for example c:/../. However, changing the cleanPath() function isn't easy because so many places rely on the current behaviour. RFs::Att() doesn't work for root directories, so instead to check whether a file exists, we now use the normal fillMetaData() function. Also fixed some compiler warnings in the file. Reviewed-By: mread
* Integrate symbian file system iteratorShane Kearns2010-09-132-21/+18
| | | | | | | | | | Store the relative path in nativeFilePath and prepend it to results, this behaviour was previously provided by the base class. Some refactoring to avoid needing to allocate a TFileName on the stack, and to set the known metadata flags inside the fillFromXXX functions. Reviewed-By: Thomas Zander Reviewed-By: mread
* Fix setPermissions in symbianShane Kearns2010-09-131-4/+4
| | | | | | | | In error, it was checking the read permissions to set the read-only file attribute, when it should have been checking the write permissions. read-only = !writable. Reviewed-By: Thomas Zander
* Fix Symbian's root pathShane Kearns2010-09-131-3/+5
| | | | | | | | | Change the root path to return the root of the system drive, e.g. "c:/" instead of the PhoneMemoryRootPath() "c:/data/". The PhoneMemoryRootPath() matched Qt's concept of the home path, and will continue to be returned for that function. Reviewed-By: Thomas Zander
* Refactored QFSFileEngineIterator/UnixJoão Abecasis2010-09-1012-154/+181
| | | | | | | | | into new internal native iterators. QFSFileEngineIterator will use that internally, currently only on non-windows platforms. This implementation can be reused on Windows once the native iterators are in place there as well. Reviewed-by: Shane Kearns
* QDirIterator: Use new native iterators when possibleJoão Abecasis2010-09-104-24/+100
| | | | | | | Native iterators interface allows propagation of meta data gathered during directory traversal. Reviewed-by: Shane Kearns
* Move resolving of user/group name to the engine.Thomas Zander2010-09-107-24/+70
| | | | Reviewed-by: João Abecasis
* Move OS specific inlines outside of class declarationShane Kearns2010-09-101-61/+79
| | | | | | | | This makes it easier to read, as common functions with different implementations depending on the OS are only declared once in the class. Reviewed-By: joao
* 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