summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qfilesystementry.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Unify behavior for long path or UNC prefix removalKarsten Heimrich2021-06-051-0/+28
| | | | | | | | | | | | | Split the code out of QDir::fromNativeSeparator into a separate reusable function to remove the above-mentioned prefixes. Fixes and unifies behavior if the prefix was given with slashes instead of backslashes. Add a couple more test cases. Fixes: QTBUG-93868 Pick-to: 5.15 6.0 6.1 Change-Id: Ibd94ae283e2fb113f9c2db97475fbc7d89522bbf Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Purge QFILESYSTEMENTRY_NATIVE_PATH_IS_UTF16Karsten Heimrich2021-05-111-3/+1
| | | | | | | | | | | This was probably introduced for Symbian and did not change since the Qt4 import (except for the Symbian code cleanup). Since it seems only to effect Windows, use Q_OS_WIN instead. Change-Id: I36f4d83ed5254d8b77073fc216551dfa0cc64a9f Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix QSaveFile and QTemporaryFile issues with windows network sharesKarsten Heimrich2021-05-111-6/+0
| | | | | | | | | | | | | | | | | | | The commit amends commit 3966b571 to take UNC prefix into account as well. Fixes the weird file name output as reported in QTBUG-74291 and QTBUG-83365. Replace manual separator normalizing in qt_cleanPath(), this is another spot where UNC prefix handling needs to be applied. Also make QTemporaryFile operate on '/' as file separators to fix creating both file types with native path separators on network shares. Fixes: QTBUG-74291 Fixes: QTBUG-76228 Fixes: QTBUG-83365 Pick-to: 5.15 6.0 6.1 Change-Id: Iff8d26b994bf4194c074cd5c996cda3934297fa5 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Port QDir, QFile from QStringRef to QStringViewLars Knoll2020-06-121-1/+1
| | | | | | Task-number: QTBUG-84319 Change-Id: I7feb5c12eb5a8504c34292e0da75332b5ba9ef20 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Remove winrtOliver Wolff2020-06-061-14/+0
| | | | | | | | | Macros and the await helper function from qfunctions_winrt(_p).h are needed in other Qt modules which use UWP APIs on desktop windows. Task-number: QTBUG-84434 Change-Id: Ice09c11436ad151c17bdccd2c7defadd08c13925 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QFileSystemEngine: verify that the file name isn't emptyThiago Macieira2017-08-171-5/+0
| | | | | | | | | | | | | | | | Making system calls with empty file names is not a good idea. When you run qmake $srcdir, you see this in strace: stat("", 0x7ffed229e250) = -1 ENOENT (No such file or directory) (twice) I've also inlined the isEmpty() function for better code generation. Some functions take QSystemError and some don't. That needs to be corrected at some point, possibly with something like std::expected. Change-Id: I1eba2b016de74620bfc8fffd14ccbfa162f93631 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QFileSystemEntry: Export static helper function checking for the root pathFriedemann Kleint2017-07-031-10/+20
| | | | | | | | | | | This provides a helper function which does the check on the string. QFileInfo::isRoot() in addition checks for the existence of the directory, which can cause hangs with network drives. Use the new function in appropriate places in QtWidgets. Task-number: QTBUG-6039 Change-Id: I54d0d860713e82b28fa4069a5345b042337f9c52 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Remove support for WinRT 8.1 and Windows Phone 8.1Maurice Kalinowski2017-01-181-2/+0
| | | | | | | | [ChangeLog][QtBase][General] Removed support for WinRT/Windows Phone 8.1. Task-number: QTBUG-57288 Change-Id: Ifd6d6780cbbdb710d99556ba3d2fb2e514d4f789 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Merge remote-tracking branch 'origin/5.6' into devLiang Qi2016-02-111-6/+10
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qfilesystemwatcher_win.cpp src/corelib/plugin/plugin.pri src/plugins/platforms/cocoa/qcocoaaccessibility.mm tests/auto/corelib/tools/qlocale/tst_qlocale.cpp Change-Id: Id6824631252609a75eff8b68792e4d10095c8fc1
| * Readability fix for MS isRelative, isAbsolute.Edward Welbourne2016-02-091-6/+10
| | | | | | | | | | | | | | | | | | | | | | The layout and phrasing of these two QFileSystemEntry methods was such as to obscure what they actually test. (Overlong lines, extraneous parentheses, spurious conditions and poor line-breaking.) Rewrote to make both clearer; and, in particular, to make it obvious that they are *not* mutually complementary. Behavior is not changed. Change-Id: If748e48d41fe3a76bab3a1f840c7b7ca62442f8f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2016-01-261-0/+10
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java src/dbus/qdbusconnection_p.h src/dbus/qdbusintegrator.cpp src/dbus/qdbusintegrator_p.h tests/auto/corelib/io/qdir/qdir.pro tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp Change-Id: I3d3fd07aed015c74b1f545f1327aa73d5f365fcc
| * winrt: msvc2015: refactor file handlingMaurice Kalinowski2016-01-211-0/+10
| | | | | | | | | | | | | | | | | | | | | | msvc2015 reintroduced a couple of functions from the win32 API towards WinRT. Enable usage of those and simplify the file system engine. Furthermore update the autotests. Change-Id: I9eafffba0ddfd05917c184c4a6b9e166f86d71d9 Reviewed-by: Oliver Wolff <oliver.wolff@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>
* | QtBase: use preincrement for iterator typesAnton Kudryavtsev2015-12-091-1/+1
|/ | | | | | | | | ... because it's useful for non-primitive types. Except for index-based loops, these were the only two remaining instances in QtBase. Change-Id: I0fafa502d78a70f98b4a90f4d3c7fdfbb401a90f Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QtCore: use QStringRef in more placesMarc Mutz2015-10-121-2/+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>
* Fix hidden detachSérgio Martins2015-05-131-8/+8
| | | | | | | | | | The methods are const but the member is mutable. Spotted being detached a few times at app startup. Strings were a few hundred chars big. Change-Id: Iaa3dc42a4f01f819a3fc4f8d756e35d38ce0aa1b Reviewed-by: David Faure <david.faure@kdab.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>
* QFileSystemEntry: Replace manual seek in string with lastIndexOf()Orgad Shaneh2015-01-111-7/+1
| | | | | Change-Id: Icf45795a962baa7102c02293cb7ce1781b8f2f56 Reviewed-by: Thiago Macieira <thiago.macieira@intel.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>
* Revert path() behavior to not expand a current path on a driveAndy Shaw2014-03-041-1/+1
| | | | | | | | | | | | | | | | | In the original change - cfb44c6528b2518274bf157388832d1d610ce0e4 - when querying for the path of a file that did not contain a slash after the drive indicator it would get the current path and return that as the path that the file resided on. However this meant that it would take the current path at that time which may not be the actual path that was expected. So it was decided that it should revert back to the original behavior which was to just return the drive letter followed by the colon which would thus indicate still that it represented whatever the current path was on that drive. Change-Id: Ic57ae9227882a66e9a4c4d6537d7f2cae829165a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Refactor plugin loading for WinRTMaurice Kalinowski2013-11-051-0/+6
| | | | | | | | | | | | | | | | | Specify the root directory to be the package root. Only plugins inside the root can be opened (actually also only files). Furthermore current defaults to the package root now, which in most cases is identical to previous behavior. When attempting to load a plugin the path can either be specified in host format "C:/..." or as plugin absolute "/platforms/...". Check for both, with preference of latter case, like when qt.conf is used with / being used as plugin path. Change-Id: I7e3da293362488b62a3357c4882ebf5e048dcf95 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Andrew Knight <andrew.knight@digia.com> Reviewed-by: Oliver Wolff <oliver.wolff@digia.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>
* Fix default-constructed QFileSystemEntryJoão Abecasis2012-09-251-3/+3
| | | | | | | | | | | | | | Member variables for lastSeparator, first and lastDotInFileName are now initialized to -1 (non-existing), where the previous value of zero would mean a separator/dot at that position and resulted in path() returning '/', instead of '.'. Tests were expanded for better coverage of empty state and default-constructed instances. Change-Id: Ie27547886b52224d38b5be0b4f920c9927fd440f Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.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>
* Don't do path conversions on isEmpty()João Abecasis2012-08-291-2/+1
| | | | | | Change-Id: I4b5eefe74c6f741d1d0870d502798a5e3d0e7a2a Reviewed-by: Prasanth Ullattil <prasanth.ullattil@nokia.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Fix cases where functions are called with a drive and no slashAndy Shaw2012-05-161-9/+9
| | | | | | | | | | | | | | | When a file is specified on a path that includes a drive letter followed by a colon but no slash then it didn't always account for the fact that this refers to the current path on that drive. This fixes the problems in completeBaseName(), baseName() and path(). Tests are also added for these three cases and some others too. Task-number: QTBUG-25353 Change-Id: I47a197c6af066f532442ad269be57597ec61303a Reviewed-by: Irfan Omair <irfan.omair@gmail.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Remove Symbian specific code from QtCore.Xizhi Zhu2012-01-301-12/+8
| | | | | 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>
* Fix comparison of absolute, unclean paths in QDirShane Kearns2011-09-021-0/+31
| | | | | | | | | | | | | | QDir::operator== was creating a clean absolute path for comparison purposes if the original path was relative. However original absolute paths were trusted, even though they could be unclean. Now they are checked for cleanliness first. Task-Number: QTBUG-19995 Task-Number: QTBUG-20495 Change-Id: I047a1a40ae5151e4604085e4ac87f30a4e4979c4 Reviewed-on: http://codereview.qt.nokia.com/4099 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Prasanth Ullattil <prasanth.ullattil@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
* Initial import from the monolithic Qt.Qt by Nokia2011-04-271-0/+383
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