| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
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
|
|
|
|
| |
Reviewed-by: João Abecasis
|
|
|
|
| |
Reviewed-by: Joao
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Moved it into QFileSystemEntry, instead.
For the time being, QFileSystemEntry may look like an unnecessary extra
layer of indirection. For the time being, this allows us to do some code
cleanup and de-duplication. It is also a stepping stone to becoming
completely independent of the current file engine abstraction.
Changes to QFileSystemEntry:
- native file path on Windows is now a QString, instead of a
QByteArray. Accordingly, constructors taking a QByteArray were
removed for these platforms.
- Encoding/decoding of file names uses QFile::encode/decodeName API,
instead of assuming local 8 bit. On Windows, UTF-16 is used for
native, as was being done in QFSFileEngine.
- new functions isRoot(), isDriveRoot() [Windows/Symbian], and path()
- convenience functions clear() and isEmpty() added to facilitate
porting.
Changes to QFSFileEngine (Windows):
- removed QFSFileEnginePrivate::sizeFdFh(): the function was broken
and never used, so might as well not get compiled in.
- repeated pattern for use of FindFirstFile/FindClose hidden away in a
static inline function.
- repeated and inconsistent conversions from QString to native file
paths reduced through the use of QFileSystemEntry.
Done-with: Prasanth Ullattil
Done-with: Thomas Zander
|
|
|
|
|
|
|
|
|
|
| |
* Added default constructor.
* Made single-argument constructors explicit
* Converted bit-field data to "proper" variables - the bit-fields may
have been premature optimization and it may even turn out to not
relevant to keep this cache.
Reviewed-by: Thomas Zander
|
|
|
|
| |
to implementation files in new QFileSystem* API.
|
|
|
|
|
|
|
|
| |
Since we're refactoring code out of QFSFileEngine the new internal
classes have to be compiled in together with the old engines.
For the time being, we'll assume Mac uses the unix version of the
engine. We'll fork those only if and as needed.
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
Move the code for determining the absolute path on unix from the
qfsfileengine_unix.cpp to the new qfilesystemengine_unix.cpp which
is a static, stateless class.
Made sure that the old qfsfileengine_unix.cpp keeps on working by
calling into the new one.
Reviewed-by: João Abecasis
|
| |
|
|
|
|
|
|
|
|
|
|
| |
New file engine API is meant to be a thin layer of abstraction over
native file system APIs. Stateless and static for the time being.
Platform-specific implementations will follow.
Reviewed-by: Thomas Zander
Reviewed-by: Prasanth Ullattil
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Moved common initialization code from QDir ctor to QDirPrivate.
Reviewed-by: Thomas Zander
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
The QFileInfoPrivate::Data member class is removed now. All the methods
moved to QFileInfoPrivate. QFileInfoPrivate becomes a QSharedData type.
Reviewed-by: Joao
|
|
|
|
| |
Reviewed-by: Thomas Zander
|
| |
|
|
|
|
| |
Reviewed-by: Joao
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Reviewed-by: Joao
|
| |
|
|
|
|
| |
Reviewed-by: Prasanth Ullattil
|
|
|
|
|
|
| |
Empty for now.
Reviewed-by: Thomas Zander
|
|
|
|
| |
Reviewed-by: Thomas Zander
|
|
|
|
|
|
|
| |
is correct.
Merge-request: 720
Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>
|
|\
| |
| |
| |
| |
| |
| | |
master-integration
* 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2:
QGroupBox: Fix the focus rect of the title when using stylesheet
|
| |
| |
| |
| |
| | |
Task-number: QTBUG-13015
Reviewed-by: Olivier Goffart
|