summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
Commit message (Collapse)AuthorAgeFilesLines
* Prevent repeated instantiations of some qRegisterNormalizedMetaType<>s [1/N] ↵Marc Mutz2022-01-214-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (QtGui) Create macros that wrap the magic developed in 7d63efc16f65f98c657caa90e0d7e9b72a879ade and apply it to all Q_DECLARE_METATYPE invocations that show up in Clang -ftime-trace for a PCH'ed QtGui build. Effects on compile times: Clang 10 -ftme-trace: $ ClangBuildAnalyzer --analyze qtgui-before.trace | head -n6 Analyzing build trace from 'qtgui-before.trace'... **** Time summary: Compilation (523 times): Parsing (frontend): 628.3 s Codegen & opts (backend): 304.5 s $ ClangBuildAnalyzer --analyze qtgui-after.trace | head -n6 Analyzing build trace from 'qtgui-after.trace'... **** Time summary: Compilation (523 times): Parsing (frontend): 546.0 s Codegen & opts (backend): 304.4 s GCC 11 time (bash builtin): before: $ time for ((i=0; i < 3; ++i)) do touch src/gui/painting/qpolygon.h ; ninja libQt6Gui.so; done real 4m13,539s user 49m24,416s sys 3m18,177s after: $ time for ((i=0; i < 3; ++i)) do touch src/gui/painting/qpolygon.h ; ninja libQt6Gui.so; done real 3m55,697s user 45m19,941s sys 3m7,370s Task-number: QTBUG-97601 Pick-to: 6.3 Change-Id: Ia8e37a58937568a7ed21cfeb4b27274deca4d53b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtCore: replace qSwap with std::swap/member-swap where possibleMarc Mutz2022-01-207-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qSwap() is a monster that looks for ADL overloads of swap() and also detects the noexcept of the wrapped swap() function, so it should only be used when the argument type is unknown. In the vast majority of cases, the type is known to be efficiently std::swap()able or to have a member-swap. Call either of these. For the common case of pointer types, circumvent the expensive trait checks on std::swap() by providing a hand-rolled qt_ptr_swap() template, the advantage being that it can be unconditionally noexcept, removing all type traits instantiations. Don't document it, otherwise we'd be unable to pick it to 6.2. Effects on Clang -ftime-trace of a PCH'ed libQt6Gui.so build: before: **** Template sets that took longest to instantiate: [...] 27766 ms: qSwap<$> (9073 times, avg 3 ms) [...] 2806 ms: std::swap<$> (1229 times, avg 2 ms) (30572ms) after: **** Template sets that took longest to instantiate: [...] 5047 ms: qSwap<$> (641 times, avg 7 ms) [...] 3371 ms: std::swap<$> (1376 times, avg 2 ms) [qt_ptr_swap<$> does not appear in the top 400, so < 905ms] (< 9323ms) As a drive-by, remove superfluous inline keywords and template ornaments. Task-number: QTBUG-97601 Pick-to: 6.3 6.2 Change-Id: I88f9b4e3cbece268c4a1238b6d50e5712a1bab5a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QProcess/Unix: fallback on _POSIX_PIPE_BUF w/ missing PIPE_BUFPino Toscano2022-01-181-0/+5
| | | | | | | | | | | | | | | | | | | PIPE_BUF is optional in POSIX, e.g. "where the corresponding value is equal to or greater than the stated minimum, but where the value can vary depending on the file to which it is applied." [1] GNU/Hurd does not provide PIPE_BUF, so fallback to its minimum acceptable value, that is _POSIX_PIPE_BUF. [1] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html Also, explicitly include <limits.h> in this file, to make sure PIPE_BUF or _POSIX_PIPE_BUF are available without relying on other headers to pull <limits.h>. Change-Id: Ifae964db81841e1d31fc09e73b45594af9a326d1 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Replace QString::utf16 with QString::data where appropriateØystein Heskestad2022-01-172-2/+2
| | | | | | | | | | | QString::utf16() needlessly detaches fromRawData() to ensure a terminating NUL. Use data() where we don't require said NUL, taking care not call the mutable data() overload, which would detach, too. Task-number: QTBUG-98763 Change-Id: Ibd5e56798c0c666893c12c91ff0881842b8430c7 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QStorageInfo: limit Linux-only code with Q_OS_LINUXPino Toscano2022-01-161-0/+2
| | | | | | | | | This fixes a build problem (use of PATH_MAX) by eliminating a Linux-specific condition that can't happen on HURD anyway. Pick-to: 6.3 Change-Id: I5dcaf104a60b7850b8af3964fc4cd02ab24acd7b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Mark QSP::PublicShare, Templates for 6.4Kai Köhne2022-01-141-2/+2
| | | | | | | | | The commit missed the 6.3 branching / feature freeze. Task-number: QTBUG-86106 Task-number: QTBUG-78092 Change-Id: I1d6b1efe0d482b6fc1ff3cfbbb440856b8cf1856 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QStandardPaths_win: Add mapping for DownloadLocationYuhang Zhao2022-01-131-8/+4
| | | | | | | | | Un-special-case for DownloadLocation. I assume the original code is written like that to be compatible with some really old versions of Windows. Change-Id: I643401910bae9a061f2e02c651971b4f2dd46901 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* QStandardPaths: Remove old MinGW workaroundYuhang Zhao2022-01-131-11/+1
| | | | | | | | | | | | | | | | From the comments the workaround is for MinGW older than v7, now our CI has MinGW v9 trunk, it should be safe to drop this. The magic number is replaced by the official function, although it was introduced in Win8, Qt6's minimum supported platform is Win10, so it's also safe to do. As a drive-by, remove two unused includes. Change-Id: I891fe3883f17d4914932784868d7446299d32c65 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QStandardPath: fix typoYuhang Zhao2022-01-131-1/+1
| | | | | | Pick-to: 6.3 6.2 Change-Id: I12837ce614ea91a8a72191092dc8c835f74107cc Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Doc: Replace "C:\Documents and Settings" pathsKai Köhne2022-01-121-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. Pick-to: 6.2 6.3 5.15 Change-Id: I1bef97b6482180a6467fffcd1d62d6c168bcb389 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Replace QString::utf16() with data() in memcpy() and QByteArray ctorØystein Heskestad2022-01-072-4/+4
| | | | | | | | | | | QString::utf16() needlessly detaches fromRawData() to ensure a terminating NUL. Use data() where we don't require said NUL, taking care not to call the mutable data() overload, which would detach, too. Task-number: QTBUG-98763 Change-Id: I7075a8f18ab1f82ebbcf8cfab1643e8ab7f38d51 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Add PublicShare and Templates QStandardPathsBjörn Feber2022-01-017-2/+63
| | | | | | | | | | | | | | | | | These directories are common on desktop operating systems. "Public" is used for sharing files with other users and "Templates" lets you add new files to the file creation desktop menu (for example in a file manager). An example use in a Qt application would be KDE's KIO having default icons for both directories. This is where they point to: Windows: C:/Users/Public, C:/Users/<USER>/AppData/Roaming/Microsoft/Windows/Templates macOS: ~/Public, ~/Templates Unix: ~/Public, ~/Templates Task-number: QTBUG-86106 Task-number: QTBUG-78092 Change-Id: Ifca60c7d2a6dc2109ec290e8fb109ee2d5ca4d38 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Docs: Add other Unix paths to the Linux table in QStandardPathsNicholas Bennett2021-12-301-1/+1
| | | | | | | | | | | | Added Unix to the title of the enum QStandardPaths::StandardLocation docs Linux paths table as this also aplies to Unix based OS's such as QNX. Fixes: QTBUG-63695 Pick-to: 6.2 6.3 Change-Id: I37b1bb6167984ccf7877baf2e6e764337121a947 Reviewed-by: Tommi Mänttäri <tommi.manttari@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Windows: Fix handling of childGroups() when fallbacks are disabledJeremie Graulle2021-12-271-4/+10
| | | | | | | | | | When fallbacks are disabled for QSettings then it should not be falling back to any child groups or keys that might exist in a fallback set of settings. Fixes: QTBUG-85295 Change-Id: I563999293a103702035c8d3b027b59b94ca43c0e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Make QRingBuffer a move-only typeMarc Mutz2021-12-161-5/+9
| | | | | | | | | | | | There's no sense in copying a ring buffer. Moving is enough. This marks an important step on the way to preventing accidental copies of ring buffer content, because the 'QList buffers' member can now no longer be implicitly shared. While the compiler will still emit the code for detach()ing, it will now never be executed. Pick-to: 6.3 Change-Id: I968bfe3e50c46720ed4baca55c99c1f9c518f653 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QIODevice: use QVLA to hold the ring buffers, not QListMarc Mutz2021-12-151-3/+3
| | | | | | | | | | | | | | | The only users of more than one read- or write channel are the SCTP code and QProcess. SCTP being pretty rare, optimize for the common case of at most two QRingBuffers for reading (QProcess) and one for writing. Even with more channels, QVLA shouldn't be slower than QList - on the contrary. Need to adjust tst_toolsupport and TypeInformationVersion, as QFilePrivate::fileName has changed. Pick-to: 6.3 Change-Id: I3baf982ba1f4dc51463be8730e414f6164072d8b Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QNX: Fix QLockFile supportPasi Petäjäjärvi2021-12-141-1/+21
| | | | | | | | Implement getting pid by process name and enable using flock(). Pick-to: 6.2 Change-Id: I500e645b451baddea788d834374a7ae29a4d223f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QLockFile/Linux: skip QFileInfo if we're just doing string manipulationThiago Macieira2021-12-111-1/+2
| | | | | | | | | | | Avoids a lot of overhead. Could be even simpler, but we don't need to duplicate QFileSystemEntry. Pick-to: 6.2 Change-Id: Ib42b3adc93bf4d43bd55fffd16beda971e4b2ae7 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Igor Kushnir <igorkuo@gmail.com> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Remove redundant QDir::fromNativeSeparators() callIgor Kushnir2021-12-111-1/+1
| | | | | | | | | | | | QFileSystemEntry::QFileSystemEntry(const QString &filePath) already calls this function. Calling it repeatedly changes nothing but wastes CPU time. Neither the line modified in this commit nor the QFileSystemEntry's constructor have been changed since 2011's commit "Initial import from the monolithic Qt." Other constructor overloads of QFileInfoPrivate don't call QDir::fromNativeSeparators(). Change-Id: I01e54662efd96e87c4a686369dc0b265b47e5938 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Implement fetching physical QStorageInfo::blockSize() under WindowsKarsten Heimrich2021-12-083-1/+239
| | | | | | | | | | | | | | | | | | This is implemented in two passes, first we try the older and always available DeviceIoControl() function. This works most of the time, though it might fail for example for storage devices attached via USB. In this case, we try to dynamically load the newer NtQueryVolumeInformationFile kernel function. Since this is probably more expensive, we do this as fallback. [ChangeLog][QtCore][QStorageInfo] The QStorageInfo::blockSize() will now report the physical block size of a storage device under Windows. Network mapped drives are not supported. Fixes: QTBUG-93976 Change-Id: I08b5b879e5bf79c025e2e305196ec5c5fce8b20f Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QFile: Add open() overload that accepts permissions argumentIevgenii Meshcheriakov2021-12-042-1/+49
| | | | | | | | | | | | | | | The new overload allows creation of files with non-default permissions. This is useful when files need to be created with more restrictive permissions than the default ones, and removes the time window when such files are available with less restrictive permissions. [ChangeLog][QtCore][QFile] Added QDir::open() overload that accepts permissions argument. Fixes: QTBUG-79750 Change-Id: Iddfced3c324e03f2c53f421c9b31c76dee82df58 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QAbstractFileEngine: Add permission argument to open()Ievgenii Meshcheriakov2021-12-0410-16/+51
| | | | | | | | | The new argument allows atomic creation of files with non-default permissions. Task-number: QTBUG-79750 Change-Id: I4c49455b41f924ba87148302c8d0f77f5de0832b Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QTemporaryDir: Set directory permissions at the time of creationIevgenii Meshcheriakov2021-11-261-11/+3
| | | | | | | | | | | Use new QDir::mkdir() method to set directory permissions at the time of its creation on systems that support this feature. This removes the time window when the created directory is potentially accessible to everybody. Task-number: QTBUG-79750 Change-Id: I82afee7f0708bfdcc9b3b3978af9a2aef1b8672d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDir: Add support for setting directory permissions to mkdir()Ievgenii Meshcheriakov2021-11-2610-45/+380
| | | | | | | | | | | | | | This patch adds an overload of the QDir::mkdir() method that accepts permissions. This allows setting of the directory permissions at the time of its creation. [ChangeLog][QtCore][QDir] Added QDir::mdkir() overload that accepts permissions argument. Task-number: QTBUG-79750 Change-Id: Ic9db723b94ff0d2da6e0b819ac2e5d1f9a4e2049 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Doc: Replace use of \oldcode-\newcodeLuca Di Sera2021-11-251-2/+8
| | | | | | | | | | | The command-pair was recently deprecated. The replacement code should produce an output that is equal to the previous one. Task-number: QTBUG-98499 Change-Id: If26e0d85a174ebc3858b638c34d7f43637eab46d Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Use Authz API to query permissions info in Windows filesystem backendIevgenii Meshcheriakov2021-11-191-117/+214
| | | | | | | | | | | | | | | | | | | | | | | | | | Microsoft documentation for GetEffectiveRightsFromAclW function that was used previously has this at the top of the page: > GetEffectiveRightsFromAcl is available for use in the operating > systems specified in the Requirements section. It may be altered > or unavailable in subsequent versions. Instead, use the method > demonstrated in the example below. This says to me that the function is deprecated. In addition to that, it is not able to handle ACLs that are not in "canonical" order, returning ERROR_INVALID_ACL. Such ACLs are useful to represent POSIX permissions in Windows, and are produced by Cygwin for example. This patch uses Authz API referenced by the message quoted above. The used API is available starting from Windows XP/Windows Server 2003. This API also allowe to perform access checks given access token, and so allows to use similar code all permission checks. Task-number: QTBUG-79750 Change-Id: I8b11ff3cc83cd9ed5bfb2ce9432a375a122cdbbf Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QLoggingRegistry: avoid double-lookupMarc Mutz2021-11-191-2/+5
| | | | | | | | | | | | | The code used the if (!contains()) { insert() } anti-pattern, necessitated by Qt's deviation from the STL of allowing insert() to overwrite an existing entry, causing two lookups of the same key. Fix by recording the size prior to the execution of the indexing operator and taking a size increase as the cue to populate the (new) entry. This way, we look up the key only once. Change-Id: Ica039035fe9ea4b88c20184784c324c9fac33d49 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* QIODeviceBase: make dtor protectedMarc Mutz2021-11-181-0/+2
| | | | | | | | | | | | | Base class dtors should be virtual and public or else protected and non-virtual. This one was neither of these. [ChangeLog][Potentially Source-Incompatible Changes][QtCore] The QIODeviceBase destructor is now protected to avoid deleting objects of classes derived from it through a QIODeviceBase pointer, which would be undefined behavior. Change-Id: Id390ace75d5b64f746d9b1865b8800c9f0590977 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QFileSystemEngine: Fix permissions query in Windows backendIevgenii Meshcheriakov2021-11-181-1/+1
| | | | | | | | | Make fillPermissions() correctly set OtherExecutePermission instead of OwnerExecutePermission. Pick-to: 6.2 Change-Id: I77ef3c5bc59ac6110c5a461a599d03029c70493c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* 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. Pick-to: 6.2 5.15 Change-Id: I30469504cdbc90e2ab27125181e53d74305f13fd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QFileSystemEngine: Don't use _?W suffixesIevgenii Meshcheriakov2021-11-101-7/+7
| | | | | | | | | We don't use W suffix for most of the Windows API so there is no need to use it here either. Also remove W suffix for variables of type TRUSTEE (was TRUSTEE_W). Change-Id: Id67b772ba5d3232f882841a1e581fb1bbd392fa4 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Use nullptr to represent null pointersIevgenii Meshcheriakov2021-11-101-39/+36
| | | | | | | Replace occurrences of NULL and 0 when used for pointers. Change-Id: I485e73d22a1a85d1303f3e0967cd4e8f10ff5d33 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QFileSystemEngine: Fix some code style issues in Windows backendIevgenii Meshcheriakov2021-11-101-55/+113
| | | | | | | | | | | Wrap lines at column 101 so that it is easier to edit the file and review the changes in Gerrit. Move comments when they cannot be easily wrapped. Add curly braces to `if` statements if they became multiline. Run `git clang-format` on the file afterwards. Change-Id: Ib21afd65147a7b202e031d4a865b5f615e5ad6d8 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Move toMode_t() from qfilesystemengine_unix.cpp to qfiledevice_p.hIevgenii Meshcheriakov2021-11-102-28/+37
| | | | | | | | | | The function is needed in multiple files to implement QDir::mkdir() and QFile::open() methods that accept a permission argument on Unix. Task-number: QTBUG-79750 Change-Id: Ib0853f7d12bcb5d6f1116b43ec1aa07b6554bb93 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove useless blocksIevgenii Meshcheriakov2021-11-101-38/+34
| | | | | | | Don't put the code inside two blocks for no reason. Change-Id: I54b8d6fbfab50a26ddcd8ec07ba689e5094bcad3 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Bump WINVER, _WIN32_WINNT and _WIN32_IE to _WIN32_WINNT_WIN10 (0x0A00)Yuhang Zhao2021-11-101-9/+0
| | | | | | | | | | | And bump NTDDI_VERSION to 0x0A00000B (NTDDI_WIN10_CO) at the same time, to unblock the developers from accessing the latest Windows APIs. Pick-to: 6.2 Change-Id: Ifbc28c8f8b073866871685c020301f5f20dc9591 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qC{Debug,Info,Warning,Critical}: Simplify #ifndef QT_NO_xxx_OUTPUTThiago Macieira2021-11-061-24/+32
| | | | | | | | | | | | | Further simplifies the definition of the macros. The class is placed in an unnamed namespace so two translation units can still have different settings. A difference is that the expanded no-output code is now using QDebug, not QNoDebug, but it should get dead-code-eliminated either way. Change-Id: I3eb1bd30e0124f89a052fffd16a7564f4450ec8a Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* qC{Debug,Info,Warning,Critical}: centralize common partsThiago Macieira2021-11-061-12/+33
| | | | | | | | | | | Move some content to a helper structure and the rest to a common macro. Immediate advantage is that we avoid calling the category function twice. The Q_UNLIKELY also moves most of the formatting code out of the hot code paths of the functions where it's used. Change-Id: I3eb1bd30e0124f89a052fffd16a754e980c1d971 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* QProcess: Distinguish between null and empty QProcessEnvironmentIevgenii Meshcheriakov2021-11-074-63/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The documentation for QProcessEnvironment's default constructor says: This constructor creates an empty environment. If set on a QProcess, this will cause the current environment variables to be removed. This is not the case however, because setting such an environment for a process is equivalent to not setting an environment at all and the child process is executed with parent's environment. It is still possible starting from Qt 6.2.0 to create an empty environment by adding a variable to a null environment and removing it, but that's cumbersome, and the comparison operator says that it is equal to the null environment but it is obviously behaving in a different way. This change adds an additional constructor to QProcessEnvironment that can be used to construct a null environment, and changes the default constructor to produce an empty environment. The comparison operator is changed to correctly distinguish between such objects. This is a behavior change, but the current behavior is broken and this is unlikely to affect working code. [ChangeLog][QtCore][QProcessEnvironment] An additional constructor was added to explicitly create an object that when set on QProcess would cause it to inherit the environment from parent (this was formerly the behavior of a default-constructed QProcessEnvironment, which will now (as documented) actually give a process an environment with no variables set). A new method inheritsFromParent() was added to test for such objects. Fixes: QTBUG-58053 Change-Id: I15e20c6a5f01ebe2c736d5578c75dba1ee319320 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QAbstractFileEngine: Remove useless method overridesIevgenii Meshcheriakov2021-11-033-119/+0
| | | | | | | | | | | | Remove useless overrides of QAbstractFileEngine methods from the derived classes. Also remove "This virtual function must be reimplemented by all subclasses" passages from the QAbstractFileEngine's documentation. There are pure virtual methods for such use cases. QAbstractFileEngine already contains useful defaults for classes not supporting all the functionality. Change-Id: Ia25965854f3809b15d7502da3749cc2f3414bbc3 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Rename LinkName to AbsoluteLinkTargetWang Fei2021-11-037-9/+9
| | | | | | | | | | | | | The existing symLinkTarget() always resolves the symlink target to an absolute path; It will be clearer to change LinkName to AbsoluteLinkTarget. It is ready for the commit about add symLinkPath() to read the raw link path. Fixes: QTBUG-96761 Change-Id: I8da7e23b066c9ac1a16abb691aa1c4a5f1ff8361 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Wang Fei <wangfeia@uniontech.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Remove pre-Win10 code paths in QtBaseYuhang Zhao2021-11-023-30/+4
| | | | | | | | | | | | | | Mostly a removal of dynamically loaded API. They should all exist on Windows 10 1809 (Qt6's minimum supported version). accessibility parts left untouched to make sure MinGW still compiles. Task-number: QTBUG-84432 Pick-to: 6.2 Change-Id: I7a091fc967bd6b9d18ac2de39db16e3b4b9a76ea Reviewed-by: André de la Rocha <andre.rocha@qt.io>
* Doc: Fix broken formattingIvan Tkachenko2021-10-291-1/+1
| | | | | | | | Amends f25bc30d8d9d13fffd34213dfbf5e7373a18222a Pick-to: 6.2 5.15 Change-Id: Ia42c7639e4919de3f995d771bfc7d8237a8773d8 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QLoggingRegistry: Disable internal tracking of source file namesThiago Macieira2021-10-271-3/+2
| | | | | | | | | | Commit d78fb442d750b33afe2e41f31588ec94cf4023ad (5.4) did this for all regular users of our macros, but obviously missed this manual override. So apply here too. Change-Id: I8c6a0ff3ec184205a544fffd16af7734fed2ebd1 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QLoggingRegistry: add the ability to have environment variable overridesThiago Macieira2021-10-272-1/+56
| | | | | | | | | | | Quite a lot of our code in Qt predating QLoggingCategory has manual environment variable controls. For compatibility with established documentation and tips-and-tricks out there, we should keep them working when switching to categorized logging. Change-Id: I3eb1bd30e0124f89a052fffd16a6c151d3e9d552 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix QDebug operator<< for QMultiMap when Q_CLANG_QDOC is definedJoerg Bornemann2021-10-271-1/+1
| | | | | | | | This amends commit 8a8bf1b84e9a096993b892873eb62c735149f320. Pick-to: 6.2 Change-Id: If863d33d055e0a743606d11859b11c112de105f1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Avoid warnings when compiling bootstrap library without zstdUlf Hermann2021-10-211-0/+4
| | | | | Change-Id: Ic67cd2b582df0464a17f6181157ebbd47986114c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Make QDir::mkpath() return true when given an existing root pathKarsten Heimrich2021-10-201-0/+2
| | | | | | | | | | On macOs with APFS mkdir sets errno to EISDIR, so take the error code into account. Pick-to: 6.2 Fixes: QTBUG-97110 Change-Id: I8e7d10c95430a2802bdbfbf94dd65219bd9071a7 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Make QDir::mkpath() return true when given an existing drive nameKarsten Heimrich2021-10-201-1/+1
| | | | | | | | | | | | Commit ed48391c592e8ba68c723e3017ac384f0c7a7c23 removed the check for ERROR_ACCESS_DENIED reported by the Windows CreateDirectory(...) function in case an existing windows drive name was passed as argument. This restores the behavior of the function which broke after 5.15. Pick-to: 6.2 Fixes: QTBUG-85997 Change-Id: Ie86188100766f7364acee57b15a250f4a2720b9f Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Fix docs for comparison/debug/data stream operators of Qt containersSona Kurazyan2021-10-182-0/+79
| | | | | | | | | | | | | | Because of the constraints on comparison, debug and data stream operators, the return types for them look weird in docs. Conditionally use the actual return types, in case if Q_CLANG_QDOC is defined. Also add the docs of debug stream operators for types for which they were misssing. Task-number: QTBUG-97247 Pick-to: 6.2 Change-Id: I57f2c52bd3af805c7eeebb602c47de1e95ee09bd Reviewed-by: Lars Knoll <lars.knoll@qt.io>