virtual MessageModel *createMessageModel(QObject *parent) = 0;
virtual AbstractMessageProcessor *createMessageProcessor(QObject *parent) = 0;
-protected slots:
+public slots:
virtual void connectedToCore() {}
virtual void disconnectedFromCore() {}
{
setSourceModel(parent);
if (Quassel::isOptionSet("debugbufferswitches")) {
- connect(_selectionModelSynchronizer.selectionModel(), SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)),
- this, SLOT(debug_currentChanged(const QModelIndex &, const QModelIndex &)));
+ connect(_selectionModelSynchronizer.selectionModel(), &QItemSelectionModel::currentChanged,
+ this, &BufferModel::debug_currentChanged);
}
- connect(Client::instance(), SIGNAL(networkCreated(NetworkId)), this, SLOT(newNetwork(NetworkId)));
- connect(this, SIGNAL(rowsInserted(const QModelIndex &, int, int)), this, SLOT(newBuffers(const QModelIndex &, int, int)));
+ connect(Client::instance(), &Client::networkCreated, this, &BufferModel::newNetwork);
+ connect(this, &QAbstractItemModel::rowsInserted, this, &BufferModel::newBuffers);
}
{
const Network *net = Client::network(id);
Q_ASSERT(net);
- connect(net, SIGNAL(connectionStateSet(Network::ConnectionState)),
- this, SLOT(networkConnectionChanged(Network::ConnectionState)));
+ connect(net, &Network::connectionStateSet,
+ this, &BufferModel::networkConnectionChanged);
}
}
disconnect(config, SIGNAL(initDone()), this, SLOT(viewInitialized()));
- connect(config, SIGNAL(configChanged()), this, SLOT(update()));
+ connect(config, &BufferViewConfig::configChanged, this, &BufferViewOverlay::update);
// check if the view was removed in the meantime...
if (_bufferViewIds.contains(config->bufferViewId()))
Q_INIT_RESOURCE(data);
#endif
- //connect(mainUi(), SIGNAL(connectToCore(const QVariantMap &)), this, SLOT(connectToCore(const QVariantMap &)));
- connect(mainUi(), SIGNAL(disconnectFromCore()), this, SLOT(disconnectFromCore()));
- connect(this, SIGNAL(connected()), mainUi(), SLOT(connectedToCore()));
- connect(this, SIGNAL(disconnected()), mainUi(), SLOT(disconnectedFromCore()));
+ connect(mainUi(), &AbstractUi::disconnectFromCore, this, &Client::disconnectFromCore);
+ connect(this, &Client::connected, mainUi(), &AbstractUi::connectedToCore);
+ connect(this, &Client::disconnected, mainUi(), &AbstractUi::disconnectedFromCore);
- connect(this, SIGNAL(networkRemoved(NetworkId)), _networkModel, SLOT(networkRemoved(NetworkId)));
+ connect(this, &Client::networkRemoved, _networkModel, &NetworkModel::networkRemoved);
connect(this, SIGNAL(networkRemoved(NetworkId)), _messageProcessor, SLOT(networkRemoved(NetworkId)));
- connect(backlogManager(), SIGNAL(messagesReceived(BufferId, int)), _messageModel, SLOT(messagesReceived(BufferId, int)));
- connect(coreConnection(), SIGNAL(stateChanged(CoreConnection::ConnectionState)), SLOT(connectionStateChanged(CoreConnection::ConnectionState)));
+ connect(backlogManager(), &ClientBacklogManager::messagesReceived, _messageModel, &MessageModel::messagesReceived);
+ connect(coreConnection(), &CoreConnection::stateChanged, this, &Client::connectionStateChanged);
SignalProxy *p = signalProxy();
net->setProxy(signalProxy());
signalProxy()->synchronize(net);
networkModel()->attachNetwork(net);
- connect(net, SIGNAL(destroyed()), instance(), SLOT(networkDestroyed()));
+ connect(net, &QObject::destroyed, instance(), &Client::networkDestroyed);
instance()->_networks[net->networkId()] = net;
emit instance()->networkCreated(net->networkId());
}
// create buffersyncer
Q_ASSERT(!_bufferSyncer);
_bufferSyncer = new BufferSyncer(this);
- connect(bufferSyncer(), SIGNAL(lastSeenMsgSet(BufferId, MsgId)), _networkModel, SLOT(setLastSeenMsgId(BufferId, MsgId)));
- connect(bufferSyncer(), SIGNAL(markerLineSet(BufferId, MsgId)), _networkModel, SLOT(setMarkerLineMsgId(BufferId, MsgId)));
- connect(bufferSyncer(), SIGNAL(bufferRemoved(BufferId)), this, SLOT(bufferRemoved(BufferId)));
- connect(bufferSyncer(), SIGNAL(bufferRenamed(BufferId, QString)), this, SLOT(bufferRenamed(BufferId, QString)));
- connect(bufferSyncer(), SIGNAL(buffersPermanentlyMerged(BufferId, BufferId)), this, SLOT(buffersPermanentlyMerged(BufferId, BufferId)));
- connect(bufferSyncer(), SIGNAL(buffersPermanentlyMerged(BufferId, BufferId)), _messageModel, SLOT(buffersPermanentlyMerged(BufferId, BufferId)));
- connect(bufferSyncer(), SIGNAL(bufferMarkedAsRead(BufferId)), SIGNAL(bufferMarkedAsRead(BufferId)));
- connect(bufferSyncer(), SIGNAL(bufferActivityChanged(BufferId, const Message::Types)), _networkModel, SLOT(bufferActivityChanged(BufferId, const Message::Types)));
- connect(bufferSyncer(), SIGNAL(highlightCountChanged(BufferId, int)), _networkModel, SLOT(highlightCountChanged(BufferId, int)));
- connect(networkModel(), SIGNAL(requestSetLastSeenMsg(BufferId, MsgId)), bufferSyncer(), SLOT(requestSetLastSeenMsg(BufferId, const MsgId &)));
+ connect(bufferSyncer(), &BufferSyncer::lastSeenMsgSet, _networkModel, &NetworkModel::setLastSeenMsgId);
+ connect(bufferSyncer(), &BufferSyncer::markerLineSet, _networkModel, &NetworkModel::setMarkerLineMsgId);
+ connect(bufferSyncer(), &BufferSyncer::bufferRemoved, this, &Client::bufferRemoved);
+ connect(bufferSyncer(), &BufferSyncer::bufferRenamed, this, &Client::bufferRenamed);
+ connect(bufferSyncer(), &BufferSyncer::buffersPermanentlyMerged, this, &Client::buffersPermanentlyMerged);
+ connect(bufferSyncer(), &BufferSyncer::buffersPermanentlyMerged, _messageModel, &MessageModel::buffersPermanentlyMerged);
+ connect(bufferSyncer(), &BufferSyncer::bufferMarkedAsRead, this, &Client::bufferMarkedAsRead);
+ connect(bufferSyncer(), &BufferSyncer::bufferActivityChanged, _networkModel, &NetworkModel::bufferActivityChanged);
+ connect(bufferSyncer(), &BufferSyncer::highlightCountChanged, _networkModel, &NetworkModel::highlightCountChanged);
+ connect(networkModel(), &NetworkModel::requestSetLastSeenMsg, bufferSyncer(), &BufferSyncer::requestSetLastSeenMsg);
SignalProxy *p = signalProxy();
p->synchronize(bufferSyncer());
// create a new BufferViewManager
Q_ASSERT(!_bufferViewManager);
_bufferViewManager = new ClientBufferViewManager(p, this);
- connect(_bufferViewManager, SIGNAL(initDone()), _bufferViewOverlay, SLOT(restore()));
+ connect(_bufferViewManager, &SyncableObject::initDone, _bufferViewOverlay, &BufferViewOverlay::restore);
// create AliasManager
Q_ASSERT(!_aliasManager);
_aliasManager = new ClientAliasManager(this);
- connect(aliasManager(), SIGNAL(initDone()), SLOT(sendBufferedUserInput()));
+ connect(aliasManager(), &SyncableObject::initDone, this, &Client::sendBufferedUserInput);
p->synchronize(aliasManager());
// create NetworkConfig
_highlightRuleManager = new HighlightRuleManager(this);
p->synchronize(highlightRuleManager());
// Listen to network removed events
- connect(this, SIGNAL(networkRemoved(NetworkId)),
- _highlightRuleManager, SLOT(networkRemoved(NetworkId)));
+ connect(this, &Client::networkRemoved,
+ _highlightRuleManager, &HighlightRuleManager::networkRemoved);
/* not ready yet
// create TransferManager and DccConfig if core supports them
*/
// trigger backlog request once all active bufferviews are initialized
- connect(bufferViewOverlay(), SIGNAL(initDone()), this, SLOT(finishConnectionInitialization()));
+ connect(bufferViewOverlay(), &BufferViewOverlay::initDone, this, &Client::finishConnectionInitialization);
_connected = true;
emit connected();
// triggers this slot. But we have to make sure that we know all buffers yet.
// so we check the BufferSyncer and in case it wasn't initialized we wait for that instead
if (!bufferSyncer()->isInitialized()) {
- disconnect(bufferViewOverlay(), SIGNAL(initDone()), this, SLOT(finishConnectionInitialization()));
- connect(bufferSyncer(), SIGNAL(initDone()), this, SLOT(finishConnectionInitialization()));
+ disconnect(bufferViewOverlay(), &BufferViewOverlay::initDone, this, &Client::finishConnectionInitialization);
+ connect(bufferSyncer(), &SyncableObject::initDone, this, &Client::finishConnectionInitialization);
return;
}
- disconnect(bufferViewOverlay(), SIGNAL(initDone()), this, SLOT(finishConnectionInitialization()));
- disconnect(bufferSyncer(), SIGNAL(initDone()), this, SLOT(finishConnectionInitialization()));
+ disconnect(bufferViewOverlay(), &BufferViewOverlay::initDone, this, &Client::finishConnectionInitialization);
+ disconnect(bufferSyncer(), &SyncableObject::initDone, this, &Client::finishConnectionInitialization);
requestInitialBacklog();
if (isCoreFeatureEnabled(Quassel::Feature::BufferActivitySync)) {
#endif
setSocket(socket);
- connect(socket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), SLOT(onSocketStateChanged(QAbstractSocket::SocketState)));
- connect(socket, SIGNAL(readyRead()), SLOT(onReadyRead()));
- connect(socket, SIGNAL(connected()), SLOT(onSocketConnected()));
+ connect(socket, &QAbstractSocket::stateChanged, this, &ClientAuthHandler::onSocketStateChanged);
+ connect(socket, &QIODevice::readyRead, this, &ClientAuthHandler::onReadyRead);
+ connect(socket, &QAbstractSocket::connected, this, &ClientAuthHandler::onSocketConnected);
emit statusMessage(tr("Connecting to %1...").arg(_account.accountName()));
socket->connectToHost(_account.hostName(), _account.port());
if (_probing && _legacy) {
// Remote host has closed the connection while probing
_probing = false;
- disconnect(socket(), SIGNAL(readyRead()), this, SLOT(onReadyRead()));
+ disconnect(socket(), &QIODevice::readyRead, this, &ClientAuthHandler::onReadyRead);
emit statusMessage(tr("Reconnecting in compatibility mode..."));
socket()->connectToHost(_account.hostName(), _account.port());
return;
return; // make sure to not read more data than needed
_probing = false;
- disconnect(socket(), SIGNAL(readyRead()), this, SLOT(onReadyRead()));
+ disconnect(socket(), &QIODevice::readyRead, this, &ClientAuthHandler::onReadyRead);
quint32 reply;
socket()->read((char *)&reply, 4);
qDebug().nospace() << "Using " << qPrintable(peer->protocolName()) << "...";
_peer = peer;
- connect(_peer, SIGNAL(transferProgress(int,int)), SIGNAL(transferProgress(int,int)));
+ connect(_peer, &RemotePeer::transferProgress, this, &ClientAuthHandler::transferProgress);
// The legacy protocol enables SSL later, after registration
if (!_account.useSsl() || _legacy)
auto *sslSocket = qobject_cast<QSslSocket *>(socket());
Q_ASSERT(sslSocket);
- connect(sslSocket, SIGNAL(encrypted()), SLOT(onSslSocketEncrypted()));
+ connect(sslSocket, &QSslSocket::encrypted, this, &ClientAuthHandler::onSslSocketEncrypted);
connect(sslSocket, SIGNAL(sslErrors(QList<QSslError>)), SLOT(onSslErrors()));
qDebug() << "Starting encryption...";
sslSocket->flush();
: BufferViewConfig(bufferViewId, parent),
_locked(false)
{
- connect(this, SIGNAL(initDone()), this, SLOT(ensureDecoration()));
+ connect(this, &SyncableObject::initDone, this, &ClientBufferViewConfig::ensureDecoration);
}
_certManager = new ClientCertManager(id(), this);
if (isValid()) { // this means we are not a newly created Identity but have a proper Id
Client::signalProxy()->synchronize(_certManager);
- connect(_certManager, SIGNAL(updated()), this, SLOT(markClean()));
- connect(_certManager, SIGNAL(initDone()), this, SLOT(markClean()));
+ connect(_certManager, &SyncableObject::updated, this, &CertIdentity::markClean);
+ connect(_certManager, &SyncableObject::initDone, this, &CertIdentity::markClean);
}
}
ClientIgnoreListManager::ClientIgnoreListManager(QObject *parent)
: IgnoreListManager(parent)
{
- connect(this, SIGNAL(updatedRemotely()), SIGNAL(ignoreListChanged()));
+ connect(this, &SyncableObject::updatedRemotely, this, &ClientIgnoreListManager::ignoreListChanged);
}
#pragma once
+#include "client-export.h"
+
#include "irclisthelper.h"
-class ClientIrcListHelper : public IrcListHelper
+class CLIENT_EXPORT ClientIrcListHelper : public IrcListHelper
{
Q_OBJECT
: Transfer(uuid, parent),
_file(nullptr)
{
- connect(this, SIGNAL(statusChanged(Transfer::Status)), SLOT(onStatusChanged(Transfer::Status)));
+ connect(this, &Transfer::statusChanged, this, &ClientTransfer::onStatusChanged);
}
}
auto transfer = new ClientTransfer(uuid, this);
- connect(transfer, SIGNAL(initDone()), SLOT(onTransferInitDone())); // we only want to add initialized transfers
+ connect(transfer, &SyncableObject::initDone, this, &ClientTransferManager::onTransferInitDone); // we only want to add initialized transfers
Client::signalProxy()->synchronize(transfer);
}
void CoreConnection::init()
{
Client::signalProxy()->setHeartBeatInterval(30);
- connect(Client::signalProxy(), SIGNAL(lagUpdated(int)), SIGNAL(lagUpdated(int)));
+ connect(Client::signalProxy(), &SignalProxy::lagUpdated, this, &CoreConnection::lagUpdated);
_reconnectTimer.setSingleShot(true);
- connect(&_reconnectTimer, SIGNAL(timeout()), SLOT(reconnectTimeout()));
+ connect(&_reconnectTimer, &QTimer::timeout, this, &CoreConnection::reconnectTimeout);
_qNetworkConfigurationManager = new QNetworkConfigurationManager(this);
- connect(_qNetworkConfigurationManager, SIGNAL(onlineStateChanged(bool)), SLOT(onlineStateChanged(bool)));
+ connect(_qNetworkConfigurationManager.data(), &QNetworkConfigurationManager::onlineStateChanged, this, &CoreConnection::onlineStateChanged);
CoreConnectionSettings s;
s.initAndNotify("PingTimeoutInterval", this, SLOT(pingTimeoutIntervalChanged(QVariant)), 60);
_authHandler = new ClientAuthHandler(currentAccount(), this);
- connect(_authHandler, SIGNAL(disconnected()), SLOT(coreSocketDisconnected()));
- connect(_authHandler, SIGNAL(connectionReady()), SLOT(onConnectionReady()));
- connect(_authHandler, SIGNAL(socketError(QAbstractSocket::SocketError,QString)), SLOT(coreSocketError(QAbstractSocket::SocketError,QString)));
- connect(_authHandler, SIGNAL(transferProgress(int,int)), SLOT(updateProgress(int,int)));
+ connect(_authHandler.data(), &AuthHandler::disconnected, this, &CoreConnection::coreSocketDisconnected);
+ connect(_authHandler.data(), &ClientAuthHandler::connectionReady, this, &CoreConnection::onConnectionReady);
+ connect(_authHandler.data(), &AuthHandler::socketError, this, &CoreConnection::coreSocketError);
+ connect(_authHandler.data(), &ClientAuthHandler::transferProgress, this, &CoreConnection::updateProgress);
connect(_authHandler, SIGNAL(requestDisconnect(QString,bool)), SLOT(disconnectFromCore(QString,bool)));
- connect(_authHandler, SIGNAL(errorMessage(QString)), SIGNAL(connectionError(QString)));
- connect(_authHandler, SIGNAL(errorPopup(QString)), SIGNAL(connectionErrorPopup(QString)), Qt::QueuedConnection);
- connect(_authHandler, SIGNAL(statusMessage(QString)), SIGNAL(connectionMsg(QString)));
- connect(_authHandler, SIGNAL(encrypted(bool)), SIGNAL(encrypted(bool)));
- connect(_authHandler, SIGNAL(startCoreSetup(QVariantList, QVariantList)), SIGNAL(startCoreSetup(QVariantList, QVariantList)));
- connect(_authHandler, SIGNAL(coreSetupFailed(QString)), SIGNAL(coreSetupFailed(QString)));
- connect(_authHandler, SIGNAL(coreSetupSuccessful()), SIGNAL(coreSetupSuccess()));
- connect(_authHandler, SIGNAL(userAuthenticationRequired(CoreAccount*,bool*,QString)), SIGNAL(userAuthenticationRequired(CoreAccount*,bool*,QString)));
- connect(_authHandler, SIGNAL(handleNoSslInClient(bool*)), SIGNAL(handleNoSslInClient(bool*)));
- connect(_authHandler, SIGNAL(handleNoSslInCore(bool*)), SIGNAL(handleNoSslInCore(bool*)));
+ connect(_authHandler.data(), &ClientAuthHandler::errorMessage, this, &CoreConnection::connectionError);
+ connect(_authHandler.data(), &ClientAuthHandler::errorPopup, this, &CoreConnection::connectionErrorPopup, Qt::QueuedConnection);
+ connect(_authHandler.data(), &ClientAuthHandler::statusMessage, this, &CoreConnection::connectionMsg);
+ connect(_authHandler.data(), &ClientAuthHandler::encrypted, this, &CoreConnection::encrypted);
+ connect(_authHandler.data(), &ClientAuthHandler::startCoreSetup, this, &CoreConnection::startCoreSetup);
+ connect(_authHandler.data(), &ClientAuthHandler::coreSetupFailed, this, &CoreConnection::coreSetupFailed);
+ connect(_authHandler.data(), &ClientAuthHandler::coreSetupSuccessful, this, &CoreConnection::coreSetupSuccess);
+ connect(_authHandler.data(), &ClientAuthHandler::userAuthenticationRequired, this, &CoreConnection::userAuthenticationRequired);
+ connect(_authHandler.data(), &ClientAuthHandler::handleNoSslInClient, this, &CoreConnection::handleNoSslInClient);
+ connect(_authHandler.data(), &ClientAuthHandler::handleNoSslInCore, this, &CoreConnection::handleNoSslInCore);
#ifdef HAVE_SSL
- connect(_authHandler, SIGNAL(handleSslErrors(const QSslSocket*,bool*,bool*)), SIGNAL(handleSslErrors(const QSslSocket*,bool*,bool*)));
+ connect(_authHandler.data(), &ClientAuthHandler::handleSslErrors, this, &CoreConnection::handleSslErrors);
#endif
- connect(_authHandler, SIGNAL(loginSuccessful(CoreAccount)), SLOT(onLoginSuccessful(CoreAccount)));
- connect(_authHandler, SIGNAL(handshakeComplete(RemotePeer*,Protocol::SessionState)), SLOT(onHandshakeComplete(RemotePeer*,Protocol::SessionState)));
+ connect(_authHandler.data(), &ClientAuthHandler::loginSuccessful, this, &CoreConnection::onLoginSuccessful);
+ connect(_authHandler.data(), &ClientAuthHandler::handshakeComplete, this, &CoreConnection::onHandshakeComplete);
setState(Connecting);
_authHandler->connectToCore();
_authHandler = nullptr;
_peer = peer;
- connect(peer, SIGNAL(disconnected()), SLOT(coreSocketDisconnected()));
- connect(peer, SIGNAL(statusMessage(QString)), SIGNAL(connectionMsg(QString)));
- connect(peer, SIGNAL(socketError(QAbstractSocket::SocketError,QString)), SLOT(coreSocketError(QAbstractSocket::SocketError,QString)));
+ connect(peer, &Peer::disconnected, this, &CoreConnection::coreSocketDisconnected);
+ connect(peer, &RemotePeer::statusMessage, this, &CoreConnection::connectionMsg);
+ connect(peer, &RemotePeer::socketError, this, &CoreConnection::coreSocketError);
Client::signalProxy()->addPeer(_peer); // sigproxy takes ownership of the peer!
continue;
auto *net = new Network(netid, Client::instance());
_netsToSync.insert(net);
- connect(net, SIGNAL(initDone()), SLOT(networkInitDone()));
- connect(net, SIGNAL(destroyed()), SLOT(networkInitDone()));
+ connect(net, &SyncableObject::initDone, this, &CoreConnection::networkInitDone);
+ connect(net, &QObject::destroyed, this, &CoreConnection::networkInitDone);
Client::addNetwork(net);
}
checkSyncState();
ExecWrapper::ExecWrapper(QObject *parent) : QObject(parent)
{
- connect(&_process, SIGNAL(readyReadStandardOutput()), SLOT(processReadStdout()));
- connect(&_process, SIGNAL(readyReadStandardError()), SLOT(processReadStderr()));
+ connect(&_process, &QProcess::readyReadStandardOutput, this, &ExecWrapper::processReadStdout);
+ connect(&_process, &QProcess::readyReadStandardError, this, &ExecWrapper::processReadStderr);
connect(&_process, SIGNAL(finished(int, QProcess::ExitStatus)), SLOT(processFinished(int, QProcess::ExitStatus)));
connect(&_process, SIGNAL(error(QProcess::ProcessError)), SLOT(processError(QProcess::ProcessError)));
- connect(this, SIGNAL(output(QString)), SLOT(postStdout(QString)));
- connect(this, SIGNAL(error(QString)), SLOT(postStderr(QString)));
+ connect(this, &ExecWrapper::output, this, &ExecWrapper::postStdout);
+ connect(this, &ExecWrapper::error, this, &ExecWrapper::postStderr);
}
_nextDayChange.setTimeSpec(Qt::LocalTime);
_dayChangeTimer.setInterval(QDateTime::currentDateTime().secsTo(_nextDayChange) * 1000);
_dayChangeTimer.start();
- connect(&_dayChangeTimer, SIGNAL(timeout()), this, SLOT(changeOfDay()));
+ connect(&_dayChangeTimer, &QTimer::timeout, this, &MessageModel::changeOfDay);
}
// use networkDataChanged() instead. Otherwise you will end up in a infinite loop
// as we "sync" the dataChanged() signals of NetworkItem and StatusBufferItem
setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
- connect(this, SIGNAL(networkDataChanged(int)), this, SIGNAL(dataChanged(int)));
- connect(this, SIGNAL(beginRemoveChilds(int, int)), this, SLOT(onBeginRemoveChilds(int, int)));
+ connect(this, &NetworkItem::networkDataChanged, this, &AbstractTreeItem::dataChanged);
+ connect(this, &AbstractTreeItem::beginRemoveChilds, this, &NetworkItem::onBeginRemoveChilds);
}
case BufferInfo::StatusBuffer:
_statusBufferItem = new StatusBufferItem(bufferInfo, this);
bufferItem = _statusBufferItem;
- disconnect(this, SIGNAL(networkDataChanged(int)), this, SIGNAL(dataChanged(int)));
- connect(this, SIGNAL(networkDataChanged(int)), bufferItem, SIGNAL(dataChanged(int)));
- connect(bufferItem, SIGNAL(dataChanged(int)), this, SIGNAL(dataChanged(int)));
+ disconnect(this, &NetworkItem::networkDataChanged, this, &AbstractTreeItem::dataChanged);
+ connect(this, &NetworkItem::networkDataChanged, bufferItem, &AbstractTreeItem::dataChanged);
+ connect(bufferItem, &AbstractTreeItem::dataChanged, this, &AbstractTreeItem::dataChanged);
break;
case BufferInfo::ChannelBuffer:
bufferItem = new ChannelBufferItem(bufferInfo, this);
_network = network;
- connect(network, SIGNAL(networkNameSet(QString)),
- this, SLOT(setNetworkName(QString)));
- connect(network, SIGNAL(currentServerSet(QString)),
- this, SLOT(setCurrentServer(QString)));
- connect(network, SIGNAL(ircChannelAdded(IrcChannel *)),
- this, SLOT(attachIrcChannel(IrcChannel *)));
- connect(network, SIGNAL(ircUserAdded(IrcUser *)),
- this, SLOT(attachIrcUser(IrcUser *)));
- connect(network, SIGNAL(connectedSet(bool)),
- this, SIGNAL(networkDataChanged()));
- connect(network, SIGNAL(destroyed()),
- this, SLOT(onNetworkDestroyed()));
+ connect(network, &Network::networkNameSet,
+ this, &NetworkItem::setNetworkName);
+ connect(network, &Network::currentServerSet,
+ this, &NetworkItem::setCurrentServer);
+ connect(network, &Network::ircChannelAdded,
+ this, &NetworkItem::attachIrcChannel);
+ connect(network, &Network::ircUserAdded,
+ this, &NetworkItem::attachIrcUser);
+ connect(network, &Network::connectedSet,
+ this, &NetworkItem::networkDataChanged);
+ connect(network, &QObject::destroyed,
+ this, &NetworkItem::onNetworkDestroyed);
emit networkDataChanged();
}
}
if (ircUser) {
- connect(ircUser, SIGNAL(destroyed(QObject*)), SLOT(removeIrcUser()));
- connect(ircUser, SIGNAL(quited()), this, SLOT(removeIrcUser()));
- connect(ircUser, SIGNAL(awaySet(bool)), this, SIGNAL(dataChanged()));
- connect(ircUser, SIGNAL(encryptedSet(bool)), this, SLOT(setEncrypted(bool)));
+ connect(ircUser, &QObject::destroyed, this, &QueryBufferItem::removeIrcUser);
+ connect(ircUser, &IrcUser::quited, this, &QueryBufferItem::removeIrcUser);
+ connect(ircUser, &IrcUser::awaySet, this, &AbstractTreeItem::dataChanged);
+ connect(ircUser, &IrcUser::encryptedSet, this, &BufferItem::setEncrypted);
}
_ircUser = ircUser;
_ircChannel = ircChannel;
- connect(ircChannel, SIGNAL(destroyed(QObject*)),
- this, SLOT(ircChannelDestroyed()));
- connect(ircChannel, SIGNAL(topicSet(QString)),
- this, SLOT(setTopic(QString)));
- connect(ircChannel, SIGNAL(encryptedSet(bool)),
- this, SLOT(setEncrypted(bool)));
+ connect(ircChannel, &QObject::destroyed,
+ this, &ChannelBufferItem::ircChannelDestroyed);
+ connect(ircChannel, &IrcChannel::topicSet,
+ this, &BufferItem::setTopic);
+ connect(ircChannel, &IrcChannel::encryptedSet,
+ this, &BufferItem::setEncrypted);
connect(ircChannel, SIGNAL(ircUsersJoined(QList<IrcUser *> )),
this, SLOT(join(QList<IrcUser *> )));
- connect(ircChannel, SIGNAL(ircUserParted(IrcUser *)),
- this, SLOT(part(IrcUser *)));
- connect(ircChannel, SIGNAL(parted()),
- this, SLOT(ircChannelParted()));
- connect(ircChannel, SIGNAL(ircUserModesSet(IrcUser *, QString)),
- this, SLOT(userModeChanged(IrcUser *)));
- connect(ircChannel, SIGNAL(ircUserModeAdded(IrcUser *, QString)),
- this, SLOT(userModeChanged(IrcUser *)));
- connect(ircChannel, SIGNAL(ircUserModeRemoved(IrcUser *, QString)),
- this, SLOT(userModeChanged(IrcUser *)));
+ connect(ircChannel, &IrcChannel::ircUserParted,
+ this, &ChannelBufferItem::part);
+ connect(ircChannel, &IrcChannel::parted,
+ this, &ChannelBufferItem::ircChannelParted);
+ connect(ircChannel, &IrcChannel::ircUserModesSet,
+ this, &ChannelBufferItem::userModeChanged);
+ connect(ircChannel, &IrcChannel::ircUserModeAdded,
+ this, &ChannelBufferItem::userModeChanged);
+ connect(ircChannel, &IrcChannel::ircUserModeRemoved,
+ this, &ChannelBufferItem::userModeChanged);
if (!ircChannel->ircUsers().isEmpty())
join(ircChannel->ircUsers());
_ircUser(ircUser)
{
setObjectName(ircUser->nick());
- connect(ircUser, SIGNAL(quited()), this, SLOT(ircUserQuited()));
+ connect(ircUser, &IrcUser::quited, this, &IrcUserItem::ircUserQuited);
connect(ircUser, SIGNAL(nickSet(QString)), this, SIGNAL(dataChanged()));
- connect(ircUser, SIGNAL(awaySet(bool)), this, SIGNAL(dataChanged()));
+ connect(ircUser, &IrcUser::awaySet, this, &AbstractTreeItem::dataChanged);
}
NetworkModel::NetworkModel(QObject *parent)
: TreeModel(NetworkModel::defaultHeader(), parent)
{
- connect(this, SIGNAL(rowsInserted(const QModelIndex &, int, int)),
- this, SLOT(checkForNewBuffers(const QModelIndex &, int, int)));
- connect(this, SIGNAL(rowsAboutToBeRemoved(const QModelIndex &, int, int)),
- this, SLOT(checkForRemovedBuffers(const QModelIndex &, int, int)));
+ connect(this, &QAbstractItemModel::rowsInserted,
+ this, &NetworkModel::checkForNewBuffers);
+ connect(this, &QAbstractItemModel::rowsAboutToBeRemoved,
+ this, &NetworkModel::checkForRemovedBuffers);
BufferSettings defaultSettings;
defaultSettings.notify("UserNoticesTarget", this, SLOT(messageRedirectionSettingsChanged()));
_model(parent),
_selectionModel(parent)
{
- connect(&_selectionModel, SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)),
- this, SLOT(currentChanged(const QModelIndex &, const QModelIndex &)));
- connect(&_selectionModel, SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)),
- this, SLOT(selectionChanged(const QItemSelection &, const QItemSelection &)));
+ connect(&_selectionModel, &QItemSelectionModel::currentChanged,
+ this, &SelectionModelSynchronizer::currentChanged);
+ connect(&_selectionModel, &QItemSelectionModel::selectionChanged,
+ this, &SelectionModelSynchronizer::selectionChanged);
}
return;
}
- connect(selectionModel, SIGNAL(currentChanged(QModelIndex, QModelIndex)),
- this, SLOT(syncedCurrentChanged(QModelIndex, QModelIndex)));
- connect(selectionModel, SIGNAL(selectionChanged(QItemSelection, QItemSelection)),
- this, SLOT(syncedSelectionChanged(QItemSelection, QItemSelection)));
+ connect(selectionModel, &QItemSelectionModel::currentChanged,
+ this, &SelectionModelSynchronizer::syncedCurrentChanged);
+ connect(selectionModel, &QItemSelectionModel::selectionChanged,
+ this, &SelectionModelSynchronizer::syncedSelectionChanged);
- connect(selectionModel, SIGNAL(destroyed(QObject *)), this, SLOT(selectionModelDestroyed(QObject *)));
+ connect(selectionModel, &QObject::destroyed, this, &SelectionModelSynchronizer::selectionModelDestroyed);
_selectionModels << selectionModel;
}
_manager = manager;
if (_manager) {
- connect(manager, SIGNAL(transferAdded(QUuid)), SLOT(onTransferAdded(QUuid)));
- connect(manager, SIGNAL(transferRemoved(QUuid)), SLOT(onTransferRemoved(QUuid)));
+ connect(manager, &TransferManager::transferAdded, this, &TransferModel::onTransferAdded);
+ connect(manager, &TransferManager::transferRemoved, this, &TransferModel::onTransferRemoved);
for (auto &&transferId : _manager->transferIds()) {
onTransferAdded(transferId);
}
}
// TODO Qt5: use new connection syntax to make things much less complicated
- connect(transfer, SIGNAL(statusChanged(Transfer::Status)), SLOT(onTransferDataChanged()));
- connect(transfer, SIGNAL(directionChanged(Transfer::Direction)), SLOT(onTransferDataChanged()));
- connect(transfer, SIGNAL(addressChanged(QHostAddress)), SLOT(onTransferDataChanged()));
- connect(transfer, SIGNAL(portChanged(quint16)), SLOT(onTransferDataChanged()));
- connect(transfer, SIGNAL(fileNameChanged(QString)), SLOT(onTransferDataChanged()));
- connect(transfer, SIGNAL(fileSizeChanged(quint64)), SLOT(onTransferDataChanged()));
- connect(transfer, SIGNAL(transferredChanged(quint64)), SLOT(onTransferDataChanged()));
- connect(transfer, SIGNAL(nickChanged(QString)), SLOT(onTransferDataChanged()));
+ connect(transfer, &Transfer::statusChanged, this, &TransferModel::onTransferDataChanged);
+ connect(transfer, &Transfer::directionChanged, this, &TransferModel::onTransferDataChanged);
+ connect(transfer, &Transfer::addressChanged, this, &TransferModel::onTransferDataChanged);
+ connect(transfer, &Transfer::portChanged, this, &TransferModel::onTransferDataChanged);
+ connect(transfer, &Transfer::fileNameChanged, this, &TransferModel::onTransferDataChanged);
+ connect(transfer, &Transfer::fileSizeChanged, this, &TransferModel::onTransferDataChanged);
+ connect(transfer, &Transfer::transferredChanged, this, &TransferModel::onTransferDataChanged);
+ connect(transfer, &Transfer::nickChanged, this, &TransferModel::onTransferDataChanged);
beginInsertRows({}, rowCount(), rowCount());
_transferIds.append(transferId);
connectItem(rootItem);
if (Quassel::isOptionSet("debugmodel")) {
- connect(this, SIGNAL(rowsAboutToBeInserted(const QModelIndex &, int, int)),
- this, SLOT(debug_rowsAboutToBeInserted(const QModelIndex &, int, int)));
- connect(this, SIGNAL(rowsAboutToBeRemoved(const QModelIndex &, int, int)),
- this, SLOT(debug_rowsAboutToBeRemoved(const QModelIndex &, int, int)));
- connect(this, SIGNAL(rowsInserted(const QModelIndex &, int, int)),
- this, SLOT(debug_rowsInserted(const QModelIndex &, int, int)));
- connect(this, SIGNAL(rowsRemoved(const QModelIndex &, int, int)),
- this, SLOT(debug_rowsRemoved(const QModelIndex &, int, int)));
- connect(this, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)),
- this, SLOT(debug_dataChanged(const QModelIndex &, const QModelIndex &)));
+ connect(this, &QAbstractItemModel::rowsAboutToBeInserted,
+ this, &TreeModel::debug_rowsAboutToBeInserted);
+ connect(this, &QAbstractItemModel::rowsAboutToBeRemoved,
+ this, &TreeModel::debug_rowsAboutToBeRemoved);
+ connect(this, &QAbstractItemModel::rowsInserted,
+ this, &TreeModel::debug_rowsInserted);
+ connect(this, &QAbstractItemModel::rowsRemoved,
+ this, &TreeModel::debug_rowsRemoved);
+ connect(this, &QAbstractItemModel::dataChanged,
+ this, &TreeModel::debug_dataChanged);
}
}
void TreeModel::connectItem(AbstractTreeItem *item)
{
- connect(item, SIGNAL(dataChanged(int)),
- this, SLOT(itemDataChanged(int)));
+ connect(item, &AbstractTreeItem::dataChanged,
+ this, &TreeModel::itemDataChanged);
- connect(item, SIGNAL(beginAppendChilds(int, int)),
- this, SLOT(beginAppendChilds(int, int)));
- connect(item, SIGNAL(endAppendChilds()),
- this, SLOT(endAppendChilds()));
+ connect(item, &AbstractTreeItem::beginAppendChilds,
+ this, &TreeModel::beginAppendChilds);
+ connect(item, &AbstractTreeItem::endAppendChilds,
+ this, &TreeModel::endAppendChilds);
- connect(item, SIGNAL(beginRemoveChilds(int, int)),
- this, SLOT(beginRemoveChilds(int, int)));
- connect(item, SIGNAL(endRemoveChilds()),
- this, SLOT(endRemoveChilds()));
+ connect(item, &AbstractTreeItem::beginRemoveChilds,
+ this, &TreeModel::beginRemoveChilds);
+ connect(item, &AbstractTreeItem::endRemoveChilds,
+ this, &TreeModel::endRemoveChilds);
}
{
_socket = socket;
connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), SLOT(onSocketError(QAbstractSocket::SocketError)));
- connect(socket, SIGNAL(disconnected()), SLOT(onSocketDisconnected()));
+ connect(socket, &QAbstractSocket::disconnected, this, &AuthHandler::onSocketDisconnected);
}
_inflater(nullptr),
_deflater(nullptr)
{
- connect(socket, SIGNAL(readyRead()), SLOT(readData()));
+ connect(socket, &QIODevice::readyRead, this, &Compressor::readData);
bool ok = true;
if (level != NoCompression)
// It's possible that more data has already arrived during the handshake, so readyRead() wouldn't be triggered.
// However, we want to give RemotePeer a chance to connect to our signals, so trigger this asynchronously.
if (socket->bytesAvailable())
- QTimer::singleShot(0, this, SLOT(readData()));
+ QTimer::singleShot(0, this, &Compressor::readData);
}
// If there's still data left in the socket buffer, make sure to schedule a read
if (_socket->bytesAvailable())
- QTimer::singleShot(0, this, SLOT(readData()));
+ QTimer::singleShot(0, this, &Compressor::readData);
return n;
}
connect(peer, SIGNAL(dispatchMessage(Protocol::InitRequest)), SLOT(handleMessage(Protocol::InitRequest)));
connect(peer, SIGNAL(dispatchMessage(Protocol::InitData)) , SLOT(handleMessage(Protocol::InitData)));
- connect(peer, SIGNAL(disconnected()), SLOT(peerDisconnected()));
+ connect(peer, &Peer::disconnected, this, &InternalPeer::peerDisconnected);
_isOpen = true;
}
}();
Q_UNUSED(registered)
- connect(this, SIGNAL(messageLogged(Logger::LogEntry)), this, SLOT(onMessageLogged(Logger::LogEntry)));
+ connect(this, &Logger::messageLogged, this, &Logger::onMessageLogged);
qInstallMessageHandler(Logger::messageHandler);
}
else
qWarning() << "unable to synchronize new IrcUser" << hostmask << "forgot to call Network::setProxy(SignalProxy *)?";
- connect(ircuser, SIGNAL(nickSet(QString)), this, SLOT(ircUserNickChanged(QString)));
+ connect(ircuser, &IrcUser::nickSet, this, &Network::ircUserNickChanged);
_ircUsers[nick] = ircuser;
_msgSize(0)
{
socket->setParent(this);
- connect(socket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), SLOT(onSocketStateChanged(QAbstractSocket::SocketState)));
+ connect(socket, &QAbstractSocket::stateChanged, this, &RemotePeer::onSocketStateChanged);
connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), SLOT(onSocketError(QAbstractSocket::SocketError)));
- connect(socket, SIGNAL(disconnected()), SIGNAL(disconnected()));
+ connect(socket, &QAbstractSocket::disconnected, this, &Peer::disconnected);
#ifdef HAVE_SSL
auto *sslSocket = qobject_cast<QSslSocket *>(socket);
connect(sslSocket, SIGNAL(encrypted()), SIGNAL(secureStateChanged()));
#endif
- connect(_compressor, SIGNAL(readyRead()), SLOT(onReadyRead()));
- connect(_compressor, SIGNAL(error(Compressor::Error)), SLOT(onCompressionError(Compressor::Error)));
+ connect(_compressor, &Compressor::readyRead, this, &RemotePeer::onReadyRead);
+ connect(_compressor, &Compressor::error, this, &RemotePeer::onCompressionError);
- connect(_heartBeatTimer, SIGNAL(timeout()), SLOT(sendHeartBeat()));
+ connect(_heartBeatTimer, &QTimer::timeout, this, &RemotePeer::sendHeartBeat);
}
return;
}
_signalProxy = proxy;
- connect(proxy, SIGNAL(heartBeatIntervalChanged(int)), SLOT(changeHeartBeatInterval(int)));
+ connect(proxy, &SignalProxy::heartBeatIntervalChanged, this, &RemotePeer::changeHeartBeatInterval);
_heartBeatTimer->setInterval(proxy->heartBeatInterval() * 1000);
_heartBeatTimer->start();
}
qWarning("SignalProxy: only one peer allowed in client mode!");
return false;
}
- connect(peer, SIGNAL(lagUpdated(int)), SIGNAL(lagUpdated(int)));
+ connect(peer, &Peer::lagUpdated, this, &SignalProxy::lagUpdated);
}
- connect(peer, SIGNAL(disconnected()), SLOT(removePeerBySender()));
- connect(peer, SIGNAL(secureStateChanged(bool)), SLOT(updateSecureState()));
+ connect(peer, &Peer::disconnected, this, &SignalProxy::removePeerBySender);
+ connect(peer, &Peer::secureStateChanged, this, &SignalProxy::updateSecureState);
if (!peer->parent())
peer->setParent(this);
createExtendedMetaObject(meta);
_signalRelay->attachSignal(sender, methodId, sigName);
- disconnect(sender, SIGNAL(destroyed(QObject *)), this, SLOT(detachObject(QObject *)));
- connect(sender, SIGNAL(destroyed(QObject *)), this, SLOT(detachObject(QObject *)));
+ disconnect(sender, &QObject::destroyed, this, &SignalProxy::detachObject);
+ connect(sender, &QObject::destroyed, this, &SignalProxy::detachObject);
return true;
}
QByteArray funcName = QMetaObject::normalizedSignature(sigName.constData());
_attachedSlots.insert(funcName, qMakePair(recv, methodId));
- disconnect(recv, SIGNAL(destroyed(QObject *)), this, SLOT(detachObject(QObject *)));
- connect(recv, SIGNAL(destroyed(QObject *)), this, SLOT(detachObject(QObject *)));
+ disconnect(recv, &QObject::destroyed, this, &SignalProxy::detachObject);
+ connect(recv, &QObject::destroyed, this, &SignalProxy::detachObject);
return true;
}
Connection *connection = new Connection(QLatin1String(QString("quassel_%1_con_%2").arg(driverName()).arg(connectionId).toLatin1()));
connection->moveToThread(currentThread);
- connect(this, SIGNAL(destroyed()), connection, SLOT(deleteLater()));
- connect(currentThread, SIGNAL(destroyed()), connection, SLOT(deleteLater()));
- connect(connection, SIGNAL(destroyed()), this, SLOT(connectionDestroyed()));
+ connect(this, &QObject::destroyed, connection, &QObject::deleteLater);
+ connect(currentThread, &QObject::destroyed, connection, &QObject::deleteLater);
+ connect(connection, &QObject::destroyed, this, &AbstractSqlStorage::connectionDestroyed);
_connectionPool[currentThread] = connection;
QSqlDatabase db = QSqlDatabase::addDatabase(driverName(), connection->name());
return false;
});
- connect(&_storageSyncTimer, SIGNAL(timeout()), this, SLOT(syncStorage()));
+ connect(&_storageSyncTimer, &QTimer::timeout, this, &Core::syncStorage);
_storageSyncTimer.start(10 * 60 * 1000); // 10 minutes
}
- connect(&_server, SIGNAL(newConnection()), this, SLOT(incomingConnection()));
- connect(&_v6server, SIGNAL(newConnection()), this, SLOT(incomingConnection()));
+ connect(&_server, &QTcpServer::newConnection, this, &Core::incomingConnection);
+ connect(&_v6server, &QTcpServer::newConnection, this, &Core::incomingConnection);
if (!startListening()) {
throw ExitException{EXIT_FAILURE, tr("Cannot open port for listening!")};
return false;
}
- connect(storage.get(), SIGNAL(dbUpgradeInProgress(bool)), this, SIGNAL(dbUpgradeInProgress(bool)));
+ connect(storage.get(), &Storage::dbUpgradeInProgress, this, &Core::dbUpgradeInProgress);
Storage::State storageState = storage->init(settings, environment, loadFromEnvironment);
switch (storageState) {
case Storage::IsReady:
// delete all other backends
_registeredStorageBackends.clear();
- connect(storage.get(), SIGNAL(bufferInfoUpdated(UserId, const BufferInfo &)),
- this, SIGNAL(bufferInfoUpdated(UserId, const BufferInfo &)));
+ connect(storage.get(), &Storage::bufferInfoUpdated,
+ this, &Core::bufferInfoUpdated);
break;
}
_storage = std::move(storage);
auto *handler = new CoreAuthHandler(socket, this);
_connectingClients.insert(handler);
- connect(handler, SIGNAL(disconnected()), SLOT(clientDisconnected()));
- connect(handler, SIGNAL(socketError(QAbstractSocket::SocketError,QString)), SLOT(socketError(QAbstractSocket::SocketError,QString)));
- connect(handler, SIGNAL(handshakeComplete(RemotePeer*,UserId)), SLOT(setupClientSession(RemotePeer*,UserId)));
+ connect(handler, &AuthHandler::disconnected, this, &Core::clientDisconnected);
+ connect(handler, &AuthHandler::socketError, this, &Core::socketError);
+ connect(handler, &CoreAuthHandler::handshakeComplete, this, &Core::setupClientSession);
quInfo() << qPrintable(tr("Client connected from")) << qPrintable(socket->peerAddress().toString());
loadDefaults();
// we store our settings whenever they change
- connect(this, SIGNAL(updatedRemotely()), SLOT(save()));
+ connect(this, &SyncableObject::updatedRemotely, this, &CoreAliasManager::save);
}
_connectionFeatures(0)
{
setSocket(socket);
- connect(socket, SIGNAL(readyRead()), SLOT(onReadyRead()));
+ connect(socket, &QIODevice::readyRead, this, &CoreAuthHandler::onReadyRead);
// TODO: Timeout for the handshake phase
qDebug().nospace() << "Using " << qPrintable(peer->protocolName()) << "...";
_peer = peer;
- disconnect(socket(), SIGNAL(readyRead()), this, SLOT(onReadyRead()));
+ disconnect(socket(), &QIODevice::readyRead, this, &CoreAuthHandler::onReadyRead);
}
// only in compat mode
connect(this, SIGNAL(putCmd(QString, const QList<QList<QByteArray>> &, const QByteArray &, const bool)),
network(), SLOT(putCmd(QString, const QList<QList<QByteArray>> &, const QByteArray &, const bool)));
- connect(this, SIGNAL(putRawLine(const QByteArray &, const bool)),
- network(), SLOT(putRawLine(const QByteArray &, const bool)));
+ connect(this, &CoreBasicHandler::putRawLine,
+ network(), &CoreNetwork::putRawLine);
}
_coreSession(parent),
_purgeBuffers(false)
{
- connect(parent, SIGNAL(displayMsg(Message)), SLOT(addBufferActivity(Message)));
- connect(parent, SIGNAL(displayMsg(Message)), SLOT(addCoreHighlight(Message)));
+ connect(parent, &CoreSession::displayMsg, this, &CoreBufferSyncer::addBufferActivity);
+ connect(parent, &CoreSession::displayMsg, this, &CoreBufferSyncer::addCoreHighlight);
}
// Otherwise, we just use the defaults initialized in the base class
// We store our settings whenever they change
- connect(this, SIGNAL(updatedRemotely()), SLOT(save()));
+ connect(this, &SyncableObject::updatedRemotely, this, &CoreDccConfig::save);
}
// Otherwise, we just use the defaults initialized in the base class
// We store our settings whenever they change
- connect(this, SIGNAL(updatedRemotely()), SLOT(save()));
+ connect(this, &SyncableObject::updatedRemotely, this, &CoreHighlightRuleManager::save);
}
void CoreHighlightRuleManager::save()
#endif
{
#ifdef HAVE_SSL
- connect(this, SIGNAL(idSet(IdentityId)), &_certManager, SLOT(setId(IdentityId)));
- connect(&_certManager, SIGNAL(updated()), this, SIGNAL(updated()));
+ connect(this, &Identity::idSet, &_certManager, &CoreCertManager::setId);
+ connect(&_certManager, &SyncableObject::updated, this, &SyncableObject::updated);
#endif
}
#endif
{
#ifdef HAVE_SSL
- connect(this, SIGNAL(idSet(IdentityId)), &_certManager, SLOT(setId(IdentityId)));
- connect(&_certManager, SIGNAL(updated()), this, SIGNAL(updated()));
+ connect(this, &Identity::idSet, &_certManager, &CoreCertManager::setId);
+ connect(&_certManager, &SyncableObject::updated, this, &SyncableObject::updated);
#endif
}
#endif
{
#ifdef HAVE_SSL
- connect(this, SIGNAL(idSet(IdentityId)), &_certManager, SLOT(setId(IdentityId)));
- connect(&_certManager, SIGNAL(updated()), this, SIGNAL(updated()));
+ connect(this, &Identity::idSet, &_certManager, &CoreCertManager::setId);
+ connect(&_certManager, &SyncableObject::updated, this, &SyncableObject::updated);
#endif
}
initSetIgnoreList(Core::getUserSetting(session->user(), "IgnoreList").toMap());
// we store our settings whenever they change
- connect(this, SIGNAL(updatedRemotely()), SLOT(save()));
+ connect(this, &SyncableObject::updatedRemotely, this, &CoreIgnoreListManager::save);
//if(isEmpty())
//loadDefaults();
_debugLogRawNetId = Quassel::optionValue("debug-irc-id").toInt();
_autoReconnectTimer.setSingleShot(true);
- connect(&_socketCloseTimer, SIGNAL(timeout()), this, SLOT(socketCloseTimeout()));
+ connect(&_socketCloseTimer, &QTimer::timeout, this, &CoreNetwork::socketCloseTimeout);
setPingInterval(networkConfig()->pingInterval());
- connect(&_pingTimer, SIGNAL(timeout()), this, SLOT(sendPing()));
+ connect(&_pingTimer, &QTimer::timeout, this, &CoreNetwork::sendPing);
setAutoWhoDelay(networkConfig()->autoWhoDelay());
setAutoWhoInterval(networkConfig()->autoWhoInterval());
storeChannelCipherKey(buffer.toLower(), bufferCiphers[buffer]);
}
- connect(networkConfig(), SIGNAL(pingTimeoutEnabledSet(bool)), SLOT(enablePingTimeout(bool)));
- connect(networkConfig(), SIGNAL(pingIntervalSet(int)), SLOT(setPingInterval(int)));
- connect(networkConfig(), SIGNAL(autoWhoEnabledSet(bool)), SLOT(setAutoWhoEnabled(bool)));
- connect(networkConfig(), SIGNAL(autoWhoIntervalSet(int)), SLOT(setAutoWhoInterval(int)));
- connect(networkConfig(), SIGNAL(autoWhoDelaySet(int)), SLOT(setAutoWhoDelay(int)));
+ connect(networkConfig(), &NetworkConfig::pingTimeoutEnabledSet, this, &CoreNetwork::enablePingTimeout);
+ connect(networkConfig(), &NetworkConfig::pingIntervalSet, this, &CoreNetwork::setPingInterval);
+ connect(networkConfig(), &NetworkConfig::autoWhoEnabledSet, this, &CoreNetwork::setAutoWhoEnabled);
+ connect(networkConfig(), &NetworkConfig::autoWhoIntervalSet, this, &CoreNetwork::setAutoWhoInterval);
+ connect(networkConfig(), &NetworkConfig::autoWhoDelaySet, this, &CoreNetwork::setAutoWhoDelay);
- connect(&_autoReconnectTimer, SIGNAL(timeout()), this, SLOT(doAutoReconnect()));
- connect(&_autoWhoTimer, SIGNAL(timeout()), this, SLOT(sendAutoWho()));
- connect(&_autoWhoCycleTimer, SIGNAL(timeout()), this, SLOT(startAutoWhoCycle()));
- connect(&_tokenBucketTimer, SIGNAL(timeout()), this, SLOT(checkTokenBucket()));
+ connect(&_autoReconnectTimer, &QTimer::timeout, this, &CoreNetwork::doAutoReconnect);
+ connect(&_autoWhoTimer, &QTimer::timeout, this, &CoreNetwork::sendAutoWho);
+ connect(&_autoWhoCycleTimer, &QTimer::timeout, this, &CoreNetwork::startAutoWhoCycle);
+ connect(&_tokenBucketTimer, &QTimer::timeout, this, &CoreNetwork::checkTokenBucket);
connect(&socket, SIGNAL(connected()), this, SLOT(socketInitialized()));
connect(&socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(socketError(QAbstractSocket::SocketError)));
- connect(&socket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(socketStateChanged(QAbstractSocket::SocketState)));
- connect(&socket, SIGNAL(readyRead()), this, SLOT(socketHasData()));
+ connect(&socket, &QAbstractSocket::stateChanged, this, &CoreNetwork::socketStateChanged);
+ connect(&socket, &QIODevice::readyRead, this, &CoreNetwork::socketHasData);
#ifdef HAVE_SSL
connect(&socket, SIGNAL(encrypted()), this, SLOT(socketInitialized()));
connect(&socket, SIGNAL(sslErrors(const QList<QSslError> &)), this, SLOT(sslErrors(const QList<QSslError> &)));
#endif
- connect(this, SIGNAL(newEvent(Event *)), coreSession()->eventManager(), SLOT(postEvent(Event *)));
+ connect(this, &CoreNetwork::newEvent, coreSession()->eventManager(), &EventManager::postEvent);
// Custom rate limiting
// These react to the user changing settings in the client
- connect(this, SIGNAL(useCustomMessageRateSet(bool)), SLOT(updateRateLimiting()));
- connect(this, SIGNAL(messageRateBurstSizeSet(quint32)), SLOT(updateRateLimiting()));
- connect(this, SIGNAL(messageRateDelaySet(quint32)), SLOT(updateRateLimiting()));
- connect(this, SIGNAL(unlimitedMessageRateSet(bool)), SLOT(updateRateLimiting()));
+ connect(this, &Network::useCustomMessageRateSet, this, &CoreNetwork::updateRateLimiting);
+ connect(this, &Network::messageRateBurstSizeSet, this, &CoreNetwork::updateRateLimiting);
+ connect(this, &Network::messageRateDelaySet, this, &CoreNetwork::updateRateLimiting);
+ connect(this, &Network::unlimitedMessageRateSet, this, &CoreNetwork::updateRateLimiting);
// IRCv3 capability handling
// These react to CAP messages from the server
- connect(this, SIGNAL(capAdded(QString)), this, SLOT(serverCapAdded(QString)));
- connect(this, SIGNAL(capAcknowledged(QString)), this, SLOT(serverCapAcknowledged(QString)));
- connect(this, SIGNAL(capRemoved(QString)), this, SLOT(serverCapRemoved(QString)));
+ connect(this, &Network::capAdded, this, &CoreNetwork::serverCapAdded);
+ connect(this, &Network::capAcknowledged, this, &CoreNetwork::serverCapAcknowledged);
+ connect(this, &Network::capRemoved, this, &CoreNetwork::serverCapRemoved);
if (Quassel::isOptionSet("oidentd")) {
connect(this, SIGNAL(socketInitialized(const CoreIdentity*, QHostAddress, quint16, QHostAddress, quint16, qint64)),
restoreUserModes();
}
else {
- connect(me_, SIGNAL(userModesSet(QString)), this, SLOT(restoreUserModes()));
- connect(me_, SIGNAL(userModesAdded(QString)), this, SLOT(restoreUserModes()));
+ connect(me_, &IrcUser::userModesSet, this, &CoreNetwork::restoreUserModes);
+ connect(me_, &IrcUser::userModesAdded, this, &CoreNetwork::restoreUserModes);
}
}
IrcUser *me_ = me();
Q_ASSERT(me_);
- disconnect(me_, SIGNAL(userModesSet(QString)), this, SLOT(restoreUserModes()));
- disconnect(me_, SIGNAL(userModesAdded(QString)), this, SLOT(restoreUserModes()));
+ disconnect(me_, &IrcUser::userModesSet, this, &CoreNetwork::restoreUserModes);
+ disconnect(me_, &IrcUser::userModesAdded, this, &CoreNetwork::restoreUserModes);
QString modesDelta = Core::userModes(userId(), networkId());
QString currentModes = me_->userModes();
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)
_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);
}
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::displayStatusMsg, this, &CoreSession::recvStatusMsgFromServer);
+ connect(net, &CoreNetwork::disconnected, this, &CoreSession::networkDisconnected);
net->setNetworkInfo(info);
net->setProxy(signalProxy());
// 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)));
+ connect(net, &CoreNetwork::disconnected, this, &CoreSession::destroyNetwork);
net->disconnectFromIrc();
}
else {
: BasicHandler("handleCtcp", session),
_coreSession(session)
{
- connect(coreSession(), SIGNAL(networkDisconnected(NetworkId)), this, SLOT(destroyNetsplits(NetworkId)));
- connect(this, SIGNAL(newEvent(Event *)), coreSession()->eventManager(), SLOT(postEvent(Event *)));
+ connect(coreSession(), &CoreSession::networkDisconnected, this, &CoreSessionEventProcessor::destroyNetsplits);
+ connect(this, &CoreSessionEventProcessor::newEvent, coreSession()->eventManager(), &EventManager::postEvent);
}
Netsplit *n;
if (!_netsplits[e->network()].contains(msg)) {
n = new Netsplit(e->network(), this);
- connect(n, SIGNAL(finished()), this, SLOT(handleNetsplitFinished()));
- connect(n, SIGNAL(netsplitJoin(Network*, QString, QStringList, QStringList, QString)),
- this, SLOT(handleNetsplitJoin(Network*, QString, QStringList, QStringList, QString)));
- connect(n, SIGNAL(netsplitQuit(Network*, QString, QStringList, QString)),
- this, SLOT(handleNetsplitQuit(Network*, QString, QStringList, QString)));
- connect(n, SIGNAL(earlyJoin(Network*, QString, QStringList, QStringList)),
- this, SLOT(handleEarlyNetsplitJoin(Network*, QString, QStringList, QStringList)));
+ connect(n, &Netsplit::finished, this, &CoreSessionEventProcessor::handleNetsplitFinished);
+ connect(n, &Netsplit::netsplitJoin,
+ this, &CoreSessionEventProcessor::handleNetsplitJoin);
+ connect(n, &Netsplit::netsplitQuit,
+ this, &CoreSessionEventProcessor::handleNetsplitQuit);
+ connect(n, &Netsplit::earlyJoin,
+ this, &CoreSessionEventProcessor::handleEarlyNetsplitJoin);
_netsplits[e->network()].insert(msg, n);
}
else {
setStatus(Status::Connecting);
_socket = new QTcpSocket(this);
- connect(_socket, SIGNAL(connected()), SLOT(startReceiving()));
- connect(_socket, SIGNAL(disconnected()), SLOT(onSocketDisconnected()));
+ connect(_socket, &QAbstractSocket::connected, this, &CoreTransfer::startReceiving);
+ connect(_socket, &QAbstractSocket::disconnected, this, &CoreTransfer::onSocketDisconnected);
connect(_socket, SIGNAL(error(QAbstractSocket::SocketError)), SLOT(onSocketError(QAbstractSocket::SocketError)));
- connect(_socket, SIGNAL(readyRead()), SLOT(onDataReceived()));
+ connect(_socket, &QIODevice::readyRead, this, &CoreTransfer::onDataReceived);
_socket->connectToHost(address(), port());
}
setStandardCtcp(_coreSession->networkConfig()->standardCtcp());
- connect(_coreSession->networkConfig(), SIGNAL(standardCtcpSet(bool)), this, SLOT(setStandardCtcp(bool)));
- connect(this, SIGNAL(newEvent(Event *)), _coreSession->eventManager(), SLOT(postEvent(Event *)));
+ connect(_coreSession->networkConfig(), &NetworkConfig::standardCtcpSet, this, &CtcpParser::setStandardCtcp);
+ connect(this, &CtcpParser::newEvent, _coreSession->eventManager(), &EventManager::postEvent);
}
_coreSession(parent),
_whois(false)
{
- connect(this, SIGNAL(newMessageEvent(Event *)), coreSession()->eventManager(), SLOT(postEvent(Event *)));
+ connect(this, &EventStringifier::newMessageEvent, coreSession()->eventManager(), &EventManager::postEvent);
}
IdentServer::IdentServer(QObject *parent)
: QObject(parent)
{
- connect(&_server, SIGNAL(newConnection()), this, SLOT(incomingConnection()));
- connect(&_v6server, SIGNAL(newConnection()), this, SLOT(incomingConnection()));
+ connect(&_server, &QTcpServer::newConnection, this, &IdentServer::incomingConnection);
+ connect(&_v6server, &QTcpServer::newConnection, this, &IdentServer::incomingConnection);
}
Q_ASSERT(server);
while (server->hasPendingConnections()) {
QTcpSocket *socket = server->nextPendingConnection();
- connect(socket, SIGNAL(readyRead()), this, SLOT(respond()));
- connect(socket, SIGNAL(disconnected()), socket, SLOT(deleteLater()));
+ connect(socket, &QIODevice::readyRead, this, &IdentServer::respond);
+ connect(socket, &QAbstractSocket::disconnected, socket, &QObject::deleteLater);
}
}
_debugLogRawIrc = (Quassel::isOptionSet("debug-irc") || Quassel::isOptionSet("debug-irc-id"));
_debugLogRawNetId = Quassel::optionValue("debug-irc-id").toInt();
- connect(this, SIGNAL(newEvent(Event *)), coreSession()->eventManager(), SLOT(postEvent(Event *)));
+ connect(this, &IrcParser::newEvent, coreSession()->eventManager(), &EventManager::postEvent);
}
_joinTimer.setSingleShot(true);
_quitTimer.setSingleShot(true);
- connect(&_discardTimer, SIGNAL(timeout()), this, SIGNAL(finished()));
+ connect(&_discardTimer, &QTimer::timeout, this, &Netsplit::finished);
- connect(&_joinTimer, SIGNAL(timeout()), this, SLOT(joinTimeout()));
- connect(&_quitTimer, SIGNAL(timeout()), this, SLOT(quitTimeout()));
+ connect(&_joinTimer, &QTimer::timeout, this, &Netsplit::joinTimeout);
+ connect(&_quitTimer, &QTimer::timeout, this, &Netsplit::quitTimeout);
// wait for a maximum of 1 hour until we discard the netsplit
_discardTimer.start(3600000);
void initialize()
{
_session = new CoreSession{_userId, _restoreState, _strictIdentEnabled, this};
- connect(_session, SIGNAL(destroyed()), QThread::currentThread(), SLOT(quit()));
+ connect(_session, &QObject::destroyed, QThread::currentThread(), &QThread::quit);
connect(_session, SIGNAL(sessionState(Protocol::SessionState)), Core::instance(), SIGNAL(sessionState(Protocol::SessionState)));
emit initialized();
}
{
auto worker = new Worker(uid, restoreState, strictIdentEnabled);
worker->moveToThread(&_sessionThread);
- connect(&_sessionThread, SIGNAL(started()), worker, SLOT(initialize()));
- connect(&_sessionThread, SIGNAL(finished()), worker, SLOT(deleteLater()));
- connect(worker, SIGNAL(initialized()), this, SLOT(onSessionInitialized()));
- connect(worker, SIGNAL(destroyed()), this, SLOT(onSessionDestroyed()));
+ connect(&_sessionThread, &QThread::started, worker, &Worker::initialize);
+ connect(&_sessionThread, &QThread::finished, worker, &QObject::deleteLater);
+ connect(worker, &Worker::initialized, this, &SessionThread::onSessionInitialized);
+ connect(worker, &QObject::destroyed, this, &SessionThread::onSessionDestroyed);
- connect(this, SIGNAL(addClientToWorker(Peer*)), worker, SLOT(addClient(Peer*)));
- connect(this, SIGNAL(shutdownSession()), worker, SLOT(shutdown()));
+ connect(this, &SessionThread::addClientToWorker, worker, &Worker::addClient);
+ connect(this, &SessionThread::shutdownSession, worker, &Worker::shutdown);
// Defer thread start through the event loop, so the SessionThread instance is fully constructed before
QTimer::singleShot(0, &_sessionThread, SLOT(start()));
// Start internal core in a separate thread, so it doesn't block the UI
_core = new Core{};
_core->moveToThread(&_coreThread);
- connect(&_coreThread, SIGNAL(started()), _core, SLOT(initAsync()));
- connect(&_coreThread, SIGNAL(finished()), _core, SLOT(deleteLater()));
+ connect(&_coreThread, &QThread::started, _core.data(), &Core::initAsync);
+ connect(&_coreThread, &QThread::finished, _core.data(), &QObject::deleteLater);
connect(this, SIGNAL(connectInternalPeer(QPointer<InternalPeer>)), _core, SLOT(connectInternalPeer(QPointer<InternalPeer>)));
connect(_core, SIGNAL(sessionState(Protocol::SessionState)), Client::coreConnection(), SLOT(internalSessionStateReceived(Protocol::SessionState)));
- connect(_core, SIGNAL(dbUpgradeInProgress(bool)), Client::instance(), SLOT(onDbUpgradeInProgress(bool)));
- connect(_core, SIGNAL(exitRequested(int,QString)), Client::instance(), SLOT(onExitRequested(int,QString)));
+ connect(_core.data(), &Core::dbUpgradeInProgress, Client::instance(), &Client::onDbUpgradeInProgress);
+ connect(_core.data(), &Core::exitRequested, Client::instance(), &Client::onExitRequested);
_coreThread.start();
}
_chatViewSearchController->setSearchMsgs(ui.searchBar->searchMsgsBox()->isChecked());
_chatViewSearchController->setSearchOnlyRegularMsgs(ui.searchBar->searchOnlyRegularMsgsBox()->isChecked());
- connect(ui.searchBar, SIGNAL(searchChanged(const QString &)),
- _chatViewSearchController, SLOT(setSearchString(const QString &)));
- connect(ui.searchBar->caseSensitiveBox(), SIGNAL(toggled(bool)),
- _chatViewSearchController, SLOT(setCaseSensitive(bool)));
- connect(ui.searchBar->searchSendersBox(), SIGNAL(toggled(bool)),
- _chatViewSearchController, SLOT(setSearchSenders(bool)));
- connect(ui.searchBar->searchMsgsBox(), SIGNAL(toggled(bool)),
- _chatViewSearchController, SLOT(setSearchMsgs(bool)));
- connect(ui.searchBar->searchOnlyRegularMsgsBox(), SIGNAL(toggled(bool)),
- _chatViewSearchController, SLOT(setSearchOnlyRegularMsgs(bool)));
- connect(ui.searchBar->searchUpButton(), SIGNAL(clicked()),
- _chatViewSearchController, SLOT(highlightPrev()));
- connect(ui.searchBar->searchDownButton(), SIGNAL(clicked()),
- _chatViewSearchController, SLOT(highlightNext()));
+ connect(ui.searchBar, &ChatViewSearchBar::searchChanged,
+ _chatViewSearchController, &ChatViewSearchController::setSearchString);
+ connect(ui.searchBar->caseSensitiveBox(), &QAbstractButton::toggled,
+ _chatViewSearchController, &ChatViewSearchController::setCaseSensitive);
+ connect(ui.searchBar->searchSendersBox(), &QAbstractButton::toggled,
+ _chatViewSearchController, &ChatViewSearchController::setSearchSenders);
+ connect(ui.searchBar->searchMsgsBox(), &QAbstractButton::toggled,
+ _chatViewSearchController, &ChatViewSearchController::setSearchMsgs);
+ connect(ui.searchBar->searchOnlyRegularMsgsBox(), &QAbstractButton::toggled,
+ _chatViewSearchController, &ChatViewSearchController::setSearchOnlyRegularMsgs);
+ connect(ui.searchBar->searchUpButton(), &QAbstractButton::clicked,
+ _chatViewSearchController, &ChatViewSearchController::highlightPrev);
+ connect(ui.searchBar->searchDownButton(), &QAbstractButton::clicked,
+ _chatViewSearchController, &ChatViewSearchController::highlightNext);
connect(ui.searchBar, SIGNAL(hidden()), this, SLOT(setFocus()));
- connect(_chatViewSearchController, SIGNAL(newCurrentHighlight(QGraphicsItem *)),
- this, SLOT(scrollToHighlight(QGraphicsItem *)));
+ connect(_chatViewSearchController, &ChatViewSearchController::newCurrentHighlight,
+ this, &BufferWidget::scrollToHighlight);
ActionCollection *coll = QtUi::actionCollection();
setWindowIcon(icon::get("format-list-unordered"));
- connect(ui.advancedModeLabel, SIGNAL(clicked()), this, SLOT(toggleMode()));
- connect(ui.searchChannelsButton, SIGNAL(clicked()), this, SLOT(requestSearch()));
- connect(ui.channelNameLineEdit, SIGNAL(returnPressed()), this, SLOT(requestSearch()));
- connect(ui.filterLineEdit, SIGNAL(textChanged(QString)), &_sortFilter, SLOT(setFilterFixedString(QString)));
- connect(Client::ircListHelper(), SIGNAL(channelListReceived(const NetworkId &, const QStringList &, QList<IrcListHelper::ChannelDescription> )),
- this, SLOT(receiveChannelList(NetworkId, QStringList, QList<IrcListHelper::ChannelDescription> )));
- connect(Client::ircListHelper(), SIGNAL(finishedListReported(const NetworkId &)), this, SLOT(reportFinishedList()));
- connect(Client::ircListHelper(), SIGNAL(errorReported(const QString &)), this, SLOT(showError(const QString &)));
- connect(ui.channelListView, SIGNAL(activated(QModelIndex)), this, SLOT(joinChannel(QModelIndex)));
+ connect(ui.advancedModeLabel, &ClickableLabel::clicked, this, &ChannelListDlg::toggleMode);
+ connect(ui.searchChannelsButton, &QAbstractButton::clicked, this, &ChannelListDlg::requestSearch);
+ connect(ui.channelNameLineEdit, &QLineEdit::returnPressed, this, &ChannelListDlg::requestSearch);
+ connect(ui.filterLineEdit, &QLineEdit::textChanged, &_sortFilter, &QSortFilterProxyModel::setFilterFixedString);
+ connect(Client::ircListHelper(), &ClientIrcListHelper::channelListReceived,
+ this, &ChannelListDlg::receiveChannelList);
+ connect(Client::ircListHelper(), &ClientIrcListHelper::finishedListReported, this, &ChannelListDlg::reportFinishedList);
+ connect(Client::ircListHelper(), &ClientIrcListHelper::errorReported, this, &ChannelListDlg::showError);
+ connect(ui.channelListView, &QAbstractItemView::activated, this, &ChannelListDlg::joinChannel);
setAdvancedMode(false);
enableQuery(true);
qRegisterMetaType<WrapList>("ChatLineModel::WrapList");
qRegisterMetaTypeStreamOperators<WrapList>("ChatLineModel::WrapList");
- connect(QtUi::style(), SIGNAL(changed()), SLOT(styleChanged()));
+ connect(QtUi::style(), &UiStyle::changed, this, &ChatLineModel::styleChanged);
}
// The normal message prefixes get replaced by the network and buffer name. Re-add brackets for
// all message types.
scene()->setAlwaysBracketSender(true);
- connect(Client::instance(), SIGNAL(coreConnectionStateChanged(bool)), this, SLOT(coreConnectionStateChanged(bool)));
+ connect(Client::instance(), &Client::coreConnectionStateChanged, this, &ChatMonitorView::coreConnectionStateChanged);
}
}
addItem(_markerLine);
- connect(this, SIGNAL(sceneRectChanged(const QRectF &)), _markerLine, SLOT(sceneRectChanged(const QRectF &)));
+ connect(this, &QGraphicsScene::sceneRectChanged, _markerLine, &MarkerLineItem::sceneRectChanged);
ChatViewSettings defaultSettings;
_defaultFirstColHandlePos = defaultSettings.value("FirstColumnHandlePos", 80).toInt();
_firstColHandle = new ColumnHandleItem(QtUi::style()->firstColumnSeparator());
addItem(_firstColHandle);
_firstColHandle->setXPos(_firstColHandlePos);
- connect(_firstColHandle, SIGNAL(positionChanged(qreal)), this, SLOT(firstHandlePositionChanged(qreal)));
- connect(this, SIGNAL(sceneRectChanged(const QRectF &)), _firstColHandle, SLOT(sceneRectChanged(const QRectF &)));
+ connect(_firstColHandle, &ColumnHandleItem::positionChanged, this, &ChatScene::firstHandlePositionChanged);
+ connect(this, &QGraphicsScene::sceneRectChanged, _firstColHandle, &ColumnHandleItem::sceneRectChanged);
_secondColHandle = new ColumnHandleItem(QtUi::style()->secondColumnSeparator());
addItem(_secondColHandle);
_secondColHandle->setXPos(_secondColHandlePos);
- connect(_secondColHandle, SIGNAL(positionChanged(qreal)), this, SLOT(secondHandlePositionChanged(qreal)));
+ connect(_secondColHandle, &ColumnHandleItem::positionChanged, this, &ChatScene::secondHandlePositionChanged);
- connect(this, SIGNAL(sceneRectChanged(const QRectF &)), _secondColHandle, SLOT(sceneRectChanged(const QRectF &)));
+ connect(this, &QGraphicsScene::sceneRectChanged, _secondColHandle, &ColumnHandleItem::sceneRectChanged);
setHandleXLimits();
if (model->rowCount() > 0)
rowsInserted(QModelIndex(), 0, model->rowCount() - 1);
- connect(model, SIGNAL(rowsInserted(const QModelIndex &, int, int)),
- this, SLOT(rowsInserted(const QModelIndex &, int, int)));
- connect(model, SIGNAL(rowsAboutToBeRemoved(const QModelIndex &, int, int)),
- this, SLOT(rowsAboutToBeRemoved(const QModelIndex &, int, int)));
- connect(model, SIGNAL(rowsRemoved(QModelIndex, int, int)),
- this, SLOT(rowsRemoved()));
- connect(model, SIGNAL(dataChanged(QModelIndex, QModelIndex)), SLOT(dataChanged(QModelIndex, QModelIndex)));
+ connect(model, &QAbstractItemModel::rowsInserted,
+ this, &ChatScene::rowsInserted);
+ connect(model, &QAbstractItemModel::rowsAboutToBeRemoved,
+ this, &ChatScene::rowsAboutToBeRemoved);
+ connect(model, &QAbstractItemModel::rowsRemoved,
+ this, &ChatScene::rowsRemoved);
+ connect(model, &QAbstractItemModel::dataChanged, this, &ChatScene::dataChanged);
#if defined HAVE_WEBKIT || defined HAVE_WEBENGINE
webPreview.timer.setSingleShot(true);
- connect(&webPreview.timer, SIGNAL(timeout()), this, SLOT(webPreviewNextStep()));
+ connect(&webPreview.timer, &QTimer::timeout, this, &ChatScene::webPreviewNextStep);
#endif
_showWebPreview = defaultSettings.showWebPreview();
defaultSettings.notify("ShowWebPreview", this, SLOT(showWebPreviewChanged()));
_clickTimer.setInterval(QApplication::doubleClickInterval());
_clickTimer.setSingleShot(true);
- connect(&_clickTimer, SIGNAL(timeout()), SLOT(clickTimeout()));
+ connect(&_clickTimer, &QTimer::timeout, this, &ChatScene::clickTimeout);
setItemIndexMethod(QGraphicsScene::NoIndex);
}
_scrollTimer.setInterval(100);
_scrollTimer.setSingleShot(true);
- connect(&_scrollTimer, SIGNAL(timeout()), SLOT(scrollTimerTimeout()));
+ connect(&_scrollTimer, &QTimer::timeout, this, &ChatView::scrollTimerTimeout);
_scene = new ChatScene(filter, filter->idString(), viewport()->width(), this);
- connect(_scene, SIGNAL(sceneRectChanged(const QRectF &)), this, SLOT(adjustSceneRect()));
- connect(_scene, SIGNAL(lastLineChanged(QGraphicsItem *, qreal)), this, SLOT(lastLineChanged(QGraphicsItem *, qreal)));
- connect(_scene, SIGNAL(mouseMoveWhileSelecting(const QPointF &)), this, SLOT(mouseMoveWhileSelecting(const QPointF &)));
+ connect(_scene, &QGraphicsScene::sceneRectChanged, this, &ChatView::adjustSceneRect);
+ connect(_scene, &ChatScene::lastLineChanged, this, &ChatView::lastLineChanged);
+ connect(_scene, &ChatScene::mouseMoveWhileSelecting, this, &ChatView::mouseMoveWhileSelecting);
setScene(_scene);
- connect(verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(verticalScrollbarChanged(int)));
+ connect(verticalScrollBar(), &QAbstractSlider::valueChanged, this, &ChatView::verticalScrollbarChanged);
_lastScrollbarPos = verticalScrollBar()->maximum();
- connect(Client::networkModel(), SIGNAL(markerLineSet(BufferId, MsgId)), SLOT(markerLineSet(BufferId, MsgId)));
+ connect(Client::networkModel(), &NetworkModel::markerLineSet, this, &ChatView::markerLineSet);
// only connect if client is synched with a core
if (Client::isConnected())
- connect(Client::ignoreListManager(), SIGNAL(ignoreListChanged()), this, SLOT(invalidateFilter()));
+ connect(Client::ignoreListManager(), &ClientIgnoreListManager::ignoreListChanged, this, &ChatView::invalidateFilter);
}
hideSearchBar->setShortcutConfigurable(false);
hideSearchBar->setShortcut(Qt::Key_Escape);
- connect(ui.hideButton, SIGNAL(clicked()), toggleSearchBar, SLOT(toggle()));
- connect(ui.searchEditLine, SIGNAL(textChanged(const QString &)), this, SLOT(delaySearch()));
- connect(&_searchDelayTimer, SIGNAL(timeout()), this, SLOT(search()));
+ connect(ui.hideButton, &QAbstractButton::clicked, toggleSearchBar, &QAction::toggle);
+ connect(ui.searchEditLine, &QLineEdit::textChanged, this, &ChatViewSearchBar::delaySearch);
+ connect(&_searchDelayTimer, &QTimer::timeout, this, &ChatViewSearchBar::search);
}
if (!scene)
return;
- connect(_scene, SIGNAL(destroyed()), this, SLOT(sceneDestroyed()));
+ connect(_scene, &QObject::destroyed, this, &ChatViewSearchController::sceneDestroyed);
connect(_scene, SIGNAL(layoutChanged()), this, SLOT(repositionHighlights()));
connect(Client::messageModel(), SIGNAL(finishedBacklogFetch(BufferId)), this, SLOT(updateHighlights()));
updateHighlights();
setPos(wordRect.x(), wordRect.y());
updateGeometry(wordRect.width(), wordRect.height());
- connect(&_timeLine, SIGNAL(valueChanged(qreal)), this, SLOT(updateHighlight(qreal)));
+ connect(&_timeLine, &QTimeLine::valueChanged, this, &SearchHighlightItem::updateHighlight);
}
setPage(AuthenticationSelectionPage, new CoreConfigWizardPages::AuthenticationSelectionPage(authInfos, this));
setPage(StorageSelectionPage, new CoreConfigWizardPages::StorageSelectionPage(backendInfos, this));
syncPage = new CoreConfigWizardPages::SyncPage(this);
- connect(syncPage, SIGNAL(setupCore(const QString &, const QVariantMap &, const QString &, const QVariantMap &)),
- SLOT(prepareCoreSetup(const QString &, const QVariantMap &, const QString &, const QVariantMap &)));
+ connect(syncPage, &CoreConfigWizardPages::SyncPage::setupCore,
+ this, &CoreConfigWizard::prepareCoreSetup);
setPage(SyncPage, syncPage);
syncRelayPage = new CoreConfigWizardPages::SyncRelayPage(this);
- connect(syncRelayPage, SIGNAL(startOver()), this, SLOT(startOver()));
+ connect(syncRelayPage, &CoreConfigWizardPages::SyncRelayPage::startOver, this, &CoreConfigWizard::startOver);
setPage(SyncRelayPage, syncRelayPage);
setStartId(IntroPage);
setWindowTitle(CoreConfigWizard::tr("Core Configuration Wizard"));
setPixmap(QWizard::LogoPixmap, icon::get("quassel").pixmap(48));
- connect(connection, SIGNAL(coreSetupSuccess()), SLOT(coreSetupSuccess()));
- connect(connection, SIGNAL(coreSetupFailed(QString)), SLOT(coreSetupFailed(QString)));
- connect(connection, SIGNAL(synchronized()), SLOT(syncFinished()));
+ connect(connection, &CoreConnection::coreSetupSuccess, this, &CoreConfigWizard::coreSetupSuccess);
+ connect(connection, &CoreConnection::coreSetupFailed, this, &CoreConfigWizard::coreSetupFailed);
+ connect(connection, &CoreConnection::synchronized, this, &CoreConfigWizard::syncFinished);
connect(this, SIGNAL(rejected()), connection, SLOT(disconnectFromCore()));
connect(_settingsPage, SIGNAL(connectToCore(AccountId)), SLOT(accept()));
connect(buttonBox, SIGNAL(accepted()), SLOT(accept()));
- connect(buttonBox, SIGNAL(rejected()), SLOT(reject()));
+ connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
}
{
ui.setupUi(this);
- connect(ui.user, SIGNAL(textChanged(QString)), SLOT(setButtonStates()));
- connect(ui.password, SIGNAL(textChanged(QString)), SLOT(setButtonStates()));
+ connect(ui.user, &QLineEdit::textChanged, this, &CoreConnectAuthDlg::setButtonStates);
+ connect(ui.password, &QLineEdit::textChanged, this, &CoreConnectAuthDlg::setButtonStates);
ui.label->setText(tr("Please enter your credentials for %1:").arg(account->accountName()));
ui.user->setText(account->user());
ui.sslLabel->hide();
update();
- connect(coreConnection(), SIGNAL(progressTextChanged(QString)), ui.messageLabel, SLOT(setText(QString)));
- connect(coreConnection(), SIGNAL(progressValueChanged(int)), ui.progressBar, SLOT(setValue(int)));
- connect(coreConnection(), SIGNAL(progressRangeChanged(int, int)), ui.progressBar, SLOT(setRange(int, int)));
- connect(coreConnection(), SIGNAL(progressRangeChanged(int, int)), this, SLOT(progressRangeChanged(int, int)));
+ connect(coreConnection(), &CoreConnection::progressTextChanged, ui.messageLabel, &QLabel::setText);
+ connect(coreConnection(), &CoreConnection::progressValueChanged, ui.progressBar, &QProgressBar::setValue);
+ connect(coreConnection(), &CoreConnection::progressRangeChanged, ui.progressBar, &QProgressBar::setRange);
+ connect(coreConnection(), &CoreConnection::progressRangeChanged, this, &CoreConnectionStatusWidget::progressRangeChanged);
- connect(coreConnection(), SIGNAL(stateChanged(CoreConnection::ConnectionState)), SLOT(connectionStateChanged(CoreConnection::ConnectionState)));
- connect(coreConnection(), SIGNAL(connectionError(QString)), ui.messageLabel, SLOT(setText(QString)));
- connect(coreConnection(), SIGNAL(lagUpdated(int)), SLOT(updateLag(int)));
+ connect(coreConnection(), &CoreConnection::stateChanged, this, &CoreConnectionStatusWidget::connectionStateChanged);
+ connect(coreConnection(), &CoreConnection::connectionError, ui.messageLabel, &QLabel::setText);
+ connect(coreConnection(), &CoreConnection::lagUpdated, this, &CoreConnectionStatusWidget::updateLag);
}
ui.setupUi(this);
// Listen for resynchronization events (pre-0.13 cores only)
- connect(Client::instance(), SIGNAL(coreInfoResynchronized()),
- this, SLOT(coreInfoResynchronized()));
+ connect(Client::instance(), &Client::coreInfoResynchronized,
+ this, &CoreInfoDlg::coreInfoResynchronized);
// Update legacy core info for Quassel cores earlier than 0.13. This does nothing on modern
// cores.
// On legacy cores, CoreInfo data does not send signals. Periodically poll for information.
// 15 seconds seems like a reasonable trade-off as this only happens while the dialog is open.
- QTimer::singleShot(15 * 1000, this, SLOT(refreshLegacyCoreInfo()));
+ QTimer::singleShot(15 * 1000, this, &CoreInfoDlg::refreshLegacyCoreInfo);
}
CoreInfo *coreInfo = Client::coreInfo();
// Listen for changes to core information
- connect(coreInfo, SIGNAL(coreDataChanged(const QVariantMap &)),
- this, SLOT(coreInfoChanged(const QVariantMap &)));
+ connect(coreInfo, &CoreInfo::coreDataChanged,
+ this, &CoreInfoDlg::coreInfoChanged);
// Update with any known core information set before connecting the signal. This is needed for
// both modern (0.13+) and legacy cores.
ui.textEdit->setReadOnly(true);
- connect(Quassel::instance()->logger(), SIGNAL(messageLogged(Logger::LogEntry)), SLOT(logUpdated(Logger::LogEntry)));
+ connect(Quassel::instance()->logger(), &Logger::messageLogged, this, &DebugLogDlg::logUpdated);
QString content;
for (auto &&message : Quassel::instance()->logger()->messages()) {
itemAdded(QDBusObjectPath());
connect(Client::coreConnection(), SIGNAL(progressValueChanged(int)), this, SLOT(updateProgress(int)));
- connect(Client::coreConnection(), SIGNAL(synchronized()), this, SLOT(synchronized()));
+ connect(Client::coreConnection(), &CoreConnection::synchronized, this, &DockManagerNotificationBackend::synchronized);
}
layout->addWidget(enabledBox = new QCheckBox(tr("Mark dockmanager entry"), this));
enabledBox->setVisible(enabled);
- connect(enabledBox, SIGNAL(toggled(bool)), SLOT(widgetChanged()));
+ connect(enabledBox, &QAbstractButton::toggled, this, &ConfigWidget::widgetChanged);
}
ui.textcolorButton->setMenu(_colorMenu);
// Set the default action to clear color (last added action)
ui.textcolorButton->setDefaultAction(_colorMenu->actions().last());
- connect(_colorMenu, SIGNAL(triggered(QAction *)), this, SLOT(colorChosen(QAction *)));
+ connect(_colorMenu, &QMenu::triggered, this, &InputWidget::colorChosen);
ui.highlightcolorButton->setMenu(_colorFillMenu);
// Set the default action to clear fill color (last added action)
ui.highlightcolorButton->setDefaultAction(_colorFillMenu->actions().last());
- connect(_colorFillMenu, SIGNAL(triggered(QAction *)), this, SLOT(colorHighlightChosen(QAction *)));
+ connect(_colorFillMenu, &QMenu::triggered, this, &InputWidget::colorHighlightChosen);
// Needs to be done after adding the menu, otherwise the icon mysteriously vanishes until clicked
ui.textcolorButton->setIcon(icon::get("format-text-color"));
ui.highlightcolorButton->setIcon(icon::get("format-fill-color"));
// Show/hide style button
- connect(ui.showStyleButton, SIGNAL(toggled(bool)), this, SLOT(setStyleOptionsExpanded(bool)));
+ connect(ui.showStyleButton, &QAbstractButton::toggled, this, &InputWidget::setStyleOptionsExpanded);
// Clear formatting button
- connect(ui.clearButton, SIGNAL(clicked()), this, SLOT(clearFormat()));
+ connect(ui.clearButton, &QAbstractButton::clicked, this, &InputWidget::clearFormat);
new TabCompleter(ui.inputEdit);
activateInputline->setText(tr("Focus Input Line"));
activateInputline->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_L));
- connect(inputLine(), SIGNAL(textEntered(QString)), SLOT(onTextEntered(QString)), Qt::QueuedConnection); // make sure the line is already reset, bug #984
- connect(inputLine(), SIGNAL(currentCharFormatChanged(QTextCharFormat)), this, SLOT(currentCharFormatChanged(QTextCharFormat)));
+ connect(inputLine(), &MultiLineEdit::textEntered, this, &InputWidget::onTextEntered, Qt::QueuedConnection); // make sure the line is already reset, bug #984
+ connect(inputLine(), &QTextEdit::currentCharFormatChanged, this, &InputWidget::currentCharFormatChanged);
}
const Network *network = Client::network(networkId);
if (network) {
- connect(network, SIGNAL(identitySet(IdentityId)), this, SLOT(setIdentity(IdentityId)));
+ connect(network, &Network::identitySet, this, &InputWidget::setIdentity);
connectMyIrcUser();
setIdentity(network->identity());
}
{
const Network *network = currentNetwork();
if (network->me()) {
- connect(network->me(), SIGNAL(nickSet(const QString &)), this, SLOT(updateNickSelector()));
- connect(network->me(), SIGNAL(userModesSet(QString)), this, SLOT(updateNickSelector()));
- connect(network->me(), SIGNAL(userModesAdded(QString)), this, SLOT(updateNickSelector()));
- connect(network->me(), SIGNAL(userModesRemoved(QString)), this, SLOT(updateNickSelector()));
- connect(network->me(), SIGNAL(awaySet(bool)), this, SLOT(updateNickSelector()));
- disconnect(network, SIGNAL(myNickSet(const QString &)), this, SLOT(connectMyIrcUser()));
+ connect(network->me(), &IrcUser::nickSet, this, &InputWidget::updateNickSelector);
+ connect(network->me(), &IrcUser::userModesSet, this, &InputWidget::updateNickSelector);
+ connect(network->me(), &IrcUser::userModesAdded, this, &InputWidget::updateNickSelector);
+ connect(network->me(), &IrcUser::userModesRemoved, this, &InputWidget::updateNickSelector);
+ connect(network->me(), &IrcUser::awaySet, this, &InputWidget::updateNickSelector);
+ disconnect(network, &Network::myNickSet, this, &InputWidget::connectMyIrcUser);
updateNickSelector();
}
else {
- connect(network, SIGNAL(myNickSet(const QString &)), this, SLOT(connectMyIrcUser()));
+ connect(network, &Network::myNickSet, this, &InputWidget::connectMyIrcUser);
}
}
const Identity *identity = Client::identity(identityId);
if (identity) {
- connect(identity, SIGNAL(nicksSet(QStringList)), this, SLOT(updateNickSelector()));
+ connect(identity, &Identity::nicksSet, this, &InputWidget::updateNickSelector);
}
else {
_identityId = 0;
setOptions(options() | (QWizard::WizardOptions)(QWizard::NoDefaultButton | QWizard::CancelButtonOnLeft));
setOption(QWizard::NoCancelButton, false);
- connect(button(QWizard::FinishButton), SIGNAL(clicked()), this, SLOT(finishClicked()));
+ connect(button(QWizard::FinishButton), &QAbstractButton::clicked, this, &IrcConnectionWizard::finishClicked);
setButtonText(QWizard::FinishButton, tr("Save && Connect"));
}
identityReady(identity->id());
}
else {
- connect(Client::instance(), SIGNAL(identityCreated(IdentityId)), this, SLOT(identityReady(IdentityId)));
+ connect(Client::instance(), &Client::identityCreated, this, &IrcConnectionWizard::identityReady);
Client::createIdentity(*identity);
}
}
void IrcConnectionWizard::identityReady(IdentityId id)
{
- disconnect(Client::instance(), SIGNAL(identityCreated(IdentityId)), this, SLOT(identityReady(IdentityId)));
+ disconnect(Client::instance(), &Client::identityCreated, this, &IrcConnectionWizard::identityReady);
auto *networkPage = static_cast<NetworkPage *>(_networkPage);
NetworkInfo networkInfo = networkPage->networkInfo();
QStringList channels = networkPage->channelList();
networkInfo.identity = id;
- connect(Client::instance(), SIGNAL(networkCreated(NetworkId)), this, SLOT(networkReady(NetworkId)));
+ connect(Client::instance(), &Client::networkCreated, this, &IrcConnectionWizard::networkReady);
Client::createNetwork(networkInfo, channels);
}
void IrcConnectionWizard::networkReady(NetworkId id)
{
- disconnect(Client::instance(), SIGNAL(networkCreated(NetworkId)), this, SLOT(networkReady(NetworkId)));
+ disconnect(Client::instance(), &Client::networkCreated, this, &IrcConnectionWizard::networkReady);
const Network *net = Client::network(id);
Q_ASSERT(net);
net->requestConnect();
{
#ifndef Q_OS_MAC
- connect(_trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
- SLOT(onActivated(QSystemTrayIcon::ActivationReason)));
+ connect(_trayIcon, &QSystemTrayIcon::activated,
+ this, &LegacySystemTray::onActivated);
#endif
- connect(_trayIcon, SIGNAL(messageClicked()),
- SLOT(onMessageClicked()));
+ connect(_trayIcon, &QSystemTrayIcon::messageClicked,
+ this, &LegacySystemTray::onMessageClicked);
_trayIcon->setContextMenu(trayMenu());
_trayIcon->setVisible(false);
setMode(Mode::Legacy);
- connect(this, SIGNAL(visibilityChanged(bool)), this, SLOT(onVisibilityChanged(bool)));
- connect(this, SIGNAL(modeChanged(Mode)), this, SLOT(onModeChanged(Mode)));
- connect(this, SIGNAL(toolTipChanged(QString, QString)), SLOT(updateToolTip()));
- connect(this, SIGNAL(iconsChanged()), this, SLOT(updateIcon()));
- connect(this, SIGNAL(currentIconNameChanged()), this, SLOT(updateIcon()));
+ connect(this, &SystemTray::visibilityChanged, this, &LegacySystemTray::onVisibilityChanged);
+ connect(this, &SystemTray::modeChanged, this, &LegacySystemTray::onModeChanged);
+ connect(this, &SystemTray::toolTipChanged, this, &LegacySystemTray::updateToolTip);
+ connect(this, &SystemTray::iconsChanged, this, &LegacySystemTray::updateIcon);
+ connect(this, &SystemTray::currentIconNameChanged, this, &LegacySystemTray::updateIcon);
updateIcon();
updateToolTip();
_connectButton = new QPushButton(icon::get("network-connect"), tr("Connect to Core..."));
_connectButton->setEnabled(Client::coreConnection()->state() == CoreConnection::Disconnected);
- connect(Client::coreConnection(), SIGNAL(stateChanged(CoreConnection::ConnectionState)), this, SLOT(coreConnectionStateChanged()));
- connect(_connectButton, SIGNAL(clicked(bool)), this, SLOT(showCoreConnectionDlg()));
+ connect(Client::coreConnection(), &CoreConnection::stateChanged, this, &MainPage::coreConnectionStateChanged);
+ connect(_connectButton, &QAbstractButton::clicked, this, &MainPage::showCoreConnectionDlg);
layout->addWidget(_connectButton);
}
}
void MainWin::init()
{
- connect(Client::instance(), SIGNAL(networkCreated(NetworkId)), SLOT(clientNetworkCreated(NetworkId)));
- connect(Client::instance(), SIGNAL(networkRemoved(NetworkId)), SLOT(clientNetworkRemoved(NetworkId)));
- connect(Client::messageModel(), SIGNAL(rowsInserted(const QModelIndex &, int, int)),
- SLOT(messagesInserted(const QModelIndex &, int, int)));
+ connect(Client::instance(), &Client::networkCreated, this, &MainWin::clientNetworkCreated);
+ connect(Client::instance(), &Client::networkRemoved, this, &MainWin::clientNetworkRemoved);
+ connect(Client::messageModel(), &QAbstractItemModel::rowsInserted,
+ this, &MainWin::messagesInserted);
connect(GraphicalUi::contextMenuActionProvider(),
- SIGNAL(showChannelList(NetworkId,QString,bool)),
- SLOT(showChannelList(NetworkId,QString,bool)));
+ &NetworkModelController::showChannelList,
+ this, &MainWin::showChannelList);
connect(Client::instance(),
- SIGNAL(showChannelList(NetworkId,QString,bool)),
- SLOT(showChannelList(NetworkId,QString,bool)));
- connect(GraphicalUi::contextMenuActionProvider(), SIGNAL(showNetworkConfig(NetworkId)), SLOT(showNetworkConfig(NetworkId)));
- connect(GraphicalUi::contextMenuActionProvider(), SIGNAL(showIgnoreList(QString)), SLOT(showIgnoreList(QString)));
- connect(Client::instance(), SIGNAL(showIgnoreList(QString)), SLOT(showIgnoreList(QString)));
- connect(Client::instance(), SIGNAL(dbUpgradeInProgress(bool)), SLOT(showMigrationWarning(bool)));
- connect(Client::instance(), SIGNAL(exitRequested(QString)), SLOT(onExitRequested(QString)));
-
- connect(Client::coreConnection(), SIGNAL(startCoreSetup(QVariantList, QVariantList)), SLOT(showCoreConfigWizard(QVariantList, QVariantList)));
- connect(Client::coreConnection(), SIGNAL(connectionErrorPopup(QString)), SLOT(handleCoreConnectionError(QString)));
- connect(Client::coreConnection(), SIGNAL(userAuthenticationRequired(CoreAccount *, bool *, QString)), SLOT(userAuthenticationRequired(CoreAccount *, bool *, QString)));
- connect(Client::coreConnection(), SIGNAL(handleNoSslInClient(bool *)), SLOT(handleNoSslInClient(bool *)));
- connect(Client::coreConnection(), SIGNAL(handleNoSslInCore(bool *)), SLOT(handleNoSslInCore(bool *)));
+ &Client::showChannelList,
+ this, &MainWin::showChannelList);
+ connect(GraphicalUi::contextMenuActionProvider(), &NetworkModelController::showNetworkConfig, this, &MainWin::showNetworkConfig);
+ connect(GraphicalUi::contextMenuActionProvider(), &NetworkModelController::showIgnoreList, this, &MainWin::showIgnoreList);
+ connect(Client::instance(), &Client::showIgnoreList, this, &MainWin::showIgnoreList);
+ connect(Client::instance(), &Client::dbUpgradeInProgress, this, &MainWin::showMigrationWarning);
+ connect(Client::instance(), &Client::exitRequested, this, &MainWin::onExitRequested);
+
+ connect(Client::coreConnection(), &CoreConnection::startCoreSetup, this, &MainWin::showCoreConfigWizard);
+ connect(Client::coreConnection(), &CoreConnection::connectionErrorPopup, this, &MainWin::handleCoreConnectionError);
+ connect(Client::coreConnection(), &CoreConnection::userAuthenticationRequired, this, &MainWin::userAuthenticationRequired);
+ connect(Client::coreConnection(), &CoreConnection::handleNoSslInClient, this, &MainWin::handleNoSslInClient);
+ connect(Client::coreConnection(), &CoreConnection::handleNoSslInCore, this, &MainWin::handleNoSslInCore);
#ifdef HAVE_SSL
- connect(Client::coreConnection(), SIGNAL(handleSslErrors(const QSslSocket *, bool *, bool *)), SLOT(handleSslErrors(const QSslSocket *, bool *, bool *)));
+ connect(Client::coreConnection(), &CoreConnection::handleSslErrors, this, &MainWin::handleSslErrors);
#endif
// Setup Dock Areas
qApp->closeAllWindows();
});
- QTimer::singleShot(0, this, SLOT(doAutoConnect()));
+ QTimer::singleShot(0, this, &MainWin::doAutoConnect);
}
QAction *lockAct = coll->addAction("LockLayout", new Action(tr("&Lock Layout"), coll));
lockAct->setCheckable(true);
- connect(lockAct, SIGNAL(toggled(bool)), SLOT(on_actionLockLayout_toggled(bool)));
+ connect(lockAct, &QAction::toggled, this, &MainWin::on_actionLockLayout_toggled);
coll->addAction("ToggleSearchBar", new Action(icon::get("edit-find"), tr("Show &Search Bar"), coll,
nullptr, nullptr, QKeySequence::Find))->setCheckable(true);
enabled ? menuBar()->show() : menuBar()->hide();
connect(showMenuBar, SIGNAL(toggled(bool)), menuBar(), SLOT(setVisible(bool)));
- connect(showMenuBar, SIGNAL(toggled(bool)), this, SLOT(saveMenuBarStatus(bool)));
+ connect(showMenuBar, &QAction::toggled, this, &MainWin::saveMenuBarStatus);
}
addDockWidget(Qt::LeftDockWidgetArea, dock);
_bufferViewsMenu->addAction(dock->toggleViewAction());
- connect(dock->toggleViewAction(), SIGNAL(toggled(bool)), this, SLOT(bufferViewToggled(bool)));
- connect(dock, SIGNAL(visibilityChanged(bool)), SLOT(bufferViewVisibilityChanged(bool)));
+ connect(dock->toggleViewAction(), &QAction::toggled, this, &MainWin::bufferViewToggled);
+ connect(dock, &QDockWidget::visibilityChanged, this, &MainWin::bufferViewVisibilityChanged);
_bufferViews.append(dock);
if (!activeBufferView())
showStatusbar->setChecked(enabled);
enabled ? statusBar()->show() : statusBar()->hide();
- connect(showStatusbar, SIGNAL(toggled(bool)), statusBar(), SLOT(setVisible(bool)));
- connect(showStatusbar, SIGNAL(toggled(bool)), this, SLOT(saveStatusBarStatus(bool)));
+ connect(showStatusbar, &QAction::toggled, statusBar(), &QWidget::setVisible);
+ connect(showStatusbar, &QAction::toggled, this, &MainWin::saveStatusBarStatus);
connect(Client::coreConnection(), SIGNAL(connectionMsg(QString)), statusBar(), SLOT(showMessage(QString)));
}
{
Q_CHECK_PTR(Client::bufferViewManager());
connect(Client::bufferViewManager(), SIGNAL(bufferViewConfigAdded(int)), this, SLOT(addBufferView(int)));
- connect(Client::bufferViewManager(), SIGNAL(bufferViewConfigDeleted(int)), this, SLOT(removeBufferView(int)));
- connect(Client::bufferViewManager(), SIGNAL(initDone()), this, SLOT(loadLayout()));
+ connect(Client::bufferViewManager(), &BufferViewManager::bufferViewConfigDeleted, this, &MainWin::removeBufferView);
+ connect(Client::bufferViewManager(), &SyncableObject::initDone, this, &MainWin::loadLayout);
if (Client::transferManager()) {
- connect(Client::transferManager(), SIGNAL(transferAdded(QUuid)), SLOT(showNewTransferDlg(QUuid)));
+ connect(Client::transferManager(), &TransferManager::transferAdded, this, &MainWin::showNewTransferDlg);
}
setConnectedState();
action->setVisible(!Client::internalCore());
}
- disconnect(Client::backlogManager(), SIGNAL(updateProgress(int, int)), _msgProcessorStatusWidget, SLOT(setProgress(int, int)));
- disconnect(Client::backlogManager(), SIGNAL(messagesRequested(const QString &)), this, SLOT(showStatusBarMessage(const QString &)));
- disconnect(Client::backlogManager(), SIGNAL(messagesProcessed(const QString &)), this, SLOT(showStatusBarMessage(const QString &)));
+ disconnect(Client::backlogManager(), &ClientBacklogManager::updateProgress, _msgProcessorStatusWidget, &MsgProcessorStatusWidget::setProgress);
+ disconnect(Client::backlogManager(), &ClientBacklogManager::messagesRequested, this, &MainWin::showStatusBarMessage);
+ disconnect(Client::backlogManager(), &ClientBacklogManager::messagesProcessed, this, &MainWin::showStatusBarMessage);
if (!Client::internalCore()) {
- connect(Client::backlogManager(), SIGNAL(updateProgress(int, int)), _msgProcessorStatusWidget, SLOT(setProgress(int, int)));
- connect(Client::backlogManager(), SIGNAL(messagesRequested(const QString &)), this, SLOT(showStatusBarMessage(const QString &)));
- connect(Client::backlogManager(), SIGNAL(messagesProcessed(const QString &)), this, SLOT(showStatusBarMessage(const QString &)));
+ connect(Client::backlogManager(), &ClientBacklogManager::updateProgress, _msgProcessorStatusWidget, &MsgProcessorStatusWidget::setProgress);
+ connect(Client::backlogManager(), &ClientBacklogManager::messagesRequested, this, &MainWin::showStatusBarMessage);
+ connect(Client::backlogManager(), &ClientBacklogManager::messagesProcessed, this, &MainWin::showStatusBarMessage);
}
// _viewMenu->setEnabled(true);
auto *filter = new AwayLogFilter(Client::messageModel());
_awayLog = new AwayLogView(filter, nullptr);
filter->setParent(_awayLog);
- connect(_awayLog, SIGNAL(destroyed()), this, SLOT(awayLogDestroyed()));
+ connect(_awayLog, &QObject::destroyed, this, &MainWin::awayLogDestroyed);
_awayLog->setAttribute(Qt::WA_DeleteOnClose);
_awayLog->show();
}
auto *act = new QAction(net->networkName(), this);
act->setObjectName(QString("NetworkAction-%1").arg(id.toInt()));
act->setData(QVariant::fromValue<NetworkId>(id));
- connect(net, SIGNAL(updatedRemotely()), this, SLOT(clientNetworkUpdated()));
- connect(act, SIGNAL(triggered()), this, SLOT(connectOrDisconnectFromNet()));
+ connect(net, &SyncableObject::updatedRemotely, this, &MainWin::clientNetworkUpdated);
+ connect(act, &QAction::triggered, this, &MainWin::connectOrDisconnectFromNet);
QAction *beforeAction = nullptr;
foreach(QAction *action, _networksMenu->actions()) {
setVisible(false);
setZValue(8);
styleChanged(); // init brush and height
- connect(QtUi::style(), SIGNAL(changed()), SLOT(styleChanged()));
+ connect(QtUi::style(), &UiStyle::changed, this, &MarkerLineItem::styleChanged);
}
"on the Quassel Core running at <b>%2</b>.")
.arg(account.user(), account.hostName()));
- connect(ui.oldPasswordEdit, SIGNAL(textChanged(QString)), SLOT(inputChanged()));
- connect(ui.newPasswordEdit, SIGNAL(textChanged(QString)), SLOT(inputChanged()));
- connect(ui.confirmPasswordEdit, SIGNAL(textChanged(QString)), SLOT(inputChanged()));
- connect(ui.buttonBox, SIGNAL(accepted()), SLOT(changePassword()));
+ connect(ui.oldPasswordEdit, &QLineEdit::textChanged, this, &PasswordChangeDlg::inputChanged);
+ connect(ui.newPasswordEdit, &QLineEdit::textChanged, this, &PasswordChangeDlg::inputChanged);
+ connect(ui.confirmPasswordEdit, &QLineEdit::textChanged, this, &PasswordChangeDlg::inputChanged);
+ connect(ui.buttonBox, &QDialogButtonBox::accepted, this, &PasswordChangeDlg::changePassword);
- connect(Client::instance(), SIGNAL(passwordChanged(bool)), SLOT(passwordChanged(bool)));
+ connect(Client::instance(), &Client::passwordChanged, this, &PasswordChangeDlg::passwordChanged);
ui.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
}
_audioAvailable = (QMediaPlayer().availability() == QMultimedia::Available);
- connect(ui.enabled, SIGNAL(toggled(bool)), SLOT(widgetChanged()));
- connect(ui.filename, SIGNAL(textChanged(const QString &)), SLOT(widgetChanged()));
+ connect(ui.enabled, &QAbstractButton::toggled, this, &ConfigWidget::widgetChanged);
+ connect(ui.filename, &QLineEdit::textChanged, this, &ConfigWidget::widgetChanged);
}
_mainWin = std::make_unique<MainWin>();
setMainWidget(_mainWin.get());
- connect(_mainWin.get(), SIGNAL(connectToCore(const QVariantMap &)), this, SIGNAL(connectToCore(const QVariantMap &)));
- connect(_mainWin.get(), SIGNAL(disconnectFromCore()), this, SIGNAL(disconnectFromCore()));
- connect(Client::instance(), SIGNAL(bufferMarkedAsRead(BufferId)), SLOT(closeNotifications(BufferId)));
+ connect(_mainWin.get(), &MainWin::connectToCore, this, &QtUi::connectToCore);
+ connect(_mainWin.get(), &MainWin::disconnectFromCore, this, &QtUi::disconnectFromCore);
+ connect(Client::instance(), &Client::bufferMarkedAsRead, this, &QtUi::closeNotifications);
_mainWin->init();
// Init UI only after the event loop has started
// TODO Qt5: Make this a lambda
- QTimer::singleShot(0, this, SLOT(initUi()));
+ QTimer::singleShot(0, this, &QtUiApplication::initUi);
}
notificationSettings.notify("Highlights/HighlightNick", this, SLOT(highlightNickChanged(const QVariant &)));
_processTimer.setInterval(0);
- connect(&_processTimer, SIGNAL(timeout()), this, SLOT(processNextMessage()));
+ connect(&_processTimer, &QTimer::timeout, this, &QtUiMessageProcessor::processNextMessage);
}
ui.settingsTree->setRootIsDecorated(false);
- connect(ui.settingsTree, SIGNAL(itemSelectionChanged()), this, SLOT(itemSelected()));
- connect(ui.buttonBox, SIGNAL(clicked(QAbstractButton *)), this, SLOT(buttonClicked(QAbstractButton *)));
+ connect(ui.settingsTree, &QTreeWidget::itemSelectionChanged, this, &SettingsDlg::itemSelected);
+ connect(ui.buttonBox, &QDialogButtonBox::clicked, this, &SettingsDlg::buttonClicked);
- connect(Client::instance(), SIGNAL(coreConnectionStateChanged(bool)), SLOT(coreConnectionStateChanged()));
+ connect(Client::instance(), &Client::coreConnectionStateChanged, this, &SettingsDlg::coreConnectionStateChanged);
setButtonStates();
}
updateGeometry();
connect(page, SIGNAL(changed(bool)), this, SLOT(setButtonStates()));
- connect(ui.buttonBox, SIGNAL(clicked(QAbstractButton *)), this, SLOT(buttonClicked(QAbstractButton *)));
+ connect(ui.buttonBox, &QDialogButtonBox::clicked, this, &SettingsPageDlg::buttonClicked);
page->load();
setButtonStates();
}
: QAbstractItemModel(parent)
{
// we need this signal for future connects to reset the data;
- connect(Client::instance(), SIGNAL(connected()), this, SLOT(clientConnected()));
- connect(Client::instance(), SIGNAL(disconnected()), this, SLOT(clientDisconnected()));
+ connect(Client::instance(), &Client::connected, this, &AliasesModel::clientConnected);
+ connect(Client::instance(), &Client::disconnected, this, &AliasesModel::clientDisconnected);
if (Client::isConnected())
clientConnected();
if (Client::aliasManager()->isInitialized())
initDone();
else
- connect(Client::aliasManager(), SIGNAL(initDone()), SLOT(initDone()));
+ connect(Client::aliasManager(), &SyncableObject::initDone, this, &AliasesModel::initDone);
}
ui.aliasesView->verticalHeader()->hide();
ui.aliasesView->horizontalHeader()->setStretchLastSection(true);
- connect(ui.newAliasButton, SIGNAL(clicked()), &_aliasesModel, SLOT(newAlias()));
- connect(ui.deleteAliasButton, SIGNAL(clicked()), this, SLOT(deleteSelectedAlias()));
+ connect(ui.newAliasButton, &QAbstractButton::clicked, &_aliasesModel, &AliasesModel::newAlias);
+ connect(ui.deleteAliasButton, &QAbstractButton::clicked, this, &AliasesSettingsPage::deleteSelectedAlias);
connect(&_aliasesModel, SIGNAL(configChanged(bool)), this, SLOT(setChangedState(bool)));
- connect(&_aliasesModel, SIGNAL(modelReady(bool)), this, SLOT(enableDialog(bool)));
+ connect(&_aliasesModel, &AliasesModel::modelReady, this, &AliasesSettingsPage::enableDialog);
enableDialog(_aliasesModel.isReady());
}
connect(comboBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(widgetHasChanged()));
}
foreach(QCheckBox *checkBox, findChildren<QCheckBox *>()) {
- connect(checkBox, SIGNAL(clicked()), this, SLOT(widgetHasChanged()));
+ connect(checkBox, &QAbstractButton::clicked, this, &AppearanceSettingsPage::widgetHasChanged);
}
- connect(ui.chooseStyleSheet, SIGNAL(clicked()), SLOT(chooseStyleSheet()));
+ connect(ui.chooseStyleSheet, &QAbstractButton::clicked, this, &AppearanceSettingsPage::chooseStyleSheet);
- connect(ui.userNoticesInDefaultBuffer, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
- connect(ui.userNoticesInStatusBuffer, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
- connect(ui.userNoticesInCurrentBuffer, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
+ connect(ui.userNoticesInDefaultBuffer, &QAbstractButton::clicked, this, &AppearanceSettingsPage::widgetHasChanged);
+ connect(ui.userNoticesInStatusBuffer, &QAbstractButton::clicked, this, &AppearanceSettingsPage::widgetHasChanged);
+ connect(ui.userNoticesInCurrentBuffer, &QAbstractButton::clicked, this, &AppearanceSettingsPage::widgetHasChanged);
- connect(ui.serverNoticesInDefaultBuffer, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
- connect(ui.serverNoticesInStatusBuffer, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
- connect(ui.serverNoticesInCurrentBuffer, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
+ connect(ui.serverNoticesInDefaultBuffer, &QAbstractButton::clicked, this, &AppearanceSettingsPage::widgetHasChanged);
+ connect(ui.serverNoticesInStatusBuffer, &QAbstractButton::clicked, this, &AppearanceSettingsPage::widgetHasChanged);
+ connect(ui.serverNoticesInCurrentBuffer, &QAbstractButton::clicked, this, &AppearanceSettingsPage::widgetHasChanged);
- connect(ui.errorMsgsInDefaultBuffer, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
- connect(ui.errorMsgsInStatusBuffer, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
- connect(ui.errorMsgsInCurrentBuffer, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
+ connect(ui.errorMsgsInDefaultBuffer, &QAbstractButton::clicked, this, &AppearanceSettingsPage::widgetHasChanged);
+ connect(ui.errorMsgsInStatusBuffer, &QAbstractButton::clicked, this, &AppearanceSettingsPage::widgetHasChanged);
+ connect(ui.errorMsgsInCurrentBuffer, &QAbstractButton::clicked, this, &AppearanceSettingsPage::widgetHasChanged);
}
ui.bufferViewPreview->setEnabled(false);
coreConnectionStateChanged(Client::isConnected()); // need a core connection!
- connect(Client::instance(), SIGNAL(coreConnectionStateChanged(bool)), this, SLOT(coreConnectionStateChanged(bool)));
- connect(ui.bufferViewList->selectionModel(), SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)),
- this, SLOT(bufferViewSelectionChanged(const QItemSelection &, const QItemSelection &)));
-
- connect(ui.onlyStatusBuffers, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
- connect(ui.onlyChannelBuffers, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
- connect(ui.onlyQueryBuffers, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
- connect(ui.addNewBuffersAutomatically, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
- connect(ui.sortAlphabetically, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
- connect(ui.hideInactiveBuffers, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
- connect(ui.hideInactiveNetworks, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
+ connect(Client::instance(), &Client::coreConnectionStateChanged, this, &BufferViewSettingsPage::coreConnectionStateChanged);
+ connect(ui.bufferViewList->selectionModel(), &QItemSelectionModel::selectionChanged,
+ this, &BufferViewSettingsPage::bufferViewSelectionChanged);
+
+ connect(ui.onlyStatusBuffers, &QAbstractButton::clicked, this, &BufferViewSettingsPage::widgetHasChanged);
+ connect(ui.onlyChannelBuffers, &QAbstractButton::clicked, this, &BufferViewSettingsPage::widgetHasChanged);
+ connect(ui.onlyQueryBuffers, &QAbstractButton::clicked, this, &BufferViewSettingsPage::widgetHasChanged);
+ connect(ui.addNewBuffersAutomatically, &QAbstractButton::clicked, this, &BufferViewSettingsPage::widgetHasChanged);
+ connect(ui.sortAlphabetically, &QAbstractButton::clicked, this, &BufferViewSettingsPage::widgetHasChanged);
+ connect(ui.hideInactiveBuffers, &QAbstractButton::clicked, this, &BufferViewSettingsPage::widgetHasChanged);
+ connect(ui.hideInactiveNetworks, &QAbstractButton::clicked, this, &BufferViewSettingsPage::widgetHasChanged);
connect(ui.networkSelector, SIGNAL(currentIndexChanged(int)), this, SLOT(widgetHasChanged()));
connect(ui.minimumActivitySelector, SIGNAL(currentIndexChanged(int)), this, SLOT(widgetHasChanged()));
- connect(ui.showSearch, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
+ connect(ui.showSearch, &QAbstractButton::clicked, this, &BufferViewSettingsPage::widgetHasChanged);
connect(ui.networkSelector, SIGNAL(currentIndexChanged(int)), this, SLOT(enableStatusBuffers(int)));
}
{
auto *item = new QListWidgetItem(config->bufferViewName(), ui.bufferViewList);
item->setData(Qt::UserRole, qVariantFromValue<QObject *>(qobject_cast<QObject *>(config)));
- connect(config, SIGNAL(updatedRemotely()), this, SLOT(updateBufferView()));
- connect(config, SIGNAL(destroyed()), this, SLOT(bufferViewDeleted()));
+ connect(config, &SyncableObject::updatedRemotely, this, &BufferViewSettingsPage::updateBufferView);
+ connect(config, &QObject::destroyed, this, &BufferViewSettingsPage::bufferViewDeleted);
ui.deleteBufferView->setEnabled(ui.bufferViewList->count() > 1);
}
changedConfig->fromVariantMap(config->toVariantMap());
changedConfig->setInitialized();
_changedBufferViews[config] = changedConfig;
- connect(config, SIGNAL(bufferAdded(const BufferId &, int)), changedConfig, SLOT(addBuffer(const BufferId &, int)));
- connect(config, SIGNAL(bufferMoved(const BufferId &, int)), changedConfig, SLOT(moveBuffer(const BufferId &, int)));
- connect(config, SIGNAL(bufferRemoved(const BufferId &)), changedConfig, SLOT(removeBuffer(const BufferId &)));
+ connect(config, &BufferViewConfig::bufferAdded, changedConfig, &BufferViewConfig::addBuffer);
+ connect(config, &BufferViewConfig::bufferMoved, changedConfig, &BufferViewConfig::moveBuffer);
+ connect(config, &BufferViewConfig::bufferRemoved, changedConfig, &BufferViewConfig::removeBuffer);
// connect(config, SIGNAL(addBufferRequested(const BufferId &, int)), changedConfig, SLOT(addBuffer(const BufferId &, int)));
// connect(config, SIGNAL(moveBufferRequested(const BufferId &, int)), changedConfig, SLOT(moveBuffer(const BufferId &, int)));
// connect(config, SIGNAL(removeBufferRequested(const BufferId &)), changedConfig, SLOT(removeBuffer(const BufferId &)));
// connect slots
connect(ui.operationMode, SIGNAL(currentIndexChanged(int)), SLOT(switchOperationMode(int)));
- connect(ui.showHighlights, SIGNAL(toggled(bool)), SLOT(widgetHasChanged()));
- connect(ui.showOwnMessages, SIGNAL(toggled(bool)), SLOT(widgetHasChanged()));
- connect(ui.alwaysOwn, SIGNAL(toggled(bool)), SLOT(widgetHasChanged()));
- connect(ui.showBacklog, SIGNAL(toggled(bool)), SLOT(widgetHasChanged()));
- connect(ui.includeRead, SIGNAL(toggled(bool)), SLOT(widgetHasChanged()));
+ connect(ui.showHighlights, &QAbstractButton::toggled, this, &ChatMonitorSettingsPage::widgetHasChanged);
+ connect(ui.showOwnMessages, &QAbstractButton::toggled, this, &ChatMonitorSettingsPage::widgetHasChanged);
+ connect(ui.alwaysOwn, &QAbstractButton::toggled, this, &ChatMonitorSettingsPage::widgetHasChanged);
+ connect(ui.showBacklog, &QAbstractButton::toggled, this, &ChatMonitorSettingsPage::widgetHasChanged);
+ connect(ui.includeRead, &QAbstractButton::toggled, this, &ChatMonitorSettingsPage::widgetHasChanged);
}
ui.setupUi(this);
initAutoWidgets();
- connect(Client::instance(), SIGNAL(connected()), this, SLOT(clientConnected()));
- connect(Client::instance(), SIGNAL(disconnected()), this, SLOT(clientDisconnected()));
+ connect(Client::instance(), &Client::connected, this, &ConnectionSettingsPage::clientConnected);
+ connect(Client::instance(), &Client::disconnected, this, &ConnectionSettingsPage::clientDisconnected);
setEnabled(false);
if (Client::isConnected())
if (Client::networkConfig()->isInitialized())
initDone();
else
- connect(Client::networkConfig(), SIGNAL(initDone()), SLOT(initDone()));
+ connect(Client::networkConfig(), &SyncableObject::initDone, this, &ConnectionSettingsPage::initDone);
}
ui.accountView->setModel(filteredModel());
ui.autoConnectAccount->setModel(filteredModel());
- connect(filteredModel(), SIGNAL(rowsAboutToBeRemoved(QModelIndex, int, int)), SLOT(rowsAboutToBeRemoved(QModelIndex, int, int)));
- connect(filteredModel(), SIGNAL(rowsInserted(QModelIndex, int, int)), SLOT(rowsInserted(QModelIndex, int, int)));
+ connect(filteredModel(), &QAbstractItemModel::rowsAboutToBeRemoved, this, &CoreAccountSettingsPage::rowsAboutToBeRemoved);
+ connect(filteredModel(), &QAbstractItemModel::rowsInserted, this, &CoreAccountSettingsPage::rowsInserted);
- connect(ui.accountView->selectionModel(), SIGNAL(selectionChanged(QItemSelection, QItemSelection)), SLOT(setWidgetStates()));
+ connect(ui.accountView->selectionModel(), &QItemSelectionModel::selectionChanged, this, &CoreAccountSettingsPage::setWidgetStates);
connect(ui.autoConnectAccount, SIGNAL(currentIndexChanged(int)), SLOT(widgetHasChanged()));
setWidgetStates();
}
initAutoWidgets();
- connect(ui.useQNetworkConfigurationManager, SIGNAL(toggled(bool)), SLOT(widgetHasChanged()));
- connect(ui.usePingTimeout, SIGNAL(toggled(bool)), SLOT(widgetHasChanged()));
- connect(ui.useNoTimeout, SIGNAL(toggled(bool)), SLOT(widgetHasChanged()));
+ connect(ui.useQNetworkConfigurationManager, &QAbstractButton::toggled, this, &CoreConnectionSettingsPage::widgetHasChanged);
+ connect(ui.usePingTimeout, &QAbstractButton::toggled, this, &CoreConnectionSettingsPage::widgetHasChanged);
+ connect(ui.useNoTimeout, &QAbstractButton::toggled, this, &CoreConnectionSettingsPage::widgetHasChanged);
}
ui.highlightNicksComboBox->addItem(tr("None"), QVariant(HighlightRuleManager::NoNick));
coreConnectionStateChanged(Client::isConnected()); // need a core connection!
- connect(Client::instance(), SIGNAL(coreConnectionStateChanged(bool)), this, SLOT(coreConnectionStateChanged(bool)));
+ connect(Client::instance(), &Client::coreConnectionStateChanged, this, &CoreHighlightSettingsPage::coreConnectionStateChanged);
connect(ui.highlightAdd, SIGNAL(clicked(bool)), this, SLOT(addNewHighlightRow()));
- connect(ui.highlightRemove, SIGNAL(clicked(bool)), this, SLOT(removeSelectedHighlightRows()));
- connect(ui.highlightImport, SIGNAL(clicked(bool)), this, SLOT(importRules()));
+ connect(ui.highlightRemove, &QAbstractButton::clicked, this, &CoreHighlightSettingsPage::removeSelectedHighlightRows);
+ connect(ui.highlightImport, &QAbstractButton::clicked, this, &CoreHighlightSettingsPage::importRules);
connect(ui.ignoredAdd, SIGNAL(clicked(bool)), this, SLOT(addNewIgnoredRow()));
- connect(ui.ignoredRemove, SIGNAL(clicked(bool)), this, SLOT(removeSelectedIgnoredRows()));
+ connect(ui.ignoredRemove, &QAbstractButton::clicked, this, &CoreHighlightSettingsPage::removeSelectedIgnoredRows);
// TODO: search for a better signal (one that emits everytime a selection has been changed for one item)
connect(ui.highlightTable,
- SIGNAL(itemClicked(QTableWidgetItem * )),
+ &QTableWidget::itemClicked,
this,
- SLOT(selectHighlightRow(QTableWidgetItem * )));
+ &CoreHighlightSettingsPage::selectHighlightRow);
connect(ui.ignoredTable,
- SIGNAL(itemClicked(QTableWidgetItem * )),
+ &QTableWidget::itemClicked,
this,
- SLOT(selectIgnoredRow(QTableWidgetItem * )));
+ &CoreHighlightSettingsPage::selectIgnoredRow);
// Update the "Case sensitive" checkbox
connect(ui.highlightNicksComboBox,
SLOT(highlightNicksChanged(int)));
connect(ui.highlightNicksComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(widgetHasChanged()));
- connect(ui.nicksCaseSensitive, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
+ connect(ui.nicksCaseSensitive, &QAbstractButton::clicked, this, &CoreHighlightSettingsPage::widgetHasChanged);
- connect(ui.highlightAdd, SIGNAL(clicked()), this, SLOT(widgetHasChanged()));
- connect(ui.highlightRemove, SIGNAL(clicked()), this, SLOT(widgetHasChanged()));
+ connect(ui.highlightAdd, &QAbstractButton::clicked, this, &CoreHighlightSettingsPage::widgetHasChanged);
+ connect(ui.highlightRemove, &QAbstractButton::clicked, this, &CoreHighlightSettingsPage::widgetHasChanged);
- connect(ui.ignoredAdd, SIGNAL(clicked()), this, SLOT(widgetHasChanged()));
- connect(ui.ignoredRemove, SIGNAL(clicked()), this, SLOT(widgetHasChanged()));
+ connect(ui.ignoredAdd, &QAbstractButton::clicked, this, &CoreHighlightSettingsPage::widgetHasChanged);
+ connect(ui.ignoredRemove, &QAbstractButton::clicked, this, &CoreHighlightSettingsPage::widgetHasChanged);
connect(ui.highlightTable,
- SIGNAL(itemChanged(QTableWidgetItem * )),
+ &QTableWidget::itemChanged,
this,
- SLOT(highlightTableChanged(QTableWidgetItem * )));
+ &CoreHighlightSettingsPage::highlightTableChanged);
connect(ui.ignoredTable,
- SIGNAL(itemChanged(QTableWidgetItem * )),
+ &QTableWidget::itemChanged,
this,
- SLOT(ignoredTableChanged(QTableWidgetItem * )));
+ &CoreHighlightSettingsPage::ignoredTableChanged);
- connect(Client::instance(), SIGNAL(connected()), this, SLOT(clientConnected()));
+ connect(Client::instance(), &Client::connected, this, &CoreHighlightSettingsPage::clientConnected);
// Warning icon
ui.coreUnsupportedIcon->setPixmap(icon::get("dialog-warning").pixmap(16));
void CoreHighlightSettingsPage::clientConnected()
{
- connect(Client::highlightRuleManager(), SIGNAL(updated()), SLOT(revert()));
+ connect(Client::highlightRuleManager(), &SyncableObject::updated, this, &CoreHighlightSettingsPage::revert);
}
connect(ui.portSelectionMode, SIGNAL(currentIndexChanged(int)), SLOT(updateWidgetStates()));
updateWidgetStates();
- connect(Client::instance(), SIGNAL(coreConnectionStateChanged(bool)), SLOT(onClientConfigChanged()));
+ connect(Client::instance(), &Client::coreConnectionStateChanged, this, &DccSettingsPage::onClientConfigChanged);
setClientConfig(Client::dccConfig());
}
void DccSettingsPage::onClientConfigChanged()
{
if (Client::isConnected() && Client::dccConfig() && !Client::dccConfig()->isInitialized()) {
- connect(Client::dccConfig(), SIGNAL(initDone()), SLOT(onClientConfigChanged()));
+ connect(Client::dccConfig(), &SyncableObject::initDone, this, &DccSettingsPage::onClientConfigChanged);
}
else {
setClientConfig(Client::isConnected() ? Client::dccConfig() : nullptr);
}
connect(ui.add, SIGNAL(clicked(bool)), this, SLOT(addNewRow()));
- connect(ui.remove, SIGNAL(clicked(bool)), this, SLOT(removeSelectedRows()));
+ connect(ui.remove, &QAbstractButton::clicked, this, &HighlightSettingsPage::removeSelectedRows);
//TODO: search for a better signal (one that emits everytime a selection has been changed for one item)
- connect(ui.highlightTable, SIGNAL(itemClicked(QTableWidgetItem *)), this, SLOT(selectRow(QTableWidgetItem *)));
-
- connect(ui.highlightAllNicks, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
- connect(ui.highlightCurrentNick, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
- connect(ui.highlightNoNick, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
- connect(ui.nicksCaseSensitive, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
- connect(ui.add, SIGNAL(clicked()), this, SLOT(widgetHasChanged()));
- connect(ui.remove, SIGNAL(clicked()), this, SLOT(widgetHasChanged()));
- connect(ui.highlightTable, SIGNAL(itemChanged(QTableWidgetItem *)), this, SLOT(tableChanged(QTableWidgetItem *)));
+ connect(ui.highlightTable, &QTableWidget::itemClicked, this, &HighlightSettingsPage::selectRow);
+
+ connect(ui.highlightAllNicks, &QAbstractButton::clicked, this, &HighlightSettingsPage::widgetHasChanged);
+ connect(ui.highlightCurrentNick, &QAbstractButton::clicked, this, &HighlightSettingsPage::widgetHasChanged);
+ connect(ui.highlightNoNick, &QAbstractButton::clicked, this, &HighlightSettingsPage::widgetHasChanged);
+ connect(ui.nicksCaseSensitive, &QAbstractButton::clicked, this, &HighlightSettingsPage::widgetHasChanged);
+ connect(ui.add, &QAbstractButton::clicked, this, &HighlightSettingsPage::widgetHasChanged);
+ connect(ui.remove, &QAbstractButton::clicked, this, &HighlightSettingsPage::widgetHasChanged);
+ connect(ui.highlightTable, &QTableWidget::itemChanged, this, &HighlightSettingsPage::tableChanged);
}
ui.deleteIdentity->setIcon(icon::get("list-remove-user"));
coreConnectionStateChanged(Client::isConnected()); // need a core connection!
- connect(Client::instance(), SIGNAL(coreConnectionStateChanged(bool)), this, SLOT(coreConnectionStateChanged(bool)));
+ connect(Client::instance(), &Client::coreConnectionStateChanged, this, &IdentitiesSettingsPage::coreConnectionStateChanged);
- connect(Client::instance(), SIGNAL(identityCreated(IdentityId)), this, SLOT(clientIdentityCreated(IdentityId)));
- connect(Client::instance(), SIGNAL(identityRemoved(IdentityId)), this, SLOT(clientIdentityRemoved(IdentityId)));
+ connect(Client::instance(), &Client::identityCreated, this, &IdentitiesSettingsPage::clientIdentityCreated);
+ connect(Client::instance(), &Client::identityRemoved, this, &IdentitiesSettingsPage::clientIdentityRemoved);
- connect(ui.identityEditor, SIGNAL(widgetHasChanged()), this, SLOT(widgetHasChanged()));
+ connect(ui.identityEditor, &IdentityEditWidget::widgetHasChanged, this, &IdentitiesSettingsPage::widgetHasChanged);
#ifdef HAVE_SSL
- connect(ui.identityEditor, SIGNAL(requestEditSsl()), this, SLOT(continueUnsecured()));
+ connect(ui.identityEditor, &IdentityEditWidget::requestEditSsl, this, &IdentitiesSettingsPage::continueUnsecured);
#endif
currentId = 0;
#endif
insertIdentity(identity);
#ifdef HAVE_SSL
- connect(identity, SIGNAL(sslSettingsUpdated()), this, SLOT(clientIdentityUpdated()));
+ connect(identity, &CertIdentity::sslSettingsUpdated, this, &IdentitiesSettingsPage::clientIdentityUpdated);
#endif
- connect(Client::identity(id), SIGNAL(updatedRemotely()), this, SLOT(clientIdentityUpdated()));
+ connect(Client::identity(id), &SyncableObject::updatedRemotely, this, &IdentitiesSettingsPage::clientIdentityUpdated);
}
ui.progressBar->setMaximum(numevents);
ui.progressBar->setValue(0);
- connect(Client::instance(), SIGNAL(identityCreated(IdentityId)), this, SLOT(clientEvent()));
- connect(Client::instance(), SIGNAL(identityRemoved(IdentityId)), this, SLOT(clientEvent()));
+ connect(Client::instance(), &Client::identityCreated, this, &SaveIdentitiesDlg::clientEvent);
+ connect(Client::instance(), &Client::identityRemoved, this, &SaveIdentitiesDlg::clientEvent);
foreach(CertIdentity *id, toCreate) {
Client::createIdentity(*id);
numevents--;
continue;
}
- connect(cid, SIGNAL(updatedRemotely()), this, SLOT(clientEvent()));
+ connect(cid, &SyncableObject::updatedRemotely, this, &SaveIdentitiesDlg::clientEvent);
Client::updateIdentity(id->id(), id->toVariantMap());
#ifdef HAVE_SSL
id->requestUpdateSslSettings();
ui.nickDown->setIcon(icon::get("go-down"));
// We need to know whenever the state of input widgets changes...
- connect(ui.realName, SIGNAL(textEdited(const QString &)), this, SIGNAL(widgetHasChanged()));
- connect(ui.nicknameList, SIGNAL(itemChanged(QListWidgetItem *)), this, SIGNAL(widgetHasChanged()));
- connect(ui.awayNick, SIGNAL(textEdited(const QString &)), this, SIGNAL(widgetHasChanged()));
- connect(ui.awayReason, SIGNAL(textEdited(const QString &)), this, SIGNAL(widgetHasChanged()));
- connect(ui.autoAwayEnabled, SIGNAL(clicked(bool)), this, SIGNAL(widgetHasChanged()));
+ connect(ui.realName, &QLineEdit::textEdited, this, &IdentityEditWidget::widgetHasChanged);
+ connect(ui.nicknameList, &QListWidget::itemChanged, this, &IdentityEditWidget::widgetHasChanged);
+ connect(ui.awayNick, &QLineEdit::textEdited, this, &IdentityEditWidget::widgetHasChanged);
+ connect(ui.awayReason, &QLineEdit::textEdited, this, &IdentityEditWidget::widgetHasChanged);
+ connect(ui.autoAwayEnabled, &QGroupBox::clicked, this, &IdentityEditWidget::widgetHasChanged);
connect(ui.autoAwayTime, SIGNAL(valueChanged(int)), this, SIGNAL(widgetHasChanged()));
- connect(ui.autoAwayReason, SIGNAL(textEdited(const QString &)), this, SIGNAL(widgetHasChanged()));
- connect(ui.autoAwayReasonEnabled, SIGNAL(clicked(bool)), this, SIGNAL(widgetHasChanged()));
- connect(ui.detachAwayEnabled, SIGNAL(clicked(bool)), this, SIGNAL(widgetHasChanged()));
- connect(ui.detachAwayReason, SIGNAL(textEdited(const QString &)), this, SIGNAL(widgetHasChanged()));
- connect(ui.ident, SIGNAL(textEdited(const QString &)), this, SIGNAL(widgetHasChanged()));
- connect(ui.kickReason, SIGNAL(textEdited(const QString &)), this, SIGNAL(widgetHasChanged()));
- connect(ui.partReason, SIGNAL(textEdited(const QString &)), this, SIGNAL(widgetHasChanged()));
- connect(ui.quitReason, SIGNAL(textEdited(const QString &)), this, SIGNAL(widgetHasChanged()));
+ connect(ui.autoAwayReason, &QLineEdit::textEdited, this, &IdentityEditWidget::widgetHasChanged);
+ connect(ui.autoAwayReasonEnabled, &QAbstractButton::clicked, this, &IdentityEditWidget::widgetHasChanged);
+ connect(ui.detachAwayEnabled, &QGroupBox::clicked, this, &IdentityEditWidget::widgetHasChanged);
+ connect(ui.detachAwayReason, &QLineEdit::textEdited, this, &IdentityEditWidget::widgetHasChanged);
+ connect(ui.ident, &QLineEdit::textEdited, this, &IdentityEditWidget::widgetHasChanged);
+ connect(ui.kickReason, &QLineEdit::textEdited, this, &IdentityEditWidget::widgetHasChanged);
+ connect(ui.partReason, &QLineEdit::textEdited, this, &IdentityEditWidget::widgetHasChanged);
+ connect(ui.quitReason, &QLineEdit::textEdited, this, &IdentityEditWidget::widgetHasChanged);
setWidgetStates();
- connect(ui.nicknameList, SIGNAL(itemSelectionChanged()), this, SLOT(setWidgetStates()));
+ connect(ui.nicknameList, &QListWidget::itemSelectionChanged, this, &IdentityEditWidget::setWidgetStates);
- connect(ui.continueUnsecured, SIGNAL(clicked()), this, SIGNAL(requestEditSsl()));
+ connect(ui.continueUnsecured, &QAbstractButton::clicked, this, &IdentityEditWidget::requestEditSsl);
// we would need this if we enabled drag and drop in the nicklist...
//connect(ui.nicknameList, SIGNAL(rowsInserted(const QModelIndex &, int, int)), this, SLOT(setWidgetStates()));
: QAbstractItemModel(parent)
{
// we need this signal for future connects to reset the data;
- connect(Client::instance(), SIGNAL(connected()), this, SLOT(clientConnected()));
- connect(Client::instance(), SIGNAL(disconnected()), this, SLOT(clientDisconnected()));
+ connect(Client::instance(), &Client::connected, this, &IgnoreListModel::clientConnected);
+ connect(Client::instance(), &Client::disconnected, this, &IgnoreListModel::clientDisconnected);
if (Client::isConnected())
clientConnected();
if (Client::ignoreListManager()->isInitialized())
initDone();
else
- connect(Client::ignoreListManager(), SIGNAL(initDone()), SLOT(initDone()));
+ connect(Client::ignoreListManager(), &SyncableObject::initDone, this, &IgnoreListModel::initDone);
}
ui.ignoreListView->viewport()->setAttribute(Qt::WA_Hover);
ui.ignoreListView->viewport()->setMouseTracking(true);
- connect(ui.ignoreListView->selectionModel(), SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)), this, SLOT(selectionChanged(const QItemSelection &, const QItemSelection &)));
+ connect(ui.ignoreListView->selectionModel(), &QItemSelectionModel::selectionChanged, this, &IgnoreListSettingsPage::selectionChanged);
connect(ui.newIgnoreRuleButton, SIGNAL(clicked()), this, SLOT(newIgnoreRule()));
- connect(ui.deleteIgnoreRuleButton, SIGNAL(clicked()), this, SLOT(deleteSelectedIgnoreRule()));
- connect(ui.editIgnoreRuleButton, SIGNAL(clicked()), this, SLOT(editSelectedIgnoreRule()));
+ connect(ui.deleteIgnoreRuleButton, &QAbstractButton::clicked, this, &IgnoreListSettingsPage::deleteSelectedIgnoreRule);
+ connect(ui.editIgnoreRuleButton, &QAbstractButton::clicked, this, &IgnoreListSettingsPage::editSelectedIgnoreRule);
connect(&_ignoreListModel, SIGNAL(configChanged(bool)), this, SLOT(setChangedState(bool)));
- connect(&_ignoreListModel, SIGNAL(modelReady(bool)), this, SLOT(enableDialog(bool)));
+ connect(&_ignoreListModel, &IgnoreListModel::modelReady, this, &IgnoreListSettingsPage::enableDialog);
enableDialog(_ignoreListModel.isReady());
}
else
ui.scopeRuleTextEdit->setPlainText(item.scopeRule());
- connect(ui.ignoreRuleLineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(widgetHasChanged()));
- connect(ui.scopeRuleTextEdit, SIGNAL(textChanged()), this, SLOT(widgetHasChanged()));
+ connect(ui.ignoreRuleLineEdit, &QLineEdit::textChanged, this, &IgnoreListEditDlg::widgetHasChanged);
+ connect(ui.scopeRuleTextEdit, &QPlainTextEdit::textChanged, this, &IgnoreListEditDlg::widgetHasChanged);
connect(&_typeButtonGroup, SIGNAL(buttonClicked(int)), this, SLOT(widgetHasChanged()));
connect(&_strictnessButtonGroup, SIGNAL(buttonClicked(int)), this, SLOT(widgetHasChanged()));
connect(&_scopeButtonGroup, SIGNAL(buttonClicked(int)), this, SLOT(widgetHasChanged()));
- connect(ui.isRegExCheckBox, SIGNAL(stateChanged(int)), this, SLOT(widgetHasChanged()));
- connect(ui.isActiveCheckBox, SIGNAL(stateChanged(int)), this, SLOT(widgetHasChanged()));
+ connect(ui.isRegExCheckBox, &QCheckBox::stateChanged, this, &IgnoreListEditDlg::widgetHasChanged);
+ connect(ui.isActiveCheckBox, &QCheckBox::stateChanged, this, &IgnoreListEditDlg::widgetHasChanged);
- connect(ui.buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()), this, SLOT(aboutToAccept()));
+ connect(ui.buttonBox->button(QDialogButtonBox::Ok), &QAbstractButton::clicked, this, &IgnoreListEditDlg::aboutToAccept);
widgetHasChanged();
}
setLayout(layout);
- connect(_keyButton, SIGNAL(clicked()), SLOT(startRecording()));
- connect(_keyButton, SIGNAL(clicked()), SIGNAL(clicked()));
- connect(_clearButton, SIGNAL(clicked()), SLOT(clear()));
- connect(_clearButton, SIGNAL(clicked()), SIGNAL(clicked()));
+ connect(_keyButton, &QAbstractButton::clicked, this, &KeySequenceWidget::startRecording);
+ connect(_keyButton, &QAbstractButton::clicked, this, &KeySequenceWidget::clicked);
+ connect(_clearButton, &QAbstractButton::clicked, this, &KeySequenceWidget::clear);
+ connect(_clearButton, &QAbstractButton::clicked, this, &KeySequenceWidget::clicked);
}
currentId = 0;
setEnabled(Client::isConnected()); // need a core connection!
setWidgetStates();
- connect(Client::instance(), SIGNAL(coreConnectionStateChanged(bool)), this, SLOT(coreConnectionStateChanged(bool)));
- connect(Client::instance(), SIGNAL(networkCreated(NetworkId)), this, SLOT(clientNetworkAdded(NetworkId)));
- connect(Client::instance(), SIGNAL(networkRemoved(NetworkId)), this, SLOT(clientNetworkRemoved(NetworkId)));
- connect(Client::instance(), SIGNAL(identityCreated(IdentityId)), this, SLOT(clientIdentityAdded(IdentityId)));
- connect(Client::instance(), SIGNAL(identityRemoved(IdentityId)), this, SLOT(clientIdentityRemoved(IdentityId)));
+ connect(Client::instance(), &Client::coreConnectionStateChanged, this, &NetworksSettingsPage::coreConnectionStateChanged);
+ connect(Client::instance(), &Client::networkCreated, this, &NetworksSettingsPage::clientNetworkAdded);
+ connect(Client::instance(), &Client::networkRemoved, this, &NetworksSettingsPage::clientNetworkRemoved);
+ connect(Client::instance(), &Client::identityCreated, this, &NetworksSettingsPage::clientIdentityAdded);
+ connect(Client::instance(), &Client::identityRemoved, this, &NetworksSettingsPage::clientIdentityRemoved);
connect(ui.identityList, SIGNAL(currentIndexChanged(int)), this, SLOT(widgetHasChanged()));
//connect(ui.randomServer, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
- connect(ui.performEdit, SIGNAL(textChanged()), this, SLOT(widgetHasChanged()));
- connect(ui.sasl, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
- connect(ui.saslAccount, SIGNAL(textEdited(QString)), this, SLOT(widgetHasChanged()));
- connect(ui.saslPassword, SIGNAL(textEdited(QString)), this, SLOT(widgetHasChanged()));
- connect(ui.autoIdentify, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
- connect(ui.autoIdentifyService, SIGNAL(textEdited(const QString &)), this, SLOT(widgetHasChanged()));
- connect(ui.autoIdentifyPassword, SIGNAL(textEdited(const QString &)), this, SLOT(widgetHasChanged()));
- connect(ui.useCustomEncodings, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
+ connect(ui.performEdit, &QTextEdit::textChanged, this, &NetworksSettingsPage::widgetHasChanged);
+ connect(ui.sasl, &QGroupBox::clicked, this, &NetworksSettingsPage::widgetHasChanged);
+ connect(ui.saslAccount, &QLineEdit::textEdited, this, &NetworksSettingsPage::widgetHasChanged);
+ connect(ui.saslPassword, &QLineEdit::textEdited, this, &NetworksSettingsPage::widgetHasChanged);
+ connect(ui.autoIdentify, &QGroupBox::clicked, this, &NetworksSettingsPage::widgetHasChanged);
+ connect(ui.autoIdentifyService, &QLineEdit::textEdited, this, &NetworksSettingsPage::widgetHasChanged);
+ connect(ui.autoIdentifyPassword, &QLineEdit::textEdited, this, &NetworksSettingsPage::widgetHasChanged);
+ connect(ui.useCustomEncodings, &QGroupBox::clicked, this, &NetworksSettingsPage::widgetHasChanged);
connect(ui.sendEncoding, SIGNAL(currentIndexChanged(int)), this, SLOT(widgetHasChanged()));
connect(ui.recvEncoding, SIGNAL(currentIndexChanged(int)), this, SLOT(widgetHasChanged()));
connect(ui.serverEncoding, SIGNAL(currentIndexChanged(int)), this, SLOT(widgetHasChanged()));
- connect(ui.autoReconnect, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
+ connect(ui.autoReconnect, &QGroupBox::clicked, this, &NetworksSettingsPage::widgetHasChanged);
connect(ui.reconnectInterval, SIGNAL(valueChanged(int)), this, SLOT(widgetHasChanged()));
connect(ui.reconnectRetries, SIGNAL(valueChanged(int)), this, SLOT(widgetHasChanged()));
- connect(ui.unlimitedRetries, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
- connect(ui.rejoinOnReconnect, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
+ connect(ui.unlimitedRetries, &QAbstractButton::clicked, this, &NetworksSettingsPage::widgetHasChanged);
+ connect(ui.rejoinOnReconnect, &QAbstractButton::clicked, this, &NetworksSettingsPage::widgetHasChanged);
// Core features can change during a reconnect. Always connect these here, delaying testing for
// the core feature flag in load().
- connect(ui.useCustomMessageRate, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
+ connect(ui.useCustomMessageRate, &QGroupBox::clicked, this, &NetworksSettingsPage::widgetHasChanged);
connect(ui.messageRateBurstSize, SIGNAL(valueChanged(int)), this, SLOT(widgetHasChanged()));
connect(ui.messageRateDelay, SIGNAL(valueChanged(double)), this, SLOT(widgetHasChanged()));
- connect(ui.unlimitedMessageRate, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
+ connect(ui.unlimitedMessageRate, &QAbstractButton::clicked, this, &NetworksSettingsPage::widgetHasChanged);
// Add additional widgets here
//connect(ui., SIGNAL(), this, SLOT(widgetHasChanged()));
void NetworksSettingsPage::clientIdentityAdded(IdentityId id)
{
const Identity *identity = Client::identity(id);
- connect(identity, SIGNAL(updatedRemotely()), this, SLOT(clientIdentityUpdated()));
+ connect(identity, &SyncableObject::updatedRemotely, this, &NetworksSettingsPage::clientIdentityUpdated);
QString name = identity->identityName();
for (int j = 0; j < ui.identityList->count(); j++) {
{
insertNetwork(id);
//connect(Client::network(id), SIGNAL(updatedRemotely()), this, SLOT(clientNetworkUpdated()));
- connect(Client::network(id), SIGNAL(configChanged()), this, SLOT(clientNetworkUpdated()));
+ connect(Client::network(id), &Network::configChanged, this, &NetworksSettingsPage::clientNetworkUpdated);
- connect(Client::network(id), SIGNAL(connectionStateSet(Network::ConnectionState)), this, SLOT(networkConnectionStateChanged(Network::ConnectionState)));
- connect(Client::network(id), SIGNAL(connectionError(const QString &)), this, SLOT(networkConnectionError(const QString &)));
+ connect(Client::network(id), &Network::connectionStateSet, this, &NetworksSettingsPage::networkConnectionStateChanged);
+ connect(Client::network(id), &Network::connectionError, this, &NetworksSettingsPage::networkConnectionError);
// Handle capability changes in case a server dis/connects with the settings window open.
- connect(Client::network(id), SIGNAL(capAdded(const QString &)), this, SLOT(clientNetworkCapsUpdated()));
- connect(Client::network(id), SIGNAL(capRemoved(const QString &)), this, SLOT(clientNetworkCapsUpdated()));
+ connect(Client::network(id), &Network::capAdded, this, &NetworksSettingsPage::clientNetworkCapsUpdated);
+ connect(Client::network(id), &Network::capRemoved, this, &NetworksSettingsPage::clientNetworkCapsUpdated);
}
// this is only needed when the core supports SASL EXTERNAL
if (Client::isCoreFeatureEnabled(Quassel::Feature::SaslExternal)) {
if (_cid) {
- disconnect(_cid, SIGNAL(sslSettingsUpdated()), this, SLOT(sslUpdated()));
+ disconnect(_cid, &CertIdentity::sslSettingsUpdated, this, &NetworksSettingsPage::sslUpdated);
delete _cid;
}
_cid = new CertIdentity(*Client::identity(info.identity), this);
_cid->enableEditSsl(true);
- connect(_cid, SIGNAL(sslSettingsUpdated()), this, SLOT(sslUpdated()));
+ connect(_cid, &CertIdentity::sslSettingsUpdated, this, &NetworksSettingsPage::sslUpdated);
}
#endif
// just clear widgets
#ifdef HAVE_SSL
if (_cid) {
- disconnect(_cid, SIGNAL(sslSettingsUpdated()), this, SLOT(sslUpdated()));
+ disconnect(_cid, &CertIdentity::sslSettingsUpdated, this, &NetworksSettingsPage::sslUpdated);
delete _cid;
}
#endif
ui.useSSL->setIcon(icon::get("document-encrypt"));
// Whenever useSSL is toggled, update the port number if not changed from the default
- connect(ui.useSSL, SIGNAL(toggled(bool)), SLOT(updateSslPort(bool)));
+ connect(ui.useSSL, &QAbstractButton::toggled, this, &NetworkAddDlg::updateSslPort);
// Do NOT call updateSslPort when loading settings, otherwise port settings may be overriden.
// If useSSL is later changed to be checked by default, change port's default value, too.
if (Client::isCoreFeatureEnabled(Quassel::Feature::VerifyServerSSL)) {
// Synchronize requiring SSL with the use SSL checkbox
ui.sslVerify->setEnabled(ui.useSSL->isChecked());
- connect(ui.useSSL, SIGNAL(toggled(bool)), ui.sslVerify, SLOT(setEnabled(bool)));
+ connect(ui.useSSL, &QAbstractButton::toggled, ui.sslVerify, &QWidget::setEnabled);
} else {
// Core isn't new enough to allow requiring SSL; disable checkbox and uncheck
ui.sslVerify->setEnabled(false);
ui.useManual->setChecked(true);
ui.usePreset->setEnabled(false);
}
- connect(ui.networkName, SIGNAL(textChanged(const QString &)), SLOT(setButtonStates()));
- connect(ui.serverAddress, SIGNAL(textChanged(const QString &)), SLOT(setButtonStates()));
- connect(ui.usePreset, SIGNAL(toggled(bool)), SLOT(setButtonStates()));
- connect(ui.useManual, SIGNAL(toggled(bool)), SLOT(setButtonStates()));
+ connect(ui.networkName, &QLineEdit::textChanged, this, &NetworkAddDlg::setButtonStates);
+ connect(ui.serverAddress, &QLineEdit::textChanged, this, &NetworkAddDlg::setButtonStates);
+ connect(ui.usePreset, &QRadioButton::toggled, this, &NetworkAddDlg::setButtonStates);
+ connect(ui.useManual, &QRadioButton::toggled, this, &NetworkAddDlg::setButtonStates);
setButtonStates();
}
}
// Whenever useSSL is toggled, update the port number if not changed from the default
- connect(ui.useSSL, SIGNAL(toggled(bool)), SLOT(updateSslPort(bool)));
+ connect(ui.useSSL, &QAbstractButton::toggled, this, &ServerEditDlg::updateSslPort);
// Do NOT call updateSslPort when loading settings, otherwise port settings may be overriden.
// If useSSL is later changed to be checked by default, change port's default value, too.
if (Client::isCoreFeatureEnabled(Quassel::Feature::VerifyServerSSL)) {
// Synchronize requiring SSL with the use SSL checkbox
ui.sslVerify->setEnabled(ui.useSSL->isChecked());
- connect(ui.useSSL, SIGNAL(toggled(bool)), ui.sslVerify, SLOT(setEnabled(bool)));
+ connect(ui.useSSL, &QAbstractButton::toggled, ui.sslVerify, &QWidget::setEnabled);
} else {
// Core isn't new enough to allow requiring SSL; disable checkbox and uncheck
ui.sslVerify->setEnabled(false);
ui.progressBar->setMaximum(numevents);
ui.progressBar->setValue(0);
- connect(Client::instance(), SIGNAL(networkCreated(NetworkId)), this, SLOT(clientEvent()));
- connect(Client::instance(), SIGNAL(networkRemoved(NetworkId)), this, SLOT(clientEvent()));
+ connect(Client::instance(), &Client::networkCreated, this, &SaveNetworksDlg::clientEvent);
+ connect(Client::instance(), &Client::networkRemoved, this, &SaveNetworksDlg::clientEvent);
foreach(NetworkId id, toRemove) {
Client::removeNetwork(id);
continue;
}
// FIXME this only checks for one changed item rather than all!
- connect(net, SIGNAL(updatedRemotely()), this, SLOT(clientEvent()));
+ connect(net, &SyncableObject::updatedRemotely, this, &SaveNetworksDlg::clientEvent);
Client::updateNetwork(info);
}
}
ui.shortcutsView->sortByColumn(0, Qt::AscendingOrder);
ui.keySequenceWidget->setModel(_shortcutsModel);
- connect(ui.keySequenceWidget, SIGNAL(keySequenceChanged(QKeySequence, QModelIndex)), SLOT(keySequenceChanged(QKeySequence, QModelIndex)));
+ connect(ui.keySequenceWidget, &KeySequenceWidget::keySequenceChanged, this, &ShortcutsSettingsPage::keySequenceChanged);
- connect(ui.shortcutsView->selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)), SLOT(setWidgetStates()));
+ connect(ui.shortcutsView->selectionModel(), &QItemSelectionModel::currentChanged, this, &ShortcutsSettingsPage::setWidgetStates);
setWidgetStates();
- connect(ui.useDefault, SIGNAL(clicked(bool)), SLOT(toggledCustomOrDefault()));
- connect(ui.useCustom, SIGNAL(clicked(bool)), SLOT(toggledCustomOrDefault()));
+ connect(ui.useDefault, &QAbstractButton::clicked, this, &ShortcutsSettingsPage::toggledCustomOrDefault);
+ connect(ui.useCustom, &QAbstractButton::clicked, this, &ShortcutsSettingsPage::toggledCustomOrDefault);
connect(_shortcutsModel, SIGNAL(hasChanged(bool)), SLOT(setChangedState(bool)));
auto *layout = new QVBoxLayout(this);
_configWidget = new Sonnet::ConfigWidget(this);
layout->addWidget(_configWidget);
- connect(_configWidget, SIGNAL(configChanged()), SLOT(widgetHasChanged()));
+ connect(_configWidget, &Sonnet::ConfigWidget::configChanged, this, &SonnetSettingsPage::widgetHasChanged);
}
ui.upServer->setIcon(icon::get("go-up"));
ui.downServer->setIcon(icon::get("go-down"));
- connect(ui.networkNameEdit, SIGNAL(textEdited(const QString &)), this, SIGNAL(widgetHasChanged()));
- connect(ui.channelList, SIGNAL(textChanged()), this, SIGNAL(widgetHasChanged()));
+ connect(ui.networkNameEdit, &QLineEdit::textEdited, this, &SimpleNetworkEditor::widgetHasChanged);
+ connect(ui.channelList, &QTextEdit::textChanged, this, &SimpleNetworkEditor::widgetHasChanged);
}
connect(this, SIGNAL(visibilityChanged(bool)), this, SLOT(onVisibilityChanged(bool)));
connect(this, SIGNAL(modeChanged(Mode)), this, SLOT(onModeChanged(Mode)));
- connect(this, SIGNAL(stateChanged(State)), this, SLOT(onStateChanged(State)));
+ connect(this, &SystemTray::stateChanged, this, &StatusNotifierItem::onStateChanged);
trayMenu()->installEventFilter(this);
qWarning() << "Could not create temporary directory for themed tray icons!";
}
- connect(this, SIGNAL(iconsChanged()), this, SLOT(refreshIcons()));
+ connect(this, &SystemTray::iconsChanged, this, &StatusNotifierItem::refreshIcons);
refreshIcons();
// Our own SNI service
_statusNotifierItemDBus = new StatusNotifierItemDBus(this);
- connect(this, SIGNAL(currentIconNameChanged()), _statusNotifierItemDBus, SIGNAL(NewIcon()));
- connect(this, SIGNAL(currentIconNameChanged()), _statusNotifierItemDBus, SIGNAL(NewAttentionIcon()));
- connect(this, SIGNAL(toolTipChanged(QString, QString)), _statusNotifierItemDBus, SIGNAL(NewToolTip()));
+ connect(this, &SystemTray::currentIconNameChanged, _statusNotifierItemDBus, &StatusNotifierItemDBus::NewIcon);
+ connect(this, &SystemTray::currentIconNameChanged, _statusNotifierItemDBus, &StatusNotifierItemDBus::NewAttentionIcon);
+ connect(this, &SystemTray::toolTipChanged, _statusNotifierItemDBus, &StatusNotifierItemDBus::NewToolTip);
// Service watcher to keep track of the StatusNotifierWatcher service
_serviceWatcher = new QDBusServiceWatcher(kSniWatcherService,
QDBusConnection::sessionBus(),
QDBusServiceWatcher::WatchForOwnerChange,
this);
- connect(_serviceWatcher, SIGNAL(serviceOwnerChanged(QString, QString, QString)), SLOT(serviceChange(QString, QString, QString)));
+ connect(_serviceWatcher, &QDBusServiceWatcher::serviceOwnerChanged, this, &StatusNotifierItem::serviceChange);
// Client instance for StatusNotifierWatcher
_statusNotifierWatcher = new org::kde::StatusNotifierWatcher(kSniWatcherService,
kSniWatcherPath,
QDBusConnection::sessionBus(),
this);
- connect(_statusNotifierWatcher, SIGNAL(StatusNotifierHostRegistered()), SLOT(checkForRegisteredHosts()));
- connect(_statusNotifierWatcher, SIGNAL(StatusNotifierHostUnregistered()), SLOT(checkForRegisteredHosts()));
+ connect(_statusNotifierWatcher, &OrgKdeStatusNotifierWatcherInterface::StatusNotifierHostRegistered, this, &StatusNotifierItem::checkForRegisteredHosts);
+ connect(_statusNotifierWatcher, &OrgKdeStatusNotifierWatcherInterface::StatusNotifierHostUnregistered, this, &StatusNotifierItem::checkForRegisteredHosts);
// Client instance for notifications
_notificationsClient = new org::freedesktop::Notifications(kXdgNotificationsService,
kXdgNotificationsPath,
QDBusConnection::sessionBus(),
this);
- connect(_notificationsClient, SIGNAL(NotificationClosed(uint, uint)), SLOT(notificationClosed(uint, uint)));
- connect(_notificationsClient, SIGNAL(ActionInvoked(uint, QString)), SLOT(notificationInvoked(uint, QString)));
+ connect(_notificationsClient, &OrgFreedesktopNotificationsInterface::NotificationClosed, this, &StatusNotifierItem::notificationClosed);
+ connect(_notificationsClient, &OrgFreedesktopNotificationsInterface::ActionInvoked, this, &StatusNotifierItem::notificationInvoked);
if (_notificationsClient->isValid()) {
QStringList desktopCapabilities = _notificationsClient->GetCapabilities();
_trayMenu->addSeparator();
_trayMenu->addAction(_minimizeRestoreAction);
_trayMenu->addAction(coll->action("Quit"));
- connect(_trayMenu, SIGNAL(aboutToShow()), SLOT(trayMenuAboutToShow()));
+ connect(_trayMenu, &QMenu::aboutToShow, this, &SystemTray::trayMenuAboutToShow);
- connect(QtUi::instance(), SIGNAL(iconThemeRefreshed()), this, SIGNAL(iconsChanged()));
+ connect(QtUi::instance(), &QtUi::iconThemeRefreshed, this, &SystemTray::iconsChanged);
_blinkTimer.setInterval(1000);
_blinkTimer.setSingleShot(false);
- connect(&_blinkTimer, SIGNAL(timeout()), SLOT(onBlinkTimeout()));
+ connect(&_blinkTimer, &QTimer::timeout, this, &SystemTray::onBlinkTimeout);
}
{
_showBubbleBox = new QCheckBox(tr("Show a message in a popup"));
_showBubbleBox->setIcon(icon::get("dialog-information"));
- connect(_showBubbleBox, SIGNAL(toggled(bool)), this, SLOT(widgetChanged()));
+ connect(_showBubbleBox, &QAbstractButton::toggled, this, &ConfigWidget::widgetChanged);
auto *layout = new QHBoxLayout(this);
layout->addWidget(_showBubbleBox);
}
layout->addWidget(timeoutBox);
layout->addStretch(20);
- connect(enabledBox, SIGNAL(toggled(bool)), SLOT(widgetChanged()));
- connect(enabledBox, SIGNAL(toggled(bool)), timeoutBox, SLOT(setEnabled(bool)));
+ connect(enabledBox, &QAbstractButton::toggled, this, &ConfigWidget::widgetChanged);
+ connect(enabledBox, &QAbstractButton::toggled, timeoutBox, &QWidget::setEnabled);
connect(timeoutBox, SIGNAL(valueChanged(int)), SLOT(widgetChanged()));
}
ui.topicLineEdit->setLineWrapEnabled(true);
ui.topicLineEdit->installEventFilter(this);
- connect(ui.topicLabel, SIGNAL(clickableActivated(Clickable)), SLOT(clickableActivated(Clickable)));
- connect(ui.topicLineEdit, SIGNAL(noTextEntered()), SLOT(on_topicLineEdit_textEntered()));
+ connect(ui.topicLabel, &StyledLabel::clickableActivated, this, &TopicWidget::clickableActivated);
+ connect(ui.topicLineEdit, &MultiLineEdit::noTextEntered, this, &TopicWidget::on_topicLineEdit_textEntered);
UiSettings s("TopicWidget");
s.notify("DynamicResize", this, SLOT(updateResizeMode()));
disconnect(_model, nullptr, this, nullptr);
}
_model = model;
- connect(model, SIGNAL(dataChanged(QModelIndex, QModelIndex)),
- this, SLOT(dataChanged(QModelIndex, QModelIndex)));
- connect(model, SIGNAL(rowsAboutToBeRemoved(QModelIndex, int, int)),
- this, SLOT(rowsAboutToBeRemoved(QModelIndex, int, int)));
- connect(model, SIGNAL(rowsInserted(QModelIndex, int, int)),
- this, SLOT(rowsInserted(QModelIndex, int, int)));
+ connect(model, &QAbstractItemModel::dataChanged,
+ this, &AbstractItemView::dataChanged);
+ connect(model, &QAbstractItemModel::rowsAboutToBeRemoved,
+ this, &AbstractItemView::rowsAboutToBeRemoved);
+ connect(model, &QAbstractItemModel::rowsInserted,
+ this, &AbstractItemView::rowsInserted);
}
disconnect(_selectionModel, nullptr, this, nullptr);
}
_selectionModel = selectionModel;
- connect(selectionModel, SIGNAL(currentChanged(QModelIndex, QModelIndex)),
- this, SLOT(currentChanged(QModelIndex, QModelIndex)));
- connect(selectionModel, SIGNAL(selectionChanged(QItemSelection, QItemSelection)),
- this, SLOT(selectionChanged(QItemSelection, QItemSelection)));
+ connect(selectionModel, &QItemSelectionModel::currentChanged,
+ this, &AbstractItemView::currentChanged);
+ connect(selectionModel, &QItemSelectionModel::selectionChanged,
+ this, &AbstractItemView::selectionChanged);
}
widget->addAction(action);
}
- connect(action, SIGNAL(destroyed(QObject *)), SLOT(actionDestroyed(QObject *)));
+ connect(action, &QObject::destroyed, this, &ActionCollection::actionDestroyed);
if (_connectHovered)
- connect(action, SIGNAL(hovered()), SLOT(slotActionHovered()));
+ connect(action, &QAction::hovered, this, &ActionCollection::slotActionHovered);
if (_connectTriggered)
- connect(action, SIGNAL(triggered(bool)), SLOT(slotActionTriggered()));
+ connect(action, &QAction::triggered, this, &ActionCollection::slotActionTriggered);
emit inserted(action);
return action;
if (!_connectHovered) {
_connectHovered = true;
foreach(QAction* action, actions())
- connect(action, SIGNAL(hovered()), SLOT(slotActionHovered()));
+ connect(action, &QAction::hovered, this, &ActionCollection::slotActionHovered);
}
}
else if (QMetaMethod::fromSignal(&ActionCollection::actionTriggered) == signal) {
if (!_connectTriggered) {
_connectTriggered = true;
foreach(QAction* action, actions())
- connect(action, SIGNAL(triggered(bool)), SLOT(slotActionTriggered()));
+ connect(action, &QAction::triggered, this, &ActionCollection::slotActionTriggered);
}
}
if (!_associatedWidgets.contains(widget)) {
widget->addActions(actions());
_associatedWidgets.append(widget);
- connect(widget, SIGNAL(destroyed(QObject *)), SLOT(associatedWidgetDestroyed(QObject *)));
+ connect(widget, &QObject::destroyed, this, &ActionCollection::associatedWidgetDestroyed);
}
}
foreach(QAction *action, actions())
widget->removeAction(action);
_associatedWidgets.removeAll(widget);
- disconnect(widget, SIGNAL(destroyed(QObject *)), this, SLOT(associatedWidgetDestroyed(QObject *)));
+ disconnect(widget, &QObject::destroyed, this, &ActionCollection::associatedWidgetDestroyed);
}
BufferView::BufferView(QWidget *parent)
: TreeViewTouch(parent)
{
- connect(this, SIGNAL(collapsed(const QModelIndex &)), SLOT(storeExpandedState(const QModelIndex &)));
- connect(this, SIGNAL(expanded(const QModelIndex &)), SLOT(storeExpandedState(const QModelIndex &)));
+ connect(this, &QTreeView::collapsed, this, &BufferView::storeExpandedState);
+ connect(this, &QTreeView::expanded, this, &BufferView::storeExpandedState);
setSelectionMode(QAbstractItemView::ExtendedSelection);
disconnect(this, SIGNAL(activated(QModelIndex)), this, SLOT(joinChannel(QModelIndex)));
connect(this, SIGNAL(activated(QModelIndex)), SLOT(joinChannel(QModelIndex)));
#else
- disconnect(this, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(joinChannel(QModelIndex)));
- connect(this, SIGNAL(doubleClicked(QModelIndex)), SLOT(joinChannel(QModelIndex)));
+ disconnect(this, &QAbstractItemView::doubleClicked, this, &BufferView::joinChannel);
+ connect(this, &QAbstractItemView::doubleClicked, this, &BufferView::joinChannel);
#endif
}
showSection->setCheckable(true);
showSection->setChecked(!isColumnHidden(i));
showSection->setProperty("column", i);
- connect(showSection, SIGNAL(toggled(bool)), this, SLOT(toggleHeader(bool)));
+ connect(showSection, &QAction::toggled, this, &BufferView::toggleHeader);
header()->addAction(showSection);
}
- connect(model, SIGNAL(layoutChanged()), this, SLOT(on_layoutChanged()));
+ connect(model, &QAbstractItemModel::layoutChanged, this, &BufferView::on_layoutChanged);
// Make sure collapsation is correct after setting a model
// This might not be needed here, only in BufferView::setFilteredModel(). If issues arise, just
else {
auto *filter = new BufferViewFilter(model_, config);
setModel(filter);
- connect(filter, SIGNAL(configChanged()), this, SLOT(on_configChanged()));
+ connect(filter, &BufferViewFilter::configChanged, this, &BufferView::on_configChanged);
}
setConfig(config);
}
_config = config;
if (config) {
- connect(config, SIGNAL(networkIdSet(const NetworkId &)), this, SLOT(setRootIndexForNetworkId(const NetworkId &)));
+ connect(config, &BufferViewConfig::networkIdSet, this, &BufferView::setRootIndexForNetworkId);
setRootIndexForNetworkId(config->networkId());
}
else {
setObjectName("BufferViewDock-" + QString::number(config->bufferViewId()));
toggleViewAction()->setData(config->bufferViewId());
setAllowedAreas(Qt::RightDockWidgetArea|Qt::LeftDockWidgetArea);
- connect(config, SIGNAL(bufferViewNameSet(const QString &)), this, SLOT(bufferViewRenamed(const QString &)));
- connect(config, SIGNAL(configChanged()), SLOT(configChanged()));
+ connect(config, &BufferViewConfig::bufferViewNameSet, this, &BufferViewDock::bufferViewRenamed);
+ connect(config, &BufferViewConfig::configChanged, this, &BufferViewDock::configChanged);
updateTitle();
_widget->setLayout(new QVBoxLayout);
_filterEdit->setFocusPolicy(Qt::ClickFocus);
_filterEdit->installEventFilter(this);
_filterEdit->setPlaceholderText(tr("Search..."));
- connect(_filterEdit, SIGNAL(returnPressed()), SLOT(onFilterReturnPressed()));
+ connect(_filterEdit, &QLineEdit::returnPressed, this, &BufferViewDock::onFilterReturnPressed);
_widget->layout()->addWidget(_filterEdit);
QDockWidget::setWidget(_widget);
_widget->layout()->addWidget(newWidget);
_childWidget = newWidget;
- connect(_filterEdit, SIGNAL(textChanged(QString)), bufferView(), SLOT(filterTextChanged(QString)));
+ connect(_filterEdit, &QLineEdit::textChanged, bufferView(), &BufferView::filterTextChanged);
}
void BufferViewDock::activateFilter()
_enableEditMode.setCheckable(true);
_enableEditMode.setChecked(_editMode);
- connect(&_enableEditMode, SIGNAL(toggled(bool)), this, SLOT(enableEditMode(bool)));
+ connect(&_enableEditMode, &QAction::toggled, this, &BufferViewFilter::enableEditMode);
BufferSettings defaultSettings;
defaultSettings.notify("ServerNoticesTarget", this, SLOT(showServerQueriesChanged()));
else {
// we use a queued connection here since manipulating the connection list of a sending object
// doesn't seem to be such a good idea while executing a connected slots.
- connect(config, SIGNAL(initDone()), this, SLOT(configInitialized()), Qt::QueuedConnection);
+ connect(config, &SyncableObject::initDone, this, &BufferViewFilter::configInitialized, Qt::QueuedConnection);
invalidate();
}
}
return;
// connect(config(), SIGNAL(bufferViewNameSet(const QString &)), this, SLOT(invalidate()));
- connect(config(), SIGNAL(configChanged()), this, SLOT(invalidate()));
+ connect(config(), &BufferViewConfig::configChanged, this, &QSortFilterProxyModel::invalidate);
// connect(config(), SIGNAL(networkIdSet(const NetworkId &)), this, SLOT(invalidate()));
// connect(config(), SIGNAL(addNewBuffersAutomaticallySet(bool)), this, SLOT(invalidate()));
// connect(config(), SIGNAL(sortAlphabeticallySet(bool)), this, SLOT(invalidate()));
// connect(config(), SIGNAL(bufferRemoved(const BufferId &)), this, SLOT(invalidate()));
// connect(config(), SIGNAL(bufferPermanentlyRemoved(const BufferId &)), this, SLOT(invalidate()));
- disconnect(config(), SIGNAL(initDone()), this, SLOT(configInitialized()));
+ disconnect(config(), &SyncableObject::initDone, this, &BufferViewFilter::configInitialized);
setObjectName(config()->bufferViewName());
return;
}
- connect(overlay, SIGNAL(destroyed()), this, SLOT(overlayDestroyed()));
- connect(overlay, SIGNAL(hasChanged()), this, SLOT(invalidate()));
+ connect(overlay, &QObject::destroyed, this, &BufferViewOverlayFilter::overlayDestroyed);
+ connect(overlay, &BufferViewOverlay::hasChanged, this, &QSortFilterProxyModel::invalidate);
invalidate();
}
clearButton->setStyleSheet("QToolButton { border: none; padding: 0px; }");
clearButton->hide();
- connect(clearButton, SIGNAL(clicked()), this, SLOT(clear()));
- connect(this, SIGNAL(textChanged(const QString &)), this, SLOT(updateClearButton(const QString &)));
+ connect(clearButton, &QAbstractButton::clicked, this, &QLineEdit::clear);
+ connect(this, &QLineEdit::textChanged, this, &ClearableLineEdit::updateClearButton);
int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
setStyleSheet(QString("QLineEdit { padding-right: %1px; } ").arg(clearButton->sizeHint().width() + frameWidth + 1));
ColorButton::ColorButton(QWidget *parent) : QToolButton(parent)
{
setText("");
- connect(this, SIGNAL(clicked()), SLOT(chooseColor()));
+ connect(this, &QAbstractButton::clicked, this, &ColorButton::chooseColor);
}
emit layoutChanged();
if (sourceModel) {
- connect(sourceModel, SIGNAL(columnsAboutToBeInserted(const QModelIndex &, int, int)),
- this, SLOT(on_columnsAboutToBeInserted(const QModelIndex &, int, int)));
- connect(sourceModel, SIGNAL(columnsAboutToBeRemoved(const QModelIndex &, int, int)),
- this, SLOT(on_columnsAboutToBeRemoved(const QModelIndex &, int, int)));
- connect(sourceModel, SIGNAL(columnsInserted(const QModelIndex &, int, int)),
- this, SLOT(on_columnsInserted(const QModelIndex &, int, int)));
- connect(sourceModel, SIGNAL(columnsRemoved(const QModelIndex &, int, int)),
- this, SLOT(on_columnsRemoved(const QModelIndex &, int, int)));
-
- connect(sourceModel, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)),
- this, SLOT(on_dataChanged(const QModelIndex &, const QModelIndex &)));
+ connect(sourceModel, &QAbstractItemModel::columnsAboutToBeInserted,
+ this, &FlatProxyModel::on_columnsAboutToBeInserted);
+ connect(sourceModel, &QAbstractItemModel::columnsAboutToBeRemoved,
+ this, &FlatProxyModel::on_columnsAboutToBeRemoved);
+ connect(sourceModel, &QAbstractItemModel::columnsInserted,
+ this, &FlatProxyModel::on_columnsInserted);
+ connect(sourceModel, &QAbstractItemModel::columnsRemoved,
+ this, &FlatProxyModel::on_columnsRemoved);
+
+ connect(sourceModel, &QAbstractItemModel::dataChanged,
+ this, &FlatProxyModel::on_dataChanged);
// on_headerDataChanged(Qt::Orientation orientation, int first, int last)
- connect(sourceModel, SIGNAL(layoutAboutToBeChanged()),
- this, SLOT(on_layoutAboutToBeChanged()));
- connect(sourceModel, SIGNAL(layoutChanged()),
- this, SLOT(on_layoutChanged()));
+ connect(sourceModel, &QAbstractItemModel::layoutAboutToBeChanged,
+ this, &FlatProxyModel::on_layoutAboutToBeChanged);
+ connect(sourceModel, &QAbstractItemModel::layoutChanged,
+ this, &FlatProxyModel::on_layoutChanged);
- connect(sourceModel, SIGNAL(modelAboutToBeReset()),
- this, SLOT(on_modelAboutToBeReset()));
+ connect(sourceModel, &QAbstractItemModel::modelAboutToBeReset,
+ this, &FlatProxyModel::on_modelAboutToBeReset);
// void on_modelReset()
- connect(sourceModel, SIGNAL(rowsAboutToBeInserted(const QModelIndex &, int, int)),
- this, SLOT(on_rowsAboutToBeInserted(const QModelIndex &, int, int)));
- connect(sourceModel, SIGNAL(rowsAboutToBeRemoved(const QModelIndex &, int, int)),
- this, SLOT(on_rowsAboutToBeRemoved(const QModelIndex &, int, int)));
- connect(sourceModel, SIGNAL(rowsInserted(const QModelIndex &, int, int)),
- this, SLOT(on_rowsInserted(const QModelIndex &, int, int)));
- connect(sourceModel, SIGNAL(rowsRemoved(const QModelIndex &, int, int)),
- this, SLOT(on_rowsRemoved(const QModelIndex &, int, int)));
+ connect(sourceModel, &QAbstractItemModel::rowsAboutToBeInserted,
+ this, &FlatProxyModel::on_rowsAboutToBeInserted);
+ connect(sourceModel, &QAbstractItemModel::rowsAboutToBeRemoved,
+ this, &FlatProxyModel::on_rowsAboutToBeRemoved);
+ connect(sourceModel, &QAbstractItemModel::rowsInserted,
+ this, &FlatProxyModel::on_rowsInserted);
+ connect(sourceModel, &QAbstractItemModel::rowsRemoved,
+ this, &FlatProxyModel::on_rowsRemoved);
}
}
{
auto *layout = new QHBoxLayout(this);
QPushButton *chooseButton = new QPushButton(tr("Choose..."), this);
- connect(chooseButton, SIGNAL(clicked()), SLOT(chooseFont()));
+ connect(chooseButton, &QAbstractButton::clicked, this, &FontSelector::chooseFont);
layout->addWidget(_demo = new QLabel("Font"));
layout->addWidget(chooseButton);
// Prevent QTextHtmlImporter::appendNodeText from eating whitespace
document()->setDefaultStyleSheet("span { white-space: pre-wrap; }");
- connect(this, SIGNAL(textChanged()), this, SLOT(on_textChanged()));
+ connect(this, &QTextEdit::textChanged, this, &MultiLineEdit::on_textChanged);
_mircColorMap["00"] = "#ffffff";
_mircColorMap["01"] = "#000000";
auto action = menu->addAction(tr("Auto Spell Check"));
action->setCheckable(true);
action->setChecked(highlighter()->isActive());
- connect(action, SIGNAL(toggled(bool)), this, SLOT(setSpellCheckEnabled(bool)));
+ connect(action, &QAction::toggled, this, &MultiLineEdit::setSpellCheckEnabled);
menu->exec(event->globalPos());
delete menu;
: QObject(parent),
_actionCollection(new ActionCollection(this))
{
- connect(_actionCollection, SIGNAL(actionTriggered(QAction *)), SLOT(actionTriggered(QAction *)));
+ connect(_actionCollection, &ActionCollection::actionTriggered, this, &NetworkModelController::actionTriggered);
}
networks->setInsertPolicy(QComboBox::InsertAlphabetically);
password->setEchoMode(QLineEdit::Password);
- connect(buttonBox, SIGNAL(accepted()), SLOT(accept()));
- connect(buttonBox, SIGNAL(rejected()), SLOT(reject()));
- connect(channel, SIGNAL(textChanged(QString)), SLOT(on_channel_textChanged(QString)));
+ connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
+ connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
+ connect(channel, &QLineEdit::textChanged, this, &JoinDlg::on_channel_textChanged);
foreach(NetworkId id, Client::networkIds()) {
const Network *net = Client::network(id);
setAnimated(true);
- connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), SLOT(showContextMenu(const QPoint &)));
+ connect(this, &QWidget::customContextMenuRequested, this, &NickView::showContextMenu);
#if defined Q_OS_MACOS || defined Q_OS_WIN
// afaik this is better on Mac and Windows
connect(this, SIGNAL(activated(QModelIndex)), SLOT(startQuery(QModelIndex)));
#else
- connect(this, SIGNAL(doubleClicked(QModelIndex)), SLOT(startQuery(QModelIndex)));
+ connect(this, &QAbstractItemView::doubleClicked, this, &NickView::startQuery);
#endif
}
for (int i = 1; i < model()->columnCount(); i++)
setColumnHidden(i, true);
- connect(selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)), SIGNAL(selectionUpdated()));
- connect(selectionModel(), SIGNAL(selectionChanged(QItemSelection, QItemSelection)), SIGNAL(selectionUpdated()));
+ connect(selectionModel(), &QItemSelectionModel::currentChanged, this, &NickView::selectionUpdated);
+ connect(selectionModel(), &QItemSelectionModel::selectionChanged, this, &NickView::selectionUpdated);
}
ResizingStackedWidget::ResizingStackedWidget(QWidget *parent) : QStackedWidget(parent)
{
- connect(this, SIGNAL(currentChanged(int)), SLOT(indexChanged(int)));
+ connect(this, &QStackedWidget::currentChanged, this, &ResizingStackedWidget::indexChanged);
}
action(NetworkDisconnectAllWithDropdown)->setMenu(_networksDisconnectMenu);
action(NetworkDisconnectAllWithDropdown)->setEnabled(false);
- connect(Client::instance(), SIGNAL(networkCreated(NetworkId)), SLOT(networkCreated(NetworkId)));
- connect(Client::instance(), SIGNAL(networkRemoved(NetworkId)), SLOT(networkRemoved(NetworkId)));
+ connect(Client::instance(), &Client::networkCreated, this, &ToolBarActionProvider::networkCreated);
+ connect(Client::instance(), &Client::networkRemoved, this, &ToolBarActionProvider::networkRemoved);
updateStates();
}