summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qfilesystemengine.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QFileSystemEngine: Remove unneeded test for relative symlinkOrgad Shaneh2017-09-281-2/+0
| | | | | | | symLinkTarget should always return absolute path. Change-Id: Id0078924d2f0befdea91e652a6c7775707c1b3c8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QFileInfo: harmonize QFileInfo() and QFileInfo("")Thiago Macieira2017-08-081-0/+4
| | | | | | | | | | | | | | | | | If a QFileInfo was constructed with an empty path, which could happen with QFileInfo(QFile()) or via QDir, etc., then it would issue system calls to empty paths and could even produce warnings. This commit makes am empty path name be the same as a default-constructed QFileInfo and corrects the use if 0 for ownerId and groupId to match the documentation. [ChangeLog][Important Behavior Changes] QFileInfo on empty strings now behaves like the default-constructed QFileInfo. Notably, path() will now be the empty string too, instead of ".", which means absoluteFilePath() is no longer the current working directory. Change-Id: I8d96dea9955d4c749b99fffd14ce34968b1d9bbf Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Move Unix code from qfilesystemengine.cpp to qfilesystemengine_unix.cppThiago Macieira2017-08-061-223/+0
| | | | | | | The comment about Symbian no longer applies. Change-Id: I8d96dea9955d4c749b99fffd14cd966f07d95948 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Filesystem: Use "birth time" to avoid confusion with Unix ctimeThiago Macieira2017-08-051-4/+3
| | | | | | | | | | | The Unix stat fields "st_ctime" and "st_ctim" mean "change time", the last time that the file/inode status fields were changed. It does not mean "creation time". So this commit splits all of the internal API to "birth" and "metadata change" instead of "creation" to avoid the conflict. Change-Id: I149e0540c00745fe8119fffd1463fe78b619649e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QFileSystemEngine: a file only exists if its link count is not 0Thiago Macieira2017-07-201-1/+3
| | | | | | | | | | QFileSystemMetaData::fillFromStatBuf is used when filling in the results from both stat() as well as fstat(). Obviously the file exists if it was stat()ed but not necessarily so by fstat(): we could be operating on a file descriptor referring to an unlinked file or an O_TMPFILE. Change-Id: I8d96dea9955d4c749b99fffd14cd52a8c8dd9ca1 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-11-081-2/+2
|\ | | | | | | | | | | | | Conflicts: src/corelib/tools/qalgorithms.h Change-Id: Ib8ce4d5d9ecd5b9c166d5b8b44e58f3e4e7283ff
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-11-041-2/+2
| |\ | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/json/qjsonparser.cpp src/gui/opengl/qopengl.cpp Change-Id: Ib4d3208398399691839e6c6eaeb9006f99e3a62b
| | * Stop using readdir_r: glibc deprecated it and it's not a good ideaThiago Macieira2016-11-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | POSIX does not require that readdir() be reentrant even for operations on different dirent objects, but all implementations (according to the glibc documentation) already do that. Moreover, it's not a good idea to use readdir_r since the buffer space is limited by the caller, so certain file names may be too long (ENAMETOOLONG) -- we had a workaround for QNX, but for no other OS. According to the glibc documentation, it is expected that POSIX will mark readdir_r obsolete and instead require some form of reentrancy for readdir. This commit makes everyone use readdir instead. The macros in qplatformdefs.h are left behind in case someone else is using them. With glibc 2.24, we started getting: qplatformdefs.h:150:35: warning: ‘int readdir_r(DIR*, dirent*, dirent**)’ is deprecated [-Wdeprecated-declarations] qfilesystemiterator_unix.cpp:112:17: note: in expansion of macro ‘QT_READDIR_R’ Task-number: QTBUG-56088 Change-Id: I33dc971f005a4848bb8ffffd14749b4082f62e69 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
* | | Improve precision of reported file times on Unix-style platformsSimon Hausmann2016-07-201-3/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of reporting the file times in the precision of seconds, our API allows us to report it up to millisecond precision. Change-Id: I8bcc6a1fb4116e8c5421d650a68f6fb00482e551 Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | CoreLib: use QStringRef to optimize memory allocationAnton Kudryavtsev2016-07-021-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | Replace substring functions that return QString with corresponding functions that return QStringRef where it's possible. Create QString from QStringRef only where necessary. Change-Id: Id9ea11b16947220cd27787c0b529de62d10b6c26 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-05-061-1/+13
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/qtestlib/tutorial5/containers.cpp examples/widgets/tools/tools.pro src/corelib/io/qprocess.cpp src/corelib/io/qprocess_unix.cpp src/corelib/io/qprocess_win.cpp src/network/kernel/qdnslookup_unix.cpp src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/testlib/qtestcase.cpp tools/configure/configureapp.cpp Change-Id: I838ae7f082535a67a4a53aa13a21ba5580758be8
| * QFileSystemMetaData: do not treat block devices as sequentialAlex Trotsenko2016-05-041-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch allows handling of special block devices in random-access mode that restores a Qt4 behavior. Can not be tested because requires root privileges in the system. Task-number: QTBUG-51666 Change-Id: Iaa56355f1be343c0d05b292e3c7d2e1c88724529 Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Andrius Štikonas <andrius@stikonas.eu> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | Updated license headersJani Heikkinen2016-01-151-14/+20
|/ | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* QtCore: use QStringRef in more placesMarc Mutz2015-10-121-1/+1
| | | | | | | | Apart from removing some unwanted allocations, also reduces text size by ~800B on Linux AMD64 GCC 4.9 release builds. Change-Id: Ibcd1d8264f54f2b165b69bee8aa50ff7f4ad3a10 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Modernize and unify filesystem code on Apple platforms.Jake Petroules2015-09-221-1/+1
| | | | | | | | | | | | | | | Replace deprecated File Manager APIs with modern equivalents. Change some Q_OS_MACX to Q_OS_DARWIN in file system related code. All of these apply to iOS as well as OS X, and were ifdef'ed for OS X only primarily due to legacy reasons - carryovers from Qt 4 or Carbon APIs which have since been refactored into using CoreFoundation. This also makes the code consistent with the documentation. Change-Id: I414e9bdfffff731413ddf16171b1317027d87caf Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into 5.5Liang Qi2015-04-151-1/+1
|\ | | | | | | Change-Id: I004854a25ebbf12b1fda88900162fe7878716c58
| * Doc: Fix using Apple-related terminology in Qt CoreAlexander Volkov2015-03-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | Use the name "OS X" instead of "Mac OS X", "Mac OS" and "OSX", and mention iOS. Replace "Carbon Preferences API" by "CFPreferences API" in the QSettings documentation. Change-Id: Ia7f9fb874276c7c445a1649df521b96ff43daa0c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* | Update copyright headersJani Heikkinen2015-02-111-7/+7
|/ | | | | | | | | | | | | | | | | | 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. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* QNX: Fix QDir::entryInfoList()Bernd Weimer2014-04-141-2/+2
| | | | | | | | | | | | If D_FLAG_FILTER is set, duplicate name entries are filtered out, so this flag has to be set along with D_FLAG_STAT in the call to dircntl. Also releaved dependencies between defines__EXT_QNX__READDIR_R, __EXT_QNX__READDIR64_R and _POSIX_THREAD_SAFE_FUNCTIONS Task-number: QTBUG-38189 Change-Id: I4e620cb9967e3d1baf6f2109a7c83703702f805b Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
* Utilize the new Q_OS_MACX define.Jake Petroules2013-05-091-1/+1
| | | | | | | | | | All occurrences of `#if defined(Q_OS_MAC) && !defined(Q_OS_IOS)` have been replaced with `#if defined(Q_OS_MACX)`. Change-Id: I5055d9bd1845136beb8ed1c79a8f0f2c0897751a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove ifdefs for supporting Mac OS <= 10.5Tor Arne Vestbø2013-02-181-2/+1
| | | | | | | | Qt5 requires Mac OS 10.6, so we can remove checks such as if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 Change-Id: Iea21727a277291148704ecf9677ed0b68c24920f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QNX: Fix build with QNX SDP 6.5.Sergio Martins2012-11-021-1/+1
| | | | | | | | | | | | __EXT_LF64SRC isn't defined in this case. This also makes it consistent with mkspecs/common/posix/qplatformdefs.h which uses QT_USE_XOPEN_LFS_EXTENSIONS and QT_LARGEFILE_SUPPORT to decide which type of stat struct to declare. Change-Id: Iaa155acc270783901376b543fdeffb5263294754 Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QNX: Remember information on whether a file is a linkThomas McGuire2012-10-301-0/+7
| | | | | | | | | | This avoids an additional call to lstat() When using QDir::entryList() with the QDir::NoSymLinks flag. Change-Id: I3b602546c6a4502ae25a5748a12c60e69325bb5d Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com> Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: João Abecasis <joao@abecasis.name>
* QNX: Use extra information in dirent to avoid stat() callsThomas McGuire2012-10-191-1/+48
| | | | | | | | | | | | This improves iterating over /usr/bin with QDirIterator by more than half, from 36 to 13 milliseconds. Change-Id: Ib3a9271c3a6f81c1ea3c21d012c875c7e9bad2ad Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Change coreservices -> iosIan Dean2012-04-191-1/+1
| | | | | | | | Replace "contains(QT_CONFIG, coreservices)" with "!ios" in config files. Replace "QT_NO_CORESERVICES" with "Q_OS_IOS" in source files. Change-Id: Id3b02316b245a24ce550e0b47596d18a4a409e4f Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Remove Symbian specific code from QtCore.Xizhi Zhu2012-01-301-24/+4
| | | | | Change-Id: I131303e28a12dccb96de3de4ca0073b389a9bbae Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | 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: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* corelib: Remove Q_WS-macros.Friedemann Kleint2011-10-241-1/+1
| | | | | | | | | | | | | | | | | | | | Q_WS_QPA is the only active code path after merging refactor, other Q_WS-macros are no longer used. Enable compilation without -qpa. - Remove Q_OS_MSDOS, Q_OS_OS2 - Remove Q_WS_QWS - Remove/replace definitions/conditionals of Q_WS_XX - Remove qpa branches from profiles - Replace Q_WS_MAC by Q_OS_MAC - Replace Q_WS_MAC && !Q_WS_QPA by Q_OS_MAC && !QT_NO_CORESERVICES - Similarly in profiles: mac:contains(QT_CONFIG, coreservices) - Replace Q_FS_FAT by Q_OS_WIN Change-Id: Icce5a6c55b052c8f72b3b979ddf31a4f388ea9c9 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Update licenseheader text in source files for qtbase Qt moduleJyri Tahtela2011-05-241-17/+17
| | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Doc: Applied pending fixes to API documentation.David Boddie2011-05-231-1/+1
|
* Initial import from the monolithic Qt.Qt by Nokia2011-04-271-0/+391
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12