From 6288da2f3df51d2c27c8f6016ab8ea2812237e6f Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Fri, 6 Jan 2023 14:20:26 +0400 Subject: [PATCH] Remove socket errors from Qt adapters --- Telegram/SourceFiles/core/sandbox.cpp | 3 +-- Telegram/SourceFiles/core/update_checker.cpp | 7 +++---- .../SourceFiles/mtproto/details/mtproto_tcp_socket.cpp | 3 +-- .../SourceFiles/mtproto/details/mtproto_tls_socket.cpp | 3 +-- Telegram/SourceFiles/storage/file_download_web.cpp | 3 +-- 5 files changed, 7 insertions(+), 12 deletions(-) diff --git a/Telegram/SourceFiles/core/sandbox.cpp b/Telegram/SourceFiles/core/sandbox.cpp index 91e1f4f21..ef93d97b5 100644 --- a/Telegram/SourceFiles/core/sandbox.cpp +++ b/Telegram/SourceFiles/core/sandbox.cpp @@ -25,7 +25,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "base/invoke_queued.h" #include "base/qthelp_url.h" #include "base/qthelp_regex.h" -#include "base/qt/qt_common_adapters.h" #include "ui/ui_utility.h" #include "ui/effects/animations.h" @@ -135,7 +134,7 @@ int Sandbox::start() { [=] { socketDisconnected(); }); connect( &_localSocket, - base::QLocalSocket_error, + &QLocalSocket::errorOccurred, [=](QLocalSocket::LocalSocketError error) { socketError(error); }); connect( &_localSocket, diff --git a/Telegram/SourceFiles/core/update_checker.cpp b/Telegram/SourceFiles/core/update_checker.cpp index 9b534c24a..9a1734a35 100644 --- a/Telegram/SourceFiles/core/update_checker.cpp +++ b/Telegram/SourceFiles/core/update_checker.cpp @@ -13,7 +13,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "base/timer.h" #include "base/bytes.h" #include "base/unixtime.h" -#include "base/qt/qt_common_adapters.h" #include "storage/localstorage.h" #include "core/application.h" #include "core/changelogs.h" @@ -664,7 +663,7 @@ void HttpChecker::start() { _reply->connect(_reply, &QNetworkReply::finished, [=] { gotResponse(); }); - _reply->connect(_reply, base::QNetworkReply_error, [=](auto e) { + _reply->connect(_reply, &QNetworkReply::errorOccurred, [=](auto e) { gotFailure(e); }); } @@ -703,7 +702,7 @@ void HttpChecker::clearSentRequest() { return; } reply->disconnect(reply, &QNetworkReply::finished, nullptr, nullptr); - reply->disconnect(reply, base::QNetworkReply_error, nullptr, nullptr); + reply->disconnect(reply, &QNetworkReply::errorOccurred, nullptr, nullptr); reply->abort(); reply->deleteLater(); _manager = nullptr; @@ -857,7 +856,7 @@ void HttpLoaderActor::sendRequest() { &HttpLoaderActor::partFinished); connect( _reply.get(), - base::QNetworkReply_error, + &QNetworkReply::errorOccurred, this, &HttpLoaderActor::partFailed); connect( diff --git a/Telegram/SourceFiles/mtproto/details/mtproto_tcp_socket.cpp b/Telegram/SourceFiles/mtproto/details/mtproto_tcp_socket.cpp index 5eb98bacb..76a59c120 100644 --- a/Telegram/SourceFiles/mtproto/details/mtproto_tcp_socket.cpp +++ b/Telegram/SourceFiles/mtproto/details/mtproto_tcp_socket.cpp @@ -8,7 +8,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "mtproto/details/mtproto_tcp_socket.h" #include "base/invoke_queued.h" -#include "base/qt/qt_common_adapters.h" namespace MTP::details { @@ -47,7 +46,7 @@ TcpSocket::TcpSocket( wrap([=] { _readyRead.fire({}); })); connect( &_socket, - base::QTcpSocket_error, + &QAbstractSocket::errorOccurred, wrap([=](Error e) { handleError(e); })); } diff --git a/Telegram/SourceFiles/mtproto/details/mtproto_tls_socket.cpp b/Telegram/SourceFiles/mtproto/details/mtproto_tls_socket.cpp index 166ce8702..f382828be 100644 --- a/Telegram/SourceFiles/mtproto/details/mtproto_tls_socket.cpp +++ b/Telegram/SourceFiles/mtproto/details/mtproto_tls_socket.cpp @@ -12,7 +12,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "base/bytes.h" #include "base/invoke_queued.h" #include "base/unixtime.h" -#include "base/qt/qt_common_adapters.h" #include #include @@ -482,7 +481,7 @@ TlsSocket::TlsSocket( wrap([=] { plainReadyRead(); })); connect( &_socket, - base::QTcpSocket_error, + &QAbstractSocket::errorOccurred, wrap([=](Error e) { handleError(e); })); } diff --git a/Telegram/SourceFiles/storage/file_download_web.cpp b/Telegram/SourceFiles/storage/file_download_web.cpp index c9f58afc7..c9fd48878 100644 --- a/Telegram/SourceFiles/storage/file_download_web.cpp +++ b/Telegram/SourceFiles/storage/file_download_web.cpp @@ -8,7 +8,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "storage/file_download_web.h" #include "storage/cache/storage_cache_types.h" -#include "base/qt/qt_common_adapters.h" #include "base/timer.h" #include "base/weak_ptr.h" @@ -277,7 +276,7 @@ not_null WebLoadManager::send(int id, const QString &url) { result, &QNetworkReply::downloadProgress, handleProgress); - QObject::connect(result, base::QNetworkReply_error, handleError); + QObject::connect(result, &QNetworkReply::errorOccurred, handleError); return result; }