summaryrefslogtreecommitdiff
path: root/src/corelib/io/qfsfileengine_unix.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright headersAkseli Salovaara2015-03-311-13/+13
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I7e3e96183e073877b46bc8071b2ccae19e69426b Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
* Updated year in copyright headerKai Koehne2014-03-261-1/+1
| | | | | | | | | | | | | | | | | | find . -path '*/3rdparty/*' -prune -o -type f -print | xargs -L1 sed -i -E 's/Copyright(.*) 2013 Digia/Copyright\1 2014 Digia/g' Manually patched files: demos/spectrum/3rdparty/fftreal/fftreal_wrapper.h demos/spectrum/3rdparty/fftreal/fftreal_wrapper.cpp src/3rdparty/s60/eiksoftkeyimage.h tools/qdoc3/test/qt-project.qdocconf tests/auto/qsharedpointer/nontracked.h tests/auto/qsharedpointer/nontracked.cpp Change-Id: I3f9074923b4d6bd4666258ab04f01476cc6e901c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Sergio Ahumada <sahumada@blackberry.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-131-1/+1
| | | | | | Change-Id: I52bf8ef0447b701b4ebf7d7d240013a72adb9425 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-291-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: I280c0a575987d1770e354b4948f1d4d767d711ea Reviewed-by: Simo Fält <simo.falt@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Update contact information in license headers.Sergio Ahumada2012-08-011-2/+2
| | | | | | | | | | | | | - Replace Nokia contact email address with Qt Project website. - Remove "All rights reserved" line from license headers. As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: Ie7ba62011752fcb149b99b26317c54f2a0cfa931 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Changes in Symbian CleanupStack use to allow dodgy app startMurray Read2012-02-081-12/+9
| | | | | | | | | | | | | | Some important apps were found to invoke Qt code using the Symbian CleanupStack during static data initialization. This is not legal Qt code, but due to the importance of maintaining compatability with these apps, Qt has been modified to avoid the problem. In one case by removing unnessary use of CleanupStack. In the other by creating a temporary CleanupStack. Task-number: ou1cimx1#960665 Change-Id: Iff631a638dceec10aa38add88ba93a63a831a574 Reviewed-by: Shane Kearns <ext-shane.2.kearns@nokia.com>
* Update year in Nokia copyright messages.Jason McDonald2012-01-111-1/+1
| | | | | | | | | Simple search and replace. This commit doesn't touch 3rd-party files, nor translations (where the change is not so simple and will be handled in a separate commit). Change-Id: I4e48513b8078a44a8cd272326685b25338890148 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Symbian - Fix QFile::map with non page aligned offsetsShane Kearns2011-12-151-3/+5
| | | | | | | | | | | | | | | | | Although it is not documented, RFileMap native API requires the offset into the file to be a multiple of the page size. Round down the offset requested by the user to the page size. Add back the difference before returning the base address to the user. e.g. if the offset passed to QFile::map was 5000: The offset passed to RFileMap will be 4096 The address returned to the user will be the RFileMap::Base() + 904 The modified address is used to key the hash of file mappings, so that QFile::unmap() can be passed the modified address without needing changes. Reviewed-by: mread Task-number: ou1cimx#953054
* Doc: Fixed qdoc warnings.David Boddie2011-08-151-0/+8
|
* Native memory mapped file supportShane Kearns2011-06-281-2/+53
| | | | | Task-number: QT-5026 Reviewed-by: mread
* Fix compiler warningShane Kearns2011-06-271-0/+1
| | | | Reviewed-by: Trust Me
* Update licenseheader text in source files for qt4.8Jyri Tahtela2011-05-131-17/+17
| | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Various INTEGRITY fixesRolland Dudemaine2011-02-221-0/+8
| | | | | | | | Some smaller adaptation for missing POSIX calls and some build system tweaks for the INTEGRITY RTOS Merge-request: 1101 Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
* Merge remote branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2011-01-171-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/webkit/imageanalyzer/imageanalyzer.h examples/webkit/imageanalyzer/mainwindow.h mkspecs/unsupported/qws/linux-x86-openkode-g++/qplatformdefs.h src/corelib/io/qfsfileengine_iterator_unix.cpp src/corelib/io/qfsfileengine_iterator_win.cpp src/corelib/kernel/qcoreapplication.cpp src/network/access/qnetworkaccessdatabackend.cpp src/plugins/bearer/connman/qconnmanservice_linux.cpp src/plugins/platforms/openvglite/qwindowsurface_vglite.h src/s60installs/bwins/QtCoreu.def src/s60installs/eabi/QtCoreu.def src/s60installs/s60installs.pro tools/assistant/tools/assistant/helpviewer_qwv.h tools/qdoc3/test/qt-html-templates.qdocconf
| * Update copyright year to 2011.Jason McDonald2011-01-111-1/+1
| | | | | | | | Reviewed-by: Trust Me
| * Doc: Fixing typoSergio Ahumada2010-10-251-1/+1
| |
* | QFile API: add API to specify if adopted file handles should be closedShane Kearns2010-12-201-0/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QFile behaviour has been to not close file handles adopted by open(FILE*, OpenMode) and open(int fd, OpenMode) functions. This is inconvenient for frameworks which want to return an opened QFile to the user. In this case it would be better to transfer ownership of the handle to the QFile. New overloads are added which take an additional parameter from the QFile::FileHandleFlags flags. Currently only one bit is used to provide the AutoCloseHandle option, but it is extensible. The AutoCloseHandle option tells the QFile backend that it should close the handle when close() is called, rather than the default behaviour which remains to flush the handle and leave it open. The DontCloseHandle option is the inverse of this, specifying the old behaviour of flushing but not closing the file handle. Symbian OS file handles are not compatible with int, they are an opaque data type which contains two integers. The first identifies to the kernel the file server session The second identifies to the file server the subsession object (the file) The reason for this is that it has a microkernel architecture, the kernel has no support for files - all files and file systems are handled by a user mode process called the "file server". So for symbian, a new QFile::open() overload is added for adopting a symbian RFile handle. The API mirrors the existing API for POSIX file handles, but takes an RFile reference rather than an integer file descriptor. Task-number: QT-2924 Reviewed-by: joao Reviewed-by: mread Reviewed-by: Oswald Buddenhagen
* | Fix buffered/unbuffered mode issues on symbianShane Kearns2010-11-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to a bug in the symbian file server, files in /resource can't be opened for unbuffered read, only for default mode read. (it doesn't mask the cache control flags when doing the security check) So read will always be done in default mode. Symptom of this was that QML plugin loading failed as the plugin description in /resource could not be read. Buffered or unbuffered writes (i.e. whether the cache should be write through or write behind) are controlled by the QIODevice::Unbuffered flag, therefore it needs to be passed through to the file engine. An optimisation for unix and windows to force unbuffered mode in the file engine is inappropriate (as that is referring to buffering in the standard library, which is bypassed entirely by using the low level RFile to open files on symbian) Reviewed-by: joao
* | Fix compile error on symbianShane Kearns2010-11-301-0/+4
| | | | | | | | | | | | | | | | | | | | | | Symbian doesn't have file owners, the resolveUserName / resolveGroupName functions have been correctly moved to unix only scope which caused a compile error. This change makes the QFSFileEngine::owner[Id] return -2 / QString() for symbian directly. Reviewed-by: Markus Goetz
* | Re-enable emulated QFile::map on symbianShane Kearns2010-10-291-26/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | Memory mapping of RFile handles is not supported in current symbian OS versions. However the "open C" libraries provide an emulated mmap() implementation which was used by QFile::map in Qt 4.6 release. To avoid breaking applications which rely on this function, QFile::map will now open the file with open C as well in order to use that handle to call mmap(). When symbian implements a file mapping API, we can switch the implementation to use that for RFile handles. Reviewed-By: joao
* | Move QDir::fromNativeSeparators call to the QFileSystemEntry constructorShane Kearns2010-10-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The m_filePath should always have / as the separator, while m_nativeFilePath should always have the native separator. Almost every place the constructor is used, the path could be one passed into an API from code outside our control. So it's easier to do the path conversion in the constructor than to have to remember to call fromNativeSeparators in every place a QFileSystemEntry is constructed (especially since unix tests won't reveal any error) Reviewed-By: joao
* | Implement seek beyond end of file for symbianShane Kearns2010-10-191-25/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | On Symbian, the Seek() function clamps to the end of file position if a position beyond the end of file is given. Also the write functions which take a position silently append at the end of file position if asked to write to a start position beyond EOF. To avoid this behaviour, we don't use seek but rather maintain our own cursor position. When writing, we check if the cursor is beyond EOF and if so extend the file using SetSize() before writing. Reviewed-By: joao
* | Use QSystemError to return errors from QFileSystemEngineShane Kearns2010-10-121-19/+21
| | | | | | | | | | | | | | | | | | | | Testing done: win32-msvc2008 and Mac OS X - qfile, qfileinfo, qdir, qdiriterator, qtemporaryfile autotests symbian-sbsv2 - qtcore, qtgui, qtxml autotests win32-g++ - compilation test for qmake Reviewed-By: Thomas Zander
* | Remove setSymbianError functionShane Kearns2010-10-071-37/+4
| | | | | | | | | | | | | | | | | | Qt autotests require the same error code on all platforms, and the OS specific error to be in text format in the errorString. Tests were failing due to QFile::error returning more detailed information than was wanted. Reviewed-By: Thomas Zander
* | Implement error reporting for QFile position and size functionsShane Kearns2010-10-071-3/+4
| | | | | | | | Reviewed-By: Thomas Zander
* | Implement error reporting for file APIsShane Kearns2010-10-071-39/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Part of the refactoring broke error reporting (false would be return on failure, but the QFile::error() would not return the right thing) A string is passed to the QFileSystemEngine functions which need to return an error, and filled in via the error code when a function fails. For windows, this is GetLastError() as for the previous workaround For unix, this is errno, as for the previous workaround For symbian, this is the integer error code returned by the function Reviewed-By: Thomas Zander Reviewed-By: Prasanth Ullattil
* | Move resolving names to qfilesystemengineThomas Zander2010-09-231-44/+3
| | | | | | | | | | | | Resolve username and group names code is now in the QFileSystemEngine Reviewed-by: João Abecasis
* | Implement unix permissions settingThomas Zander2010-09-221-41/+8
| | | | | | | | Reviewed-by: João Abecasis
* | Move rootPath, homePath, tempPath, currentPath and setCurrentPathShane Kearns2010-09-201-74/+5
| | | | | | | | | | | | | | Moved these functions inside the QFilesystemEngine and redirected the QFSFileEngine copies. 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-151-1/+1
| | | | | | | | | | | | | | | | 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
* | 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
* | Fix warning of unused variable on non-symbianThomas Zander2010-09-091-1/+1
| |
* | Implement basic symbian native file IO to QFsFileEngineShane Kearns2010-09-091-0/+95
| | | | | | | | | | | | | | Enough functionality to be able to read/write files for the tst_qfileinfo autotest to pass. Reviewed-By: joao
* | Enable symbian IO code in the buildShane Kearns2010-09-081-151/+192
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Move resolving a symlink to the qfilesystemengine_unixThomas Zander2010-09-061-68/+2
| | | | | | | | Reviewed-by: João Abecasis
* | QFileSystemEngine::fillMetaData for Unix platformsJoão Abecasis2010-09-031-207/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Move rmdir code to createDirectory for unix'Thomas Zander2010-09-031-22/+1
| | | | | | | | | | | | | | 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-031-31/+1
| | | | | | | | | | | | | | 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-031-11/+1
| | | | | | | | | | | | | | 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
* | Finish canonicalized for all platformsThomas Zander2010-09-011-13/+4
| | | | | | | | | | | | | | QFSFileEnginePrivate::canonicalized is now removed and spread out over the qfsfileengine_unix.cpp and qfsfileengine.cpp Reviewed-by: João Abecasis
* | Move canonicalPath() to the new qfilesystemengine_unixThomas Zander2010-08-301-14/+5
| | | | | | | | Reviewed-by: João Abecasis
* | Removed native file path handling from QFSFileEngineJoão Abecasis2010-08-301-93/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Move absoluteName to new fileSystemEngine for unixThomas Zander2010-08-271-14/+5
| | | | | | | | | | | | | | | | | | | | 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
* | Prefer Q_CHECK_PTR to q_check_ptrJoão Abecasis2010-08-191-1/+2
| | | | | | | | | | | | | | | | | | | | | | With the macro version we get proper debug output (with __FILE__, __LINE__ annotations) when compiling with -no-exceptions and !QT_NO_DEBUG. All changes in this patch affect assignment to local variables, where the order of assignment versus actual pointer check is not important. Reviewed-by: Olivier Goffart
* | Merge remote branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2010-07-281-2/+2
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qapplication.cpp tests/auto/qfileinfo/tst_qfileinfo.cpp tools/qdoc3/test/assistant.qdocconf tools/qdoc3/test/designer.qdocconf tools/qdoc3/test/linguist.qdocconf tools/qdoc3/test/qmake.qdocconf tools/qdoc3/test/qt-build-docs.qdocconf tools/qdoc3/test/qt.qdocconf
| * Merge remote branch 'origin/4.6' into qt-4.7-from-4.6Thiago Macieira2010-07-151-2/+2
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: bin/syncqt src/3rdparty/webkit/VERSION src/3rdparty/webkit/WebCore/ChangeLog src/3rdparty/webkit/WebCore/bridge/qt/qt_instance.cpp src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.h src/3rdparty/webkit/WebCore/page/FrameView.cpp src/3rdparty/webkit/WebCore/page/FrameView.h src/3rdparty/webkit/WebCore/platform/ScrollView.cpp src/3rdparty/webkit/WebCore/platform/ScrollView.h src/corelib/plugin/quuid.cpp src/gui/dialogs/qfontdialog.cpp src/multimedia/audio/qaudiodevicefactory.cpp src/opengl/qgl.cpp src/openvg/qpaintengine_vg.cpp tests/auto/qxmlquery/tst_qxmlquery.cpp
| | * Fix a couple of memory leaks due to not releasing CFTypes on MacAndy Shaw2010-07-091-2/+2
| | | | | | | | | | | | Reviewed-by: Prasanth Ullattil
* | | Merge remote branch 'origin/4.7' into qt-master-from-4.7Thiago Macieira2010-07-151-10/+0
|\ \ \ | |/ / | | | | | | | | | Conflicts: src/gui/kernel/qapplication.h