| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
migrate the QFSFileEngine::rmdir code to QFileSystemEngine::removeDirectory
and make the former call the latter.
Reviewed-by: João Abecasis
|
|
|
|
|
|
|
| |
migrate the QFSFileEngine::mkdir code to QFileSystemEngine::createDirectory
and make the former call the latter.
Reviewed-by: João Abecasis
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Reviewed-by: Prasanth Ullattil
|
| |
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
QFSFileEnginePrivate::canonicalized is now removed and spread out
over the qfsfileengine_unix.cpp and qfsfileengine.cpp
Reviewed-by: João Abecasis
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Must clear file lists when changing the name filters.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Only stubs, for now, but it's a start.
Reviewed-by: Thomas Zander
|
|
|
|
|
|
|
|
| |
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
|