| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
In order to build a complete graph of metaobjects via properties and
methods we need to know about all argument and return types as
metaobjecs. Such a graph is desirable for reasoning about the
consistency of the type system.
Task-number: QTBUG-101143
Change-Id: Ic4e2f58a4275df06178437c6d45270f3f2aa5ce6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is an untested config for enabling null-strings, so technically
not supported. But if we ever want to make null mean null
then we should protect against it.
Also drop the explicit template argument for qMin. This means
we use the hetereogeneus version which will promote to
size_t. Which is the type that memcpy expects anyway.
Change-Id: I91e0a3b159b065b76e9e93605ef0e502f41af74f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
|
|
|
|
|
|
|
|
| |
QT_NO_CAST_TO_ASCII
QT_NO_CAST_FROM_BYTEARRAY
QT_NO_URL_CAST_FROM_STRING
Change-Id: Ic77ed8ccbdb146b7e7b26123923795f9748d3a38
Reviewed-by: Mate Barany <mate.barany@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
QHttpHeaderParser::headers() method is changed to return QHttpHeaders.
QAuthenticatorPrivate::parseHttpResponse() method is changed to work with QHttpHeaders.
QHttpNetworkHeader::header() method is updated to return QHttpHeaders.
Tests are updated.
Task-number: QTBUG-120133
Change-Id: I20a18b509acd7a8b8d93884cff8349519d64293e
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
... and not just for Qt 7.
Found in API-Review.
Amends dd50d58af267bd3b79d1ca31b920d72b925d5a37.
[ChangeLog][QtNetwork][QHostInfo] The lookupHost() static function now
takes const QObject* receivers (was: (non-const) QObject*).
Pick-to: 6.7
Change-Id: I22b11e06cfba4e96975239cabed8b379cf3f4fa4
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The docs claim that QThreadPool always creates at least one thread.
However, the user can (usually by mistake) request zero or a negative
number of threads.
The maxThreadCount() function is simply returning the value, that was
requested by the user.
Since it's a public API, it is used in several places in QtConcurrent,
where it is assumed that the value is always positive. This can lead
to a crash if the user sets zero as a maxThreadCount.
Update all such places with std::max(maxThreadCount(), 1).
Prefer this approach over changing the return value of
maxThreadCount(), because its behavior is documented and tested.
Amends 885eff053797d56f2e295558d0a71b030fbb1a69.
Fixes: QTBUG-120335
Pick-to: 6.7 6.6 6.5 6.2
Change-Id: Id3b2087cec7fbc7a2d42febca6586f2dacffe444
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
|
|
|
|
|
|
| |
Task-number: QTBUG-117983
Change-Id: I2339dc96b49aba38169ad3e84f48c9d3c97d6117
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
|
|
|
|
|
|
| |
to reduce allocations
Change-Id: I648518fd152a834bbdc6afcedb693f02c1b13af1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As a fallback before picking the dummy backend.
[ChangeLog][QtNetwork][QNetworkInformation]
QNetworkInformation::defaultBackend() will now load any available
backend with Reachability support if the default ones are not available.
If none are available it will create a backend that always returns the
default values for each property.
Change-Id: I40889eeb51929e81f77ec2d84999932b095baf0b
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|
|
|
|
|
| |
Change-Id: I5e369b9cd2b3abc6c0ac1e632e495b05c506980b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
That we have two macros to declare a C++ type to represent a Java class
is confusing. The TYPE macro as of now allows us to declare array types,
but with QJniArray we won't need that anymore, and can just use Class[]
as the type instead. Changing that will be a follow-up commit; for now,
get rid of TYPE-usages to declare regular classes.
Change-Id: Iea0a9548772ca701148442412cf6ad567583213f
Reviewed-by: Zoltan Gera <zoltan.gera@qt.io>
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix potential nullptr access in
QNetworkConnectionEvents::getNetworkConnectionFromAdapterGuid().
This can happen if for some reason the NetworkListManager instance
failed to be instantiated in QNetworkConnectionEvents constructor.
Fixes: QTBUG-117097
Pick-to: 6.6 6.5
Change-Id: If51ea383e22461a6c3124576c4e1be3f30dde1f6
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|
|
|
|
|
|
|
|
| |
Detecting if a member exists is very easy and saves us from running the
test at CMake time. Saves about 350 ms.
Change-Id: I2b24e1d3cad44897906efffd178007fdcdd18e37
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
lookupHostImpl requires either `receiver` or `slotObj` to be non-null.
Since this code path deals with the string-based slots, `slotObj` is
going to be null, therefore check that `receiver` is non-null.
For completeness: also check that `member` is non-null.
Emit a warning (à la QObject::connect) in case the user did something
wrong.
Change-Id: Ic6dcd51d7ddd977b121484369b1aef48844364c5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
|
|
|
|
|
|
|
|
|
| |
The id -1 is the one of a default-constructed QHostInfo (invalid).
It's also returned by various codepaths to mean a lookup failure.
Attemping to abort its lookup should simply be ignored.
Change-Id: I0413dd248a890f57195e4f5b5baea011b6737102
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
|
|
|
|
|
|
| |
Prefer QLatin1StringView overloads
Change-Id: I23846761f2c93021de4f6e6b7eba1d74045f89a1
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Amends cda98280edd2ab7b8d6b3dee08281b045c470dc5
Pick-to: 6.6
Fixes: QTBUG-116758
Change-Id: I337d946a054eb9c9e2f6ec9e8af40694b37afe12
Reviewed-by: André Klitzing <aklitzing@gmail.com>
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
The integration of QTBUG-113813 has failed because at the moment there
is no network information backend for QNX. Implement a simple dummy
backend to handle these cases.
Task-number: QTBUG-113813
Change-Id: Id6fa3e590c43b0125d82e8680733e30788d9894e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
QHostInfo's lookup can notify a slot specified either via the
string-based SLOT or via PMF/function objects. In the first case,
an actual connection is established and a signal is emitted carrying the
result object.
In the PMF case, QHostInfo does not establish a connection and calls
the slot object "directly" (using some private QObject APIs).
The implementation was (and still somehow is) quite convoluted: the
index of the QHostInfoResult signal to be emitted was looked up, and
used to create a metacall event. However the metacall event was also
intercepted in an override of event(), and from there the slot was
called.
But we don't need to look the signal index up at all to do that, since
we are actually never emitting the signal! This can be done with a
custom event.
... but I'm not doing that as that's reinventing the wheel. Instead, I'm
using invokeMethod to call a private function of QHostInfoResult, and
from there we can invoke the slot object. This allows us to get rid of
the signal index lookup, remove the manual metacall event handling, and
the copy() kludge for SlotObjUniquePtr.
Change-Id: I2193acdad57788efd5250bd29f7a1c7505eed2f1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The 3-arg QObject::connect() overload (the "contextless" one) simply
forwards to the 4-arg overload, using the sender object as both
the sender and the receiver/context.
QHostInfo does not use connect() directly in order to emit notifications
that a lookup is finished. Instead, it uses some of QObject private
plumbing. When handling a lookup request that specifies a function
to call when done, but no context object, QHostInfo passes nullptr
as context/receiver.
Change QHostInfoResult's behavior to always have a "receiver": in case
the caller didn't specify one, use `this` (= the sender).
As a drive-by, this allows to streamline some code.
Change-Id: Ic2e63ac18ba36269036950b6f6b7fecea51d0c99
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|
|
|
|
|
| |
Change-Id: I45ee4eba1f7ded358acaccf678e4e12a006b91b6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Since a non-null `member` implies a non-null `receiver`, streamline
the redundant check(s). While at it, introduce a simple boolean that
conveys the meaning of what we're checking for.
Change-Id: Ib9be162075771de74b1a6bc4426008b7c194df3a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
If `member` is set it means that the caller wants us to connect
to a slot using string-based connections. That means `receiver`
must be non-null as well. Check for it.
Change-Id: I6b3542855147e95fecbf4c645b556c2047a1ed69
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
QHostInfo::lookupHost uses some QObject private APIs in order to have a
invoke a slot/function when the lookup is finished. The overload that
simply takes a function (and not a context object) was still available
even under QT_NO_CONTEXTLESS_CONNECT, because indeed the implementation
bypasses the public QObject::connect API. Hence, explicitly the overload
that doesn't take a context object.
Change-Id: Ibf5b0efc49b7f9c8d045862ae061f4e05ee1b769
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
|
|
|
|
|
|
|
| |
call toBase64() with temp value
Change-Id: Idedfd91f60900ec51923803a6bb9ed6631e64d94
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|
|
|
|
|
| |
Change-Id: Iaa208785f6e1dc8eb5f32ab5e099c8df277bb2f1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
|
|
|
|
|
|
| |
by QBAV usage. While touching code, port index based loop to range based
Change-Id: I06a784b94678b901d1074cca224c926e8534bd8e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
|
|
|
|
|
|
| |
Pick-to: 6.6
Task-number: QTBUG-84234
Change-Id: I8f5e2947b6529a0a8871d040050205934ee60354
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
|
|
|
|
|
|
| |
to reduce allocations
Change-Id: If75c3818333880ba34f2e58038b05869979ae14d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
|
|
|
|
|
|
| |
to avoid needless allocations
Change-Id: I39eb90ef073db5359e7a559e33233b1e75b7461c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
|
|
|
|
| |
Change-Id: Id7d9675c5a8dd09d0edaaa34a28a07fead068109
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
|
|
|
|
|
|
|
|
|
|
| |
I've left the QT_NO_ macros because they were public. No one should be
using them (and they are now 1 on Linux, so you had better not be using
them), but just in case.
Change-Id: Ifbf974a4d10745b099b1fffd177758a7a26e4244
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
|
|
|
|
|
|
|
| |
Create QBA only when it's needed
While touching code, use std::move more
Change-Id: I5f014822a47d41fa1fca46a85a7921c70d1d9a55
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
|
|
|
|
|
|
| |
avoid temp allocations
Change-Id: I8ca4d4b748f79d1c7a4455a5105998c58c91c7a4
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
As part of creating the QML binding, add
Q_CLASSINFO("RegisterEnumClassesUnscoped", "false")
to QNetworkInformation.
Task-number: QTBUG-113813
Change-Id: Ib5d3b2356986c565b9786bc2d925cc4199bae6c9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
| |
Clean up after all users are ported to the SlotObjUniquePtr overloads.
Pick-to: 6.6 6.5
Change-Id: I3e58249296ea9674c45fb412463ae3201518de72
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
... and use them around the code.
Avoids the impedance mismatch between users, which .release() their
SlotObjUniquePtr's into the ctors, and the ctor, which constructs its
member SlotObjUniquePtr from that.
The old constructors are left in on purpose and removed in a follow-up
commit to facilitate cherry-picking into branches that might have
additional callers.
Pick-to: 6.6 6.5
Change-Id: I6f8bce317d5116296973a3a2e3f97db1451f579d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We've known for a long time that this is producing worse code with GCC
because of how we implemented in Q_ASSUME_IMPL(). So bite the bullet and
actually deprecate the macro, replacing all extant Q_ASSUME() with
Q_ASSERT().
The replacement is in C++23. Backporting the support onto Q_ASSUME_IMPL
was previously rejected by reviewers.
[ChangeLog][Deprecation Notice] The Q_ASSUME() macro is deprecated. This
macro has different side-effects depending on the compiler used (GCC
compared to Clang and MSVC), and there are certain conditions under
which GCC is known to produce worse code than if the macro was absent.
To give a hint to the compiler for optimizations, use the C++23
[[assume]] attribute.
Change-Id: I80612a7d275c41f1baf0fffd177a3a4ad819fb2d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
|
|
|
|
|
|
|
|
|
| |
Avoids the manual deref'ing.
Pick-to: 6.6 6.5
Change-Id: I1a51a468dfa704986f050b29322a424dc6fcd7b7
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current implementation is not thread safe - it is possible
to update and query the network information without any locking.
Protect the internals of the backend with a lock and move the
object to the main thread.
Task-number: QTBUG-115748
Change-Id: I9511fc3522ae82cffca42abc54eb79cb156397c4
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Move the SlotObjUniquePtr directly into the QMetaCallEvent, without
having to up and down the ref-count.
Pick-to: 6.6 6.5
Change-Id: I029f71c60defce71ac8778547efe999ce0cf7b4b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
These classes are not exported, so we don't run into duplicate vtables
here, but the header is included in a few TUs other than qhostinfo.cpp
(all, when building with PCH), so make sure we compile dtors only once.
Pick-to: 6.6 6.5
Change-Id: I51f6a6d27fc084ad469f82dc7aef3327bdd9a906
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's a free function, because a) it rhymes with move(ptr) and, of
course, SlotObjUniquePtr being a std::unique_ptr, b) we can't add
member functions to it (and no, inheriting from a type whose dtor is
neither protected nor virtual is nothing you will catch yours truly
doing).
Pick-to: 6.6 6.5
Change-Id: I2026126857a7bba204d683bad118e8a2c5cb2924
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
|
|
|
|
|
|
|
|
|
| |
Drops the direct deref'ing.
Pick-to: 6.6 6.5
Change-Id: I9f159244d50572659fa8e9cabfbef47e769ac54e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We failed to delete the slot object when lookUpHost() was called in
these (exceptional) circumstances:
- on a thread with no event dispatcher
- after application shut-down, when the QHostInfoLookupManager
Q_APPLICATION_STATIC was destroyed already
Fix by adding the missing destroyIfLastRef() calls into these code
paths, too.
Amends ad5eb297e179a164e297a7c2eb3b9674a1196605.
This would be so much easier if we had SlotObjUniquePtr...
Pick-to: 6.6 6.5 6.2 5.15
Task-number: QTBUG-115263
Change-Id: Ief8bf125bc196742c0ce59c1fd87ab93242fc0da
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|
|
|
|
|
| |
Change-Id: I5b216ed02452549b69847b34139613669905023c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
We were not ref'ing or deref'ing the slot object in the various places
that owned it. So, if, in the end, the QHostInfoResult object didn't
call the slot we would leak the slot object.
Pick-to: 6.6 6.5 6.2 5.15
Fixes: QTBUG-115263
Change-Id: I45f43756c7589470045d97b59257ccfd85a325b7
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It was hard to see the problem because of the lambda, combined with
reinterpret_cast on the output of non-typesafe C macro. NLMSG_DATA
returns a void*, so use static_cast to be sure not to do something
wrong.
This only affected the code that dealt with unexpected replies from the
Linux kernel, which it doesn't send. So I don't expect this fixes any
improper QNetworkInterface behavior.
Found by CodeChecker.
Pick-to: 6.5 6.6
Change-Id: I61b74deaf2514644a24efffd1770d75e5a4f2636
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
|
|
|
|
| |
Change-Id: I5f7f427ded124479baa6fffd175f3ce37f0e49aa
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Avoid decoding multiple times the domain name when it comes in
sequence. This happens when a given domain label either has multiple
entries in its record set or when it's a CNAME (or both), such as in:
;; ANSWER SECTION:
cname-cname.test.qt-project.org. 3600 IN CNAME cname.test.qt-project.org.
cname.test.qt-project.org. 1614 IN CNAME multi.test.qt-project.org.
multi.test.qt-project.org. 1614 IN A 198.51.100.2
multi.test.qt-project.org. 1614 IN A 198.51.100.3
multi.test.qt-project.org. 1614 IN A 198.51.100.1
Label targets from other records such as MX and SRV usually do show up
again, in the Additional section, but the chance that they are
sequential isn't very good, so we don't cache those.
;; ANSWER SECTION:
mx-multi.test.qt-project.org. 3354 IN MX 10 multi.test.qt-project.org.
mx-multi.test.qt-project.org. 3354 IN MX 20 a-single.test.qt-project.org.
;; ADDITIONAL SECTION:
multi.test.qt-project.org. 1145 IN A 198.51.100.3
multi.test.qt-project.org. 1145 IN A 198.51.100.1
multi.test.qt-project.org. 1145 IN A 198.51.100.2
a-single.test.qt-project.org. 3364 IN A 192.0.2.1
Change-Id: I5f7f427ded124479baa6fffd175f5cf88939ee73
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|