Remove some usage of deprecated QSslCertificate::fromPath

The changed function was added in September 2019 in 5.15 branch before
the new overload was added and the old one was deprecated, so we can
freely change it.

Amends 1068d579ee

Change-Id: Iff9d72c26ce557c28b188e1754daa03fd061d531
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This commit is contained in:
Mårten Nordheim 2020-01-28 14:47:36 +01:00
parent 6f44c40f18
commit 33c9a1e0bc
3 changed files with 10 additions and 2 deletions

View File

@ -660,6 +660,8 @@ void QSslConfiguration::setCaCertificates(const QList<QSslCertificate> &certific
}
/*!
\since 5.15
Searches all files in the \a path for certificates encoded in the
specified \a format and adds them to this socket's CA certificate
database. \a path must be a file or a pattern matching one or more
@ -675,7 +677,7 @@ void QSslConfiguration::setCaCertificates(const QList<QSslCertificate> &certific
\sa addCaCertificate(), QSslCertificate::fromPath()
*/
bool QSslConfiguration::addCaCertificates(const QString &path, QSsl::EncodingFormat format,
QRegExp::PatternSyntax syntax)
QSslCertificate::PatternSyntax syntax)
{
QList<QSslCertificate> certs = QSslCertificate::fromPath(path, format, syntax);
if (certs.isEmpty())

View File

@ -132,7 +132,7 @@ public:
QList<QSslCertificate> caCertificates() const;
void setCaCertificates(const QList<QSslCertificate> &certificates);
bool addCaCertificates(const QString &path, QSsl::EncodingFormat format = QSsl::Pem,
QRegExp::PatternSyntax syntax = QRegExp::FixedString);
QSslCertificate::PatternSyntax syntax = QSslCertificate::FixedString);
void addCaCertificate(const QSslCertificate &certificate);
void addCaCertificates(const QList<QSslCertificate> &certificates);

View File

@ -1417,7 +1417,10 @@ bool QSslSocket::addCaCertificates(const QString &path, QSsl::EncodingFormat for
QRegExp::PatternSyntax syntax)
{
Q_D(QSslSocket);
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
QList<QSslCertificate> certs = QSslCertificate::fromPath(path, format, syntax);
QT_WARNING_POP
if (certs.isEmpty())
return false;
@ -2361,7 +2364,10 @@ bool QSslSocketPrivate::addDefaultCaCertificates(const QString &path, QSsl::Enco
QRegExp::PatternSyntax syntax)
{
QSslSocketPrivate::ensureInitialized();
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
QList<QSslCertificate> certs = QSslCertificate::fromPath(path, format, syntax);
QT_WARNING_POP
if (certs.isEmpty())
return false;