Fix signal connection nodiscard warnings (#4818)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user