summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qfilesystemengine_unix.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix malloc errors from legacy realpath on Mac OSX.Jeremy Nicholl2013-01-161-2/+9
| | | | | | | | | | | | | | | Avoid using realpath(X,0) on Mac OSX at all, since even on versions of OSX where realpath(X,0) is supported, we still get the legacy version due to our compiler flags. If we were to change the -mmacosx-version-min to 10.5 or higher then this patch would be safe but unnecessary. Task-number: QTBUG-28282 (cherry picked from commit 67195dc394001ee1c9adc7db97fd6ff9d88e9b0c) Change-Id: I0e763321aed71b03e6bf256d112cf4b743411626 Signed-off-by: Peter Hartmann <phartmann@rim.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.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>
* Refactor coreservices -> ios & QT_NO_CORESERVICES -> Q_OS_IOSIan Dean2012-09-181-1/+1
| | | | | | | Similar work was done in Qt5 in Change Id3b02316 Change-Id: I392d2a5bfffb9a335f28d5dbc5ea27b800fc4487 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Fix realpath() call to older POSIX platformsRafael Roquetto2012-09-121-8/+13
| | | | | | | | | | | | | | Some POSIX platforms do not support realpath(X, 0). This commit is akin to the following qt5 commits: 4a4e9e4a9c56f9b27f2fb76fae6ff06b9f470895 ad5d64226abd50a43856ab560583f37b49ff04c9 6e8e1da0a8267d2f8f568403e6ab9fe53b01cd29 f3707a5a0c4483b15e7bb2ba9f0e7d1913a713ee Change-Id: I05dc12cedefcaaa11eec2bcc71df023fdb51ac00 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Blackberry: Fix QFileSystemEngine::tempPath()Thomas McGuire2012-08-301-2/+5
| | | | | | | | | | | | | Apparently it depends on the user and/or firmware version on whether TMPDIR or TEMP is set, so try both. Additionally, fall back to /tmp if neither is set, as that seems to be present on all devices. This is a backport of a135d87a0f8ec24445e13fb54f4316e4ca7473be from Qt5. Change-Id: I1637f4ab74c8c8bd350b4efb451c2143c0642796 Reviewed-by: Sean Harmer <sean.harmer@kdab.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>
* Fix QFileSystemEngine::tempPath on Blackberry OSRafael Roquetto2012-04-011-0/+7
| | | | | | | | | | | Unlike Unix, Blackberry OS stores the location of the temporary directory into the TEMP environment variable. Change-Id: I31f50fc4b160e5594339c4fcd62613963cc1484f Reviewed-by: Shane Kearns <shane.kearns@accenture.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* realpath(X,0) IS supported on QNX.Nick Ratelle2012-02-091-1/+1
| | | | | | | | | | | Adds check for Q_OS_QNX to force QFileSystemEntry QFileSystemEngine::canonicalName() use realpath(X, 0) on QNX as well. cherry-picked from qt5/qtbase ee592fc042efc19acbc5407f5277abe7372c138d Change-Id: I715b1a226cc89831333f70a295c5d269bf6a8baf Reviewed-by: João Abecasis <joao.abecasis@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>
* Resolve a number of compilation issues with INTEGRITYRolland Dudemaine2011-09-191-0/+4
| | | | | | | | | | | First, #ifdef'ed out getpwuid_r() and getpwgid_r() usage since users/groups support is not in in single-process Posix mode. Also, correct a typo and add missing files to io.pri. Update documentation to disable libtiff which won't compile until ibtiff itself is updated, and add back -no-exceptions in the sample command line. And add a line to compile host tools. Add a dummy QT_OPEN_LARGEFILE definition in qplatformdefs.h since there is code that requires it. Move definition of getGlyph() after the definition of qHash(GlyphAndSubPixelPosition). Merge-request: 2686 Reviewed-by: ossi
* Restore Qt4.7 behaviour of QFileInfo::absolute(File)PathShane Kearns2011-09-051-1/+1
| | | | | | | | | | | | | | | | | Many applications relied on the undefined behaviour that the filesystem engines returned clean paths (despite the documentation stating that they may not), and consequently suffered regressions with Qt 4.8. Unix paths are once again cleaned if necessary. Windows/Symbian paths were already cleaned, but now use the utility function to check if a path is dirty, to avoid duplicated code. Task-number: QTBUG-19995 Change-Id: If8c18469f149291c9d079ae3da23bc2087bbd49a Reviewed-on: http://codereview.qt.nokia.com/4154 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Prasanth Ullattil <prasanth.ullattil@nokia.com>
* Compile fixes in corelib for iosIan2011-06-201-3/+8
| | | | Reviewed-by: Jørgen Lind
* 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
* QFileSystemEngine::currentPath(): use QFileSystemEntry() also for the ↵Pino Toscano2011-05-051-1/+1
| | | | | | | | | | | no-PATH_MAX case ... in the same way as done in the other code path. This makes qmake/QtCore compile again on glibc systems without PATH_MAX (e.g. GNU/Hurd). Merge-request: 1218 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Fixes warningsOlivier Goffart2011-04-281-0/+1
| | | | | | | | | | In QString, it would comlain that: assuming signed overflow does not occur when assuming that (X - c) > X is always false Changing to unsigned comparison fix the warning Others are about unused variables Reviewed-by: Thiago
* Fix warning about "data" being unused.Thiago Macieira2011-03-221-0/+1
| | | | Reviewed-by: Trust Me
* Update copyright year to 2011.Rohan McGovern2011-03-111-1/+1
| | | | | Reviewed-by: Trust Me (cherry picked from commit 774a3536b00c4d6e4c4c10b708e31b4373a338e3)
* Fix warning, unused parametter errorOlivier Goffart2011-02-081-2/+1
| | | | | | Use the Function not implemented error Reviewed-by: Joao
* Crash in QFileSystemEngine::canonicalName with older libc versionOlivier Goffart2011-02-021-2/+3
| | | | | | | | | | Crashed on OpenBSD. POSIX.1-2001 says that the behavior if resolved_path is NULL is implementation-defined. POSIX.1-2008 specifies that the it can be NULL Reviewed-By: Markus Goetz
* Allow hard-coding the Unix temp pathHarald Fernengel2011-01-191-0/+4
| | | | | | | | | | This came as a requirement from a device manufacturer that couldn't agree whether tmp is /var/tmp or /tmp, which lead to all kinds of side effects. QSharedMemory token generation was broken depending on where TMPDIR pointed to. This patch allows hard-coding a Qt-wide temp-dir in qplatformdefs. Reviewed-by: Robert Griebl
* Adding #ifdefs/#defines lost in the merge to masterJoão Abecasis2010-11-231-8/+9
| | | | | | | | The file-engine-refactor moved a lot of code around. So simple merge conflict resolution didn't cut it to finish the merge. Lighthouse on OS X adds Q_WS_QPA, where we were already using QWS. Also introduced QT_NO_CORESERVICES.
* QFileSystemEngine: remove symbian code from Unix-specific implementationJoão Abecasis2010-11-221-51/+0
| | | | | | Symbian is not serviced by this code, anyway. So it's just dead code. Reviewed-by: Shane Kearns
* QFileSystemEngine: clean up unused codeJoão Abecasis2010-11-221-4/+2
| | | | | | | | | | resolveUser/GroupName(id) only make sense on Unix platforms, there's no point in replicating them elsewhere. bundleName is a Mac-only feature, so we can otherwise merge the default implementation for other platforms. Reviewed-by: Shane Kearns
* Use QSystemError to return errors from QFileSystemEngineShane Kearns2010-10-121-10/+10
| | | | | | | | | | 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
* Fix compileThomas Zander2010-10-071-1/+1
|
* Implement error reporting for file APIsShane Kearns2010-10-071-8/+21
| | | | | | | | | | | | | | | 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-2/+51
| | | | | | Resolve username and group names code is now in the QFileSystemEngine Reviewed-by: João Abecasis
* Mark the QFileSystemEngine::copyFile/unix done.Thomas Zander2010-09-231-1/+4
| | | | | | | There is no native implementation for this (the old FSFilesystemEngine never had one either) so no code to move. Reviewed-by: João Abecasis
* Make setPermissions update metaThomas Zander2010-09-231-1/+7
| | | | | | | | in the unix QFileSystemEngine::setPermissions we now update the QFileSystemMetaData instance passed in on success, to avoid another stat later. Reviewed-by: João Abecasis
* Implement unix permissions settingThomas Zander2010-09-221-1/+28
| | | | Reviewed-by: João Abecasis
* Remove warningsThomas Zander2010-09-221-0/+3
|
* Move rootPath, homePath, tempPath, currentPath and setCurrentPathShane Kearns2010-09-201-1/+56
| | | | | | | Moved these functions inside the QFilesystemEngine and redirected the QFSFileEngine copies. Reviewed-By: joao
* Fix typoJoão Abecasis2010-09-151-1/+1
|
* Pass QFileSystemMetaData reference into QFileSystemEngine::canonicalNameShane Kearns2010-09-151-1/+5
| | | | | | | | 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
* Move resolving of user/group name to the engine.Thomas Zander2010-09-101-0/+12
| | | | Reviewed-by: João Abecasis
* Fix QFileInfo::isHidden on MacJoão Abecasis2010-09-101-0/+7
| | | | | | | | | | | | | 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.
* Set file metadata variables to known values when stat failsShane Kearns2010-09-091-1/+8
| | | | | | | | | 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
* Enable symbian IO code in the buildShane Kearns2010-09-081-3/+5
| | | | | | | | | | | | | 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.
* Symbian OS implementation for QFileSystemMetaDataShane Kearns2010-09-071-63/+0
| | | | | | | | | | | | 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
* Move resolving a symlink to the qfilesystemengine_unixThomas Zander2010-09-061-2/+72
| | | | Reviewed-by: João Abecasis
* QFileSystemEngine::fillMetaData for Unix platformsJoão Abecasis2010-09-031-2/+207
| | | | | | | | | | | | | | | | | | | | | 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-031-1/+50
| | | | | | | | | | | | | | | | | | | | 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
* Move rmdir code to createDirectory for unix'Thomas Zander2010-09-031-1/+21
| | | | | | | 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-1/+32
| | | | | | | 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-1/+11
| | | | | | | 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
* Expanding the stub QFileSystemMetaDataJoão Abecasis2010-09-011-1/+1
| | | | | | | | 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-011-2/+2
| | | | | | | | | | | | | | | 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-011-2/+25
| | | | | | | 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-1/+20
| | | | Reviewed-by: João Abecasis