summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* 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-033-76/+3
| | | | | | 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
* 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-014-28/+20
| | | | | | | | | | | | | | | 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-312-20/+29
| | | | | | | | | | | | | 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-315-1/+206
| | | | | | 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
* Move canonicalPath() to the new qfilesystemengine_unixThomas Zander2010-08-307-71/+145
| | | | Reviewed-by: João Abecasis
* Fix the tst_QFileInfo::absolutePath() autotests on WindowsPrasanth Ullattil2010-08-301-2/+4
| | | | Reviewed-by: Joao
* QFileSystemEngine::isCaseSensitive for Symbian and WindowsJoão Abecasis2010-08-302-1/+5
|
* Removed native file path handling from QFSFileEngineJoão Abecasis2010-08-307-318/+302
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Small changes to QFileSystemEntryJoão Abecasis2010-08-302-5/+13
| | | | | | | | | | * 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
* Added missing QT_BEGIN/END_NAMESPACEJoão Abecasis2010-08-304-1/+18
| | | | to implementation files in new QFileSystem* API.
* Adding QFileSystemEntry and QFileSystemEngine to build systemJoão Abecasis2010-08-302-5/+6
| | | | | | | | 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.
* Simplify QDir::cdJoão Abecasis2010-08-271-2/+1
| | | | | | | 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
* QDir::makeAbsolute could self-destruct on failureJoão Abecasis2010-08-271-7/+4
| | | | | | | | | | | 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
* QDir::operator= simplificationJoão Abecasis2010-08-271-3/+0
| | | | | | | | 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 absoluteName to new fileSystemEngine for unixThomas Zander2010-08-272-15/+34
| | | | | | | | | | 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
* Add empty implementations of each of the filesystemenginesThomas Zander2010-08-264-0/+361
|
* Begin defining the interface for file engines NGJoão Abecasis2010-08-262-0/+33
| | | | | | | | | | 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
* QDirPrivate refactoringJoão Abecasis2010-08-251-1/+3
| | | | | | | | | | | | 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
* QDirPrivate refactoringJoão Abecasis2010-08-251-20/+20
| | | | | | | | | | | | | 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
* QDirPrivate refactoringJoão Abecasis2010-08-251-25/+24
| | | | | | Moved common initialization code from QDir ctor to QDirPrivate. Reviewed-by: Thomas Zander
* Removed QDirPrivate layer of indirectionJoão Abecasis2010-08-252-229/+216
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Refactor QFileInfoPrivate::Data (Round 2)Prasanth Ullattil2010-08-253-178/+161
| | | | | | | The QFileInfoPrivate::Data member class is removed now. All the methods moved to QFileInfoPrivate. QFileInfoPrivate becomes a QSharedData type. Reviewed-by: Joao
* Fix QFileSystemEntry autotests for WindowsPrasanth Ullattil2010-08-251-1/+1
| | | | Reviewed-by: Thomas Zander
* Fix the unit test on WindowsThomas Zander2010-08-251-1/+8
|
* Add unit test for qfilesystementryThomas Zander2010-08-252-4/+10
| | | | Reviewed-by: Joao
* Refactoring QDirPrivate::DataJoão Abecasis2010-08-241-84/+98
| | | | | | | | 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
* Move QFileInfoPrivate methods to QFileInfoPrivate::Data (1st Round)Prasanth Ullattil2010-08-242-89/+90
| | | | Reviewed-by: Joao
* Add some more methods to the QFileSystemEntryThomas Zander2010-08-242-8/+94
|
* Add constructors and basic getters to QFilesystemEntryThomas Zander2010-08-242-0/+91
| | | | Reviewed-by: Prasanth Ullattil
* Adding internal classes QFileSystem{Engine,MetaData}João Abecasis2010-08-243-1/+131
| | | | | | Empty for now. Reviewed-by: Thomas Zander
* Adding placeholder for internal QFileSystemEntry classJoão Abecasis2010-08-243-2/+109
| | | | Reviewed-by: Thomas Zander
* Make the QItemSelectionRange and QItemSelectionModel ensure that the model ↵Stephen Kelly2010-08-191-1/+2
| | | | | | | is correct. Merge-request: 720 Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>
* Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into ↵Qt Continuous Integration System2010-08-191-0/+7
|\ | | | | | | | | | | | | master-integration * 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2: QGroupBox: Fix the focus rect of the title when using stylesheet
| * QGroupBox: Fix the focus rect of the title when using stylesheetMartin Pejcoch2010-08-191-0/+7
| | | | | | | | | | Task-number: QTBUG-13015 Reviewed-by: Olivier Goffart