| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
Pick-to: 6.10
Change-Id: If5239161254da7e7a9d6c6a6ce2d724841fec330
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Looks like this was forgotten since time immemorial. And not a lot
called QHostAddress::clear(), so we never noticed; it was definitely not
tested.
Drive-by move it to the header to make it inline.
Pick-to: 6.10 6.8 6.5
Change-Id: I2cdc8cf3cbbcb17ecc5ffffdb4257ce269813971
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
| |
|
|
|
|
| |
Pick-to: 6.10
Change-Id: Idf70d329977e17b5b936fffd1debc21f1b86c43a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Amends 043590b891a98350edb23715a86f4af6d3f1ecdb, which wasn't complete
because half the change was in the wrong commit.
Amends commit 969337bcfd6af6d91b988e4b412703274a0b5877, which introduced
these constants. We've since learned that those either need an
out-of-line definition or need to be in a non-exported base[1]. This
commit uses both strategies: an out-of-line definition for the symbols
that are used in Qt 6 and thus have an ABI requirement to stay the same,
and moving to a base class for the Qt 7 ones, which don't yet.
[1] https://lists.qt-project.org/pipermail/development/2024-January/044888.html
Pick-to: 6.10 6.8 6.5
Change-Id: Iaad6d22475eba5eb5d16fffd2a31a74d2633a7b8
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
... over Qt::Literals::StringLiterals.
The latter works, but is needlessly verbose. Since such code is
copy'n'pasted, use the preferred form everywhere, to avoid
proliferation.
The docs have been fixed to suggest the shortcut in a separate commit.
As a drive-by, move them to their preferred location, after the
QT_BEGIN_NAMESPACE, but only if they were far away to begin with.
Pick-to: 6.10 6.8 6.5
Change-Id: I0325f749f3b5a331d9c6af458a9bd3bb70d4aa3b
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
To avoid double-definition when it's included more than once.
Amends be84e9cf3e0ad6559921016ec563a25b1892d823.
Pick-to: 6.10 6.8
Change-Id: Ia40cab02ec8d9c927b22cf090e8ea96d1821e68d
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Rym Bouabid <rym.bouabid@qt.io>
|
| |
|
|
|
|
|
|
| |
... so it can be reused elsewhere.
Pick-to: 6.10 6.8
Change-Id: Ia6b5f24cfbc586f0afe470cbb399cbb234c92f3d
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
|
| |
|
|
|
|
|
|
|
| |
While testing defining Q_DECL_PURE_FUNCTION for MSVC I discovered
it cannot handle having the marker trailing, while GCC/clang can cope
with either.
Change-Id: Ic9dd088996c191263e2f2a43c2f6a16533bdb9c5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Provide an alternative for
*auth = QAuthenticator();
[ChangeLog][QtNetwork][QAuthenticator] Add a new method to clear all
credentials.
Fixes: QTBUG-139124
Change-Id: Ia33b5dcb8eb6961f5daa5bc78addd8c78dd10e9a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
| |
|
|
|
|
|
|
|
| |
Highlight only the important part.
Task-number: QTBUG-136625
Pick-to: 6.10
Change-Id: I9707d0d69b964421ab4f8a07c8b87cc07fa01e2f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
| |
|
|
|
|
|
|
|
|
| |
Extended with a description that explains the shortcomings of this
approach.
Task-number: QTBUG-136625
Pick-to: 6.10
Change-Id: I07473b1395fcc6dec0917da4bcc1c3791c1ed839
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
| |
The method has been deprecated in favor of loadBackendByName() and
loadBackendByFeatures().
Task-number: QTBUG-136625
Pick-to: 6.10
Change-Id: I092c693091f64b2f069366ed74940d427a600dab
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
| |
|
|
|
|
|
|
|
|
| |
The methods are well-documented but it probably does not hurt to add a
small snippet about a simple example use case.
Task-number: QTBUG-136625
Pick-to: 6.10
Change-Id: I267250faae4a062ed514a2e0bccca57f7bd8a0b3
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
|
| |
|
|
|
|
| |
Task-number: QTBUG-132213
Change-Id: If644d6afd4258aa9bc3e2ea2eb05c39f4ce07c30
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
| |
|
|
|
|
|
|
|
| |
As it is not supported anymore on Apple, drop QNetworkConnectionMonitor
for simplicity.
Fixes: QTBUG-132137
Change-Id: If5e216e857b4449b9937323aa58630777cb4b82d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
| |
We don't need the thread parameter, because nullptr implies "current
thread". Instead, let QAbstractEventDispatcher get the thread-local
variable on its own and benefit from any LTO code generation QtCore may
have had.
Pick-to: 6.10
Change-Id: Ia2f962c3886c8901a3a5fffde336c1505b68e185
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
| |
|
|
|
|
|
|
|
| |
The rest was handled separately.
Fixes: QTBUG-135584
Pick-to: 6.10 6.9 6.8
Change-Id: I302f9f381712e5f65cc4b7354bfb441361c615e7
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
|
| |
|
|
|
|
|
|
|
|
| |
While the files are parsing some data, it is acquired from a trusted
source, such as the operating system (e.g. /etc/resolv.conf)
Task-number: QTBUG-135584
Pick-to: 6.10 6.9 6.8
Change-Id: Id1741d66258f5c247342015988e2ce916e5280b3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
The files are parsing or working with data that is obtained from
outside.
tldurl is special in that it is a list we ship or acquire from the
system, but we are working with a string that was obtained from a
user or from the network.
Task-number: QTBUG-135584
Pick-to: 6.10 6.9 6.8
Change-Id: Icb13a9acc859e07460f6c10b3f108e65ff130c5c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
| |
Since global destructors are not reliably fired on Android especially
when QT_ANDROID_NO_EXIT_CALL to mitigate crashes at exit, it's better
to define ProxyInfoObject as Qt application static instead.
Pick-to: 6.10 6.9 6.8 6.5
Fixes: QTBUG-138238
Change-Id: Ib8fd7860a88907259216d498013bb6829e8a71b4
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit replaces one-shot synchronization of threads that were using
QSemaphore with QLatch. QSemaphore is efficient on Linux and Windows,
but allocates memory elsewhere. Even on those platforms where we have
futex-like OS support, QSemaphore is heavier than what we really need
here.
All but one uses of QSemaphore in qtbase libraries (I didn't change
examples or tests) were replaced. The remaining use of QSemaphore in
qnetworkproxy_libproxy.cpp is a proper producer-consumer.
Change-Id: Ib5ce7a497e034ebabb2cfffd1761a4fcb2be9a6c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
|
| |
|
|
|
|
| |
Pick-to: 6.9 6.10
Change-Id: Idbfb39bbe1f16de420711911df0a8c47a2a75420
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
| |
|
|
|
|
|
|
|
| |
Clarified in the documentation that the 'netmask' parameter in
QHostAddress::isInSubnet() is a prefix length, not a full netmask.
Fixes: QTBUG-63252
Change-Id: I2917f0f57bb369cc9256f46a1ce15dd41f2199c8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The QT_BEGIN_NAMESPACE macro was inside the "#if networkproxy" code
block, whereas the QT_END_NAMESPACE was outside of it.
When networkproxy feature is then disabled, the file will only
effectively have the QT_END_NAMESPACE macro. This fails to compile
when the build is an actual namespace build.
Pick-to: 6.9 6.8
Change-Id: Ic0b0fd2d086811664a4f66e2c46424d370641355
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
| |
unity build
On Windows the "interface" is defined as "struct".
Pick-to: 6.9 6.8
Task-number: QTBUG-122980
Change-Id: I1a80c9e40d59449bb3c3773679a95405ea39d630
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
MINGW's implementation of Microsoft::WRL::ComPtr lacks comparison
operators, and calling operator==() on them will implicitly convert them
to bool before comparing the resulting bool values. Two non-zero ComPtr
instances will therefore always compare equal, even if they point to
different interfaces.
This patch adds ComPtr comparison operators if they are missing, and
replaces existing includes to wrl.h or wrl/client.h with
QtCore/private/qcomptr_p.h
Pick-to: 6.9 6.8
Change-Id: I8123d9d874ae53ebfd6d381b69097e75527848b6
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a thread-safe version of
QCoreApplication::instance() != nullptr
for Qt 6.x, because QCoreApplication::self is not atomic and thus
reading it from outside the main thread could be a data race.
That's not to say it always is: if by construction the code can only run
in the main thread or while QCoreApplication definitely exists, that's
safe. Therefore, this commit focuses on places that are meant to be used
in multi-threaded environment (ruling out most of QtGui and QtWidgets)
or where the code was going to dereference the returned pointer anyway.
Change-Id: I6fc556c5fe5cbe0b5902fffdfb6b3bb345b0ee50
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Specifically on Windows we use COM, which requires being
de-initialized in the same thread as it was initialized.
Given that QNetworkInfo is a GLOBAL_STATIC with a qAddPostCondition
(iirc APPLICATION_STATIC was not yet implemented at the time) to
delete the backend when qApp is destructed, we need to cope with
destruction happening on the main thread.
If the backend is loaded on a secondary thread, the thread may
have shut down, or we may not otherwise be able to rely on
emitting Queued emissions to perform the destruction.
Conversely we also can't trivially move the construction to the
application thread (eg. using BlockingQueued emission during first load)
because we may cause a deadlock.
This leaves us with just documenting where the first load should happen.
Fixes: QTBUG-133644
Pick-to: 6.9 6.8 6.5
Change-Id: I7f52e884151c6c24acc34f1112faabc897d9b0f9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since SCNetworkReachability is deprecated,
the implementation is now updated to use the Network framework.
[ChangeLog][QNetworkInformation] Replace deprecated
SCNetworkReachability implementation with Network framework (iOS, macOS)
Fixes: QTBUG-132103
Change-Id: Iff4a667fd07002451b7d49cc8fd069945d426aab
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Vladimir Belyavsky <belyavskyv@gmail.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a family of qdoc macros to document the various qHash() overloads
we have.
This patch does not change the \relates of the qHash() functions, they
remain as inconsistent as they have been. Created QTBUG-129815 to
clean things up. Since this author expects the \relates to change in
the future, there are different \qhash commands, and all except
\qhashbuiltin take the class name as an argument, for use in a
centrally-choreographed fix for QTBUG-129815.
As drive-by's, fix:
- missing documentation about Key having to support qHash() in the
associative Qt containers
- drop noexcept and default arguments from \fn lines that needed to
have their argument names changed
- move the QStringView overload from qhash.cpp to qstringview.cpp
(as it \relates to the former)
Fixes: QTBUG-129574
Pick-to: 6.8 6.5
Change-Id: I8e8c2edc27422cbe5823f56baf3a24d7f7050836
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Jaishree Vyas <jaishree.vyas@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is a potential race condition on Mac that can lead to crashes
when destroying `QNetworkConnectionMonitor`. This issue arises when
`QNetworkConnectionMonitorPrivate` has already been destroyed, but is
still being accessed through `QNCMP::probeCallback()` from another
thread.
To fix the issue, a reference counter is used.
This counter indicates whether the callback is being used in monitoring.
It increases when information is retained (when we set the callback,
the info retains to 1) and decreases when information is released
(the info releases to 0, when QNCMP object is not used in monitoring).
A waitCondition is used to notify all threads when the reference counter
reaches zero. The QNCMP::reset function waits until
the probeCallback is disconnected and the reference counter is zero.
This indicates that the info resource is free,
allowing us to safely destroy the QNCMP object.
The conditional variable protects
the QNetworkConnectionMonitorPrivate object and ensures
that the callback is disconnected properly.
Fixes: QTBUG-130552
Pick-to: 6.8 6.5
Change-Id: I1259c429e92bc20c382604192243d6d8fadb5c25
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Vladimir Belyavsky <belyavskyv@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We have some patterns for how to document certain functions, but we
also vary the sentences a lot, and you have to look up one
documentation piece and copy it, essentially. If we ever want to
change them, we end up with shotgun surgery.
So apply DRY to the documentation and start a collection of macros to
help with repetitive C++ class documentation tasks.
The first macro is for member-swap(), and this third patch is for
documentation that used a non-standard phrasing for documenting
member-swap(). By using the macro, the documentation automatically
conforms to what the documentation team picks as the \memberswap
expansion going forward.
As a drive-by, fix doc block indentation to the Qt standard of 4
spaces (only in changed lines), and add a few blank lines where they
were missing before.
Fixes: QTBUG-129573
Pick-to: 6.8 6.7 6.5 6.2
Change-Id: If007602d7690572fcbb848a8d0235416c908cfd2
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We have some patterns for how to document certain functions, but we
also vary the sentences a lot, and you have to look up one
documentation piece and copy it, essentially. If we ever want to
change them, we end up with shotgun surgery.
So apply DRY to the documentation and start a collection of macros to
help with repetitive C++ class documentation tasks.
The first macro is for member-swap(), and this second patch is for
documentation that used the simplified phrasing ("Swaps this X with \a
other."), which this patch adopts as the text for \memberswap, too,
because it doesn't repeat the macro argument, making it easier to find a
grammatically-fitting argument than in the traditional phrasing.
This doesn't change the documentation, except as follows:
* standardizes on simpified instead of traditional phrasing for docs
that already use the \memberswap macro
* adds the "very fast and never fails" blurb, if it was missing
* changes the function's argument name to `other`, as required by
the macro.
Task-number: QTBUG-129573
Pick-to: 6.8 6.7 6.5 6.2
Change-Id: I1123e783ce0da76c5997ff74007d77504ac5b334
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We have some patterns for how to document certain functions, but we
also vary the sentences a lot, and you have to look up one
documentation piece and copy it, essentially. If we ever want to
change them, we end up with shotgun surgery.
So apply DRY to the documentation and start a collection of macros to
help with repetitive C++ class documentation tasks.
The first macro is for member-swap(), and the first patch is for
documentation that used the traditional phrasing ("Swaps the X \a
other with this X.").
This doesn't change the documentation, except as follows:
* adds the "very fast and never fails" blurb, if it was missing
* changes the function's argument name to `other`, as required by
the macro.
Task-number: QTBUG-129573
Pick-to: 6.8 6.7 6.5 6.2
Change-Id: Ib494bd218334724b3b43796ba6f71fb52b83aa94
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
|
| |
|
|
|
|
|
| |
Task-number: QTBUG-115841
Change-Id: I34f3106e4b50a18cc19c4cda597205c346e7561e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
|
| |
|
|
|
|
|
| |
Task-number: QTBUG-106722
Fixes: QTBUG-106728
Change-Id: Id0435ad2ffffdb159e44c1929df6ba904bd5b01a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Most of the callers of QIODevice::readLine() are reading a device line
by line in a loop. Instead, use one QByteArray and modify it in every
iteration using QIODevice::readLineInto().
Use a QByteArrayView instead of QByteArray when calling trimmed() as
it's an expensive operation.
Fixes: QTBUG-103108
Change-Id: Ic1af487a2fbf352cc21d76a41717944d034d3709
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
| |
IIRC they were Q_GADGET'ed
Pick-to: 6.8
Change-Id: Ia80e506587fb583591ea4b89e648cb9cdfd98dfa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
|
|
| |
After the base and derived classes have been merged we can uniformize
the initialization as well.
Task-number: QTBUG-127539
Pick-to: 6.8
Change-Id: I3828dc973fd7b3ccd06272e2e26eaae4edab8768
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The inheritance is probably unnecessary.
As a drive-by, initialize all the members to silence the original
Axivion warning.
Task-number: QTBUG-127539
Pick-to: 6.8
Change-Id: Iba9d8f2cba246616dbb6e8e9b7b21e8589af84d9
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This is a non-polymorphic class, so explicitly export only the
out-of-line methods.
Amends 4503dabfbd11c084c2781a679c9af12d5fb8f763.
Found in 6.8 API review.
Pick-to: 6.8
Change-Id: I600d355a3b3abd321841dfc33030de9e5707c38a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Commit f2f00b2a4632aaeb58e6cdae7faef9e0bafaff49 ("QDnsLookup: implement
DNS-over-TLS") added the use of QSpan, but confounded the size of the
buffer array with the size of the query we prepared. The queryLength
variable was never used after checking if the preparation had failed.
Pick-to: 6.8
Task-number: QTBUG-127073
Change-Id: Iac1ff680887641888e00fffd17e0e49faab1d579
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
When building qt with QT_NO_DEBUG/WARNING/INFO_OUTPUT set, then the
qDebug/Warning/Info macros expand to `QMessageLogger::noDebug`. That
helper is not defined to take a logging category or category function,
so using `qDebug(lcX, ...)` breaks the build. The correct way to emit
categorized logging is to use the qCDebug/Warning/Info macros.
Task-number: QTBUG-125589
Pick-to: 6.8 6.7 6.5
Change-Id: I968b0e826871a09023c11fec9e51caa5a2c4dc0b
Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
While adding senderPort to the initializer list of the constructor we
have decided that NSDMI would be a better approach for the member
variables.
Task-number: QTBUG-125026
Pick-to: 6.8 6.7 6.5
Change-Id: Ibc65251f99a66f1d7ee0c3570e608c2b534aa8b3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Address the "A constructor must initialize all data members of the
class" warning found by an Axivion scan.
Just as the destinationPort is defaulted to 0 initialize the senderPort
to be 0 as well.
Task-number: QTBUG-125026
Pick-to: 6.8 6.7 6.5
Change-Id: Ifec55ba4b6c23a6feed2b4816d4ba6aae061f1cd
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The class has a move assignment operator, it should have a move
constructor as well.
Found by an Axivion scan.
Task-number: QTBUG-125026
Pick-to: 6.8
Change-Id: I301e8e3f275b0d5217afc1559947870ff87bcf45
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Started with fixing a "Class with destructor should also declare a
copy or move constructor and assignment operator." warning found by an
Axivion scan.
However, the NetlinkSocket struct is used only once and the behavior
can be replicated with a qScopeGuard.
Remove the struct NetlinkSocket and use a qScopeGuard for resource
management.
Drive-by: remove a Q_UNLIKELY that's not needed (qErrnoWarning() is
already marked as Q_DECL_COLD_FUNCTION).
Task-number: QTBUG-125026
Pick-to: 6.8 6.7 6.5
Change-Id: I6b770e284fdda3ff97b8cabac205e9b5abe88b14
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This is a RAII class the result of the constructor call should never be
discarded.
As a drive-by made the constructor explicit.
Task-number: QTBUG-125026
Pick-to: 6.8 6.7 6.5
Change-Id: I651dda87b5191d50e111732d11bab8d5aa58e9af
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Provide the new comparesEqual() helper function as an implementation of
the (in)equality operators and compareThreeWay() helper function for
the rest of the relational operators.
Use Q_DECLARE_STRONGLY_ORDERED to provide all relational operators.
Use the new Qt::totally_ordered_wrapper to wrap the "d" pointer to
avoid UB when performing comparisons of QSharedDataPointer.
The old implementation of the operators between QSharedDataPointer
and the normal pointer T* used to cause a bug but this was not noticed
because QSharedDataPointer didn't have any tests.
I added tests and tried to compare using operator<(). I got
build issues:
error: no match for call to
‘(std::less<MyClass*>) (const MyClass*&, MyClass* const&)’
This happens because QSharedDataPointer has an implicit conversion
to MyClass*.
Making the normal pointer T* non-const as follow resolves the issue:
DECLARE_COMPARE_SET(const QSharedDataPointer &p1, p1.d, T *ptr, ptr)
DECLARE_COMPARE_SET(T *ptr, ptr, const QSharedDataPointer &p2, p2.d)
A similar bug happens if we make the normal pointer const in the
comparison macro Q_DECLARE_STRONGLY_ORDERED. The relational operators
will be ambiguous. The compiler picks between
operator<(QSharedDataPointer<MyClass>, MyClass*) and
opeartor<(MyClass*, MyClass*) (In case we're calling <).
Therefore, use:
Q_DECLARE_STRONGLY_ORDERED(QSharedDataPointer, T*)
Add some comparisons related tests for QSharedDataPointer.
Use QT_TEST_ALL_COMPARISON_OPS macros in unit-tests.
Task-number: QTBUG-120306
Change-Id: I8d1159a01651bab442b79a89c53e064914103133
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This avoids that we or users have to declare e.g. String or Uri in
several places in Qt. This also prevents problems where multiple
declarations (possibly from different headers) cause build errors.
As a drive-by, remove some unnecessary type declarations (e.g.
UriType, which had the same class string as Uri).
To ease the submodule update process, define a preprocessor symbol
that submodules can use to conditionally declare the type locally.
Once the dependency update is through, the symbol can be removed
and submodules can use the declaration from qjnitypes.h.
Pick-to: 6.8
Change-Id: I7d96edf644a54246302b5c5cb478e66fa615e73e
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
|