| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Reviewed-By: joao
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Reviewed-By: joao
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
Adding the test tst_QDirIterator::uncPaths(). Currently this traverses
the shares & folders in test-server for all entries except '.' & '..'
Reviewed-by: Denis
|
|
|
|
| |
Reviewed-by: Shane Kearns
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Reviewed-by: Joao
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
Native iterators interface allows propagation of meta data gathered
during directory traversal.
Reviewed-by: Shane Kearns
|
|
|
|
| |
Reviewed-by: João Abecasis
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Removing unnecessary garbage, inlining a destructor.
|
|
|
|
| |
Was missing counter initialization at the start of QBENCHMARK loop.
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
Added lots of unit tests (inspired from qfileinfo) and found plenty
of bugs that I fixed.
Reviewed-by: João Abecasis
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
To allow file-engines-refactor branch to build.
Reviewed-By: Trust Me
|
|
|
|
|
|
|
| |
Enough functionality to be able to read/write files for the
tst_qfileinfo autotest to pass.
Reviewed-By: joao
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Reviewed-By: joao
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
To fix compile error due to header changes upstream
Reviewed-By: Trust Me
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Reviewed-by: João Abecasis
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
So we can invoke custom handlers from QFileSystemEngine.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
Code comes from QFile, QDir and QFileInfo in the native IO branch
Reviewed-By: joao
|