Remove socket errors from Qt adapters

This commit is contained in:
Ilya Fedin 2023-01-06 14:20:26 +04:00 committed by John Preston
parent ce37c6ef08
commit 6288da2f3d
5 changed files with 7 additions and 12 deletions

View file

@ -25,7 +25,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "base/invoke_queued.h" #include "base/invoke_queued.h"
#include "base/qthelp_url.h" #include "base/qthelp_url.h"
#include "base/qthelp_regex.h" #include "base/qthelp_regex.h"
#include "base/qt/qt_common_adapters.h"
#include "ui/ui_utility.h" #include "ui/ui_utility.h"
#include "ui/effects/animations.h" #include "ui/effects/animations.h"
@ -135,7 +134,7 @@ int Sandbox::start() {
[=] { socketDisconnected(); }); [=] { socketDisconnected(); });
connect( connect(
&_localSocket, &_localSocket,
base::QLocalSocket_error, &QLocalSocket::errorOccurred,
[=](QLocalSocket::LocalSocketError error) { socketError(error); }); [=](QLocalSocket::LocalSocketError error) { socketError(error); });
connect( connect(
&_localSocket, &_localSocket,

View file

@ -13,7 +13,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "base/timer.h" #include "base/timer.h"
#include "base/bytes.h" #include "base/bytes.h"
#include "base/unixtime.h" #include "base/unixtime.h"
#include "base/qt/qt_common_adapters.h"
#include "storage/localstorage.h" #include "storage/localstorage.h"
#include "core/application.h" #include "core/application.h"
#include "core/changelogs.h" #include "core/changelogs.h"
@ -664,7 +663,7 @@ void HttpChecker::start() {
_reply->connect(_reply, &QNetworkReply::finished, [=] { _reply->connect(_reply, &QNetworkReply::finished, [=] {
gotResponse(); gotResponse();
}); });
_reply->connect(_reply, base::QNetworkReply_error, [=](auto e) { _reply->connect(_reply, &QNetworkReply::errorOccurred, [=](auto e) {
gotFailure(e); gotFailure(e);
}); });
} }
@ -703,7 +702,7 @@ void HttpChecker::clearSentRequest() {
return; return;
} }
reply->disconnect(reply, &QNetworkReply::finished, nullptr, nullptr); 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->abort();
reply->deleteLater(); reply->deleteLater();
_manager = nullptr; _manager = nullptr;
@ -857,7 +856,7 @@ void HttpLoaderActor::sendRequest() {
&HttpLoaderActor::partFinished); &HttpLoaderActor::partFinished);
connect( connect(
_reply.get(), _reply.get(),
base::QNetworkReply_error, &QNetworkReply::errorOccurred,
this, this,
&HttpLoaderActor::partFailed); &HttpLoaderActor::partFailed);
connect( connect(

View file

@ -8,7 +8,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "mtproto/details/mtproto_tcp_socket.h" #include "mtproto/details/mtproto_tcp_socket.h"
#include "base/invoke_queued.h" #include "base/invoke_queued.h"
#include "base/qt/qt_common_adapters.h"
namespace MTP::details { namespace MTP::details {
@ -47,7 +46,7 @@ TcpSocket::TcpSocket(
wrap([=] { _readyRead.fire({}); })); wrap([=] { _readyRead.fire({}); }));
connect( connect(
&_socket, &_socket,
base::QTcpSocket_error, &QAbstractSocket::errorOccurred,
wrap([=](Error e) { handleError(e); })); wrap([=](Error e) { handleError(e); }));
} }

View file

@ -12,7 +12,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "base/bytes.h" #include "base/bytes.h"
#include "base/invoke_queued.h" #include "base/invoke_queued.h"
#include "base/unixtime.h" #include "base/unixtime.h"
#include "base/qt/qt_common_adapters.h"
#include <QtCore/QtEndian> #include <QtCore/QtEndian>
#include <range/v3/algorithm/reverse.hpp> #include <range/v3/algorithm/reverse.hpp>
@ -482,7 +481,7 @@ TlsSocket::TlsSocket(
wrap([=] { plainReadyRead(); })); wrap([=] { plainReadyRead(); }));
connect( connect(
&_socket, &_socket,
base::QTcpSocket_error, &QAbstractSocket::errorOccurred,
wrap([=](Error e) { handleError(e); })); wrap([=](Error e) { handleError(e); }));
} }

View file

@ -8,7 +8,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "storage/file_download_web.h" #include "storage/file_download_web.h"
#include "storage/cache/storage_cache_types.h" #include "storage/cache/storage_cache_types.h"
#include "base/qt/qt_common_adapters.h"
#include "base/timer.h" #include "base/timer.h"
#include "base/weak_ptr.h" #include "base/weak_ptr.h"
@ -277,7 +276,7 @@ not_null<QNetworkReply*> WebLoadManager::send(int id, const QString &url) {
result, result,
&QNetworkReply::downloadProgress, &QNetworkReply::downloadProgress,
handleProgress); handleProgress);
QObject::connect(result, base::QNetworkReply_error, handleError); QObject::connect(result, &QNetworkReply::errorOccurred, handleError);
return result; return result;
} }