Skip to content

Commit

Permalink
Doc: Fix readString() and readByteArray() code snippets
Browse files Browse the repository at this point in the history
Both of these functions return a StringResult, which has no
StringResult::code member. Instead, use the existing
StringResult::status member.

Fixes: QTBUG-122254
Pick-to: 6.7 6.6 6.5 6.2
Change-Id: I0b9bfa1fc9a30e9c542ab90f3d8f4243bdeda762
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
  • Loading branch information
andreaseliasson committed Feb 15, 2024
1 parent 026e1e3 commit 5738817
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,12 @@ using namespace Qt::StringLiterals;
{
QString result;
auto r = reader.readString();
while (r.code == QCborStreamReader::Ok) {
while (r.status == QCborStreamReader::Ok) {
result += r.data;
r = reader.readString();
}

if (r.code == QCborStreamReader::Error) {
if (r.status == QCborStreamReader::Error) {
// handle error condition
result.clear();
}
Expand All @@ -289,12 +289,12 @@ using namespace Qt::StringLiterals;
{
QBytearray result;
auto r = reader.readBytearray();
while (r.code == QCborStreamReader::Ok) {
while (r.status == QCborStreamReader::Ok) {
result += r.data;
r = reader.readByteArray();
}

if (r.code == QCborStreamReader::Error) {
if (r.status == QCborStreamReader::Error) {
// handle error condition
result.clear();
}
Expand Down

0 comments on commit 5738817

Please sign in to comment.