diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2023-01-05 09:50:28 -0300 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2023-01-20 03:19:19 +0000 |
commit | 3d584b1093cdb6245b02eda996db2927ffaf09ea (patch) | |
tree | 8fd024ae4cc1cdfd8b0a1e13708cd39c169b1986 /src/corelib/io | |
parent | d298ec3a6f4634254c6685398d49b1ba4dfa8e6b (diff) |
QUrlQuery: fix operator== for emptied object case
If an object had elements and then was emptied, it will have a non-null
d pointer, which wasn't taken into account in the comparison.
Fixes: QTBUG-109840
Pick-to: 6.5 6.4 6.2
Change-Id: I69ecc04064514f939896fffd17376aa18184653c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/corelib/io')
-rw-r--r-- | src/corelib/io/qurlquery.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/corelib/io/qurlquery.cpp b/src/corelib/io/qurlquery.cpp index 9b3015ecf0..57e66142ca 100644 --- a/src/corelib/io/qurlquery.cpp +++ b/src/corelib/io/qurlquery.cpp @@ -401,7 +401,11 @@ bool QUrlQuery::operator ==(const QUrlQuery &other) const return d->valueDelimiter == other.d->valueDelimiter && d->pairDelimiter == other.d->pairDelimiter && d->itemList == other.d->itemList; - return false; + + const QUrlQueryPrivate *x = d ? d.data() : other.d.data(); + return x->valueDelimiter == defaultQueryValueDelimiter() && + x->pairDelimiter == defaultQueryPairDelimiter() && + x->itemList.isEmpty(); } /*! |