Parcourir la source

Remove deprecated API from Http2Channel

Alexey Edelev il y a 5 ans
Parent
commit
af498dc990

+ 1 - 1
examples/addressbook/addressbookengine.cpp

@@ -58,7 +58,7 @@ AddressBookEngine::AddressBookEngine() : QObject()
     conf.setProtocol(QSsl::TlsV1_2);
     conf.setAllowedNextProtocols({QSslConfiguration::ALPNProtocolHTTP2});
 
-    std::shared_ptr<qtprotobuf::AbstractChannel> channel(new qtprotobuf::Http2Channel("localhost", 65001, qtprotobuf::SslCredentials(conf) |
+    std::shared_ptr<qtprotobuf::AbstractChannel> channel(new qtprotobuf::Http2Channel(QUrl("https://localhost:65001"), qtprotobuf::SslCredentials(conf) |
                                                                                       AuthCredentials("authorizedUser", QCryptographicHash::hash("test", QCryptographicHash::Md5).toHex())));
     m_client->attachChannel(channel);
     m_client->subscribeContactsUpdates(ListFrame());

+ 0 - 20
src/grpc/http2channel.cpp

@@ -171,19 +171,6 @@ struct Http2ChannelPrivate {
         return networkReply->readAll().mid(5);
     }
 
-    Http2ChannelPrivate(const AbstractCredentials &credentials_) : credentials(credentials_) {
-        if (credentials.channelCredentials().contains(QLatin1String("sslConfig"))) {
-            sslConfig = credentials.channelCredentials().value(QLatin1String("sslConfig")).value<QSslConfiguration>();
-        }
-
-        if (sslConfig.isNull()) {
-            url.setScheme("http");
-        } else {
-            url.setScheme("https");
-        }
-    }
-
-
     Http2ChannelPrivate(const QUrl &_url, const AbstractCredentials &_credentials)
         : url(_url)
         , credentials(_credentials)
@@ -201,13 +188,6 @@ struct Http2ChannelPrivate {
 
 }
 
-Http2Channel::Http2Channel(const QString &addr, quint16 port, const AbstractCredentials &credentials) : AbstractChannel()
-  , d(new Http2ChannelPrivate(credentials))
-{
-    d->url.setHost(addr, QUrl::StrictMode);
-    d->url.setPort(port);
-}
-
 Http2Channel::Http2Channel(const QUrl &url, const AbstractCredentials &credentials) : AbstractChannel()
   , d(new Http2ChannelPrivate(url, credentials))
 {

+ 0 - 2
src/grpc/http2channel.h

@@ -40,8 +40,6 @@ class AbstractCredentials;
 class Q_GRPC_EXPORT Http2Channel final : public AbstractChannel
 {
 public:
-    [[deprecated ("This contructor is obsolete and is going to be removed soon. Use Http2Channel(const QUrl&, const AbstractCredentials&)")]]
-    Http2Channel(const QString &addr, quint16 port, const AbstractCredentials &credentials);
     Http2Channel(const QUrl &url, const AbstractCredentials &credentials);
     ~Http2Channel();