summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/tqtc/lts-5.15.14' into ↵v5.15.14-lts-lgpl5.15Tarja Sundqvist2024-05-088-14428/+14417
|\ | | | | | | | | | | tqtc/lts-5.15-opensource Change-Id: Ibe29c3c6b47675d0a342bff3db91e79a3ea8a166
| * QProcess: remove the note that it freezes threads on QNXThiago Macieira2023-05-031-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The notes were added in commit e3363fd945b3ab961fba720ee013533dd8ba2930 by Rafael, because at the time QNX 6.5.0 did not support fork() in multithreaded applications. We had to use posix_spawn(3) and that doesn't support setting the child's working directory, so we needed to freeze the application while chdir(2)ing in doSpawn(). doSpawn() was removed in commit 005a8bfbf0022f03dafafcf2b5c438ccf0675a49 for Qt 5.7, because fork() works since QNX 6.6.0. But the comments were accidentally left behind. Fixes: QTBUG-112990 Change-Id: I3b169860d8bd41e9be6bfffd17577276eaabb855 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 6d30e7da3dcb2d5596552ac6b94f6599abcc2c2f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Update public suffix list for QUrl/QtNetworkMårten Nordheim2023-05-032-14353/+14293
| | | | | | | | | | | | | | | | | | Some test data was removed since the domain in question has been removed from the list. Change-Id: I2ec83a9f28ee7d6ba629dc635ebe02d0966c7267 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
| * QFSFileEngine: fix overflow bug when using lseek64Ahmad Samir2023-03-142-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QT_LSEEK (lseek64()) returns QT_OFF_T, which is off64_t on 32bit systems. The return from the lseek64() call was being assigned to an int, which meant that if the returned value is > INT_MAX it will overflow and the value becomes -1, and since errno would be EOVERFLOW the code would fail to open the file. Fix the issue by assigning the return value to QT_OFF_T. Thanks to Giuseppe for pointing out the issue in the code review. Found by compiling with -Wshorten-64-to-32. [ChangeLog][QtCore][QFile] Fixed a bug where opening a file in append mode may fail if the file size was bigger than INT_MAX. Change-Id: Iad33e3192f37466643a1218d38e5ecc2baaa7dc9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 5bffb47d6e45260953bc679e1e9582322064b753) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Android: fix and document QStandardPaths behavior on different versionsAssam Boudjelthia2023-03-032-15/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Partially revert e1440dd7bc1a5da9a536f88b9733d04ec8fa6e61 for Android versions below 11 which could take advantage of the manifest flag android:requestLegacyExternalStorage. And for other newer versions avoid returning them while adding a note to the docs about this behavior. Fixes: QTBUG-108013 Fixes: QTBUG-104892 Task-number: QTBUG-81860 Change-Id: I10851c20e2831bddaa329164c941e2ae71f0a497 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> (cherry picked from commit 81a748efb742092f5a0a1c33b8340478e52cc79f) Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
| * Android: avoid duplicate paths from QStandardPaths::standardLocations()Assam Boudjelthia2023-03-021-49/+37
| | | | | | | | | | | | | | | | | | | | | | Don't return duplicate path entries from calling QStandardPaths::standardLocations() and as a pass by no empty entries either. Task-number: QTBUG-104892 Change-Id: If05b20d2c07d75428cb572d9549a39cf21bdef99 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> (cherry picked from commit 30014ed850bbe62005b4aa789586b01c1281cab4)
| * Android: document limitation for QFile::copy() operation for content uriAssam Boudjelthia2023-03-021-0/+6
| | | | | | | | | | | | | | | | | | | | | | Document that the operation is not supported. Task-number: QTBUG-98974 Change-Id: I1faacb7af7e11943d6da62313ed104fda063d30d Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io> (cherry picked from commit 7af39be05295c5743d04ef83468a0d250141b145) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* | Merge remote-tracking branch 'origin/tqtc/lts-5.15.13' into ↵v5.15.13-lts-lgplTarja Sundqvist2024-01-047-8/+62
|\| | | | | | | | | | | tqtc/lts-5.15-opensource Change-Id: Ie9df84af22570d601db002e391a1a0d97e7cd9e1
| * Fix few QFileInfo and QDir callsAssam Boudjelthia2023-02-142-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Return the file engine impl of QFileInfo::completeBaseName() and QDir::absolutePath() and QFileInfo::fileName() (based on QAbstractFileEngine::BaseName) if the file engine impl is valid. Amends f77668ffec48d8aaad7c74069c6f3e770a305ae1. Task-number: QTBUG-98974 Change-Id: I28a8c75a6f25e30012b0791c12dbde51bfe8f62c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 249d613a60aa6a1347ebc1c29902049247b93324) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| * Docs:Android: Add docs notes about support for content UrisNicholas Bennett2023-02-013-0/+16
| | | | | | | | | | | | | | | | | | | | | | Add some details about the support of Qt apis (QFile, QDir, QFileInfo) for Android content uris. Fixes: QTBUG-99664 Task-number: QTBUG-98974 Change-Id: I4b884623702ccad116d47049e34ccddfe21f83ca Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io> (cherry picked from commit a0ca5f433fdc45e97e461ece2d9839eebd3c7ea0)
| * QFileSystemEngine: URL encode path in trash info, use relative pathJonas Kvinge2023-01-211-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the specifications, the path in .trashinfo should be URL encoded. The path can be relative when possible, otherwise changing the mountpoint will break restoring files from trash. But don't do that for root (/) and home. For more info, see.: https://specifications.freedesktop.org/trash-spec/trashspec-1.0.html Change-Id: Id8271a893a007f4cb5c10611f2b1bc71c1ff4860 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 314a4d121f55a7a6cd8335c9953d105574efab76) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| * [doc] Warn users about data races regarding qt_ntfs_permission_lookupMate Barany2023-01-192-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | qt_ntfs_permission_lookup is a non-atomic global variable that is prone to data races. Make a remark about this in the documentation. Task-number: QTBUG-105804 Change-Id: If7c64f3ab7d2c3b1487fe56204a4e66c420b0604 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 696ad54e5d76dd063cbb02d0c288fdece6ee75d0) Reviewed-by: Marc Mutz <marc.mutz@qt.io>
| * Fix infinite loop when iterating content uri sub-files/dirsAssam Boudjelthia2023-01-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | make QAbstractFileEngineIterator::currentFilePath() virtual and implement it under AndroidContentFileEngine to return current fileName because content uris shouldn't be constructed manaully like normal file paths. Fixes: QTBUG-104776 Change-Id: I4643a73a3bd4019bedaa056c35468117bcec18dc Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> (cherry picked from commit f3c998510d3a6c8fc468e449d66b0280119d0a8f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Return the QFileInfo::baseName/QDir::dirName() from fileEngine implAssam Boudjelthia2023-01-162-2/+6
| | | | | | | | | | | | | | | | | | | | | | Get those values from the file engine instead, this is relevant especially on Android for content uris. Task-number: QTBUG-98974 Change-Id: I65fe4c59e5f1feed0dcf14cc8988b4a40d9d979e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit f77668ffec48d8aaad7c74069c6f3e770a305ae1) Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
| * QBuffer: test and document open() behaviorMarc Mutz2022-12-161-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | QBuffer::open() was only documented as \reimp, so its behavior regarding WriteOnly was never actually described. Add a test and document the outcome. Change-Id: I75c49cd3f6a1961bcaece4a92a4e479bb3300d36 Reviewed-by: Mate Barany <mate.barany@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit c262a1805a062fd99abc890f58ea951da80ff0af) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* | Merge remote-tracking branch 'origin/tqtc/lts-5.15.12' into ↵Tarja Sundqvist2023-10-112-2/+3
|\| | | | | | | | | | | tqtc/lts-5.15-opensource Change-Id: Ie633210bf47c0a8738f0278a2d2b6362334ca564
| * Mention limitation of QDir::drives() on WindowsTimothée Keller2022-10-251-1/+2
| | | | | | | | | | | | | | | | | | | | Added comment to clarify returned drives from QDir::drives() Task-number: QTBUG-106896 Change-Id: I7cf9642b11f9000a5e6382a2b29070ab2cd6442e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit df89c93d916873c02c0995c76f325e7147858dae) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * QFileSystemEngine/Win: fix incorrect buffer size in currentPath()Thiago Macieira2022-10-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | We've just allocated a buffer of 'size' size, which is bigger than PATH_MAX, but told GetCurrentDirectory() that its size is PATH_MAX. Fixes: QTBUG-103852 Change-Id: Ibcde9b9795ad42ac9978fffd16f2ba2cd8712cb7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit e21522b8bfb4375e9c3f0336b1d218523de721b0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* | Merge remote-tracking branch 'origin/tqtc/lts-5.15.11' into ↵v5.15.11-lts-lgplTarja Sundqvist2023-06-0910-14332/+14401
|\| | | | | | | | | | | tqtc/lts-5.15-opensource Change-Id: Iac056a5e9f59fc8d1929171c18039aeb45be22b8
| * QTemporaryFile: document rename() differences from QFileThiago Macieira2022-09-121-8/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We will not do a copy+delete if the destination is on another mount point (in fact, QFile uses QTemporaryFile for the latter). In my opinion, that's a misfeature in QFile, because such an operation may need to display a progress bar to the user so they won't think the application has frozen. But it's too late to change now. I don't know why QTemporaryFile is different. It might be because it was used for the atomic materialization of a file before QSaveFile existed (5.1) but I didn't research to confirm. It's still useful even in the presence of that class if the file is really temporary (meant to be removed when the QTemporaryFile is destroyed). Fixes: QTBUG-103740 Change-Id: Iba16e8ea451b444ab213fffd16f4461f3f972d8c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 612f5cf9a1c708a18d6488f2b25d85716a899d99) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * QDirPrivate: pass input QList by crefMarc Mutz2022-08-222-2/+2
| | | | | | | | | | | | | | | | | | | | | | Unlike the mutable lvalue reference that was previously used to pass it suggested, the input is never modified, so pass by const reference. Change-Id: I5659fe5eab4a8953cd36134735e9e8fd9601f530 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit eef0013086bc23e4951c1a09018f9fc23f185f72) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * corelib: Fix typos in documentationJonas Kvinge2022-07-265-6/+6
| | | | | | | | | | | | | | Change-Id: I64d63af708bc6ddaabd12450eb3089e5077f849e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 18e1711f7a6b240bde9b8dc5366394c9b01b3a7f) Reviewed-by: Paul Wicking <paul.wicking@qt.io>
| * Fix doc and example of QLoggingCategory::installCategory()Edward Welbourne2022-06-151-7/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Snippet [22] was unused and the example using snippet [21] neglected to show how its oldCategoryFilter got initialized, which is what [22] does. But it turns out the example code was crashy in any case, as it left the oldCategoryFilter uninitialized (albeit probably null) until the call to installFilter() had returned, and installFilter() calls the new filter, so the new filter needs to check oldCategoryFilter before calling it. The doc also failed to explain why it's OK to not defer to the prior filter in these calls during installFilter(), so revise the doc and example so that the latter behaves sensibly and readers of the former are likely to use the function safely. This amends commit 8f0654ceb878b6c8a08c7f5b790027c26e007c13 which added the snippets and the use of one of them, but not the other. Fixes: QTBUG-49704 Change-Id: Iddb8d97b0bef417d8f16e7910730cfa59ea3e715 Reviewed-by: Kai Koehne <kai.koehne@qt.io> (cherry picked from commit 6ae2bfad411faf896fdca83a55db1e24a0b70e73)
| * Network: update Public Suffix ListIvan Solovev2022-05-242-14309/+14336
| | | | | | | | | | | | | | | | | | For the branches that use old format. Task-number: QTBUG-103663 Change-Id: I4fc2e75efc5b060afa232cd268baa23e4c23245b Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (adapted from commit ee1e446502993bb2e170cf351375d6cded29562a)
* | Merge remote-tracking branch 'origin/tqtc/lts-5.15.10' into ↵v5.15.10-lts-lgplTarja Sundqvist2023-04-242-10/+18
|\| | | | | | | | | | | tqtc/lts-5.15-opensource Change-Id: Ic1bb4240ca70a8a361fa0267476707446579221d
| * Remove duplicated include for <limits>Sona Kurazyan2022-05-091-1/+0
| | | | | | | | | | Change-Id: Ie9ec36029825754b5fbf53178fab0f5830c6b2be Reviewed-by: Marc Mutz <marc.mutz@qt.io>
| * Fix handling of DateTime values in QSettingsEdward Welbourne2022-05-071-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since 5.6.0, Qt's serialization of QDateTime in QSettings files has had special-case handling to use a newer QDataStream version than the one QSettings uses for most other types. This was handled in the serialization and parsing, but not taken into account in the code that turned binary data into content suitable for saving to an ini file. In Qt 5 this caused no problem when no iniCodec was set on the QSettings object but Qt 6 now uses UTF-8 as (in effect) codec on every QSettings object. This lead to the binary data encoding QDateTime being encoded as if it were Unicode, instead of using \x tokens where suitable. This lead to an unintended incompatible change in how QSettings stores QDateTime values: Qt 6 was still able to read Qt 5's values, but Qt 5 was unable to read Qt 6's settings files (unless it sets its iniCodec to UTF-8, which works round the problem). The code to convert raw binary data to ini-file-friendly value texts had a special case for ByteArray and Variant values, to ignore the codec and use \x tokens: when support for QDateTime was split from Variant, it gained a DateTime prefix in the parsing code that wasn't included in this special handling. So add that now. The resulting DateTime values now match Qt 5 so are readable by it and by Qt 6 (including versions prior to this change); and the code to read a DateTime can still read what earlier Qt 6 versions have been writing. It is likely a Qt 5 QSettings with an iniCodec other than UTF-8 may have problems with the result, but that was already true. This amends commit 73b8cd879cd723fbcce42e63f21cc864d13cb91e This cherry-pick converts "..."_L1 to QLatin1String("..."). Fixes: QTBUG-102334 Change-Id: Icc44a33db3dcc6400144bc001710b400ee883c90 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> (cherry picked from commit 6c5dac1685a1e88e530a10f18dc5da7667c95a1e) Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
| * Fix build with GCC 11: include <limits>Sona Kurazyan2022-05-011-0/+2
| | | | | | | | | | | | Task-number: QTBUG-102867 Change-Id: I459d953f27e0b565690603f6c96e93e8f06753c1 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
| * Include <limits> where std::numeric_limits is usedShawn Rutledge2022-04-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The error was: qt5/qtbase/src/corelib/io/qbuffer.cpp:370:41: error: no member named 'numeric_limits' in namespace 'std' constexpr qint64 MaxSeekPos = (std::numeric_limits<decltype(oldBufSize)>::max)(); ~~~~~^ qt5/qtbase/src/corelib/io/qbuffer.cpp:370:76: error: expected '(' for function-style cast or type construction constexpr qint64 MaxSeekPos = (std::numeric_limits<decltype(oldBufSize)>::max)(); ~~~~~~~~~~~~~~~~~~~~^ qt5/qtbase/src/corelib/io/qbuffer.cpp:370:77: error: no member named 'max' in the global namespace; did you mean 'std::max'? constexpr qint64 MaxSeekPos = (std::numeric_limits<decltype(oldBufSize)>::max)(); ^~~~~ std::max /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/bits/algorithmfwd.h:407:5: note: 'std::max' declared here max(const _Tp&, const _Tp&); ^ Amends da52a120dc0b93359fac35f8eef87301bba62904 Change-Id: I3cd13d39a8410a519627384171b49f96c9383bbd Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| * Correct documentation of INI format's loss of type informationEdward Welbourne2022-04-271-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | Although it loses type information for numeric types, it does preserve the type of most other values. This amends commit ee8a5f4917d98a26f8dedd6802eac754d748b227 Change-Id: Id4d0e11eabff1874869b940c05055e0bebef5963 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 76f9a768e89351e8b0690cdf2889bc45441f9686) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * QBuffer: fail early in seek() beyond QByteArray's max capacityMarc Mutz2022-04-131-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On 32-bit platforms, the range of qsizetype is smaller than the range of the qint64 used as a parameter in seek(). When seek()ing beyond the current buffer's size, the old code relied on a write() to fill the gap with NUL bytes. This has two problems: First, this may allocate a huge amount of memory just to find that it cannot write that much, possibly even taking the program down when the allocation in the QByteArray ctor fails, instead of returning false from seek(). Second, the QByteArray ctor to which we pass the gapSize only takes qsizetype, not qint64, so we were writing data of size gapSize mod (INT_MAX+1) on 32-bit platforms, which may succeed, just to find that that wasn't the number of bytes we expected to be written. By that time, however, the internal buffer has already been enlarged. Fix by checking whether the desired seek position is within the limits that QByteArray can contain early on, before attempting to construct such a large QByteArray. [ChangeLog][QtCore][QBuffer] Fixed silent data corruption on 32-bit platforms when seek() fails due to position > INT_MAX. Fixes: QTBUG-102274 Change-Id: Ib63cef7e7e61ef8101a5f056c7b2198bb7baa228 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 4bc85b9850303fa20206f8774af88d72593d3454) Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| * [doc] Fix typo in QBuffer::setBuffer() descriptionMarc Mutz2022-04-051-1/+1
| | | | | | | | | | | | | | Change-Id: I0afb0f114ddf7ceb5e99cb1bca3db99fd6e29223 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit ade96f461df0f126a843e65c2b7d368b89f42a13) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* | Merge remote-tracking branch 'origin/tqtc/lts-5.15.9' into ↵v5.15.9-lts-lgplTarja Sundqvist2023-03-2310-14479/+14313
|\| | | | | | | | | | | tqtc/lts-5.15-opensource Change-Id: Iaff6b55275e50d19973e1020853d8622587069f9
| * Doc: Fix broken formattingIvan Tkachenko2022-03-161-1/+1
| | | | | | | | | | | | | | | | Amends f25bc30d8d9d13fffd34213dfbf5e7373a18222a Change-Id: Ia42c7639e4919de3f995d771bfc7d8237a8773d8 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit a670839c61b6e7957bfacab0b51990f9ad37ffe1)
| * QFileSystemEngine: fix potential formatting errorMarc Mutz2022-03-161-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's not immediately clear that trashedName doesn't contain %1 or %2, in which case the subsequent .arg() would replace that instead of the intended %2. Fix by using QString::asprintf(), which doesn't perform multiple interpolation passes. Change-Id: Ib6c24bfea01db4cdc80f7547c8269cce3f815158 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> (cherry picked from commit bbae5c891b8807399271a655f99a3c90882a0f9e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Update QFileInfo docs to mention macOS aliasesTor Arne Vestbø2022-03-151-5/+7
| | | | | | | | | | | | | | | | | | | | The LegacyLinkType reflected by isSymLink() includes QFileSystemMetaData::AliasType. Change-Id: I98c84573f7f05d6d183b6ce1e22fc7424ed8e730 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit b5144d272293c2c6f135f9446df61011852c1cf6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Distinguish macOS aliases from normal symbolic linksTor Arne Vestbø2022-03-151-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The deprecated Carbon function FSIsAliasFile() returned isAlias only for actual aliases, whereas the replacement CFURLCopyResourcePropertyForKey with kCFURLIsAliasFileKey returns true for both aliases and symbolic links. Since we didn't explicitly check for AliasType in any of our internal code, or or any of the public API, the distinction did not cause any issues, but if we want to expose QFileInfo::isAlias() we need to fix this. Change-Id: I29f795d55fe40898de319aa1cb0a4a1b5646bbd6 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 34b5e38f207e092f89bb18aa0e69336b70de5247) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * QProcess/Unix: ensure we don't accidentally execute something from CWDThiago Macieira2022-02-281-11/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unless "." (or the empty string) is in $PATH, we're not supposed to find executables in the current directory. This is how the Unix shells behave and we match their behavior. It's also the behavior Qt had prior to 5.9 (commit 28666d167aa8e602c0bea25ebc4d51b55005db13). On Windows, searching the current directory is the norm, so we keep that behavior. This commit does not add an explicit check for an empty return from QStandardPaths::findExecutable(). Instead, we allow that empty string to go all the way to execve(2), which will fail with ENOENT. We could catch it early, before fork(2), but why add code for the error case? See https://kde.org/info/security/advisory-20220131-1.txt [ChangeLog][Important Behavior Changes] When passed a simple program name with no slashes, QProcess on Unix systems will now only search the current directory if "." is one of the entries in the PATH environment variable. This bug fix restores the behavior QProcess had before Qt 5.9. If launching an executable in the directory set by setWorkingDirectory() or inherited from the parent is intended, pass a program name starting with "./". For more information and best practices about finding an executable, see QProcess' documentation. Change-Id: I54f205f6b7314351b078fffd16cf7013c97ee9fb Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 29fceed2ffb41954a63001414bd042611f2d4980) Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
| * Windows: use QSystemLibrary instead of LoadLibrary directlyAndy Shaw2022-02-221-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Using QSystemLibrary ensures that it will only use the expected copy of the system library and not one that has been placed in the application's working directory or elsewhere in the PATH environment variable. Pick-to: 5.12 Change-Id: Ic4234334f73482b38ee5f06345bf11f8c029edc5 (cherry picked from commit a14f2d59141e05d4c8e116895e918638b920611d) Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| * Update public suffix listIevgenii Meshcheriakov2022-02-182-14451/+14277
| | | | | | | | | | | | | | | | | | | | Adjust the testcase that uses domain .nym.ie. This domain was removed from public suffix list. Fixes: QTBUG-100990 Change-Id: Icfcc7882be35b85bfd8828c6950e2cf23f7ede65 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (adapted from commit 1e468432f624642db4ca3997140431640499025d)
| * Fix issue where readyRead() could happen after disconnected()Joni Poikelin2022-02-141-1/+1
| | | | | | | | | | | | | | | | | | disconnected() signal can be emitted inside startAsyncRead() if the other application happens to disconnect at the right time. Fixes: QTBUG-100511 Change-Id: I3fb2f2978ef9113af9dbac05762c85a32b3999f8 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
| * doc: Update GenericDataLocation location on iOSTor Arne Vestbø2022-02-091-1/+1
| | | | | | | | | | | | | | | | | | | | Now matches implementation. Fixes: QTBUG-100364 Change-Id: I1274b8b485f1a02a79b7abebc2289613958f9a76 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 13fa00519d684ddc1779845cebbd6cec552f8f1c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Doc: Replace "C:\Documents and Settings" pathsKai Köhne2022-01-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | "C:\Documents and Settings" isn't a real path anymore since Windows Vista. Replace it by C:\Users, or - in the snippet for QDesktopServices that is for demoing a path with space - with C:\Program Files. Change-Id: I1bef97b6482180a6467fffcd1d62d6c168bcb389 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 623200643ca92b781774cd323e39c477abdb471f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* | Merge remote-tracking branch 'origin/tqtc/lts-5.15.8' into ↵v5.15.8-lts-lgplTarja Sundqvist2022-11-111-4/+4
|\| | | | | | | | | | | tqtc/lts-5.15-opensource Change-Id: I569a2246c9e8d70430e8c5405b9f3df2218078ee
| * QAbstractFileEngine: fix UB (data race) on qt_file_engine_handlers_in_useMarc Mutz2021-11-161-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While all writers of the variable hold fileEngineHandlerMutex for writing, the qt_custom_file_engine_handler_create() function checks the value before entering a fileEngineHandlerMutex read-side critical section, thereby causing a C++11 data race. Fix by making the variable atomic. Interestingly enough, relaxed atomic operations suffice here, since the actual synchronization happens in read- and write-side critical sections, and if qt_file_engine_handlers_in_use is wrong w.r.t. to the actual list, the critical sections will still work. We just mustn't cause UB by reading and writing to a simple bool without proper synchronization. Change-Id: I30469504cdbc90e2ab27125181e53d74305f13fd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 536471106d47bb99680f8e0dbb448c9671914309) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* | Merge remote-tracking branch 'origin/tqtc/lts-5.15.7' into ↵Tarja Sundqvist2022-09-121-0/+2
|\| | | | | | | | | | | tqtc/lts-5.15-opensource Change-Id: I976ce0c3664c9953dd0019b7d76d3f603583634f
| * Doc: Replace the example for QFileInfo::setFileLuca Di Sera2021-08-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The example in the documentation of `QFileInfo::setFile` made no use of `setFile` and only showed a use of `QDir::setCurrent`. The example was replaced with a new example showing how `setFile` changes the file that the information are retrieved from. The old example was moved under the documentation for `QDir::setCurrent` as it shows its working. Fixes: QTBUG-87128 Change-Id: I8227876cfcb4d582040bda9b4b7f3f7debea1e07 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit a2abb0145174a8ed82572a06e537f550a6777b08) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* | Merge remote-tracking branch 'origin/tqtc/lts-5.15.6' into ↵Tarja Sundqvist2022-08-165-14320/+14436
|\| | | | | | | | | | | tqtc/lts-5.15-opensource Change-Id: Ia9164a17d80376f0a3ab9752c4a9f4dd2f0bd3d9
| * Doc: Add see also links to operator== and operator!=Paul Wicking2021-08-181-0/+4
| | | | | | | | | | | | | | | | | | | | | | Add see also link from operator== and operator!= to matches() to avoid possible confusion. Fixes: QTBUG-95820 Change-Id: Ica8112da436b57da0d410f8e1f6b71fc6bf0791f Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> (cherry picked from commit c4ac9e74c79ebba3493ce29b25623b8c39b021a4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * macOS: Don't mangle QByteArray settings with @ prefix by decoding as UTF-8Tor Arne Vestbø2021-07-121-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QSettings encodes QVariants as @Type(data) strings. If that data contains a null-byte, we write the string as UTF-8 encoded CFData. When reading it back we look for a @ prefix, and then pass it as UTF-8 through stringToVariant. The problem arises then the user writes raw QByteArrays with a @ prefix. We can detect this situation by checking the result of stringToVariant, and if it's just a simple conversion of the string into a QVariant, we know that stringToVariant hit its fallback path due to not finding any embedded variants. If that's the case, we return the raw bytes as a QByteArray. Change-Id: I4ac5c35d0a6890ebea983b9aca0a3a36b0143de2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 3eac6079d9a02fbedd3740186eaaf21134dc45c2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>