summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/dev' into wip/cmakeSimon Hausmann2019-10-171-0/+2
|\ | | | | | | Change-Id: Ia1da879a7bd8f71a649661a1844144dd67d60b3a
| * Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-10-171-0/+2
| |\ | | | | | | | | | Change-Id: Ica69de99be9c8af4d28a52e4b69e6af748ed983c
| | * Win32: Consolidate registry codeFriedemann Kleint2019-10-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Add a RAII class for registry keys and use it throughout the code base. Change-Id: I666b2fbb790f83436443101d6bc1e3c0525e78df Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2019-10-1411-178/+247
|\| | | | | | | | | | | Change-Id: I4a78428a8ea273b6960792e3b8043f816fa37fcf
| * | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-10-142-1/+4
| |\| | | | | | | | | | Change-Id: I129dd579f92cb2592a38ca043472b45cb926ae12
| | * Merge remote-tracking branch 'origin/5.13' into 5.14Liang Qi2019-10-102-1/+4
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/xcb/qxcbscreen.h src/src.pro Change-Id: I4e1981e69a1ddcbe4078ec6ab2a64b0da6a445de
| | | * Include XDG font locations in QStandardPaths::FontsLocation on LinuxAlex Henrie2019-10-082-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ~/.fonts was deprecated in 2012, see https://wiki.archlinux.org/index.php/Font_configuration#Fontconfig_configuration Few people keep fonts there anymore. Change-Id: Ide048e1df2c2db4856a38c574df36663ab684f89 Reviewed-by: David Faure <david.faure@kdab.com>
| * | | Minor cleanupLars Knoll2019-10-071-1/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: I77c631a73f1029433dfdd91681cc1f657a5c7cac Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-10-061-4/+3
| |\| | | | | | | | | | | | | | Change-Id: Ife31dad3c8dc43c5ff4d266e6d646230c5d20a50
| | * | Convert a few sizeof(array)/sizeof(element0) fors to range forsAlbert Astals Cid2019-10-041-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Increases readability Change-Id: I81ea915517fd2cd6bc2780f37ba8d8097c63f44b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| * | | Build fix for -developer-build with certain features disabledGuy Poizat2019-10-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When building with -developer-build the unused-parameter warning is a build breaker error, but some combinations of -no-features was still making it happen. Change-Id: Ib6354e6a599b8d64fd593fb94e9cfa32db63c77d Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
| * | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-10-022-11/+78
| |\| | | | | | | | | | | | | | Change-Id: Ideaa64d583746f1ce8265997131fb1ce3a9acbcf
| | * | Merge remote-tracking branch 'origin/5.13' into 5.14Liang Qi2019-09-302-11/+78
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qrandom.cpp src/corelib/io/qfileinfo.cpp src/corelib/kernel/qeventdispatcher_win.cpp src/corelib/kernel/qeventdispatcher_win_p.h src/gui/text/qfontdatabase.cpp src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm src/plugins/platforms/windows/qwindowsglcontext.cpp src/testlib/qtestcase.cpp Done-With: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Done-With: Edward Welbourne <edward.welbourne@qt.io> Change-Id: I4893212471aa24be804c989a581810e2f714545c
| | | * QFileInfo: clarify documentation about handling of symlink attributesThiago Macieira2019-09-251-11/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Windows, shortcut ".lnk" files are treated as symlinks, and attribute queries on a shortcut file return the results for the shortcut target. Fixes: QTBUG-77523 Change-Id: I907a43cd9a714da288a2fffd15bada7eba37d3ba Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| | | * Filesystem: avoid crashes on exit in case the locale codec is nullThiago Macieira2019-09-241-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On exit, QLocale::codecForLocale() can return null as the codec may have already been destroyed. In that case, pretend that Latin1 was the locale, so any file name is acceptable. This matches QString: QTextCodec *codec = QTextCodec::codecForLocale(); if (codec) return codec->toUnicode(str, size); #endif // textcodec return fromLatin1(str, size); Note that if we're wrong and the locale was *not* Latin1, files that you had a name to may not be encoded or decoded the same way. Fixes: QTBUG-78446 Change-Id: Iece6e011237e4ab284ecfffd15c54077728a17ca Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * | | Simplify code guarded by QT_USE_MMAPTobias Hunger2019-10-011-8/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QT_USE_MMAP is true only on systems with a defined Q_OS_UNIX, so there is no need to have code for windows in a section guarded by QT_USE_MMAP. Change-Id: I33d4ad596cc96f8f2e41374742fd5ec15b9e91a2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-09-241-0/+6
| |\| | | | | | | | | | | | | | Change-Id: Ic0dbddfa711905bc8e01aa6cbbdabf056a19587f
| | * | doc: add a note to QFileSystemWatcher about files saved by re-creationShawn Rutledge2019-09-231-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: QTBUG-46483 Fixes: QTBUG-53607 Change-Id: I434f177b35689d55aa1deea360bf7e6ae009ad68 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
| * | | Add note about reading/writing external storage on AndroidNicolas Fella2019-09-181-0/+2
| | | | | | | | | | | | | | | | | | | | Change-Id: I05e055de60c9a9a96f6536378585dc28410ddbbb Reviewed-by: BogDan Vatra <bogdan@kdab.com>
| * | | Merge remote-tracking branch 'origin/wip/qt6' into devSimon Hausmann2019-09-182-8/+1
| |\ \ \ | | |/ / | |/| | | | | | | | | | | | | | | | | | Conflicts: src/gui/image/qpicture.cpp Change-Id: Iecf79f96f54dc23bd703e6c4c634f909b796d7b3
| * | | Fix mis-handling of actual TLD in qIsEffectiveTLD()Edward Welbourne2019-09-161-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the domain passed down is an actual TLD that's the subject of a * rule, e.g. "ck" subject to *.ck, then we were finding no dot in it and concluding that it couldn't be the subject of a * rule. Added a test for the specific .ck case and commented on where we could get some canonical test data that I tripped over while researching this. Cross-reference the cookie-jar test from the QUrl test, too. Fixes: QTBUG-78097 Change-Id: Id858a9dae22e6b306a68df3fc199e0160f537159 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | | Add qt.core.filesystemwatcher logging categoryShawn Rutledge2019-09-111-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QFileSystemWatcher has open bugs, so users should be able to help troubleshoot. Change-Id: I6b703e25f294944469d20fd36012b6a55133732a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * | | Merge remote-tracking branch 'origin/5.13' into 5.14Liang Qi2019-09-042-145/+136
| |\ \ \ | | | |/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/codecs/qicucodec.cpp src/dbus/qdbusserver.cpp src/gui/painting/qbezier.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp src/plugins/printsupport/cups/qppdprintdevice.cpp Change-Id: I2703128bb64baf5580fbc2c2061b55b0f0611d2a
| | * | Docs: Some cleanup of class documentationKavindra Palaraja2019-08-271-140/+127
| | | | | | | | | | | | | | | | | | | | Change-Id: I62f89157e57189a97151f9661bc354af9bd67468 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
| | * | Also fall back to direct write for Android content: URLs in QSaveFileVolker Krause2019-08-241-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We cannot rename into content: URLs, so that is the only option, and this is particularly relevant here as the native file dialog will give us content: URLs by default for saving to. Change-Id: Ie96fcfc404a0842d397c7d1554e3c76f06bb3074 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | | Merge remote-tracking branch 'origin/wip/qt6' into wip/cmakeAlexandru Croitor2019-10-119-77/+114
|\ \ \ \ | | |_|/ | |/| | | | | | Change-Id: I3a1d7673c3c20019ab12a2ea0a60f1619920a34c
| * | | Merge remote-tracking branch 'origin/dev' into wip/qt6Alexandru Croitor2019-09-049-77/+114
| |\| | | | | | | | | | | | | | Change-Id: I54741635460bb2d8f3fd0be535ee1968d6c442bb
| | * | Remove QFileInfo::type and related enum from 5.14Volker Hilsheimer2019-08-302-83/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The API is problematic for several reasons: - the mixing of flags and enum in a single enum type - the name "type" as somewhat overloaded - the ease of misuse when comparing the result rather than testing for a bit being set In light of this, focus for 5.14 on the new isShortcut and isSymbolicLink functions, thus migitating the problematic isSymLink which conflates the two concepts. Change-Id: I57e02321edd5061f69a775f04a0932ef89adf866 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | * | Merge remote-tracking branch 'origin/dev' into 5.14Liang Qi2019-08-271-27/+2
| | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/widgets/kernel/qwidget.cpp src/widgets/kernel/qwidget_p.h src/widgets/kernel/qwidgetrepaintmanager.cpp src/widgets/kernel/qwidgetwindow.cpp tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp Change-Id: Ifae457d0427be8e2465e474b055722e11b3b1e5c
| | | * | forkfd: Add C11 and C++11 atomic supportThiago Macieira2019-08-201-27/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For forkfd, this is extremely useful, since users can rely on proper atomic API, not the old GCC API or the internal API that backs the C11 / C++11 implementation itself. This also caught one more mistaken use of seq_cst. Change-Id: Iec9c051acd73484c8d94fffd15b9985fe545e8b5 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | * | | QtCore: port all QMutexLocker users to qt_{scoped,unique}_lockMarc Mutz2019-08-255-32/+38
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... except four instances in QCoreApplication that would conflict with another change. Replace a locally-defined MutexUnlocker with a call to unlock() + qScopedGuard'ed lock() to avoid having to spell out the locker type while we can't depend on C++17 CTAD, yet. In QSettings, move the new mutex locker into and out of initDefaultPaths(), such as is idiomatic for std::unique_lock, but wasn't possible with QMutexLocker (which is not movable). Change-Id: I23056e13ecaa76159db583c7dccc6e05715e0788 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
| | * | Make Qt aware of symlinks and shortcuts on WindowsRyan Chu2019-08-162-15/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt has traditionally considered Windows shortcut files equivalent to symlinks on Unix file systems. Because of NTFS symlinks, the interpretation of shotcut files as symlinks is confusing. In this change, QFileInfo treats shortcut (.lnk) files as regular files but can follow the pointed object. In addition, QFileInfo introduces a more comprehensive file type. So that applications can make well-informed decisions about how to treat a file system entry. Based on the implementation of QFileInfo::type(), two inline helper functions are introduced to QFileInfo. 1. isSymbolicLink, returns true if it points to a symbolic link. 2. isShortcut, returns true if it points to a shortcut. [ChangeLog][QtCore][QFileInfo] Introduce QFileInfo::type() to replace the isSymLink method. Task-number: QTBUG-75869 Change-Id: Icc0dd52f9ad0ea50b0265d77ee0d0a3d25054e39 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| | * | QResource: port from QMutexLocker to qt_scoped_lockMarc Mutz2019-08-131-13/+13
| | | | | | | | | | | | | | | | | | | | Change-Id: I483e4765ef83d13e81bb830c9f48421410c5718b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | | Fix qmake build in developer buildsLeander Beernaert2019-08-161-0/+2
|/ / / | | | | | | | | | | | | | | | | | | | | | When building with developer builds, all targets are built with warnings as errors. In CMake this also applies to the qmake build. Change-Id: Ie62681d6c4756c106f5931a2a7d452a18dfa45f1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | | Merge remote-tracking branch 'origin/dev' into wip/qt6Lars Knoll2019-08-0628-227/+315
|\| | | | | | | | | | | Change-Id: Ib719a6249069e6bd6c9311bbec7f364855ab82ff
| * | QResource: consistently cache resourceList()Marc Mutz2019-08-011-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each call to reourceList() uses atomic operations to check whether resourceGLobalData has not expired, yet. Some functions already cached the value, but then went on to use the function directly afterwards. In some cases, this was due to the cached value being a pointer-to-const and the function later deciding to mutate the list. But all the code is safe from detaches, so this distinction need not be made. Standardize on caching, and using the cached value, except in functions which call it only once. Change-Id: I79780b990da539bf7beaa8104e13cb8187f84812 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
| * | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-08-011-1/+1
| |\| | | | | | | | | | Change-Id: I4505ec6fe17a1aa2c8d1e6576234d06a34eb9f99
| | * Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-07-311-1/+1
| | |\ | | | | | | | | | | | | Change-Id: Ifbaa4877051d93bcb0d58eed35bfe8dffa5634a3
| | | * qfsfileengine_p.h: Un-inline processOpenModeFlagsOliver Wolff2019-07-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An inlined exported function does not make sense and will cause a warning. Fixes: QTBUG-77242 Change-Id: I016b93d6b39c4db82148fdc5a8a92bc9d5751885 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
| * | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-07-303-21/+40
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/generators/win32/mingw_make.cpp Change-Id: I2f790bc8572bd22fea01edf7ca74595b29f063eb
| | * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-07-302-19/+36
| | |\| | | | | | | | | | | | | Change-Id: Ibdbd88e11cd03d5ce558e67ad8e9a21436e7ef89
| | | * Move processOpenModeFlags out of QFSFileEngineOliver Wolff2019-07-292-19/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The same logic is needed for QWinRTFileEngine. To be able to reuse the code, it was moved out of the class. Task-number: QTBUG-77095 Change-Id: If52b2fc8a0f3056d32fc693775565a1c3803b7d4 Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| | * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-07-291-2/+4
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qresource.cpp Change-Id: I54917f72444a621bd08aeaa15f5d17415993144d
| | | * QResource: fix nullptr-check gone tautologicalMarc Mutz2019-07-261-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Amends 136c5b9338f71775eb42528cfc7c23b2b4e5dff9. Before that change, each of the three members was a separate Q_GLOBAL_STATIC, so checking resourceList() for nullptr was the correct thing to do to find out whether the static was already destroyed. After the change, the resourceList() function will never return nullptr. Either resourceGlobalData.isDestroyed(), in which case dereferencing it asserts, or it isn't, in which case resourceList() returns a valid pointer. An explicit isDestroyed() check was added to the unregister function, but the register one was also checking resourceList() for nullptr, and this was left unprotected. Add the check and remove the now-tautological checks for nullptr resourceList(). Change-Id: I41fe66939ce858a77802b8af04c1de6e4fafe048 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * | | QStandardPaths: don't build a QHash just to look up one keyMarc Mutz2019-07-291-41/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code parses a file, looking for XDG_*_DIR entries and stores each one's key and raw value in a QHash. After parsing, it, however, looked up exactly once, by a key it could have known all along. So, move the key computation before the opening of the file, and look for the correct key directly, consciously striving to continue to find, as the old code implicitly did, the last entry, since man 5 user-dirs.dirs explains: > The format of user-dirs.dirs is designed to allow direct sourcing of > this file in shell scripts. Which means last one wins. Port to QStringView API of QRegularExpression, too. Change-Id: Ie92b689b5b9221df918c67b96f2f6a09827e7b1e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: David Faure <david.faure@kdab.com>
| * | | Port from QStringViewLiteral to u""Marc Mutz2019-07-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that all our supported compilers know char16_t, we no longer need QStringViewLiteral, whose only purpose in life was to turn u"" into L"" for MSVC < 2015. Change-Id: I25a094fe7992d9d5dbeb4a524d9e99e043dcb8ce Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| * | | Standardize on unique_ptr to hold QAbstractFileEngineMarc Mutz2019-07-285-22/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will make it possible to return it from functions in an owner, as exemplified in the QFileInfoPrivate ctor, unlike QScopedPointer, which lacks move special member functions. Change-Id: I179ffa4f656e1b83c23e0f67d1542834460ff382 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
| * | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-07-221-2/+12
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/generators/makefile.cpp Change-Id: Ib3715e626f2fd32804c75c16ea9aa06a1216e76d
| | * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-07-201-2/+12
| | |\| | | | | | | | | | | | | Change-Id: Ic34021fbb87d689ee23a5d1b3f50617ada9ec9b9
| | | * Fix QStorageInfo inability to parse really long mountinfo linesThiago Macieira2019-07-191-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Docker creates really long lines due to the multiple levels of overlays in the overlayfs. Our limit of 1024 bytes was too short. [ChangeLog][QtCore][QStorageInfo] Fixed a bug that caused QStorageInfo to be unable to report all filesystems if the options to mounted filesystems were too long (over 900 characters, roughly), such as those found in Docker overlay mounts. Fixes: QTBUG-77059 Change-Id: I6aed4df6a12e43c3ac8efffd15b1ba4231e60b4a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>