Fix signal connection nodiscard warnings (#4818)

This commit is contained in:
pajlada
2023-09-16 13:52:51 +02:00
committed by GitHub
parent 2d5f078306
commit 8fe3af3522
40 changed files with 709 additions and 554 deletions
+13 -12
View File
@@ -38,18 +38,6 @@ IrcConnection::IrcConnection(QObject *parent)
}
});
// Schedule a reconnect that won't violate RECONNECT_MIN_INTERVAL
this->smartReconnect.connect([this] {
if (this->reconnectTimer_.isActive())
{
return;
}
auto delay = this->reconnectBackoff_.next();
qCDebug(chatterinoIrc) << "Reconnecting in" << delay.count() << "ms";
this->reconnectTimer_.start(delay);
});
this->reconnectTimer_.setSingleShot(true);
QObject::connect(&this->reconnectTimer_, &QTimer::timeout, [this] {
if (this->isConnected())
@@ -123,6 +111,19 @@ IrcConnection::~IrcConnection()
this->disconnect();
}
void IrcConnection::smartReconnect()
{
if (this->reconnectTimer_.isActive())
{
// Ignore this reconnect request, we already have a reconnect request queued up
return;
}
auto delay = this->reconnectBackoff_.next();
qCDebug(chatterinoIrc) << "Reconnecting in" << delay.count() << "ms";
this->reconnectTimer_.start(delay);
}
void IrcConnection::open()
{
this->expectConnectionLoss_ = false;