From 93cb61e305f834a25ccbe0f2b64e0f8ebb72a168 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 2 Mar 2023 19:05:16 +0100 Subject: QMessageAuthenticationCode: port to QByteArrayView [1/3]: ctor/setKey() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The class is not used frequently enough to warrant the overhead of a Q_WEAK_ QByteArray overload to fix the SiC Type A for users that pass objects that implicitly convert to QByteArray. QCryptographicHash also doesn't have it. Also mark setKey() noexcept. Now that it takes a view instead of an owning container, it only calls other noexcept functions. ChangeLog will be on patch [3/3]. Task-number: QTBUG-111676 Task-number: QTBUG-111688 Change-Id: Ic2321d0d41ce8eb4d0390889f28b3fd4bd9af103 Reviewed-by: MÃ¥rten Nordheim --- src/corelib/compat/removed_api.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/corelib/compat/removed_api.cpp') diff --git a/src/corelib/compat/removed_api.cpp b/src/corelib/compat/removed_api.cpp index d99ca42122..a04550350d 100644 --- a/src/corelib/compat/removed_api.cpp +++ b/src/corelib/compat/removed_api.cpp @@ -486,6 +486,17 @@ void QXmlStreamWriter::writeStartElement(const QString &namespaceUri, const QStr #if QT_CORE_REMOVED_SINCE(6, 6) +#include "qmessageauthenticationcode.h" + +QMessageAuthenticationCode::QMessageAuthenticationCode(QCryptographicHash::Algorithm method, + const QByteArray &key) + : QMessageAuthenticationCode(method, qToByteArrayViewIgnoringNull(key)) {} + +void QMessageAuthenticationCode::setKey(const QByteArray &key) +{ + setKey(qToByteArrayViewIgnoringNull(key)); +} + #include "qstring.h" qsizetype QString::toUcs4_helper(const ushort *uc, qsizetype length, uint *out) -- cgit v1.2.3