mirror of
https://github.com/clementine-player/Clementine
synced 2024-12-22 07:54:18 +01:00
clementine-tagreader: Fix addDefaultCaCertificates deprecation
QSslSocket::addDefaultCaCertificates is deprecated in 5.15. Use QSslConfiguration default configuration instead.
This commit is contained in:
parent
5f75bde396
commit
59f6d95b80
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QLocalSocket>
|
#include <QLocalSocket>
|
||||||
|
#include <QSslConfiguration>
|
||||||
#include <QSslSocket>
|
#include <QSslSocket>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@ -58,8 +59,15 @@ int main(int argc, char** argv) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
|
||||||
|
// This method is marked deprecated in 5.15.
|
||||||
QSslSocket::addDefaultCaCertificates(
|
QSslSocket::addDefaultCaCertificates(
|
||||||
QSslCertificate::fromPath(":/certs/godaddy-root.pem", QSsl::Pem));
|
QSslCertificate::fromPath(":/certs/godaddy-root.pem", QSsl::Pem));
|
||||||
|
#else
|
||||||
|
QSslConfiguration config = QSslConfiguration::defaultConfiguration();
|
||||||
|
config.addCaCertificates(":/certs/godaddy-root.pem", QSsl::Pem);
|
||||||
|
QSslConfiguration::setDefaultConfiguration(config);
|
||||||
|
#endif
|
||||||
|
|
||||||
TagReaderWorker worker(&socket);
|
TagReaderWorker worker(&socket);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user