diff options
author | Kai Koehne <kai.koehne@theqtcompany.com> | 2015-02-11 10:22:01 +0100 |
---|---|---|
committer | Kai Koehne <kai.koehne@theqtcompany.com> | 2015-02-12 10:08:20 +0000 |
commit | cd83859bd6310a2cf0a67c489aa597dc87e326b4 (patch) | |
tree | a6c9472f4e668035775b4f9260a2e8d3f02baf27 /src/network/ssl | |
parent | 7997e56a2e5f35fa19da9ccb5dc89586882d951b (diff) |
Network: Fix operator<<(QDebug, ...) operations
Use the
QDebugStateSaver saver(debug);
debug.resetFormat().nospace();
idiom to unify the formatting and whitespace handling.
Change-Id: Id346d63b3f589b60ca19e4459271d587f1a0c003
Reviewed-by: Richard J. Moore <rich@kde.org>
Diffstat (limited to 'src/network/ssl')
-rw-r--r-- | src/network/ssl/qsslcertificate.cpp | 16 | ||||
-rw-r--r-- | src/network/ssl/qsslcipher.cpp | 6 | ||||
-rw-r--r-- | src/network/ssl/qsslellipticcurve.cpp | 3 | ||||
-rw-r--r-- | src/network/ssl/qsslkey_p.cpp | 3 |
4 files changed, 17 insertions, 11 deletions
diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp index 01951bef08..1aac152ca3 100644 --- a/src/network/ssl/qsslcertificate.cpp +++ b/src/network/ssl/qsslcertificate.cpp @@ -682,16 +682,18 @@ QByteArray QSslCertificatePrivate::subjectInfoToString(QSslCertificate::SubjectI #ifndef QT_NO_DEBUG_STREAM QDebug operator<<(QDebug debug, const QSslCertificate &certificate) { + QDebugStateSaver saver(debug); + debug.resetFormat().nospace(); debug << "QSslCertificate(" << certificate.version() - << ',' << certificate.serialNumber() - << ',' << certificate.digest().toBase64() - << ',' << certificate.issuerInfo(QSslCertificate::Organization) - << ',' << certificate.subjectInfo(QSslCertificate::Organization) - << ',' << certificate.subjectAlternativeNames() + << ", " << certificate.serialNumber() + << ", " << certificate.digest().toBase64() + << ", " << certificate.issuerInfo(QSslCertificate::Organization) + << ", " << certificate.subjectInfo(QSslCertificate::Organization) + << ", " << certificate.subjectAlternativeNames() #ifndef QT_NO_DATESTRING - << ',' << certificate.effectiveDate() - << ',' << certificate.expiryDate() + << ", " << certificate.effectiveDate() + << ", " << certificate.expiryDate() #endif << ')'; return debug; diff --git a/src/network/ssl/qsslcipher.cpp b/src/network/ssl/qsslcipher.cpp index f60569942f..8f2b8b54ad 100644 --- a/src/network/ssl/qsslcipher.cpp +++ b/src/network/ssl/qsslcipher.cpp @@ -248,9 +248,11 @@ QSsl::SslProtocol QSslCipher::protocol() const #ifndef QT_NO_DEBUG_STREAM QDebug operator<<(QDebug debug, const QSslCipher &cipher) { - debug << "QSslCipher(name=" << qPrintable(cipher.name()) + QDebugStateSaver saver(debug); + debug.resetFormat().nospace().noquote(); + debug << "QSslCipher(name=" << cipher.name() << ", bits=" << cipher.usedBits() - << ", proto=" << qPrintable(cipher.protocolString()) + << ", proto=" << cipher.protocolString() << ')'; return debug; } diff --git a/src/network/ssl/qsslellipticcurve.cpp b/src/network/ssl/qsslellipticcurve.cpp index 31b8b8f57e..a16f726429 100644 --- a/src/network/ssl/qsslellipticcurve.cpp +++ b/src/network/ssl/qsslellipticcurve.cpp @@ -170,7 +170,8 @@ QT_BEGIN_NAMESPACE QDebug operator<<(QDebug debug, QSslEllipticCurve curve) { QDebugStateSaver saver(debug); - debug.nospace() << "QSslEllipticCurve(" << curve.shortName() << ")"; + debug.resetFormat().nospace(); + debug << "QSslEllipticCurve(" << curve.shortName() << ")"; return debug; } #endif diff --git a/src/network/ssl/qsslkey_p.cpp b/src/network/ssl/qsslkey_p.cpp index c18e713ef6..55a2ab7108 100644 --- a/src/network/ssl/qsslkey_p.cpp +++ b/src/network/ssl/qsslkey_p.cpp @@ -444,9 +444,10 @@ bool QSslKey::operator==(const QSslKey &other) const */ #ifndef QT_NO_DEBUG_STREAM -class QDebug; QDebug operator<<(QDebug debug, const QSslKey &key) { + QDebugStateSaver saver(debug); + debug.resetFormat().nospace(); debug << "QSslKey(" << (key.type() == QSsl::PublicKey ? "PublicKey" : "PrivateKey") << ", " << (key.algorithm() == QSsl::Opaque ? "OPAQUE" : |