p->setHeartBeatInterval(30);
p->setMaxHeartBeatCount(60); // 30 mins until we throw a dead socket out
- connect(p, SIGNAL(peerRemoved(Peer*)), SLOT(removeClient(Peer*)));
+ connect(p, &SignalProxy::peerRemoved, this, &CoreSession::removeClient);
- connect(p, SIGNAL(connected()), SLOT(clientsConnected()));
- connect(p, SIGNAL(disconnected()), SLOT(clientsDisconnected()));
+ connect(p, &SignalProxy::connected, this, &CoreSession::clientsConnected);
+ connect(p, &SignalProxy::disconnected, this, &CoreSession::clientsDisconnected);
p->attachSlot(SIGNAL(sendInput(BufferInfo, QString)), this, SLOT(msgFromClient(BufferInfo, QString)));
p->attachSignal(this, SIGNAL(displayMsg(Message)));
eventManager()->registerObject(ctcpParser(), EventManager::LowPriority, "send");
// periodically save our session state
- connect(Core::instance()->syncTimer(), SIGNAL(timeout()), this, SLOT(saveSessionState()));
+ connect(Core::instance()->syncTimer(), &QTimer::timeout, this, &CoreSession::saveSessionState);
p->synchronize(_bufferSyncer);
p->synchronize(&aliasManager());
p->synchronize(&_ignoreListManager);
p->synchronize(&_highlightRuleManager);
// Listen to network removed events
- connect(this, SIGNAL(networkRemoved(NetworkId)),
- &_highlightRuleManager, SLOT(networkRemoved(NetworkId)));
+ connect(this, &CoreSession::networkRemoved,
+ &_highlightRuleManager, &HighlightRuleManager::networkRemoved);
p->synchronize(transferManager());
// Restore session state
if (restoreState)
for (CoreNetwork *net : _networks.values()) {
if (net->socketState() != QAbstractSocket::UnconnectedState) {
_networksPendingDisconnect.insert(net->networkId());
- connect(net, SIGNAL(disconnected(NetworkId)), this, SLOT(onNetworkDisconnected(NetworkId)));
+ connect(net, &CoreNetwork::disconnected, this, &CoreSession::onNetworkDisconnected);
net->shutdown();
}
}
void CoreSession::addClient(InternalPeer *peer)
{
signalProxy()->addPeer(peer);
- emit sessionState(sessionState());
+ emit sessionStateReceived(sessionState());
}
_identities[identity.id()] = coreIdentity;
// CoreIdentity has its own synchronize method since its "private" sslManager needs to be synced as well
coreIdentity->synchronize(signalProxy());
- connect(coreIdentity, SIGNAL(updated()), this, SLOT(updateIdentityBySender()));
+ connect(coreIdentity, &SyncableObject::updated, this, &CoreSession::updateIdentityBySender);
emit identityCreated(*coreIdentity);
}
id = info.networkId.toInt();
if (!_networks.contains(id)) {
// create persistent chans
- QRegExp rx("\\s*(\\S+)(?:\\s*(\\S+))?\\s*");
+ QRegExp rx(R"(\s*(\S+)(?:\s*(\S+))?\s*)");
foreach(QString channel, persistentChans) {
if (!rx.exactMatch(channel)) {
qWarning() << QString("Invalid persistent channel declaration: %1").arg(channel);
}
CoreNetwork *net = new CoreNetwork(id, this);
- connect(net, SIGNAL(displayMsg(NetworkId, Message::Type, BufferInfo::Type, const QString &, const QString &, const QString &, Message::Flags)),
- SLOT(recvMessageFromServer(NetworkId, Message::Type, BufferInfo::Type, const QString &, const QString &, const QString &, Message::Flags)));
- connect(net, SIGNAL(displayStatusMsg(QString)), SLOT(recvStatusMsgFromServer(QString)));
- connect(net, SIGNAL(disconnected(NetworkId)), SIGNAL(networkDisconnected(NetworkId)));
+ connect(net, &CoreNetwork::displayMsg, this, &CoreSession::recvMessageFromServer);
+ connect(net, &CoreNetwork::displayStatusMsg, this, &CoreSession::recvStatusMsgFromServer);
+ connect(net, &CoreNetwork::disconnected, this, &CoreSession::networkDisconnected);
net->setNetworkInfo(info);
net->setProxy(signalProxy());
if (net->connectionState() != Network::Disconnected) {
// make sure we no longer receive data from the tcp buffer
- disconnect(net, SIGNAL(displayMsg(NetworkId, Message::Type, BufferInfo::Type, const QString &, const QString &, const QString &, Message::Flags)), this, nullptr);
- disconnect(net, SIGNAL(displayStatusMsg(QString)), this, nullptr);
- connect(net, SIGNAL(disconnected(NetworkId)), this, SLOT(destroyNetwork(NetworkId)));
+ disconnect(net, &CoreNetwork::displayMsg, this, nullptr);
+ disconnect(net, &CoreNetwork::displayStatusMsg, this, nullptr);
+ connect(net, &CoreNetwork::disconnected, this, &CoreSession::destroyNetwork);
net->disconnectFromIrc();
}
else {