Skip to content

Commit

Permalink
Fix build errors from deprecated QByteArray::count()
Browse files Browse the repository at this point in the history
    In file included from /build/source/build/src/mozillavpn_autogen/UM7GZO45JR/../../../../src/platforms/linux/daemon/dnsutilslinux.h:12,
                     from /build/source/build/src/mozillavpn_autogen/UM7GZO45JR/../../../../src/platforms/linux/daemon/dbusservice.h:13,
                     from /build/source/build/src/mozillavpn_autogen/UM7GZO45JR/moc_dbusservice.cpp:9,
                     from /build/source/build/src/mozillavpn_autogen/mocs_compilation.cpp:88:
    /build/source/build/src/mozillavpn_autogen/UM7GZO45JR/../../../../src/platforms/linux/daemon/dbustypeslinux.h: In function 'const QDBusArgument& operator>>(const QDBusArgument&, DnsResolver&)':
    /build/source/build/src/mozillavpn_autogen/UM7GZO45JR/../../../../src/platforms/linux/daemon/dbustypeslinux.h:49:26: error: 'qsizetype QByteArray::count() const' is deprecated: Use size() or length() instead. [-Werror=deprecated-declarations]
       49 |     } else if (data.count() >= 4) {
          |                ~~~~~~~~~~^~
    In file included from /nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtCore/qstringview.h:10,
                     from /nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtCore/qchar.h:660,
                     from /nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtCore/qstring.h:14,
                     from /nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtCore/qcoreapplication.h:8,
                     from /nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtGui/qaccessible.h:17,
                     from /nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtGui/QAccessible:1,
                     from /build/source/build/src/mozillavpn_autogen/EWIEGA46WW/../../../../src/accessiblenotification.h:8,
                     from /build/source/build/src/mozillavpn_autogen/EWIEGA46WW/moc_accessiblenotification.cpp:9,
                     from /build/source/build/src/mozillavpn_autogen/mocs_compilation.cpp:2:
    /nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtCore/qbytearray.h:501:22: note: declared here
      501 |     inline qsizetype count() const noexcept { return size(); }
          |                      ^~~~~

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
  • Loading branch information
andersk committed Oct 15, 2024
1 parent 319be60 commit 1b358d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/networkrequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ void NetworkRequest::processData(QNetworkReply::NetworkError error,
}

qint64 NetworkRequest::discardData() {
qint64 bytes = m_replyData.count();
qint64 bytes = m_replyData.size();
if (m_reply != nullptr) {
bytes += m_reply->skip(m_reply->bytesAvailable());
}
Expand Down
2 changes: 1 addition & 1 deletion src/platforms/linux/daemon/dbustypeslinux.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class DnsResolver : public QHostAddress {
args.endStructure();
if (family == AF_INET6) {
ip.setAddress(data.constData());
} else if (data.count() >= 4) {
} else if (data.size() >= 4) {
quint32 addrv4 = 0;
addrv4 |= (data[0] << 24);
addrv4 |= (data[1] << 16);
Expand Down

0 comments on commit 1b358d2

Please sign in to comment.