modernize: Replace most remaining old-style connects by PMF ones
authorManuel Nickschas <sputnick@quassel-irc.org>
Wed, 12 Sep 2018 17:45:13 +0000 (19:45 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sun, 18 Nov 2018 10:06:43 +0000 (11:06 +0100)
Manually replace old-style connects (using the SIGNAL/SLOT macros)
by the much more efficient and typesafe pointer-to-member-function-
based ones.

This fixes the cases where clazy could not auto-migrate to the new
syntax for a variety of reasons. In most of the cases, we need to
remove overloads or explicitly select the desired one, because the
plain syntax cannot deal with overloads. Another issue is trying
to connect to signals in a baseclass that are only declared in a
derived class (which works with the old-style runtime connection
handling, but obviously no longer with the compile-time version).

Also do some selected cleanups in places.

96 files changed:
src/client/abstractmessageprocessor.h
src/client/bufferviewoverlay.cpp
src/client/client.cpp
src/client/clientauthhandler.cpp
src/client/coreconnection.cpp
src/client/coreconnection.h
src/client/execwrapper.cpp
src/client/networkmodel.cpp
src/common/authhandler.cpp
src/common/compressor.cpp
src/common/internalpeer.cpp
src/common/ircchannel.cpp
src/common/ircchannel.h
src/common/posixsignalwatcher.cpp
src/common/protocols/legacy/legacypeer.h
src/common/quassel.cpp
src/common/remotepeer.cpp
src/common/remotepeer.h
src/core/core.cpp
src/core/core.h
src/core/coreapplication.cpp
src/core/coreauthhandler.cpp
src/core/corebasichandler.cpp
src/core/corebasichandler.h
src/core/corenetwork.cpp
src/core/corenetwork.h
src/core/coresession.cpp
src/core/coresession.h
src/core/coretransfer.cpp
src/core/sessionthread.cpp
src/main/monoapplication.cpp
src/qtui/awaylogview.cpp
src/qtui/bufferwidget.cpp
src/qtui/chatitem.cpp
src/qtui/chatmonitorview.cpp
src/qtui/chatviewsearchbar.cpp
src/qtui/chatviewsearchcontroller.cpp
src/qtui/columnhandleitem.cpp
src/qtui/coreconfigwizard.cpp
src/qtui/coreconnectdlg.cpp
src/qtui/coreinfodlg.cpp
src/qtui/coresessionwidget.cpp
src/qtui/coresessionwidget.h
src/qtui/debugbufferviewoverlay.cpp
src/qtui/dockmanagernotificationbackend.cpp
src/qtui/inputwidget.cpp
src/qtui/knotificationbackend.cpp
src/qtui/mainwin.cpp
src/qtui/nicklistwidget.cpp
src/qtui/nicklistwidget.h
src/qtui/osxnotificationbackend.mm
src/qtui/qtui.cpp
src/qtui/qtuiapplication.cpp
src/qtui/qtuimessageprocessor.cpp
src/qtui/qtuimessageprocessor.h
src/qtui/settingsdlg.cpp
src/qtui/settingspagedlg.cpp
src/qtui/settingspages/aliasesmodel.cpp
src/qtui/settingspages/aliasesmodel.h
src/qtui/settingspages/aliasessettingspage.cpp
src/qtui/settingspages/appearancesettingspage.cpp
src/qtui/settingspages/backlogsettingspage.cpp
src/qtui/settingspages/bufferviewsettingspage.cpp
src/qtui/settingspages/chatmonitorsettingspage.cpp
src/qtui/settingspages/coreaccountsettingspage.cpp
src/qtui/settingspages/corehighlightsettingspage.cpp
src/qtui/settingspages/dccsettingspage.cpp
src/qtui/settingspages/highlightsettingspage.cpp
src/qtui/settingspages/identitiessettingspage.cpp
src/qtui/settingspages/identityeditwidget.cpp
src/qtui/settingspages/ignorelistmodel.cpp
src/qtui/settingspages/ignorelistmodel.h
src/qtui/settingspages/ignorelistsettingspage.cpp
src/qtui/settingspages/ignorelistsettingspage.h
src/qtui/settingspages/itemviewsettingspage.cpp
src/qtui/settingspages/networkssettingspage.cpp
src/qtui/settingspages/notificationssettingspage.cpp
src/qtui/settingspages/shortcutsmodel.cpp
src/qtui/settingspages/shortcutsmodel.h
src/qtui/settingspages/shortcutssettingspage.cpp
src/qtui/snorenotificationbackend.cpp
src/qtui/snorenotificationbackend.h
src/qtui/sslinfodlg.cpp
src/qtui/statusnotifieritem.cpp
src/qtui/statusnotifieritemdbus.h
src/qtui/systraynotificationbackend.cpp
src/qtui/systraynotificationbackend.h
src/qtui/taskbarnotificationbackend.cpp
src/uisupport/abstractnotificationbackend.h
src/uisupport/action.cpp
src/uisupport/bufferview.cpp
src/uisupport/bufferviewfilter.cpp
src/uisupport/nickview.cpp
src/uisupport/settingspage.h
src/uisupport/toolbaractionprovider.cpp
src/uisupport/toolbaractionprovider.h

index 1ac52fb..a1b3466 100644 (file)
@@ -37,6 +37,7 @@ public:
 public slots:
     virtual void process(Message &msg) = 0;
     virtual void process(QList<Message> &msgs) = 0;
 public slots:
     virtual void process(Message &msg) = 0;
     virtual void process(QList<Message> &msgs) = 0;
+    virtual void networkRemoved(NetworkId id) = 0;
 
 protected:
     // updateBufferActivity also sets the Message::Redirected flag which is later used
 
 protected:
     // updateBufferActivity also sets the Message::Redirected flag which is later used
index 0769435..02e5702 100644 (file)
@@ -109,10 +109,9 @@ void BufferViewOverlay::addView(int viewId)
         }
     }
     else {
         }
     }
     else {
-        disconnect(config, SIGNAL(initDone()), this, SLOT(viewInitialized()));
         // 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.
         // 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(viewInitialized()), Qt::QueuedConnection);
+        connect(config, &BufferViewConfig::initDone, this, selectOverload<>(&BufferViewOverlay::viewInitialized), Qt::QueuedConnection);
     }
     save();
 }
     }
     save();
 }
@@ -157,8 +156,6 @@ void BufferViewOverlay::viewInitialized(BufferViewConfig *config)
         qWarning() << "BufferViewOverlay::viewInitialized() received invalid view!";
         return;
     }
         qWarning() << "BufferViewOverlay::viewInitialized() received invalid view!";
         return;
     }
-    disconnect(config, SIGNAL(initDone()), this, SLOT(viewInitialized()));
-
     connect(config, &BufferViewConfig::configChanged, this, &BufferViewOverlay::update);
 
     // check if the view was removed in the meantime...
     connect(config, &BufferViewConfig::configChanged, this, &BufferViewOverlay::update);
 
     // check if the view was removed in the meantime...
index f4c5089..9126239 100644 (file)
@@ -81,7 +81,7 @@ Client::Client(std::unique_ptr<AbstractUi> ui, QObject *parent)
     connect(this, &Client::disconnected, mainUi(), &AbstractUi::disconnectedFromCore);
 
     connect(this, &Client::networkRemoved, _networkModel, &NetworkModel::networkRemoved);
     connect(this, &Client::disconnected, mainUi(), &AbstractUi::disconnectedFromCore);
 
     connect(this, &Client::networkRemoved, _networkModel, &NetworkModel::networkRemoved);
-    connect(this, SIGNAL(networkRemoved(NetworkId)), _messageProcessor, SLOT(networkRemoved(NetworkId)));
+    connect(this, &Client::networkRemoved, _messageProcessor, &AbstractMessageProcessor::networkRemoved);
 
     connect(backlogManager(), &ClientBacklogManager::messagesReceived, _messageModel, &MessageModel::messagesReceived);
     connect(coreConnection(), &CoreConnection::stateChanged, this, &Client::connectionStateChanged);
 
     connect(backlogManager(), &ClientBacklogManager::messagesReceived, _messageModel, &MessageModel::messagesReceived);
     connect(coreConnection(), &CoreConnection::stateChanged, this, &Client::connectionStateChanged);
@@ -530,7 +530,7 @@ void Client::setDisconnectedFromCore()
     while (netIter != _networks.end()) {
         Network *net = netIter.value();
         emit networkRemoved(net->networkId());
     while (netIter != _networks.end()) {
         Network *net = netIter.value();
         emit networkRemoved(net->networkId());
-        disconnect(net, SIGNAL(destroyed()), this, nullptr);
+        disconnect(net, &Network::destroyed, this, nullptr);
         netIter = _networks.erase(netIter);
         net->deleteLater();
     }
         netIter = _networks.erase(netIter);
         net->deleteLater();
     }
index 68f545e..668c4a4 100644 (file)
@@ -32,6 +32,7 @@
 #include "clientsettings.h"
 #include "logmessage.h"
 #include "peerfactory.h"
 #include "clientsettings.h"
 #include "logmessage.h"
 #include "peerfactory.h"
+#include "util.h"
 
 using namespace Protocol;
 
 
 using namespace Protocol;
 
@@ -132,7 +133,7 @@ void ClientAuthHandler::onSocketStateChanged(QAbstractSocket::SocketState socket
                 // The baseclass implementation will make sure to only send the signal once.
                 // However, we do want to prefer a potential socket error signal that may be on route already, so
                 // give this a chance to overtake us by spinning the loop...
                 // The baseclass implementation will make sure to only send the signal once.
                 // However, we do want to prefer a potential socket error signal that may be on route already, so
                 // give this a chance to overtake us by spinning the loop...
-                QTimer::singleShot(0, this, SLOT(onSocketDisconnected()));
+                QTimer::singleShot(0, this, &ClientAuthHandler::onSocketDisconnected);
             }
             break;
         default:
             }
             break;
         default:
@@ -214,9 +215,9 @@ void ClientAuthHandler::onSocketConnected()
 
     qDebug() << "Legacy core detected, switching to compatibility mode";
 
 
     qDebug() << "Legacy core detected, switching to compatibility mode";
 
-    RemotePeer *peer = PeerFactory::createPeer(PeerFactory::ProtoDescriptor(Protocol::LegacyProtocol, 0), this, socket(), Compressor::NoCompression, this);
+    auto *peer = PeerFactory::createPeer(PeerFactory::ProtoDescriptor(Protocol::LegacyProtocol, 0), this, socket(), Compressor::NoCompression, this);
     // Only needed for the legacy peer, as all others check the protocol version before instantiation
     // Only needed for the legacy peer, as all others check the protocol version before instantiation
-    connect(peer, SIGNAL(protocolVersionMismatch(int,int)), SLOT(onProtocolVersionMismatch(int,int)));
+    connect(peer, &RemotePeer::protocolVersionMismatch, this, &ClientAuthHandler::onProtocolVersionMismatch);
 
     setPeer(peer);
 }
 
     setPeer(peer);
 }
@@ -258,7 +259,7 @@ void ClientAuthHandler::onReadyRead()
     }
 
     if (peer->protocol() == Protocol::LegacyProtocol) {
     }
 
     if (peer->protocol() == Protocol::LegacyProtocol) {
-        connect(peer, SIGNAL(protocolVersionMismatch(int,int)), SLOT(onProtocolVersionMismatch(int,int)));
+        connect(peer, &RemotePeer::protocolVersionMismatch, this, &ClientAuthHandler::onProtocolVersionMismatch);
         _legacy = true;
     }
 
         _legacy = true;
     }
 
@@ -434,7 +435,7 @@ void ClientAuthHandler::checkAndEnableSsl(bool coreSupportsSsl)
         auto *sslSocket = qobject_cast<QSslSocket *>(socket());
         Q_ASSERT(sslSocket);
         connect(sslSocket, &QSslSocket::encrypted, this, &ClientAuthHandler::onSslSocketEncrypted);
         auto *sslSocket = qobject_cast<QSslSocket *>(socket());
         Q_ASSERT(sslSocket);
         connect(sslSocket, &QSslSocket::encrypted, this, &ClientAuthHandler::onSslSocketEncrypted);
-        connect(sslSocket, SIGNAL(sslErrors(QList<QSslError>)), SLOT(onSslErrors()));
+        connect(sslSocket, selectOverload<const QList<QSslError>&>(&QSslSocket::sslErrors), this, &ClientAuthHandler::onSslErrors);
         qDebug() << "Starting encryption...";
         sslSocket->flush();
         sslSocket->startClientEncryption();
         qDebug() << "Starting encryption...";
         sslSocket->flush();
         sslSocket->startClientEncryption();
index 982e439..e41ccdc 100644 (file)
@@ -386,28 +386,27 @@ void CoreConnection::connectToCurrentAccount()
 
     _authHandler = new ClientAuthHandler(currentAccount(), this);
 
 
     _authHandler = new ClientAuthHandler(currentAccount(), this);
 
-    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.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);
+    connect(_authHandler, &ClientAuthHandler::disconnected, this, &CoreConnection::coreSocketDisconnected);
+    connect(_authHandler, &ClientAuthHandler::connectionReady, this, &CoreConnection::onConnectionReady);
+    connect(_authHandler, &ClientAuthHandler::socketError, this, &CoreConnection::coreSocketError);
+    connect(_authHandler, &ClientAuthHandler::transferProgress, this, &CoreConnection::updateProgress);
+    connect(_authHandler, &ClientAuthHandler::requestDisconnect, this, selectOverload<const QString&, bool>(&CoreConnection::disconnectFromCore));
+
+    connect(_authHandler, &ClientAuthHandler::errorMessage, this, &CoreConnection::connectionError);
+    connect(_authHandler, &ClientAuthHandler::errorPopup, this, &CoreConnection::connectionErrorPopup, Qt::QueuedConnection);
+    connect(_authHandler, &ClientAuthHandler::statusMessage, this, &CoreConnection::connectionMsg);
+    connect(_authHandler, &ClientAuthHandler::encrypted, this, &CoreConnection::encrypted);
+    connect(_authHandler, &ClientAuthHandler::startCoreSetup, this, &CoreConnection::startCoreSetup);
+    connect(_authHandler, &ClientAuthHandler::coreSetupFailed, this, &CoreConnection::coreSetupFailed);
+    connect(_authHandler, &ClientAuthHandler::coreSetupSuccessful, this, &CoreConnection::coreSetupSuccess);
+    connect(_authHandler, &ClientAuthHandler::userAuthenticationRequired, this, &CoreConnection::userAuthenticationRequired);
+    connect(_authHandler, &ClientAuthHandler::handleNoSslInClient, this, &CoreConnection::handleNoSslInClient);
+    connect(_authHandler, &ClientAuthHandler::handleNoSslInCore, this, &CoreConnection::handleNoSslInCore);
 #ifdef HAVE_SSL
 #ifdef HAVE_SSL
-    connect(_authHandler.data(), &ClientAuthHandler::handleSslErrors, this, &CoreConnection::handleSslErrors);
+    connect(_authHandler, &ClientAuthHandler::handleSslErrors, this, &CoreConnection::handleSslErrors);
 #endif
 #endif
-
-    connect(_authHandler.data(), &ClientAuthHandler::loginSuccessful, this, &CoreConnection::onLoginSuccessful);
-    connect(_authHandler.data(), &ClientAuthHandler::handshakeComplete, this, &CoreConnection::onHandshakeComplete);
+    connect(_authHandler, &ClientAuthHandler::loginSuccessful, this, &CoreConnection::onLoginSuccessful);
+    connect(_authHandler, &ClientAuthHandler::handshakeComplete, this, &CoreConnection::onHandshakeComplete);
 
     setState(Connecting);
     _authHandler->connectToCore();
 
     setState(Connecting);
     _authHandler->connectToCore();
index 7902022..dff1f5a 100644 (file)
@@ -81,6 +81,7 @@ public slots:
     bool connectToCore(AccountId = 0);
     void reconnectToCore();
     void disconnectFromCore();
     bool connectToCore(AccountId = 0);
     void reconnectToCore();
     void disconnectFromCore();
+    void internalSessionStateReceived(const Protocol::SessionState &sessionState);
 
     void setupCore(const Protocol::SetupData &setupData);
 
 
     void setupCore(const Protocol::SetupData &setupData);
 
@@ -126,7 +127,6 @@ private slots:
 
     void loginToCore(const QString &user, const QString &password, bool remember); // for config wizard
     void syncToCore(const Protocol::SessionState &sessionState);
 
     void loginToCore(const QString &user, const QString &password, bool remember); // for config wizard
     void syncToCore(const Protocol::SessionState &sessionState);
-    void internalSessionStateReceived(const Protocol::SessionState &sessionState);
 
     void resetConnection(bool wantReconnect = false);
 
 
     void resetConnection(bool wantReconnect = false);
 
index c44b69c..67292df 100644 (file)
 #include "client.h"
 #include "messagemodel.h"
 #include "quassel.h"
 #include "client.h"
 #include "messagemodel.h"
 #include "quassel.h"
+#include "util.h"
 
 ExecWrapper::ExecWrapper(QObject *parent) : QObject(parent)
 {
     connect(&_process, &QProcess::readyReadStandardOutput, this, &ExecWrapper::processReadStdout);
     connect(&_process, &QProcess::readyReadStandardError, this, &ExecWrapper::processReadStderr);
 
 ExecWrapper::ExecWrapper(QObject *parent) : QObject(parent)
 {
     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(&_process, selectOverload<int, QProcess::ExitStatus>(&QProcess::finished), this, &ExecWrapper::processFinished);
+    connect(&_process, selectOverload<QProcess::ProcessError>(&QProcess::error), this, &ExecWrapper::processError);
 
     connect(this, &ExecWrapper::output, this, &ExecWrapper::postStdout);
     connect(this, &ExecWrapper::error, this, &ExecWrapper::postStderr);
 
     connect(this, &ExecWrapper::output, this, &ExecWrapper::postStdout);
     connect(this, &ExecWrapper::error, this, &ExecWrapper::postStderr);
index dca6ffe..223e09c 100644 (file)
@@ -46,8 +46,8 @@ NetworkItem::NetworkItem(const NetworkId &netid, AbstractTreeItem *parent)
     // 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);
     // 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, &NetworkItem::networkDataChanged, this, &AbstractTreeItem::dataChanged);
-    connect(this, &AbstractTreeItem::beginRemoveChilds, this, &NetworkItem::onBeginRemoveChilds);
+    connect(this, &NetworkItem::networkDataChanged, this, &NetworkItem::dataChanged);
+    connect(this, &NetworkItem::beginRemoveChilds, this, &NetworkItem::onBeginRemoveChilds);
 }
 
 
 }
 
 
@@ -115,9 +115,9 @@ BufferItem *NetworkItem::bufferItem(const BufferInfo &bufferInfo)
     case BufferInfo::StatusBuffer:
         _statusBufferItem = new StatusBufferItem(bufferInfo, this);
         bufferItem = _statusBufferItem;
     case BufferInfo::StatusBuffer:
         _statusBufferItem = new StatusBufferItem(bufferInfo, this);
         bufferItem = _statusBufferItem;
-        disconnect(this, &NetworkItem::networkDataChanged, this, &AbstractTreeItem::dataChanged);
-        connect(this, &NetworkItem::networkDataChanged, bufferItem, &AbstractTreeItem::dataChanged);
-        connect(bufferItem, &AbstractTreeItem::dataChanged, this, &AbstractTreeItem::dataChanged);
+        disconnect(this, &NetworkItem::networkDataChanged, this, &NetworkItem::dataChanged);
+        connect(this, &NetworkItem::networkDataChanged, bufferItem, &BufferItem::dataChanged);
+        connect(bufferItem, &BufferItem::dataChanged, this, &NetworkItem::dataChanged);
         break;
     case BufferInfo::ChannelBuffer:
         bufferItem = new ChannelBufferItem(bufferInfo, this);
         break;
     case BufferInfo::ChannelBuffer:
         bufferItem = new ChannelBufferItem(bufferInfo, this);
@@ -175,7 +175,7 @@ void NetworkItem::attachNetwork(Network *network)
     connect(network, &Network::ircUserAdded,
         this, &NetworkItem::attachIrcUser);
     connect(network, &Network::connectedSet,
     connect(network, &Network::ircUserAdded,
         this, &NetworkItem::attachIrcUser);
     connect(network, &Network::connectedSet,
-        this, &NetworkItem::networkDataChanged);
+        this, [this]() { emit networkDataChanged(); });
     connect(network, &QObject::destroyed,
         this, &NetworkItem::onNetworkDestroyed);
 
     connect(network, &QObject::destroyed,
         this, &NetworkItem::onNetworkDestroyed);
 
@@ -698,9 +698,9 @@ void QueryBufferItem::setIrcUser(IrcUser *ircUser)
     }
 
     if (ircUser) {
     }
 
     if (ircUser) {
-        connect(ircUser, &QObject::destroyed, this, &QueryBufferItem::removeIrcUser);
+        connect(ircUser, &IrcUser::destroyed, this, &QueryBufferItem::removeIrcUser);
         connect(ircUser, &IrcUser::quited, this, &QueryBufferItem::removeIrcUser);
         connect(ircUser, &IrcUser::quited, this, &QueryBufferItem::removeIrcUser);
-        connect(ircUser, &IrcUser::awaySet, this, &AbstractTreeItem::dataChanged);
+        connect(ircUser, &IrcUser::awaySet, this, [this]() { emit dataChanged(); });
         connect(ircUser, &IrcUser::encryptedSet, this, &BufferItem::setEncrypted);
     }
 
         connect(ircUser, &IrcUser::encryptedSet, this, &BufferItem::setEncrypted);
     }
 
@@ -809,24 +809,15 @@ void ChannelBufferItem::attachIrcChannel(IrcChannel *ircChannel)
 
     _ircChannel = ircChannel;
 
 
     _ircChannel = ircChannel;
 
-    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, &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);
+    connect(ircChannel, &QObject::destroyed, this, &ChannelBufferItem::ircChannelDestroyed);
+    connect(ircChannel, &IrcChannel::topicSet, this, &ChannelBufferItem::setTopic);
+    connect(ircChannel, &IrcChannel::encryptedSet, this, &ChannelBufferItem::setEncrypted);
+    connect(ircChannel, &IrcChannel::ircUsersJoined, this, &ChannelBufferItem::join);
+    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());
 
     if (!ircChannel->ircUsers().isEmpty())
         join(ircChannel->ircUsers());
@@ -1114,8 +1105,8 @@ IrcUserItem::IrcUserItem(IrcUser *ircUser, AbstractTreeItem *parent)
 {
     setObjectName(ircUser->nick());
     connect(ircUser, &IrcUser::quited, this, &IrcUserItem::ircUserQuited);
 {
     setObjectName(ircUser->nick());
     connect(ircUser, &IrcUser::quited, this, &IrcUserItem::ircUserQuited);
-    connect(ircUser, SIGNAL(nickSet(QString)), this, SIGNAL(dataChanged()));
-    connect(ircUser, &IrcUser::awaySet, this, &AbstractTreeItem::dataChanged);
+    connect(ircUser, &IrcUser::nickSet, this, [this]() { emit dataChanged(); });
+    connect(ircUser, &IrcUser::awaySet, this, [this]() { emit dataChanged(); });
 }
 
 
 }
 
 
@@ -1289,10 +1280,8 @@ QString IrcUserItem::channelModes() const
 NetworkModel::NetworkModel(QObject *parent)
     : TreeModel(NetworkModel::defaultHeader(), parent)
 {
 NetworkModel::NetworkModel(QObject *parent)
     : TreeModel(NetworkModel::defaultHeader(), parent)
 {
-    connect(this, &QAbstractItemModel::rowsInserted,
-        this, &NetworkModel::checkForNewBuffers);
-    connect(this, &QAbstractItemModel::rowsAboutToBeRemoved,
-        this, &NetworkModel::checkForRemovedBuffers);
+    connect(this, &NetworkModel::rowsInserted, this, &NetworkModel::checkForNewBuffers);
+    connect(this, &NetworkModel::rowsAboutToBeRemoved, this, &NetworkModel::checkForRemovedBuffers);
 
     BufferSettings defaultSettings;
     defaultSettings.notify("UserNoticesTarget", this, SLOT(messageRedirectionSettingsChanged()));
 
     BufferSettings defaultSettings;
     defaultSettings.notify("UserNoticesTarget", this, SLOT(messageRedirectionSettingsChanged()));
index f1dc292..ddc8fcf 100644 (file)
@@ -21,6 +21,7 @@
 #include <QHostAddress>
 
 #include "authhandler.h"
 #include <QHostAddress>
 
 #include "authhandler.h"
+#include "util.h"
 
 AuthHandler::AuthHandler(QObject *parent)
     : QObject(parent)
 
 AuthHandler::AuthHandler(QObject *parent)
     : QObject(parent)
@@ -38,7 +39,7 @@ QTcpSocket *AuthHandler::socket() const
 void AuthHandler::setSocket(QTcpSocket *socket)
 {
     _socket = socket;
 void AuthHandler::setSocket(QTcpSocket *socket)
 {
     _socket = socket;
-    connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), SLOT(onSocketError(QAbstractSocket::SocketError)));
+    connect(socket, selectOverload<QAbstractSocket::SocketError>(&QTcpSocket::error), this, &AuthHandler::onSocketError);
     connect(socket, &QAbstractSocket::disconnected, this, &AuthHandler::onSocketDisconnected);
 }
 
     connect(socket, &QAbstractSocket::disconnected, this, &AuthHandler::onSocketDisconnected);
 }
 
index bef6dbb..816f26c 100644 (file)
@@ -41,7 +41,7 @@ Compressor::Compressor(QTcpSocket *socket, Compressor::CompressionLevel level, Q
 
     if (!ok) {
         // something went wrong during initialization... but we can only emit an error after RemotePeer has connected its signal
 
     if (!ok) {
         // something went wrong during initialization... but we can only emit an error after RemotePeer has connected its signal
-        QTimer::singleShot(0, this, SIGNAL(error()));
+        QTimer::singleShot(0, this, [this]() { emit error(); });
         return;
     }
 
         return;
     }
 
index 5ac80cb..b538d2a 100644 (file)
@@ -19,6 +19,7 @@
  ***************************************************************************/
 
 #include "internalpeer.h"
  ***************************************************************************/
 
 #include "internalpeer.h"
+#include "util.h"
 
 using namespace Protocol;
 
 
 using namespace Protocol;
 
@@ -125,10 +126,14 @@ void InternalPeer::setSignalProxy(::SignalProxy *proxy)
 
 void InternalPeer::setPeer(InternalPeer *peer)
 {
 
 void InternalPeer::setPeer(InternalPeer *peer)
 {
-    connect(peer, SIGNAL(dispatchMessage(Protocol::SyncMessage)), SLOT(handleMessage(Protocol::SyncMessage)));
-    connect(peer, SIGNAL(dispatchMessage(Protocol::RpcCall))    , SLOT(handleMessage(Protocol::RpcCall)));
-    connect(peer, SIGNAL(dispatchMessage(Protocol::InitRequest)), SLOT(handleMessage(Protocol::InitRequest)));
-    connect(peer, SIGNAL(dispatchMessage(Protocol::InitData))   , SLOT(handleMessage(Protocol::InitData)));
+    connect(peer, selectOverload<const Protocol::SyncMessage&>(&InternalPeer::dispatchMessage),
+            this, selectOverload<const Protocol::SyncMessage&>(&InternalPeer::handleMessage));
+    connect(peer, selectOverload<const Protocol::RpcCall&>(&InternalPeer::dispatchMessage),
+            this, selectOverload<const Protocol::RpcCall&>(&InternalPeer::handleMessage));
+    connect(peer, selectOverload<const Protocol::InitRequest&>(&InternalPeer::dispatchMessage),
+            this, selectOverload<const Protocol::InitRequest&>(&InternalPeer::handleMessage));
+    connect(peer, selectOverload<const Protocol::InitData&>(&InternalPeer::dispatchMessage),
+            this, selectOverload<const Protocol::InitData&>(&InternalPeer::handleMessage));
 
     connect(peer, &Peer::disconnected, this, &InternalPeer::peerDisconnected);
 
 
     connect(peer, &Peer::disconnected, this, &InternalPeer::peerDisconnected);
 
index 7bb83ed..37318d9 100644 (file)
@@ -191,7 +191,7 @@ void IrcChannel::joinIrcUsers(const QList<IrcUser *> &users, const QStringList &
 
         _userModes[ircuser] = sortedModes[i];
         ircuser->joinChannel(this, true);
 
         _userModes[ircuser] = sortedModes[i];
         ircuser->joinChannel(this, true);
-        connect(ircuser, SIGNAL(nickSet(QString)), this, SLOT(ircUserNickSet(QString)));
+        connect(ircuser, &IrcUser::nickSet, this, selectOverload<QString>(&IrcChannel::ircUserNickSet));
 
         // connect(ircuser, SIGNAL(destroyed()), this, SLOT(ircUserDestroyed()));
         // If you wonder why there is no counterpart to ircUserJoined:
 
         // connect(ircuser, SIGNAL(destroyed()), this, SLOT(ircUserDestroyed()));
         // If you wonder why there is no counterpart to ircUserJoined:
index 4c50700..bcb6f59 100644 (file)
@@ -117,7 +117,7 @@ signals:
 //   void channelModeAdded(const QChar &mode, const QString &value);
 //   void channelModeRemoved(const QChar &mode, const QString &value);
 
 //   void channelModeAdded(const QChar &mode, const QString &value);
 //   void channelModeRemoved(const QChar &mode, const QString &value);
 
-    void ircUsersJoined(QList<IrcUser *> ircusers);
+    void ircUsersJoined(const QList<IrcUser *> &ircusers);
 //   void ircUsersJoined(QStringList nicks, QStringList modes);
     void ircUserParted(IrcUser *ircuser);
     void ircUserNickSet(IrcUser *ircuser, QString nick);
 //   void ircUsersJoined(QStringList nicks, QStringList modes);
     void ircUserParted(IrcUser *ircuser);
     void ircUserNickSet(IrcUser *ircuser, QString nick);
index 7de0e77..4da9539 100644 (file)
@@ -45,7 +45,7 @@ PosixSignalWatcher::PosixSignalWatcher(QObject *parent)
     }
 
     _notifier = new QSocketNotifier(_sockpair[1], QSocketNotifier::Read, this);
     }
 
     _notifier = new QSocketNotifier(_sockpair[1], QSocketNotifier::Read, this);
-    connect(_notifier, SIGNAL(activated(int)), this, SLOT(onNotify(int)));
+    connect(_notifier, &QSocketNotifier::activated, this, &PosixSignalWatcher::onNotify);
     _notifier->setEnabled(true);
 
     registerSignal(SIGINT);
     _notifier->setEnabled(true);
 
     registerSignal(SIGINT);
index e2a2317..47cadcc 100644 (file)
@@ -66,9 +66,6 @@ public:
 signals:
     void protocolError(const QString &errorString);
 
 signals:
     void protocolError(const QString &errorString);
 
-    // only used in compat mode
-    void protocolVersionMismatch(int actual, int expected);
-
 private:
     using RemotePeer::writeMessage;
     void writeMessage(const QVariant &item);
 private:
     using RemotePeer::writeMessage;
     void writeMessage(const QVariant &item);
index 03cf739..14d6a63 100644 (file)
@@ -293,7 +293,7 @@ void Quassel::setupSignalHandling()
 #else
     _signalWatcher = new WindowsSignalWatcher(this);
 #endif
 #else
     _signalWatcher = new WindowsSignalWatcher(this);
 #endif
-    connect(_signalWatcher, SIGNAL(handleSignal(AbstractSignalWatcher::Action)), this, SLOT(handleSignal(AbstractSignalWatcher::Action)));
+    connect(_signalWatcher, &AbstractSignalWatcher::handleSignal, this, &Quassel::handleSignal);
 }
 
 
 }
 
 
index 942bbd6..c3ad24f 100644 (file)
@@ -30,6 +30,7 @@
 #endif
 
 #include "remotepeer.h"
 #endif
 
 #include "remotepeer.h"
+#include "util.h"
 
 using namespace Protocol;
 
 
 using namespace Protocol;
 
@@ -47,13 +48,14 @@ RemotePeer::RemotePeer(::AuthHandler *authHandler, QTcpSocket *socket, Compresso
 {
     socket->setParent(this);
     connect(socket, &QAbstractSocket::stateChanged, this, &RemotePeer::onSocketStateChanged);
 {
     socket->setParent(this);
     connect(socket, &QAbstractSocket::stateChanged, this, &RemotePeer::onSocketStateChanged);
-    connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), SLOT(onSocketError(QAbstractSocket::SocketError)));
+    connect(socket, selectOverload<QAbstractSocket::SocketError>(&QAbstractSocket::error), this, &RemotePeer::onSocketError);
     connect(socket, &QAbstractSocket::disconnected, this, &Peer::disconnected);
 
 #ifdef HAVE_SSL
     auto *sslSocket = qobject_cast<QSslSocket *>(socket);
     connect(socket, &QAbstractSocket::disconnected, this, &Peer::disconnected);
 
 #ifdef HAVE_SSL
     auto *sslSocket = qobject_cast<QSslSocket *>(socket);
-    if (sslSocket)
-        connect(sslSocket, SIGNAL(encrypted()), SIGNAL(secureStateChanged()));
+    if (sslSocket) {
+        connect(sslSocket, &QSslSocket::encrypted, this, [this]() { emit secureStateChanged(true); });
+    }
 #endif
 
     connect(_compressor, &Compressor::readyRead, this, &RemotePeer::onReadyRead);
 #endif
 
     connect(_compressor, &Compressor::readyRead, this, &RemotePeer::onReadyRead);
index 8a47b0a..5e06425 100644 (file)
@@ -72,6 +72,9 @@ signals:
     void socketError(QAbstractSocket::SocketError error, const QString &errorString);
     void statusMessage(const QString &msg);
 
     void socketError(QAbstractSocket::SocketError error, const QString &errorString);
     void statusMessage(const QString &msg);
 
+    // Only used by LegacyPeer
+    void protocolVersionMismatch(int actual, int expected);
+
 protected:
     SignalProxy *signalProxy() const override;
 
 protected:
     SignalProxy *signalProxy() const override;
 
index 84ce979..556eec6 100644 (file)
@@ -273,7 +273,7 @@ void Core::shutdown()
     }
 
     for (auto &&session : _sessions) {
     }
 
     for (auto &&session : _sessions) {
-        connect(session, SIGNAL(shutdownComplete(SessionThread*)), this, SLOT(onSessionShutdown(SessionThread*)));
+        connect(session, &SessionThread::shutdownComplete, this, &Core::onSessionShutdown);
         session->shutdown();
     }
 }
         session->shutdown();
     }
 }
index 45d0607..aa94725 100644 (file)
@@ -704,7 +704,7 @@ signals:
     void bufferInfoUpdated(UserId user, const BufferInfo &info);
 
     //! Relay from CoreSession::sessionState(). Used for internal connection only
     void bufferInfoUpdated(UserId user, const BufferInfo &info);
 
     //! Relay from CoreSession::sessionState(). Used for internal connection only
-    void sessionState(const Protocol::SessionState &sessionState);
+    void sessionStateReceived(const Protocol::SessionState &sessionState);
 
     //! Emitted when database schema upgrade starts or ends
     void dbUpgradeInProgress(bool inProgress);
 
     //! Emitted when database schema upgrade starts or ends
     void dbUpgradeInProgress(bool inProgress);
index 8fbf4aa..c8171dc 100644 (file)
@@ -24,7 +24,7 @@ CoreApplication::CoreApplication(int &argc, char **argv)
     : QCoreApplication(argc, argv)
 {
     Quassel::registerQuitHandler([this]() {
     : QCoreApplication(argc, argv)
 {
     Quassel::registerQuitHandler([this]() {
-        connect(_core.get(), SIGNAL(shutdownComplete()), this, SLOT(onShutdownComplete()));
+        connect(_core.get(), &Core::shutdownComplete, this, &CoreApplication::onShutdownComplete);
         _core->shutdown();
     });
 }
         _core->shutdown();
     });
 }
@@ -39,6 +39,6 @@ void CoreApplication::init()
 
 void CoreApplication::onShutdownComplete()
 {
 
 void CoreApplication::onShutdownComplete()
 {
-    connect(_core.get(), SIGNAL(destroyed()), QCoreApplication::instance(), SLOT(quit()));
+    connect(_core.get(), &QObject::destroyed, QCoreApplication::instance(), &QCoreApplication::quit);
     _core.release()->deleteLater();
 }
     _core.release()->deleteLater();
 }
index 6a1a9c1..ade356e 100644 (file)
@@ -64,7 +64,7 @@ void CoreAuthHandler::onReadyRead()
             qDebug() << "Legacy client detected, switching to compatibility mode";
             _legacy = true;
             RemotePeer *peer = PeerFactory::createPeer(PeerFactory::ProtoDescriptor(Protocol::LegacyProtocol, 0), this, socket(), Compressor::NoCompression, this);
             qDebug() << "Legacy client detected, switching to compatibility mode";
             _legacy = true;
             RemotePeer *peer = PeerFactory::createPeer(PeerFactory::ProtoDescriptor(Protocol::LegacyProtocol, 0), this, socket(), Compressor::NoCompression, this);
-            connect(peer, SIGNAL(protocolVersionMismatch(int,int)), SLOT(onProtocolVersionMismatch(int,int)));
+            connect(peer, &RemotePeer::protocolVersionMismatch, this, &CoreAuthHandler::onProtocolVersionMismatch);
             setPeer(peer);
             return;
         }
             setPeer(peer);
             return;
         }
@@ -106,7 +106,7 @@ void CoreAuthHandler::onReadyRead()
 
             if (peer->protocol() == Protocol::LegacyProtocol) {
                 _legacy = true;
 
             if (peer->protocol() == Protocol::LegacyProtocol) {
                 _legacy = true;
-                connect(peer, SIGNAL(protocolVersionMismatch(int,int)), SLOT(onProtocolVersionMismatch(int,int)));
+                connect(peer, &RemotePeer::protocolVersionMismatch, this, &CoreAuthHandler::onProtocolVersionMismatch);
             }
             setPeer(peer);
 
             }
             setPeer(peer);
 
@@ -274,7 +274,7 @@ void CoreAuthHandler::startSsl()
     Q_ASSERT(sslSocket);
 
     qDebug() << qPrintable(tr("Starting encryption for Client:"))  << _peer->description();
     Q_ASSERT(sslSocket);
 
     qDebug() << qPrintable(tr("Starting encryption for Client:"))  << _peer->description();
-    connect(sslSocket, SIGNAL(sslErrors(const QList<QSslError> &)), SLOT(onSslErrors()));
+    connect(sslSocket, selectOverload<const QList<QSslError> &>(&QSslSocket::sslErrors), this, &CoreAuthHandler::onSslErrors);
     sslSocket->flush(); // ensure that the write cache is flushed before we switch to ssl (bug 682)
     sslSocket->startServerEncryption();
     #endif /* HAVE_SSL */
     sslSocket->flush(); // ensure that the write cache is flushed before we switch to ssl (bug 682)
     sslSocket->startServerEncryption();
     #endif /* HAVE_SSL */
index 840d9bc..a458b79 100644 (file)
@@ -27,17 +27,12 @@ CoreBasicHandler::CoreBasicHandler(CoreNetwork *parent)
     : BasicHandler(parent),
     _network(parent)
 {
     : BasicHandler(parent),
     _network(parent)
 {
-    connect(this, SIGNAL(displayMsg(Message::Type, BufferInfo::Type, const QString &, const QString &, const QString &, Message::Flags)),
-        network(), SLOT(displayMsg(Message::Type, BufferInfo::Type, const QString &, const QString &, const QString &, Message::Flags)));
-
-    connect(this, SIGNAL(putCmd(QString, const QList<QByteArray> &, const QByteArray &, const bool)),
-        network(), SLOT(putCmd(QString, const QList<QByteArray> &, const QByteArray &, const bool)));
-
-    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, &CoreBasicHandler::putRawLine,
-        network(), &CoreNetwork::putRawLine);
+    connect(this, &CoreBasicHandler::displayMsg, network(), &CoreNetwork::onDisplayMsg);
+    connect(this, &CoreBasicHandler::putRawLine, network(), &CoreNetwork::putRawLine);
+    connect(this,      selectOverload<const QString&, const QList<QByteArray>&, const QByteArray&, bool>(&CoreBasicHandler::putCmd),
+            network(), selectOverload<const QString&, const QList<QByteArray>&, const QByteArray&, bool>(&CoreNetwork::putCmd));
+    connect(this,      selectOverload<const QString&, const QList<QList<QByteArray>>&, const QByteArray&, bool>(&CoreBasicHandler::putCmd),
+            network(), selectOverload<const QString&, const QList<QList<QByteArray>>&, const QByteArray&, bool>(&CoreNetwork::putCmd));
 }
 
 
 }
 
 
index 39e41cb..f741112 100644 (file)
@@ -67,14 +67,14 @@ signals:
      *
      * @see CoreNetwork::putCmd(const QString &cmd, const QList<QByteArray> &params, const QByteArray &prefix = QByteArray(), const bool prepend = false)
      */
      *
      * @see CoreNetwork::putCmd(const QString &cmd, const QList<QByteArray> &params, const QByteArray &prefix = QByteArray(), const bool prepend = false)
      */
-    void putCmd(const QString &cmd, const QList<QByteArray> &params, const QByteArray &prefix = QByteArray(), const bool prepend = false);
+    void putCmd(const QString &cmd, const QList<QByteArray> &params, const QByteArray &prefix = {}, bool prepend = false);
 
     /**
      * Sends the command for each set of encoded parameters, with optional prefix or high priority.
      *
      * @see CoreNetwork::putCmd(const QString &cmd, const QList<QList<QByteArray>> &params, const QByteArray &prefix = QByteArray(), const bool prepend = false)
      */
 
     /**
      * Sends the command for each set of encoded parameters, with optional prefix or high priority.
      *
      * @see CoreNetwork::putCmd(const QString &cmd, const QList<QList<QByteArray>> &params, const QByteArray &prefix = QByteArray(), const bool prepend = false)
      */
-    void putCmd(const QString &cmd, const QList<QList<QByteArray>> &params, const QByteArray &prefix = QByteArray(), const bool prepend = false);
+    void putCmd(const QString &cmd, const QList<QList<QByteArray>> &params, const QByteArray &prefix = {}, bool prepend = false);
 
 protected:
     /**
 
 protected:
     /**
index e033209..81e1b5e 100644 (file)
@@ -51,7 +51,7 @@ CoreNetwork::CoreNetwork(const NetworkId &networkid, CoreSession *session)
     _debugLogRawNetId = Quassel::optionValue("debug-irc-id").toInt();
 
     _autoReconnectTimer.setSingleShot(true);
     _debugLogRawNetId = Quassel::optionValue("debug-irc-id").toInt();
 
     _autoReconnectTimer.setSingleShot(true);
-    connect(&_socketCloseTimer, &QTimer::timeout, this, &CoreNetwork::socketCloseTimeout);
+    connect(&_socketCloseTimer, &QTimer::timeout, this, &CoreNetwork::onSocketCloseTimeout);
 
     setPingInterval(networkConfig()->pingInterval());
     connect(&_pingTimer, &QTimer::timeout, this, &CoreNetwork::sendPing);
 
     setPingInterval(networkConfig()->pingInterval());
     connect(&_pingTimer, &QTimer::timeout, this, &CoreNetwork::sendPing);
@@ -80,13 +80,13 @@ CoreNetwork::CoreNetwork(const NetworkId &networkid, CoreSession *session)
     connect(&_autoWhoCycleTimer, &QTimer::timeout, this, &CoreNetwork::startAutoWhoCycle);
     connect(&_tokenBucketTimer, &QTimer::timeout, this, &CoreNetwork::checkTokenBucket);
 
     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, &QAbstractSocket::stateChanged, this, &CoreNetwork::socketStateChanged);
-    connect(&socket, &QIODevice::readyRead, this, &CoreNetwork::socketHasData);
+    connect(&socket, &QAbstractSocket::connected, this, &CoreNetwork::onSocketInitialized);
+    connect(&socket, selectOverload<QAbstractSocket::SocketError>(&QAbstractSocket::error), this, &CoreNetwork::onSocketError);
+    connect(&socket, &QAbstractSocket::stateChanged, this, &CoreNetwork::onSocketStateChanged);
+    connect(&socket, &QIODevice::readyRead, this, &CoreNetwork::onSocketHasData);
 #ifdef HAVE_SSL
 #ifdef HAVE_SSL
-    connect(&socket, SIGNAL(encrypted()), this, SLOT(socketInitialized()));
-    connect(&socket, SIGNAL(sslErrors(const QList<QSslError> &)), this, SLOT(sslErrors(const QList<QSslError> &)));
+    connect(&socket, &QSslSocket::encrypted, this, &CoreNetwork::onSocketInitialized);
+    connect(&socket, selectOverload<const QList<QSslError>&>(&QSslSocket::sslErrors), this, &CoreNetwork::onSslErrors);
 #endif
     connect(this, &CoreNetwork::newEvent, coreSession()->eventManager(), &EventManager::postEvent);
 
 #endif
     connect(this, &CoreNetwork::newEvent, coreSession()->eventManager(), &EventManager::postEvent);
 
@@ -104,17 +104,13 @@ CoreNetwork::CoreNetwork(const NetworkId &networkid, CoreSession *session)
     connect(this, &Network::capRemoved, this, &CoreNetwork::serverCapRemoved);
 
     if (Quassel::isOptionSet("oidentd")) {
     connect(this, &Network::capRemoved, this, &CoreNetwork::serverCapRemoved);
 
     if (Quassel::isOptionSet("oidentd")) {
-        connect(this, SIGNAL(socketInitialized(const CoreIdentity*, QHostAddress, quint16, QHostAddress, quint16, qint64)),
-                Core::instance()->oidentdConfigGenerator(), SLOT(addSocket(const CoreIdentity*, QHostAddress, quint16, QHostAddress, quint16, qint64)), Qt::BlockingQueuedConnection);
-        connect(this, SIGNAL(socketDisconnected(const CoreIdentity*, QHostAddress, quint16, QHostAddress, quint16, qint64)),
-                Core::instance()->oidentdConfigGenerator(), SLOT(removeSocket(const CoreIdentity*, QHostAddress, quint16, QHostAddress, quint16, qint64)));
+        connect(this, &CoreNetwork::socketInitialized, Core::instance()->oidentdConfigGenerator(), &OidentdConfigGenerator::addSocket);
+        connect(this, &CoreNetwork::socketDisconnected, Core::instance()->oidentdConfigGenerator(), &OidentdConfigGenerator::removeSocket);
     }
 
     if (Quassel::isOptionSet("ident-daemon")) {
     }
 
     if (Quassel::isOptionSet("ident-daemon")) {
-        connect(this, SIGNAL(socketInitialized(const CoreIdentity*, QHostAddress, quint16, QHostAddress, quint16, qint64)),
-                Core::instance()->identServer(), SLOT(addSocket(const CoreIdentity*, QHostAddress, quint16, QHostAddress, quint16, qint64)), Qt::BlockingQueuedConnection);
-        connect(this, SIGNAL(socketDisconnected(const CoreIdentity*, QHostAddress, quint16, QHostAddress, quint16, qint64)),
-                Core::instance()->identServer(), SLOT(removeSocket(const CoreIdentity*, QHostAddress, quint16, QHostAddress, quint16, qint64)));
+        connect(this, &CoreNetwork::socketInitialized, Core::instance()->identServer(), &IdentServer::addSocket);
+        connect(this, &CoreNetwork::socketDisconnected, Core::instance()->identServer(), &IdentServer::removeSocket);
     }
 }
 
     }
 }
 
@@ -229,7 +225,7 @@ void CoreNetwork::connectToIrc(bool reconnecting)
     else if (_previousConnectionAttemptFailed) {
         // cycle to next server if previous connection attempt failed
         _previousConnectionAttemptFailed = false;
     else if (_previousConnectionAttemptFailed) {
         // cycle to next server if previous connection attempt failed
         _previousConnectionAttemptFailed = false;
-        displayMsg(Message::Server, BufferInfo::StatusBuffer, "", tr("Connection failed. Cycling to next Server"));
+        showMessage(Message::Server, BufferInfo::StatusBuffer, "", tr("Connection failed. Cycling to next Server"));
         if (++_lastUsedServerIndex >= serverList().size()) {
             _lastUsedServerIndex = 0;
         }
         if (++_lastUsedServerIndex >= serverList().size()) {
             _lastUsedServerIndex = 0;
         }
@@ -241,7 +237,7 @@ void CoreNetwork::connectToIrc(bool reconnecting)
 
     Server server = usedServer();
     displayStatusMsg(tr("Connecting to %1:%2...").arg(server.host).arg(server.port));
 
     Server server = usedServer();
     displayStatusMsg(tr("Connecting to %1:%2...").arg(server.host).arg(server.port));
-    displayMsg(Message::Server, BufferInfo::StatusBuffer, "", tr("Connecting to %1:%2...").arg(server.host).arg(server.port));
+    showMessage(Message::Server, BufferInfo::StatusBuffer, "", tr("Connecting to %1:%2...").arg(server.host).arg(server.port));
 
     if (server.useProxy) {
         QNetworkProxy proxy((QNetworkProxy::ProxyType)server.proxyType, server.proxyHost, server.proxyPort, server.proxyUser, server.proxyPass);
 
     if (server.useProxy) {
         QNetworkProxy proxy((QNetworkProxy::ProxyType)server.proxyType, server.proxyHost, server.proxyPort, server.proxyUser, server.proxyPass);
@@ -306,9 +302,9 @@ void CoreNetwork::disconnectFromIrc(bool requested, const QString &reason, bool
     else
         _quitReason = reason;
 
     else
         _quitReason = reason;
 
-    displayMsg(Message::Server, BufferInfo::StatusBuffer, "", tr("Disconnecting. (%1)").arg((!requested && !withReconnect) ? tr("Core Shutdown") : _quitReason));
+    showMessage(Message::Server, BufferInfo::StatusBuffer, "", tr("Disconnecting. (%1)").arg((!requested && !withReconnect) ? tr("Core Shutdown") : _quitReason));
     if (socket.state() == QAbstractSocket::UnconnectedState) {
     if (socket.state() == QAbstractSocket::UnconnectedState) {
-        socketDisconnected();
+        onSocketDisconnected();
     }
     else {
         if (socket.state() == QAbstractSocket::ConnectedState) {
     }
     else {
         if (socket.state() == QAbstractSocket::ConnectedState) {
@@ -326,7 +322,7 @@ void CoreNetwork::disconnectFromIrc(bool requested, const QString &reason, bool
 }
 
 
 }
 
 
-void CoreNetwork::socketCloseTimeout()
+void CoreNetwork::onSocketCloseTimeout()
 {
     qWarning() << QString{"Timed out quitting network %1 (network ID: %2, user ID: %3)"}
                   .arg(networkName()).arg(networkId().toInt()).arg(userId().toInt());
 {
     qWarning() << QString{"Timed out quitting network %1 (network ID: %2, user ID: %3)"}
                   .arg(networkName()).arg(networkId().toInt()).arg(userId().toInt());
@@ -341,15 +337,15 @@ void CoreNetwork::shutdown()
 }
 
 
 }
 
 
-void CoreNetwork::userInput(BufferInfo buf, QString msg)
+void CoreNetwork::userInput(const BufferInfo &buf, QString msg)
 {
     userInputHandler()->handleUserInput(buf, msg);
 }
 
 
 {
     userInputHandler()->handleUserInput(buf, msg);
 }
 
 
-void CoreNetwork::putRawLine(const QByteArray s, const bool prepend)
+void CoreNetwork::putRawLine(const QByteArray &s, bool prepend)
 {
 {
-    if (_tokenBucket > 0 || (_skipMessageRates && _msgQueue.size() == 0)) {
+    if (_tokenBucket > 0 || (_skipMessageRates && _msgQueue.isEmpty())) {
         // If there's tokens remaining, ...
         // Or rate limits don't apply AND no messages are in queue (to prevent out-of-order), ...
         // Send the message now.
         // If there's tokens remaining, ...
         // Or rate limits don't apply AND no messages are in queue (to prevent out-of-order), ...
         // Send the message now.
@@ -524,7 +520,7 @@ void CoreNetwork::setMyNick(const QString &mynick)
 }
 
 
 }
 
 
-void CoreNetwork::socketHasData()
+void CoreNetwork::onSocketHasData()
 {
     while (socket.canReadLine()) {
         QByteArray s = socket.readLine();
 {
     while (socket.canReadLine()) {
         QByteArray s = socket.readLine();
@@ -539,7 +535,7 @@ void CoreNetwork::socketHasData()
 }
 
 
 }
 
 
-void CoreNetwork::socketError(QAbstractSocket::SocketError error)
+void CoreNetwork::onSocketError(QAbstractSocket::SocketError error)
 {
     // Ignore socket closed errors if expected
     if (_disconnectExpected && error == QAbstractSocket::RemoteHostClosedError) {
 {
     // Ignore socket closed errors if expected
     if (_disconnectExpected && error == QAbstractSocket::RemoteHostClosedError) {
@@ -549,15 +545,15 @@ void CoreNetwork::socketError(QAbstractSocket::SocketError error)
     _previousConnectionAttemptFailed = true;
     qWarning() << qPrintable(tr("Could not connect to %1 (%2)").arg(networkName(), socket.errorString()));
     emit connectionError(socket.errorString());
     _previousConnectionAttemptFailed = true;
     qWarning() << qPrintable(tr("Could not connect to %1 (%2)").arg(networkName(), socket.errorString()));
     emit connectionError(socket.errorString());
-    displayMsg(Message::Error, BufferInfo::StatusBuffer, "", tr("Connection failure: %1").arg(socket.errorString()));
+    showMessage(Message::Error, BufferInfo::StatusBuffer, "", tr("Connection failure: %1").arg(socket.errorString()));
     emitConnectionError(socket.errorString());
     if (socket.state() < QAbstractSocket::ConnectedState) {
     emitConnectionError(socket.errorString());
     if (socket.state() < QAbstractSocket::ConnectedState) {
-        socketDisconnected();
+        onSocketDisconnected();
     }
 }
 
 
     }
 }
 
 
-void CoreNetwork::socketInitialized()
+void CoreNetwork::onSocketInitialized()
 {
     CoreIdentity *identity = identityPtr();
     if (!identity) {
 {
     CoreIdentity *identity = identityPtr();
     if (!identity) {
@@ -597,7 +593,7 @@ void CoreNetwork::socketInitialized()
 
     // Request capabilities as per IRCv3.2 specifications
     // Older servers should ignore this; newer servers won't downgrade to RFC1459
 
     // Request capabilities as per IRCv3.2 specifications
     // Older servers should ignore this; newer servers won't downgrade to RFC1459
-    displayMsg(Message::Server, BufferInfo::StatusBuffer, "", tr("Requesting capability list..."));
+    showMessage(Message::Server, BufferInfo::StatusBuffer, "", tr("Requesting capability list..."));
     putRawLine(serverEncode(QString("CAP LS 302")));
 
     if (!server.password.isEmpty()) {
     putRawLine(serverEncode(QString("CAP LS 302")));
 
     if (!server.password.isEmpty()) {
@@ -619,7 +615,7 @@ void CoreNetwork::socketInitialized()
 }
 
 
 }
 
 
-void CoreNetwork::socketDisconnected()
+void CoreNetwork::onSocketDisconnected()
 {
     disablePingTimeout();
     _msgQueue.clear();
 {
     disablePingTimeout();
     _msgQueue.clear();
@@ -636,7 +632,7 @@ void CoreNetwork::socketDisconnected()
     IrcUser *me_ = me();
     if (me_) {
         foreach(QString channel, me_->channels())
     IrcUser *me_ = me();
     if (me_) {
         foreach(QString channel, me_->channels())
-        displayMsg(Message::Quit, BufferInfo::ChannelBuffer, channel, _quitReason, me_->hostmask());
+        showMessage(Message::Quit, BufferInfo::ChannelBuffer, channel, _quitReason, me_->hostmask());
     }
 
     setConnected(false);
     }
 
     setConnected(false);
@@ -659,13 +655,13 @@ void CoreNetwork::socketDisconnected()
 }
 
 
 }
 
 
-void CoreNetwork::socketStateChanged(QAbstractSocket::SocketState socketState)
+void CoreNetwork::onSocketStateChanged(QAbstractSocket::SocketState socketState)
 {
     Network::ConnectionState state;
     switch (socketState) {
     case QAbstractSocket::UnconnectedState:
         state = Network::Disconnected;
 {
     Network::ConnectionState state;
     switch (socketState) {
     case QAbstractSocket::UnconnectedState:
         state = Network::Disconnected;
-        socketDisconnected();
+        onSocketDisconnected();
         break;
     case QAbstractSocket::HostLookupState:
     case QAbstractSocket::ConnectingState:
         break;
     case QAbstractSocket::HostLookupState:
     case QAbstractSocket::ConnectingState:
@@ -1041,7 +1037,7 @@ void CoreNetwork::updateRateLimiting(const bool forceUnlimited)
         if (_skipMessageRates) {
             // If the message queue already contains messages, they need sent before disabling the
             // timer.  Set the timer to a rapid pace and let it disable itself.
         if (_skipMessageRates) {
             // If the message queue already contains messages, they need sent before disabling the
             // timer.  Set the timer to a rapid pace and let it disable itself.
-            if (_msgQueue.size() > 0) {
+            if (!_msgQueue.isEmpty()) {
                 qDebug() << "Outgoing message queue contains messages while disabling rate "
                             "limiting.  Sending remaining queued messages...";
                 // Promptly run the timer again to clear the messages.  Rate limiting is disabled,
                 qDebug() << "Outgoing message queue contains messages while disabling rate "
                             "limiting.  Sending remaining queued messages...";
                 // Promptly run the timer again to clear the messages.  Rate limiting is disabled,
@@ -1123,8 +1119,7 @@ void CoreNetwork::serverCapAcknowledged(const QString &capability)
                 // EXTERNAL authentication supported, send request
                 putRawLine(serverEncode("AUTHENTICATE EXTERNAL"));
             } else {
                 // EXTERNAL authentication supported, send request
                 putRawLine(serverEncode("AUTHENTICATE EXTERNAL"));
             } else {
-                displayMsg(Message::Error, BufferInfo::StatusBuffer, "",
-                           tr("SASL EXTERNAL authentication not supported"));
+                showMessage(Message::Error, BufferInfo::StatusBuffer, "", tr("SASL EXTERNAL authentication not supported"));
                 sendNextCap();
             }
         } else {
                 sendNextCap();
             }
         } else {
@@ -1134,8 +1129,7 @@ void CoreNetwork::serverCapAcknowledged(const QString &capability)
                 // Only working with PLAIN atm, blowfish later
                 putRawLine(serverEncode("AUTHENTICATE PLAIN"));
             } else {
                 // Only working with PLAIN atm, blowfish later
                 putRawLine(serverEncode("AUTHENTICATE PLAIN"));
             } else {
-                displayMsg(Message::Error, BufferInfo::StatusBuffer, "",
-                           tr("SASL PLAIN authentication not supported"));
+                showMessage(Message::Error, BufferInfo::StatusBuffer, "", tr("SASL PLAIN authentication not supported"));
                 sendNextCap();
             }
 #ifdef HAVE_SSL
                 sendNextCap();
             }
 #ifdef HAVE_SSL
@@ -1240,9 +1234,9 @@ void CoreNetwork::retryCapsIndividually()
     // Add most recently tried capability set to individual list, re-requesting them one at a time
     _capsQueuedIndividual.append(_capsQueuedLastBundle);
     // Warn of this issue to explain the slower login.  Servers usually shouldn't trigger this.
     // Add most recently tried capability set to individual list, re-requesting them one at a time
     _capsQueuedIndividual.append(_capsQueuedLastBundle);
     // Warn of this issue to explain the slower login.  Servers usually shouldn't trigger this.
-    displayMsg(Message::Server, BufferInfo::StatusBuffer, "",
-               tr("Could not negotiate some capabilities, retrying individually (%1)...")
-               .arg(_capsQueuedLastBundle.join(", ")));
+    showMessage(Message::Server, BufferInfo::StatusBuffer, "",
+                tr("Could not negotiate some capabilities, retrying individually (%1)...")
+                .arg(_capsQueuedLastBundle.join(", ")));
     // Capabilities are already removed from the capability bundle queue via takeQueuedCaps(), no
     // need to remove them here.
     // Clear the most recently tried set to reduce risk that mistakes elsewhere causes retrying
     // Capabilities are already removed from the capability bundle queue via takeQueuedCaps(), no
     // need to remove them here.
     // Clear the most recently tried set to reduce risk that mistakes elsewhere causes retrying
@@ -1256,14 +1250,13 @@ void CoreNetwork::beginCapNegotiation()
     if (!capNegotiationInProgress()) {
         // If the server doesn't have any capabilities, but supports CAP LS, continue on with the
         // normal connection.
     if (!capNegotiationInProgress()) {
         // If the server doesn't have any capabilities, but supports CAP LS, continue on with the
         // normal connection.
-        displayMsg(Message::Server, BufferInfo::StatusBuffer, "", tr("No capabilities available"));
+        showMessage(Message::Server, BufferInfo::StatusBuffer, "", tr("No capabilities available"));
         endCapNegotiation();
         return;
     }
 
     _capNegotiationActive = true;
         endCapNegotiation();
         return;
     }
 
     _capNegotiationActive = true;
-    displayMsg(Message::Server, BufferInfo::StatusBuffer, "",
-               tr("Ready to negotiate (found: %1)").arg(caps().join(", ")));
+    showMessage(Message::Server, BufferInfo::StatusBuffer, "", tr("Ready to negotiate (found: %1)").arg(caps().join(", ")));
 
     // Build a list of queued capabilities, starting with individual, then bundled, only adding the
     // comma separator between the two if needed (both individual and bundled caps exist).
 
     // Build a list of queued capabilities, starting with individual, then bundled, only adding the
     // comma separator between the two if needed (both individual and bundled caps exist).
@@ -1271,8 +1264,7 @@ void CoreNetwork::beginCapNegotiation()
             _capsQueuedIndividual.join(", ")
             + ((!_capsQueuedIndividual.empty() && !_capsQueuedBundled.empty()) ? ", " : "")
             + _capsQueuedBundled.join(", ");
             _capsQueuedIndividual.join(", ")
             + ((!_capsQueuedIndividual.empty() && !_capsQueuedBundled.empty()) ? ", " : "")
             + _capsQueuedBundled.join(", ");
-    displayMsg(Message::Server, BufferInfo::StatusBuffer, "",
-               tr("Negotiating capabilities (requesting: %1)...").arg(queuedCapsDisplay));
+    showMessage(Message::Server, BufferInfo::StatusBuffer, "", tr("Negotiating capabilities (requesting: %1)...").arg(queuedCapsDisplay));
 
     sendNextCap();
 }
 
     sendNextCap();
 }
@@ -1286,12 +1278,10 @@ void CoreNetwork::sendNextCap()
         // No pending desired capabilities, capability negotiation finished
         // If SASL requested but not available, print a warning
         if (networkInfo().useSasl && !capEnabled(IrcCap::SASL))
         // No pending desired capabilities, capability negotiation finished
         // If SASL requested but not available, print a warning
         if (networkInfo().useSasl && !capEnabled(IrcCap::SASL))
-            displayMsg(Message::Error, BufferInfo::StatusBuffer, "",
-                       tr("SASL authentication currently not supported by server"));
+            showMessage(Message::Error, BufferInfo::StatusBuffer, "", tr("SASL authentication currently not supported by server"));
 
         if (_capNegotiationActive) {
 
         if (_capNegotiationActive) {
-            displayMsg(Message::Server, BufferInfo::StatusBuffer, "",
-                   tr("Capability negotiation finished (enabled: %1)").arg(capsEnabled().join(", ")));
+            showMessage(Message::Server, BufferInfo::StatusBuffer, "", tr("Capability negotiation finished (enabled: %1)").arg(capsEnabled().join(", ")));
             _capNegotiationActive = false;
         }
 
             _capNegotiationActive = false;
         }
 
@@ -1422,7 +1412,7 @@ void CoreNetwork::sendAutoWho()
 
 
 #ifdef HAVE_SSL
 
 
 #ifdef HAVE_SSL
-void CoreNetwork::sslErrors(const QList<QSslError> &sslErrors)
+void CoreNetwork::onSslErrors(const QList<QSslError> &sslErrors)
 {
     Server server = usedServer();
     if (server.sslVerify) {
 {
     Server server = usedServer();
     if (server.sslVerify) {
@@ -1433,7 +1423,7 @@ void CoreNetwork::sslErrors(const QList<QSslError> &sslErrors)
             // Add the error reason if known
             sslErrorMessage.append(tr(" (Reason: %1)").arg(sslErrors.first().errorString()));
         }
             // Add the error reason if known
             sslErrorMessage.append(tr(" (Reason: %1)").arg(sslErrors.first().errorString()));
         }
-        displayMsg(Message::Error, BufferInfo::StatusBuffer, "", sslErrorMessage);
+        showMessage(Message::Error, BufferInfo::StatusBuffer, "", sslErrorMessage);
 
         // Disconnect, triggering a reconnect in case it's a temporary issue with certificate
         // validity, network trouble, etc.
 
         // Disconnect, triggering a reconnect in case it's a temporary issue with certificate
         // validity, network trouble, etc.
@@ -1446,7 +1436,7 @@ void CoreNetwork::sslErrors(const QList<QSslError> &sslErrors)
             // Add the error reason if known
             sslErrorMessage.append(tr(" (Reason: %1)").arg(sslErrors.first().errorString()));
         }
             // Add the error reason if known
             sslErrorMessage.append(tr(" (Reason: %1)").arg(sslErrors.first().errorString()));
         }
-        displayMsg(Message::Info, BufferInfo::StatusBuffer, "", sslErrorMessage);
+        showMessage(Message::Info, BufferInfo::StatusBuffer, "", sslErrorMessage);
 
         // Proceed with the connection
         socket.ignoreSslErrors();
 
         // Proceed with the connection
         socket.ignoreSslErrors();
@@ -1560,7 +1550,7 @@ void CoreNetwork::requestSetNetworkInfo(const NetworkInfo &info)
 }
 
 
 }
 
 
-QList<QList<QByteArray>> CoreNetwork::splitMessage(const QString &cmd, const QString &message, std::function<QList<QByteArray>(QString &)> cmdGenerator)
+QList<QList<QByteArray>> CoreNetwork::splitMessage(const QString &cmd, const QString &message, const std::function<QList<QByteArray>(QString &)> &cmdGenerator)
 {
     QString wrkMsg(message);
     QList<QList<QByteArray>> msgsToSend;
 {
     QString wrkMsg(message);
     QList<QList<QByteArray>> msgsToSend;
index a774912..c67d479 100644 (file)
@@ -135,7 +135,7 @@ public:
      */
     inline bool isPongReplyPending() const { return _pongReplyPending; }
 
      */
     inline bool isPongReplyPending() const { return _pongReplyPending; }
 
-    QList<QList<QByteArray>> splitMessage(const QString &cmd, const QString &message, std::function<QList<QByteArray>(QString &)> cmdGenerator);
+    QList<QList<QByteArray>> splitMessage(const QString &cmd, const QString &message, const std::function<QList<QByteArray>(QString &)> &cmdGenerator);
 
     // IRCv3 capability negotiation
 
 
     // IRCv3 capability negotiation
 
@@ -144,8 +144,7 @@ public:
      *
      * @returns True if in progress, otherwise false
      */
      *
      * @returns True if in progress, otherwise false
      */
-    inline bool capNegotiationInProgress() const { return (!_capsQueuedIndividual.empty() ||
-                                                           !_capsQueuedBundled.empty()); }
+    inline bool capNegotiationInProgress() const { return (!_capsQueuedIndividual.empty() || !_capsQueuedBundled.empty()); }
 
     /**
      * Queues a capability to be requested.
 
     /**
      * Queues a capability to be requested.
@@ -256,7 +255,7 @@ public slots:
      */
     bool forceDisconnect(int msecs = 1000);
 
      */
     bool forceDisconnect(int msecs = 1000);
 
-    void userInput(BufferInfo bufferInfo, QString msg);
+    void userInput(const BufferInfo &bufferInfo, QString msg);
 
     /**
      * Sends the raw (encoded) line, adding to the queue if needed, optionally with higher priority.
 
     /**
      * Sends the raw (encoded) line, adding to the queue if needed, optionally with higher priority.
@@ -269,7 +268,7 @@ public slots:
      * PING/PONG replies, the other side will close the connection.
      * @endparmblock
      */
      * PING/PONG replies, the other side will close the connection.
      * @endparmblock
      */
-    void putRawLine(const QByteArray input, const bool prepend = false);
+    void putRawLine(const QByteArray &input, bool prepend = false);
 
     /**
      * Sends the command with encoded parameters, with optional prefix or high priority.
 
     /**
      * Sends the command with encoded parameters, with optional prefix or high priority.
@@ -284,7 +283,7 @@ public slots:
      * maintain PING/PONG replies, the other side will close the connection.
      * @endparmblock
      */
      * maintain PING/PONG replies, the other side will close the connection.
      * @endparmblock
      */
-    void putCmd(const QString &cmd, const QList<QByteArray> &params, const QByteArray &prefix = QByteArray(), const bool prepend = false);
+    void putCmd(const QString &cmd, const QList<QByteArray> &params, const QByteArray &prefix = {}, bool prepend = false);
 
     /**
      * Sends the command for each set of encoded parameters, with optional prefix or high priority.
 
     /**
      * Sends the command for each set of encoded parameters, with optional prefix or high priority.
@@ -303,7 +302,7 @@ public slots:
      * cannot maintain PING/PONG replies, the other side will close the connection.
      * @endparmblock
      */
      * cannot maintain PING/PONG replies, the other side will close the connection.
      * @endparmblock
      */
-    void putCmd(const QString &cmd, const QList<QList<QByteArray>> &params, const QByteArray &prefix = QByteArray(), const bool prependAll = false);
+    void putCmd(const QString &cmd, const QList<QList<QByteArray>> &params, const QByteArray &prefix = {}, bool prependAll = false);
 
     void setChannelJoined(const QString &channel);
     void setChannelParted(const QString &channel);
 
     void setChannelJoined(const QString &channel);
     void setChannelParted(const QString &channel);
@@ -424,7 +423,7 @@ public slots:
      */
     inline void resetPongReplyPending() { _pongReplyPending = false; }
 
      */
     inline void resetPongReplyPending() { _pongReplyPending = false; }
 
-    inline void displayMsg(Message::Type msgType, BufferInfo::Type bufferType, const QString &target, const QString &text, const QString &sender = "", Message::Flags flags = Message::None)
+    void onDisplayMsg(Message::Type msgType, BufferInfo::Type bufferType, const QString &target, const QString &text, const QString &sender, Message::Flags flags)
     {
         emit displayMsg(networkId(), msgType, bufferType, target, text, sender, flags);
     }
     {
         emit displayMsg(networkId(), msgType, bufferType, target, text, sender, flags);
     }
@@ -433,7 +432,7 @@ public slots:
 signals:
     void recvRawServerMsg(QString);
     void displayStatusMsg(QString);
 signals:
     void recvRawServerMsg(QString);
     void displayStatusMsg(QString);
-    void displayMsg(NetworkId, Message::Type, BufferInfo::Type, const QString &target, const QString &text, const QString &sender = "", Message::Flags flags = Message::None);
+    void displayMsg(NetworkId, Message::Type, BufferInfo::Type, const QString &target, const QString &text, const QString &sender, Message::Flags flags);
     void disconnected(NetworkId networkId);
     void connectionError(const QString &errorMsg);
 
     void disconnected(NetworkId networkId);
     void connectionError(const QString &errorMsg);
 
@@ -455,12 +454,13 @@ protected slots:
     //virtual void removeChansAndUsers();
 
 private slots:
     //virtual void removeChansAndUsers();
 
 private slots:
-    void socketHasData();
-    void socketError(QAbstractSocket::SocketError);
-    void socketInitialized();
-    void socketCloseTimeout();
-    void socketDisconnected();
-    void socketStateChanged(QAbstractSocket::SocketState);
+    void onSocketHasData();
+    void onSocketError(QAbstractSocket::SocketError);
+    void onSocketInitialized();
+    void onSocketCloseTimeout();
+    void onSocketDisconnected();
+    void onSocketStateChanged(QAbstractSocket::SocketState);
+
     void networkInitialized();
 
     void sendPerform();
     void networkInitialized();
 
     void sendPerform();
@@ -473,7 +473,7 @@ private slots:
     void startAutoWhoCycle();
 
 #ifdef HAVE_SSL
     void startAutoWhoCycle();
 
 #ifdef HAVE_SSL
-    void sslErrors(const QList<QSslError> &errors);
+    void onSslErrors(const QList<QSslError> &errors);
 #endif
 
     /**
 #endif
 
     /**
@@ -497,6 +497,17 @@ private slots:
 
     void writeToSocket(const QByteArray &data);
 
 
     void writeToSocket(const QByteArray &data);
 
+private:
+    void showMessage(Message::Type msgType,
+                     BufferInfo::Type bufferType,
+                     const QString &target,
+                     const QString &text,
+                     const QString &sender = "",
+                     Message::Flags flags = Message::None)
+    {
+        emit displayMsg(networkId(), msgType, bufferType, target, text, sender, flags);
+    }
+
 private:
     CoreSession *_coreSession;
 
 private:
     CoreSession *_coreSession;
 
index 27805ee..d258df7 100644 (file)
@@ -163,7 +163,7 @@ void CoreSession::shutdown()
     for (CoreNetwork *net : _networks.values()) {
         if (net->socketState() != QAbstractSocket::UnconnectedState) {
             _networksPendingDisconnect.insert(net->networkId());
     for (CoreNetwork *net : _networks.values()) {
         if (net->socketState() != QAbstractSocket::UnconnectedState) {
             _networksPendingDisconnect.insert(net->networkId());
-            connect(net, SIGNAL(disconnected(NetworkId)), this, SLOT(onNetworkDisconnected(NetworkId)));
+            connect(net, &CoreNetwork::disconnected, this, &CoreSession::onNetworkDisconnected);
             net->shutdown();
         }
     }
             net->shutdown();
         }
     }
@@ -269,7 +269,7 @@ void CoreSession::addClient(RemotePeer *peer)
 void CoreSession::addClient(InternalPeer *peer)
 {
     signalProxy()->addPeer(peer);
 void CoreSession::addClient(InternalPeer *peer)
 {
     signalProxy()->addPeer(peer);
-    emit sessionState(sessionState());
+    emit sessionStateReceived(sessionState());
 }
 
 
 }
 
 
@@ -622,8 +622,7 @@ void CoreSession::createNetwork(const NetworkInfo &info_, const QStringList &per
         }
 
         CoreNetwork *net = new CoreNetwork(id, this);
         }
 
         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, &CoreNetwork::displayMsg, this, &CoreSession::recvMessageFromServer);
         connect(net, &CoreNetwork::displayStatusMsg, this, &CoreSession::recvStatusMsgFromServer);
         connect(net, &CoreNetwork::disconnected, this, &CoreSession::networkDisconnected);
 
         connect(net, &CoreNetwork::displayStatusMsg, this, &CoreSession::recvStatusMsgFromServer);
         connect(net, &CoreNetwork::disconnected, this, &CoreSession::networkDisconnected);
 
@@ -649,8 +648,8 @@ void CoreSession::removeNetwork(NetworkId id)
 
     if (net->connectionState() != Network::Disconnected) {
         // make sure we no longer receive data from the tcp buffer
 
     if (net->connectionState() != Network::Disconnected) {
         // make sure we no longer receive data from the tcp buffer
-        disconnect(net, SIGNAL(displayMsg(NetworkId, Message::Type, BufferInfo::Type, const QString &, const QString &, const QString &, Message::Flags)), this, nullptr);
-        disconnect(net, SIGNAL(displayStatusMsg(QString)), this, nullptr);
+        disconnect(net, &CoreNetwork::displayMsg, this, nullptr);
+        disconnect(net, &CoreNetwork::displayStatusMsg, this, nullptr);
         connect(net, &CoreNetwork::disconnected, this, &CoreSession::destroyNetwork);
         net->disconnectFromIrc();
     }
         connect(net, &CoreNetwork::disconnected, this, &CoreSession::destroyNetwork);
         net->disconnectFromIrc();
     }
index ed9b5fe..dade24b 100644 (file)
@@ -167,7 +167,7 @@ public slots:
 
 signals:
     void initialized();
 
 signals:
     void initialized();
-    void sessionState(const Protocol::SessionState &sessionState);
+    void sessionStateReceived(const Protocol::SessionState &sessionState);
 
     //void msgFromGui(uint netid, QString buf, QString message);
     void displayMsg(Message message);
 
     //void msgFromGui(uint netid, QString buf, QString message);
     void displayMsg(Message message);
index 38b693b..e178cda 100644 (file)
@@ -24,6 +24,7 @@
 #include <QTcpSocket>
 
 #include "coretransfer.h"
 #include <QTcpSocket>
 
 #include "coretransfer.h"
+#include "util.h"
 
 const qint64 chunkSize = 16 * 1024;
 
 
 const qint64 chunkSize = 16 * 1024;
 
@@ -124,7 +125,7 @@ void CoreTransfer::setupConnectionForReceive()
     _socket = new QTcpSocket(this);
     connect(_socket, &QAbstractSocket::connected, this, &CoreTransfer::startReceiving);
     connect(_socket, &QAbstractSocket::disconnected, this, &CoreTransfer::onSocketDisconnected);
     _socket = new QTcpSocket(this);
     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, selectOverload<QAbstractSocket::SocketError>(&QAbstractSocket::error), this, &CoreTransfer::onSocketError);
     connect(_socket, &QIODevice::readyRead, this, &CoreTransfer::onDataReceived);
 
     _socket->connectToHost(address(), port());
     connect(_socket, &QIODevice::readyRead, this, &CoreTransfer::onDataReceived);
 
     _socket->connectToHost(address(), port());
index bdc0a73..80ecdd3 100644 (file)
@@ -47,7 +47,7 @@ public slots:
     {
         _session = new CoreSession{_userId, _restoreState, _strictIdentEnabled, this};
         connect(_session, &QObject::destroyed, QThread::currentThread(), &QThread::quit);
     {
         _session = new CoreSession{_userId, _restoreState, _strictIdentEnabled, this};
         connect(_session, &QObject::destroyed, QThread::currentThread(), &QThread::quit);
-        connect(_session, SIGNAL(sessionState(Protocol::SessionState)), Core::instance(), SIGNAL(sessionState(Protocol::SessionState)));
+        connect(_session, &CoreSession::sessionStateReceived, Core::instance(), &Core::sessionStateReceived);
         emit initialized();
     }
 
         emit initialized();
     }
 
index be6f440..f6dc522 100644 (file)
@@ -38,7 +38,7 @@ void MonolithicApplication::init()
 {
     QtUiApplication::init();
 
 {
     QtUiApplication::init();
 
-    connect(Client::coreConnection(), SIGNAL(connectToInternalCore(QPointer<InternalPeer>)), this, SLOT(onConnectionRequest(QPointer<InternalPeer>)));
+    connect(Client::coreConnection(), &CoreConnection::connectToInternalCore, this, &MonolithicApplication::onConnectionRequest);
 
     // If port is set, start internal core directly so external clients can connect
     // This is useful in case the mono client re-gains remote connection capability,
 
     // If port is set, start internal core directly so external clients can connect
     // This is useful in case the mono client re-gains remote connection capability,
@@ -53,7 +53,7 @@ Quassel::QuitHandler MonolithicApplication::quitHandler()
 {
     return [this]() {
         quInfo() << "Client shutting down...";
 {
     return [this]() {
         quInfo() << "Client shutting down...";
-        connect(_client.get(), SIGNAL(destroyed()), this, SLOT(onClientDestroyed()));
+        connect(_client.get(), &QObject::destroyed, this, &MonolithicApplication::onClientDestroyed);
         _client.release()->deleteLater();
     };
 }
         _client.release()->deleteLater();
     };
 }
@@ -62,7 +62,7 @@ Quassel::QuitHandler MonolithicApplication::quitHandler()
 void MonolithicApplication::onClientDestroyed()
 {
     if (_core) {
 void MonolithicApplication::onClientDestroyed()
 {
     if (_core) {
-        connect(_core, SIGNAL(shutdownComplete()), this, SLOT(onCoreShutdown()));
+        connect(_core, &Core::shutdownComplete, this, &MonolithicApplication::onCoreShutdown);
         _core->shutdown();
     }
     else {
         _core->shutdown();
     }
     else {
@@ -74,7 +74,7 @@ void MonolithicApplication::onClientDestroyed()
 void MonolithicApplication::onCoreShutdown()
 {
     if (_core) {
 void MonolithicApplication::onCoreShutdown()
 {
     if (_core) {
-        connect(_core, SIGNAL(destroyed()), QCoreApplication::instance(), SLOT(quit()));
+        connect(_core, &QObject::destroyed, QCoreApplication::instance(), &QCoreApplication::quit);
         _coreThread.quit();
         _coreThread.wait();
     }
         _coreThread.quit();
         _coreThread.wait();
     }
@@ -97,8 +97,8 @@ void MonolithicApplication::startInternalCore()
     connect(&_coreThread, &QThread::started, _core.data(), &Core::initAsync);
     connect(&_coreThread, &QThread::finished, _core.data(), &QObject::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(this, &MonolithicApplication::connectInternalPeer, _core, &Core::connectInternalPeer);
+    connect(_core, &Core::sessionStateReceived, Client::coreConnection(), &CoreConnection::internalSessionStateReceived);
 
     connect(_core.data(), &Core::dbUpgradeInProgress, Client::instance(), &Client::onDbUpgradeInProgress);
     connect(_core.data(), &Core::exitRequested, Client::instance(), &Client::onExitRequested);
 
     connect(_core.data(), &Core::dbUpgradeInProgress, Client::instance(), &Client::onDbUpgradeInProgress);
     connect(_core.data(), &Core::exitRequested, Client::instance(), &Client::onExitRequested);
index d44868a..4ff1adc 100644 (file)
@@ -23,6 +23,7 @@
 #include <QAction>
 #include <QMenu>
 
 #include <QAction>
 #include <QMenu>
 
+#include "action.h"
 #include "awaylogfilter.h"
 #include "chatlinemodel.h"
 #include "chatscene.h"
 #include "awaylogfilter.h"
 #include "chatlinemodel.h"
 #include "chatscene.h"
@@ -43,14 +44,16 @@ void AwayLogView::addActionsToMenu(QMenu *menu, const QPointF &pos)
     if (scene()->columnByScenePos(pos) == ChatLineModel::SenderColumn) {
         menu->addSeparator();
 
     if (scene()->columnByScenePos(pos) == ChatLineModel::SenderColumn) {
         menu->addSeparator();
 
-        QAction *showNetworkAction = menu->addAction(tr("Show Network Name"), this, SLOT(showFieldsChanged(bool)));
+        auto *showNetworkAction = new Action(tr("Show Network Name"), menu, this, SLOT(showFieldsChanged(bool)));
         showNetworkAction->setCheckable(true);
         showNetworkAction->setChecked(filter()->showFields() & ChatMonitorFilter::NetworkField);
         showNetworkAction->setData(ChatMonitorFilter::NetworkField);
         showNetworkAction->setCheckable(true);
         showNetworkAction->setChecked(filter()->showFields() & ChatMonitorFilter::NetworkField);
         showNetworkAction->setData(ChatMonitorFilter::NetworkField);
+        menu->addAction(showNetworkAction);
 
 
-        QAction *showBufferAction = menu->addAction(tr("Show Buffer Name"), this, SLOT(showFieldsChanged(bool)));
+        auto *showBufferAction = new Action(tr("Show Buffer Name"), menu, this, SLOT(showFieldsChanged(bool)));
         showBufferAction->setCheckable(true);
         showBufferAction->setChecked(filter()->showFields() & ChatMonitorFilter::BufferField);
         showBufferAction->setData(ChatMonitorFilter::BufferField);
         showBufferAction->setCheckable(true);
         showBufferAction->setChecked(filter()->showFields() & ChatMonitorFilter::BufferField);
         showBufferAction->setData(ChatMonitorFilter::BufferField);
+        menu->addAction(showBufferAction);
     }
 }
     }
 }
index f8c4cac..cd93228 100644 (file)
@@ -68,7 +68,7 @@ BufferWidget::BufferWidget(QWidget *parent)
     connect(ui.searchBar->searchDownButton(), &QAbstractButton::clicked,
         _chatViewSearchController, &ChatViewSearchController::highlightNext);
 
     connect(ui.searchBar->searchDownButton(), &QAbstractButton::clicked,
         _chatViewSearchController, &ChatViewSearchController::highlightNext);
 
-    connect(ui.searchBar, SIGNAL(hidden()), this, SLOT(setFocus()));
+    connect(ui.searchBar, &ChatViewSearchBar::hidden, this, selectOverload<>(&QWidget::setFocus));
 
     connect(_chatViewSearchController, &ChatViewSearchController::newCurrentHighlight,
         this, &BufferWidget::scrollToHighlight);
 
     connect(_chatViewSearchController, &ChatViewSearchController::newCurrentHighlight,
         this, &BufferWidget::scrollToHighlight);
index cda1fd8..d94a2a9 100644 (file)
@@ -33,6 +33,7 @@
 #include <QTextLayout>
 #include <QMenu>
 
 #include <QTextLayout>
 #include <QMenu>
 
+#include "action.h"
 #include "buffermodel.h"
 #include "bufferview.h"
 #include "chatline.h"
 #include "buffermodel.h"
 #include "bufferview.h"
 #include "chatline.h"
@@ -869,10 +870,13 @@ void ContentsChatItem::addActionsToMenu(QMenu *menu, const QPointF &pos)
         Clickable click = privateData()->currentClickable;
         switch (click.type()) {
         case Clickable::Url:
         Clickable click = privateData()->currentClickable;
         switch (click.type()) {
         case Clickable::Url:
+        {
             privateData()->activeClickable = click;
             privateData()->activeClickable = click;
-            menu->addAction(icon::get("edit-copy"), tr("Copy Link Address"),
-                &_actionProxy, SLOT(copyLinkToClipboard()))->setData(QVariant::fromValue<void *>(this));
+            auto action = new Action{icon::get("edit-copy"), tr("Copy Link Address"), menu, &_actionProxy, SLOT(copyLinkToClipboard())};
+            action->setData(QVariant::fromValue<void *>(this));
+            menu->addAction(action);
             break;
             break;
+        }
         case Clickable::Channel:
         {
             // Remove existing menu actions, they confuse us when right-clicking on a clickable
         case Clickable::Channel:
         {
             // Remove existing menu actions, they confuse us when right-clicking on a clickable
index 71c975b..a2740c6 100644 (file)
@@ -24,6 +24,7 @@
 #include <QMenu>
 #include <QContextMenuEvent>
 
 #include <QMenu>
 #include <QContextMenuEvent>
 
+#include "action.h"
 #include "buffermodel.h"
 #include "chatmonitorfilter.h"
 #include "chatlinemodel.h"
 #include "buffermodel.h"
 #include "chatmonitorfilter.h"
 #include "chatlinemodel.h"
@@ -54,26 +55,29 @@ void ChatMonitorView::addActionsToMenu(QMenu *menu, const QPointF &pos)
 {
     ChatView::addActionsToMenu(menu, pos);
     menu->addSeparator();
 {
     ChatView::addActionsToMenu(menu, pos);
     menu->addSeparator();
-    QAction *showOwnNicksAction = menu->addAction(tr("Show Own Messages"), _filter, SLOT(setShowOwnMessages(bool)));
+    auto showOwnNicksAction = new Action(tr("Show Own Messages"), menu, _filter, SLOT(setShowOwnMessages(bool)));
     showOwnNicksAction->setCheckable(true);
     showOwnNicksAction->setChecked(_filter->showOwnMessages());
     showOwnNicksAction->setCheckable(true);
     showOwnNicksAction->setChecked(_filter->showOwnMessages());
+    menu->addAction(showOwnNicksAction);
 
     if (scene()->columnByScenePos(pos) == ChatLineModel::SenderColumn) {
         menu->addSeparator();
 
 
     if (scene()->columnByScenePos(pos) == ChatLineModel::SenderColumn) {
         menu->addSeparator();
 
-        QAction *showNetworkAction = menu->addAction(tr("Show Network Name"), this, SLOT(showFieldsChanged(bool)));
+        auto showNetworkAction = new Action(tr("Show Network Name"), menu, this, SLOT(showFieldsChanged(bool)));
         showNetworkAction->setCheckable(true);
         showNetworkAction->setChecked(_filter->showFields() & ChatMonitorFilter::NetworkField);
         showNetworkAction->setData(ChatMonitorFilter::NetworkField);
         showNetworkAction->setCheckable(true);
         showNetworkAction->setChecked(_filter->showFields() & ChatMonitorFilter::NetworkField);
         showNetworkAction->setData(ChatMonitorFilter::NetworkField);
+        menu->addAction(showNetworkAction);
 
 
-        QAction *showBufferAction = menu->addAction(tr("Show Buffer Name"), this, SLOT(showFieldsChanged(bool)));
+        auto showBufferAction = new Action(tr("Show Buffer Name"), menu, this, SLOT(showFieldsChanged(bool)));
         showBufferAction->setCheckable(true);
         showBufferAction->setChecked(_filter->showFields() & ChatMonitorFilter::BufferField);
         showBufferAction->setData(ChatMonitorFilter::BufferField);
         showBufferAction->setCheckable(true);
         showBufferAction->setChecked(_filter->showFields() & ChatMonitorFilter::BufferField);
         showBufferAction->setData(ChatMonitorFilter::BufferField);
+        menu->addAction(showBufferAction);
     }
 
     menu->addSeparator();
     }
 
     menu->addSeparator();
-    menu->addAction(icon::get("configure"), tr("Configure..."), this, SLOT(showSettingsPage()));
+    menu->addAction(new Action(icon::get("configure"), tr("Configure..."), menu, this, SLOT(showSettingsPage())));
 }
 
 
 }
 
 
@@ -124,5 +128,5 @@ void ChatMonitorView::showSettingsPage()
 void ChatMonitorView::coreConnectionStateChanged(bool connected)
 {
     if (connected)
 void ChatMonitorView::coreConnectionStateChanged(bool connected)
 {
     if (connected)
-        connect(Client::ignoreListManager(), SIGNAL(ignoreListChanged()), _filter, SLOT(invalidateFilter()));
+        connect(Client::ignoreListManager(), &ClientIgnoreListManager::ignoreListChanged, _filter, &ChatMonitorFilter::invalidateFilter);
 }
 }
index 3ebf67c..18b0b43 100644 (file)
@@ -41,7 +41,7 @@ ChatViewSearchBar::ChatViewSearchBar(QWidget *parent)
     ActionCollection *coll = QtUi::actionCollection("General");
 
     QAction *toggleSearchBar = coll->action("ToggleSearchBar");
     ActionCollection *coll = QtUi::actionCollection("General");
 
     QAction *toggleSearchBar = coll->action("ToggleSearchBar");
-    connect(toggleSearchBar, SIGNAL(toggled(bool)), SLOT(setVisible(bool)));
+    connect(toggleSearchBar, &QAction::toggled, this, &QWidget::setVisible);
 
     auto *hideSearchBar = coll->add<Action>("HideSearchBar", toggleSearchBar, SLOT(setChecked(bool)));
     hideSearchBar->setShortcutConfigurable(false);
 
     auto *hideSearchBar = coll->add<Action>("HideSearchBar", toggleSearchBar, SLOT(setChecked(bool)));
     hideSearchBar->setShortcutConfigurable(false);
index cff1908..f12bfa0 100644 (file)
@@ -70,8 +70,8 @@ void ChatViewSearchController::setScene(ChatScene *scene)
         return;
 
     connect(_scene, &QObject::destroyed, this, &ChatViewSearchController::sceneDestroyed);
         return;
 
     connect(_scene, &QObject::destroyed, this, &ChatViewSearchController::sceneDestroyed);
-    connect(_scene, SIGNAL(layoutChanged()), this, SLOT(repositionHighlights()));
-    connect(Client::messageModel(), SIGNAL(finishedBacklogFetch(BufferId)), this, SLOT(updateHighlights()));
+    connect(_scene, &ChatScene::layoutChanged, this, [this]() { repositionHighlights(); });
+    connect(Client::messageModel(), &MessageModel::finishedBacklogFetch, this, [this]() { updateHighlights(); });
     updateHighlights();
 }
 
     updateHighlights();
 }
 
index 0f9aca5..978e6a0 100644 (file)
@@ -47,8 +47,6 @@ ColumnHandleItem::ColumnHandleItem(qreal w, QGraphicsItem *parent)
     _animation->setDirection(QPropertyAnimation::Forward);
     _animation->setDuration(350);
     _animation->setEasingCurve(QEasingCurve::InOutSine);
     _animation->setDirection(QPropertyAnimation::Forward);
     _animation->setDuration(350);
     _animation->setEasingCurve(QEasingCurve::InOutSine);
-
-    //connect(&_timeLine, SIGNAL(valueChanged(qreal)), this, SLOT(hoverChanged(qreal)));
 }
 
 
 }
 
 
index 669d670..e830512 100644 (file)
@@ -29,6 +29,7 @@
 #include "client.h"
 #include "coreconnection.h"
 #include "icon.h"
 #include "client.h"
 #include "coreconnection.h"
 #include "icon.h"
+#include "util.h"
 
 namespace {
 
 
 namespace {
 
@@ -165,7 +166,7 @@ CoreConfigWizard::CoreConfigWizard(CoreConnection *connection, const QVariantLis
     connect(connection, &CoreConnection::coreSetupSuccess, this, &CoreConfigWizard::coreSetupSuccess);
     connect(connection, &CoreConnection::coreSetupFailed, this, &CoreConfigWizard::coreSetupFailed);
     connect(connection, &CoreConnection::synchronized, this, &CoreConfigWizard::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(this, &QDialog::rejected, connection, selectOverload<>(&CoreConnection::disconnectFromCore));
 
 
     // Resize all pages to the size hint of the largest one, so the wizard is large enough
 
 
     // Resize all pages to the size hint of the largest one, so the wizard is large enough
index 220e28f..e22bfc5 100644 (file)
@@ -48,8 +48,8 @@ CoreConnectDlg::CoreConnectDlg(QWidget *parent) : QDialog(parent)
     buttonBox->setStandardButtons(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
     layout->addWidget(buttonBox);
 
     buttonBox->setStandardButtons(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
     layout->addWidget(buttonBox);
 
-    connect(_settingsPage, SIGNAL(connectToCore(AccountId)), SLOT(accept()));
-    connect(buttonBox, SIGNAL(accepted()), SLOT(accept()));
+    connect(_settingsPage, &CoreAccountSettingsPage::connectToCore, this, &QDialog::accept);
+    connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
     connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
 }
 
     connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
 }
 
index 13c203d..d7b1c3c 100644 (file)
@@ -129,7 +129,7 @@ void CoreInfoDlg::coreInfoChanged(const QVariantMap &coreInfo) {
             // The layout stretch item should never be removed, so count should always be >= 1.
             ui.coreSessionContainer->insertWidget(ui.coreSessionContainer->count() - 1,
                                                   coreSessionWidget, 0, Qt::AlignTop);
             // The layout stretch item should never be removed, so count should always be >= 1.
             ui.coreSessionContainer->insertWidget(ui.coreSessionContainer->count() - 1,
                                                   coreSessionWidget, 0, Qt::AlignTop);
-            connect(coreSessionWidget, SIGNAL(disconnectClicked(int)), this, SLOT(disconnectClicked(int)));
+            connect(coreSessionWidget, &CoreSessionWidget::disconnectClicked, this, &CoreInfoDlg::disconnectClicked);
         }
     }
 
         }
     }
 
index 29f323e..c0f9686 100644 (file)
@@ -29,7 +29,7 @@ CoreSessionWidget::CoreSessionWidget(QWidget *parent)
     : QWidget(parent)
 {
     ui.setupUi(this);
     : QWidget(parent)
 {
     ui.setupUi(this);
-    connect(ui.disconnectButton, SIGNAL(released()), this, SLOT(disconnectClicked()));
+    connect(ui.disconnectButton, &QPushButton::released, this, &CoreSessionWidget::onDisconnectClicked);
 }
 
 void CoreSessionWidget::setData(QMap<QString, QVariant> map)
 }
 
 void CoreSessionWidget::setData(QMap<QString, QVariant> map)
@@ -78,7 +78,7 @@ void CoreSessionWidget::setData(QMap<QString, QVariant> map)
     if (!success) _peerId = -1;
 }
 
     if (!success) _peerId = -1;
 }
 
-void CoreSessionWidget::disconnectClicked()
+void CoreSessionWidget::onDisconnectClicked()
 {
     // Don't allow the End Session button to be spammed; Quassel's protocol isn't lossy and it
     // should reach the destination eventually...
 {
     // Don't allow the End Session button to be spammed; Quassel's protocol isn't lossy and it
     // should reach the destination eventually...
index 0a5ff26..07eae95 100644 (file)
@@ -37,7 +37,7 @@ signals:
     void disconnectClicked(int);
 
 private slots:
     void disconnectClicked(int);
 
 private slots:
-    void disconnectClicked();
+    void onDisconnectClicked();
 
 private:
     Ui::CoreSessionWidget ui;
 
 private:
     Ui::CoreSessionWidget ui;
index e5a0ed5..23b48b8 100644 (file)
@@ -60,7 +60,7 @@ DebugBufferViewOverlay::DebugBufferViewOverlay(QWidget *parent)
     layout->addRow(tr("Is initialized:"), _isInitialized = new QLabel(this));
 
     update();
     layout->addRow(tr("Is initialized:"), _isInitialized = new QLabel(this));
 
     update();
-    connect(Client::bufferViewOverlay(), SIGNAL(hasChanged()), this, SLOT(update()));
+    connect(Client::bufferViewOverlay(), &BufferViewOverlay::hasChanged, this, &DebugBufferViewOverlay::update);
 }
 
 
 }
 
 
index a243022..2a6ea9b 100644 (file)
@@ -28,6 +28,7 @@
 #include "clientsettings.h"
 #include "coreconnection.h"
 #include "clientbacklogmanager.h"
 #include "clientsettings.h"
 #include "coreconnection.h"
 #include "clientbacklogmanager.h"
+#include "util.h"
 
 DockManagerNotificationBackend::DockManagerNotificationBackend(QObject *parent)
     : AbstractNotificationBackend(parent), _bus(QDBusConnection::sessionBus())
 
 DockManagerNotificationBackend::DockManagerNotificationBackend(QObject *parent)
     : AbstractNotificationBackend(parent), _bus(QDBusConnection::sessionBus())
@@ -54,7 +55,7 @@ DockManagerNotificationBackend::DockManagerNotificationBackend(QObject *parent)
 
     itemAdded(QDBusObjectPath());
 
 
     itemAdded(QDBusObjectPath());
 
-    connect(Client::coreConnection(), SIGNAL(progressValueChanged(int)), this, SLOT(updateProgress(int)));
+    connect(Client::coreConnection(), &CoreConnection::progressValueChanged, this, selectOverload<int>(&DockManagerNotificationBackend::updateProgress));
     connect(Client::coreConnection(), &CoreConnection::synchronized, this, &DockManagerNotificationBackend::synchronized);
 }
 
     connect(Client::coreConnection(), &CoreConnection::synchronized, this, &DockManagerNotificationBackend::synchronized);
 }
 
@@ -123,7 +124,7 @@ void DockManagerNotificationBackend::updateProgress(int done, int total)
 
 void DockManagerNotificationBackend::synchronized()
 {
 
 void DockManagerNotificationBackend::synchronized()
 {
-    connect(Client::backlogManager(), SIGNAL(updateProgress(int, int)), this, SLOT(updateProgress(int, int)));
+    connect(Client::backlogManager(), &ClientBacklogManager::updateProgress, this, selectOverload<int, int>(&DockManagerNotificationBackend::updateProgress));
 }
 
 
 }
 
 
index f93c7d9..891501e 100644 (file)
@@ -35,6 +35,7 @@
 #include "qtui.h"
 #include "qtuisettings.h"
 #include "tabcompleter.h"
 #include "qtui.h"
 #include "qtuisettings.h"
 #include "tabcompleter.h"
+#include "util.h"
 
 const int leftMargin = 3;
 
 
 const int leftMargin = 3;
 
@@ -43,7 +44,7 @@ InputWidget::InputWidget(QWidget *parent)
     _networkId(0)
 {
     ui.setupUi(this);
     _networkId(0)
 {
     ui.setupUi(this);
-    connect(ui.ownNick, SIGNAL(activated(QString)), this, SLOT(changeNick(QString)));
+    connect(ui.ownNick, selectOverload<const QString&>(&QComboBox::activated), this, &InputWidget::changeNick);
 
     layout()->setAlignment(ui.ownNick, Qt::AlignBottom);
     layout()->setAlignment(ui.inputEdit, Qt::AlignBottom);
 
     layout()->setAlignment(ui.ownNick, Qt::AlignBottom);
     layout()->setAlignment(ui.inputEdit, Qt::AlignBottom);
@@ -145,7 +146,7 @@ InputWidget::InputWidget(QWidget *parent)
     ActionCollection *coll = QtUi::actionCollection();
 
     auto *activateInputline = coll->add<Action>("FocusInputLine");
     ActionCollection *coll = QtUi::actionCollection();
 
     auto *activateInputline = coll->add<Action>("FocusInputLine");
-    connect(activateInputline, SIGNAL(triggered()), SLOT(setFocus()));
+    connect(activateInputline, &QAction::triggered, this, selectOverload<>(&QWidget::setFocus));
     activateInputline->setText(tr("Focus Input Line"));
     activateInputline->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_L));
 
     activateInputline->setText(tr("Focus Input Line"));
     activateInputline->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_L));
 
index 9ca881e..4faea24 100644 (file)
 #include "mainwin.h"
 #include "networkmodel.h"
 #include "qtui.h"
 #include "mainwin.h"
 #include "networkmodel.h"
 #include "qtui.h"
+#include "util.h"
 
 KNotificationBackend::KNotificationBackend(QObject *parent)
     : AbstractNotificationBackend(parent)
 {
 
 KNotificationBackend::KNotificationBackend(QObject *parent)
     : AbstractNotificationBackend(parent)
 {
-    connect(QtUi::mainWindow()->systemTray(), SIGNAL(activated(SystemTray::ActivationReason)),
-        SLOT(notificationActivated(SystemTray::ActivationReason)));
+    connect(QtUi::mainWindow()->systemTray(), &SystemTray::activated,
+            this, selectOverload<SystemTray::ActivationReason>(&KNotificationBackend::notificationActivated));
 
     updateToolTip();
 }
 
     updateToolTip();
 }
@@ -61,7 +62,7 @@ void KNotificationBackend::notify(const Notification &n)
         KNotification::RaiseWidgetOnActivation
         |KNotification::CloseWhenWidgetActivated
         |KNotification::CloseOnTimeout);
         KNotification::RaiseWidgetOnActivation
         |KNotification::CloseWhenWidgetActivated
         |KNotification::CloseOnTimeout);
-    connect(notification, SIGNAL(activated(uint)), SLOT(notificationActivated()));
+    connect(notification, selectOverload<uint>(&KNotification::activated), this, selectOverload<>(&KNotificationBackend::notificationActivated));
     notification->setActions(QStringList("View"));
     notification->setProperty("notificationId", n.notificationId);
 
     notification->setActions(QStringList("View"));
     notification->setProperty("notificationId", n.notificationId);
 
@@ -145,7 +146,7 @@ KNotificationBackend::ConfigWidget::ConfigWidget(QWidget *parent) : SettingsPage
     QVBoxLayout *layout = new QVBoxLayout(this);
     layout->addWidget(_widget);
 
     QVBoxLayout *layout = new QVBoxLayout(this);
     layout->addWidget(_widget);
 
-    connect(_widget, SIGNAL(changed(bool)), SLOT(widgetChanged(bool)));
+    connect(_widget, &KNotifyConfigWidget::changed, this, &ConfigWidget::widgetChanged);
 }
 
 
 }
 
 
index cccca9f..48bbcce 100644 (file)
@@ -264,7 +264,7 @@ void MainWin::init()
     // we assume that at this point, all configurable actions are defined!
     QtUi::loadShortcuts();
 
     // we assume that at this point, all configurable actions are defined!
     QtUi::loadShortcuts();
 
-    connect(bufferWidget(), SIGNAL(currentChanged(BufferId)), SLOT(currentBufferChanged(BufferId)));
+    connect(bufferWidget(), selectOverload<BufferId>(&AbstractBufferContainer::currentChanged), this, &MainWin::currentBufferChanged);
 
     setDisconnectedState(); // Disable menus and stuff
 
 
     setDisconnectedState(); // Disable menus and stuff
 
@@ -640,7 +640,7 @@ void MainWin::setupMenus()
     showMenuBar->setChecked(enabled);
     enabled ? menuBar()->show() : menuBar()->hide();
 
     showMenuBar->setChecked(enabled);
     enabled ? menuBar()->show() : menuBar()->hide();
 
-    connect(showMenuBar, SIGNAL(toggled(bool)), menuBar(), SLOT(setVisible(bool)));
+    connect(showMenuBar, &QAction::toggled, menuBar(), &QMenuBar::setVisible);
     connect(showMenuBar, &QAction::toggled, this, &MainWin::saveMenuBarStatus);
 }
 
     connect(showMenuBar, &QAction::toggled, this, &MainWin::saveMenuBarStatus);
 }
 
@@ -976,7 +976,7 @@ void MainWin::setupNickWidget()
     nickDock->toggleViewAction()->setText(tr("Show Nick List"));
 
     // See NickListDock::NickListDock();
     nickDock->toggleViewAction()->setText(tr("Show Nick List"));
 
     // See NickListDock::NickListDock();
-    // connect(nickDock->toggleViewAction(), SIGNAL(triggered(bool)), nickListWidget, SLOT(showWidget(bool)));
+    // connect(nickDock->toggleViewAction(), &NickListDock::triggered, nickListWidget, &QWidget::showWidget);
 
     // attach the NickListWidget to the BufferModel and the default selection
     _nickListWidget->setModel(Client::bufferModel());
 
     // attach the NickListWidget to the BufferModel and the default selection
     _nickListWidget->setModel(Client::bufferModel());
@@ -1020,8 +1020,6 @@ void MainWin::setupInputWidget()
     _inputWidget->setSelectionModel(Client::bufferModel()->standardSelectionModel());
 
     _inputWidget->inputLine()->installEventFilter(_bufferWidget);
     _inputWidget->setSelectionModel(Client::bufferModel()->standardSelectionModel());
 
     _inputWidget->inputLine()->installEventFilter(_bufferWidget);
-
-    connect(_topicWidget, SIGNAL(switchedPlain()), _bufferWidget, SLOT(setFocus()));
 }
 
 
 }
 
 
@@ -1036,6 +1034,8 @@ void MainWin::setupTopicWidget()
     _topicWidget->setModel(Client::bufferModel());
     _topicWidget->setSelectionModel(Client::bufferModel()->standardSelectionModel());
 
     _topicWidget->setModel(Client::bufferModel());
     _topicWidget->setSelectionModel(Client::bufferModel()->standardSelectionModel());
 
+    connect(_topicWidget, &TopicWidget::switchedPlain, _bufferWidget, selectOverload<>(&QWidget::setFocus));
+
     addDockWidget(Qt::TopDockWidgetArea, dock, Qt::Vertical);
 
     _viewMenu->addAction(dock->toggleViewAction());
     addDockWidget(Qt::TopDockWidgetArea, dock, Qt::Vertical);
 
     _viewMenu->addAction(dock->toggleViewAction());
@@ -1098,7 +1098,9 @@ void MainWin::setupStatusBar()
     connect(showStatusbar, &QAction::toggled, statusBar(), &QWidget::setVisible);
     connect(showStatusbar, &QAction::toggled, this, &MainWin::saveStatusBarStatus);
 
     connect(showStatusbar, &QAction::toggled, statusBar(), &QWidget::setVisible);
     connect(showStatusbar, &QAction::toggled, this, &MainWin::saveStatusBarStatus);
 
-    connect(Client::coreConnection(), SIGNAL(connectionMsg(QString)), statusBar(), SLOT(showMessage(QString)));
+    connect(Client::coreConnection(), &CoreConnection::connectionMsg, statusBar(), [statusBar = statusBar()](auto &&message) {
+        statusBar->showMessage(message);
+    });
 }
 
 
 }
 
 
@@ -1138,10 +1140,10 @@ void MainWin::setupSystray()
 
 void MainWin::setupToolBars()
 {
 
 void MainWin::setupToolBars()
 {
-    connect(_bufferWidget, SIGNAL(currentChanged(QModelIndex)),
-        QtUi::toolBarActionProvider(), SLOT(currentBufferChanged(QModelIndex)));
-    connect(_nickListWidget, SIGNAL(nickSelectionChanged(QModelIndexList)),
-        QtUi::toolBarActionProvider(), SLOT(nickSelectionChanged(QModelIndexList)));
+    connect(_bufferWidget, selectOverload<const QModelIndex&>(&AbstractBufferContainer::currentChanged),
+        QtUi::toolBarActionProvider(), &ToolBarActionProvider::onCurrentBufferChanged);
+    connect(_nickListWidget, &NickListWidget::nickSelectionChanged,
+        QtUi::toolBarActionProvider(), &ToolBarActionProvider::onNickSelectionChanged);
 
 #ifdef Q_OS_MAC
     setUnifiedTitleAndToolBarOnMac(true);
 
 #ifdef Q_OS_MAC
     setUnifiedTitleAndToolBarOnMac(true);
@@ -1186,7 +1188,7 @@ void MainWin::setupToolBars()
 
     bool visible = uiSettings.value("ShowMainToolBar", QVariant(true)).toBool();
     _mainToolBar->setVisible(visible);
 
     bool visible = uiSettings.value("ShowMainToolBar", QVariant(true)).toBool();
     _mainToolBar->setVisible(visible);
-    connect(_mainToolBar, SIGNAL(visibilityChanged(bool)), this, SLOT(saveMainToolBarStatus(bool)));
+    connect(_mainToolBar, &QToolBar::visibilityChanged, this, &MainWin::saveMainToolBarStatus);
 #endif
 }
 
 #endif
 }
 
@@ -1213,7 +1215,7 @@ void MainWin::doAutoConnect()
 void MainWin::connectedToCore()
 {
     Q_CHECK_PTR(Client::bufferViewManager());
 void MainWin::connectedToCore()
 {
     Q_CHECK_PTR(Client::bufferViewManager());
-    connect(Client::bufferViewManager(), SIGNAL(bufferViewConfigAdded(int)), this, SLOT(addBufferView(int)));
+    connect(Client::bufferViewManager(), &BufferViewManager::bufferViewConfigAdded, this, selectOverload<int>(&MainWin::addBufferView));
     connect(Client::bufferViewManager(), &BufferViewManager::bufferViewConfigDeleted, this, &MainWin::removeBufferView);
     connect(Client::bufferViewManager(), &SyncableObject::initDone, this, &MainWin::loadLayout);
 
     connect(Client::bufferViewManager(), &BufferViewManager::bufferViewConfigDeleted, this, &MainWin::removeBufferView);
     connect(Client::bufferViewManager(), &SyncableObject::initDone, this, &MainWin::loadLayout);
 
index a47e509..7d683e6 100644 (file)
@@ -142,13 +142,13 @@ void NickListWidget::currentChanged(const QModelIndex &current, const QModelInde
         nickViews[newBufferId] = view;
         ui.stackedWidget->addWidget(view);
         ui.stackedWidget->setCurrentWidget(view);
         nickViews[newBufferId] = view;
         ui.stackedWidget->addWidget(view);
         ui.stackedWidget->setCurrentWidget(view);
-        connect(view, SIGNAL(selectionUpdated()), SLOT(nickSelectionChanged()));
+        connect(view, &NickView::selectionUpdated, this, &NickListWidget::onNickSelectionChanged);
     }
     emit nickSelectionChanged(view->selectedIndexes());
 }
 
 
     }
     emit nickSelectionChanged(view->selectedIndexes());
 }
 
 
-void NickListWidget::nickSelectionChanged()
+void NickListWidget::onNickSelectionChanged()
 {
     auto *view = qobject_cast<NickView *>(sender());
     Q_ASSERT(view);
 {
     auto *view = qobject_cast<NickView *>(sender());
     Q_ASSERT(view);
index a4e5ecb..97ae4a0 100644 (file)
@@ -57,9 +57,9 @@ protected slots:
     void currentChanged(const QModelIndex &current, const QModelIndex &previous) override;
     void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) override;
 
     void currentChanged(const QModelIndex &current, const QModelIndex &previous) override;
     void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) override;
 
-private slots:
+private:
     void removeBuffer(BufferId bufferId);
     void removeBuffer(BufferId bufferId);
-    void nickSelectionChanged();
+    void onNickSelectionChanged();
 
 private:
     Ui::NickListWidget ui;
 
 private:
     Ui::NickListWidget ui;
index 738ee26..5294431 100644 (file)
@@ -86,7 +86,7 @@ OSXNotificationBackend::ConfigWidget::ConfigWidget(QWidget *parent)
     : SettingsPage("Internal", "OSXNotification", parent)
 {
     _enabledBox = new QCheckBox(tr("Show OS X notifications"));
     : SettingsPage("Internal", "OSXNotification", parent)
 {
     _enabledBox = new QCheckBox(tr("Show OS X notifications"));
-    connect(_enabledBox, SIGNAL(toggled(bool)), this, SLOT(widgetChanged()));
+    connect(_enabledBox, &QCheckBox::toggled, this, &ConfigWidget::widgetChanged);
     QHBoxLayout *layout = new QHBoxLayout(this);
     layout->addWidget(_enabledBox);
 }
     QHBoxLayout *layout = new QHBoxLayout(this);
     layout->addWidget(_enabledBox);
 }
index ea430c8..3bdb6e1 100644 (file)
@@ -167,7 +167,7 @@ void QtUi::registerNotificationBackend(AbstractNotificationBackend *backend)
 {
     if (!_notificationBackends.contains(backend)) {
         _notificationBackends.append(backend);
 {
     if (!_notificationBackends.contains(backend)) {
         _notificationBackends.append(backend);
-        instance()->connect(backend, SIGNAL(activated(uint)), SLOT(notificationActivated(uint)));
+        connect(backend, &AbstractNotificationBackend::activated, instance(), &QtUi::notificationActivated);
     }
 }
 
     }
 }
 
index 9eea3c6..2438d9c 100644 (file)
@@ -68,7 +68,7 @@ Quassel::QuitHandler QtUiApplication::quitHandler()
     // Wait until the Client instance is destroyed before quitting the event loop
     return [this]() {
         quInfo() << "Client shutting down...";
     // Wait until the Client instance is destroyed before quitting the event loop
     return [this]() {
         quInfo() << "Client shutting down...";
-        connect(_client.get(), SIGNAL(destroyed()), QCoreApplication::instance(), SLOT(quit()));
+        connect(_client.get(), &QObject::destroyed, QCoreApplication::instance(), &QCoreApplication::quit);
         _client.release()->deleteLater();
     };
 }
         _client.release()->deleteLater();
     };
 }
index 64ceeed..cb9cd8f 100644 (file)
@@ -219,6 +219,13 @@ void QtUiMessageProcessor::highlightNickChanged(const QVariant &variant)
 }
 
 
 }
 
 
+void QtUiMessageProcessor::networkRemoved(NetworkId id)
+{
+    // Clean up nickname matching cache
+    _nickMatcher.removeNetwork(id);
+}
+
+
 /**************************************************************************
  * LegacyHighlightRule
  *************************************************************************/
 /**************************************************************************
  * LegacyHighlightRule
  *************************************************************************/
index 3b33132..f31f75b 100644 (file)
@@ -56,10 +56,7 @@ public slots:
      *
      * @param id Network ID of removed network
      */
      *
      * @param id Network ID of removed network
      */
-    inline void networkRemoved(NetworkId id) {
-        // Clean up nickname matching cache
-        _nickMatcher.removeNetwork(id);
-    }
+    void networkRemoved(NetworkId id) override;
 
 private slots:
     void processNextMessage();
 
 private slots:
     void processNextMessage();
index 3cd2f23..56c3cdc 100644 (file)
@@ -75,7 +75,7 @@ void SettingsDlg::registerSettingsPage(SettingsPage *sp)
     sp->setParent(ui.settingsStack);
     ui.settingsStack->addWidget(sp);
 
     sp->setParent(ui.settingsStack);
     ui.settingsStack->addWidget(sp);
 
-    connect(sp, SIGNAL(changed(bool)), this, SLOT(setButtonStates()));
+    connect(sp, &SettingsPage::changed, this, &SettingsDlg::setButtonStates);
 
     QTreeWidgetItem *cat;
     QList<QTreeWidgetItem *> cats = ui.settingsTree->findItems(sp->category(), Qt::MatchExactly);
 
     QTreeWidgetItem *cat;
     QList<QTreeWidgetItem *> cats = ui.settingsTree->findItems(sp->category(), Qt::MatchExactly);
index 49e03d5..48a660b 100644 (file)
@@ -45,7 +45,7 @@ SettingsPageDlg::SettingsPageDlg(SettingsPage *page, QWidget *parent)
 
     updateGeometry();
 
 
     updateGeometry();
 
-    connect(page, SIGNAL(changed(bool)), this, SLOT(setButtonStates()));
+    connect(page, &SettingsPage::changed, this, &SettingsPageDlg::setButtonStates);
     connect(ui.buttonBox, &QDialogButtonBox::clicked, this, &SettingsPageDlg::buttonClicked);
     page->load();
     setButtonStates();
     connect(ui.buttonBox, &QDialogButtonBox::clicked, this, &SettingsPageDlg::buttonClicked);
     page->load();
     setButtonStates();
index 47a701e..54dbfd9 100644 (file)
@@ -323,7 +323,7 @@ void AliasesModel::initDone()
 
 void AliasesModel::clientConnected()
 {
 
 void AliasesModel::clientConnected()
 {
-    connect(Client::aliasManager(), SIGNAL(updated()), SLOT(revert()));
+    connect(Client::aliasManager(), &AliasManager::updated, this, &AliasesModel::revert);
     if (Client::aliasManager()->isInitialized())
         initDone();
     else
     if (Client::aliasManager()->isInitialized())
         initDone();
     else
index dc6b08f..0bc93e8 100644 (file)
@@ -47,7 +47,7 @@ public:
     inline int rowCount(const QModelIndex &parent = QModelIndex()) const override;
     inline int columnCount(const QModelIndex &parent = QModelIndex()) const override;
 
     inline int rowCount(const QModelIndex &parent = QModelIndex()) const override;
     inline int columnCount(const QModelIndex &parent = QModelIndex()) const override;
 
-    inline bool configChanged() const { return _configChanged; }
+    inline bool hasConfigChanged() const { return _configChanged; }
     inline bool isReady() const { return _modelReady; }
 
 public slots:
     inline bool isReady() const { return _modelReady; }
 
 public slots:
index a159eb3..20aa1a8 100644 (file)
@@ -43,7 +43,7 @@ AliasesSettingsPage::AliasesSettingsPage(QWidget *parent)
 
     connect(ui.newAliasButton, &QAbstractButton::clicked, &_aliasesModel, &AliasesModel::newAlias);
     connect(ui.deleteAliasButton, &QAbstractButton::clicked, this, &AliasesSettingsPage::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, &AliasesModel::configChanged, this, &AliasesSettingsPage::setChangedState);
     connect(&_aliasesModel, &AliasesModel::modelReady, this, &AliasesSettingsPage::enableDialog);
 
     enableDialog(_aliasesModel.isReady());
     connect(&_aliasesModel, &AliasesModel::modelReady, this, &AliasesSettingsPage::enableDialog);
 
     enableDialog(_aliasesModel.isReady());
@@ -52,7 +52,7 @@ AliasesSettingsPage::AliasesSettingsPage(QWidget *parent)
 
 void AliasesSettingsPage::load()
 {
 
 void AliasesSettingsPage::load()
 {
-    if (_aliasesModel.configChanged())
+    if (_aliasesModel.hasConfigChanged())
         _aliasesModel.revert();
 }
 
         _aliasesModel.revert();
 }
 
@@ -65,7 +65,7 @@ void AliasesSettingsPage::defaults()
 
 void AliasesSettingsPage::save()
 {
 
 void AliasesSettingsPage::save()
 {
-    if (_aliasesModel.configChanged())
+    if (_aliasesModel.hasConfigChanged())
         _aliasesModel.commit();
 }
 
         _aliasesModel.commit();
 }
 
index cc713be..d193b41 100644 (file)
@@ -54,7 +54,7 @@ AppearanceSettingsPage::AppearanceSettingsPage(QWidget *parent)
     initIconThemeComboBox();
 
     foreach(QComboBox *comboBox, findChildren<QComboBox *>()) {
     initIconThemeComboBox();
 
     foreach(QComboBox *comboBox, findChildren<QComboBox *>()) {
-        connect(comboBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(widgetHasChanged()));
+        connect(comboBox, selectOverload<const QString&>(&QComboBox::currentIndexChanged), this, &AppearanceSettingsPage::widgetHasChanged);
     }
     foreach(QCheckBox *checkBox, findChildren<QCheckBox *>()) {
         connect(checkBox, &QAbstractButton::clicked, this, &AppearanceSettingsPage::widgetHasChanged);
     }
     foreach(QCheckBox *checkBox, findChildren<QCheckBox *>()) {
         connect(checkBox, &QAbstractButton::clicked, this, &AppearanceSettingsPage::widgetHasChanged);
index 12022dd..f0ec4ab 100644 (file)
@@ -36,7 +36,7 @@ BacklogSettingsPage::BacklogSettingsPage(QWidget *parent)
     // FIXME: global backlog requester disabled until issues ruled out
     ui.requesterType->removeItem(2);
 
     // FIXME: global backlog requester disabled until issues ruled out
     ui.requesterType->removeItem(2);
 
-    connect(ui.requesterType, SIGNAL(currentIndexChanged(int)), this, SLOT(widgetHasChanged()));
+    connect(ui.requesterType, selectOverload<int>(&QComboBox::currentIndexChanged), this, &BacklogSettingsPage::widgetHasChanged);
 }
 
 
 }
 
 
index b27e1ae..029f120 100644 (file)
@@ -63,11 +63,11 @@ BufferViewSettingsPage::BufferViewSettingsPage(QWidget *parent)
     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.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.networkSelector, selectOverload<int>(&QComboBox::currentIndexChanged), this, &BufferViewSettingsPage::widgetHasChanged);
+    connect(ui.minimumActivitySelector, selectOverload<int>(&QComboBox::currentIndexChanged), this, &BufferViewSettingsPage::widgetHasChanged);
     connect(ui.showSearch, &QAbstractButton::clicked, this, &BufferViewSettingsPage::widgetHasChanged);
 
     connect(ui.showSearch, &QAbstractButton::clicked, this, &BufferViewSettingsPage::widgetHasChanged);
 
-    connect(ui.networkSelector, SIGNAL(currentIndexChanged(int)), this, SLOT(enableStatusBuffers(int)));
+    connect(ui.networkSelector, selectOverload<int>(&QComboBox::currentIndexChanged), this, &BufferViewSettingsPage::enableStatusBuffers);
 }
 
 
 }
 
 
@@ -194,7 +194,8 @@ void BufferViewSettingsPage::coreConnectionStateChanged(bool state)
     setEnabled(state);
     if (state) {
         load();
     setEnabled(state);
     if (state) {
         load();
-        connect(Client::bufferViewManager(), SIGNAL(bufferViewConfigAdded(int)), this, SLOT(addBufferView(int)));
+        connect(Client::bufferViewManager(), selectOverload<int>(&BufferViewManager::bufferViewConfigAdded),
+                this, selectOverload<int>(&BufferViewSettingsPage::addBufferView));
     }
     else {
         reset();
     }
     else {
         reset();
@@ -339,7 +340,7 @@ void BufferViewSettingsPage::on_addBufferView_clicked()
     BufferViewEditDlg dlg(QString(), existing, this);
     if (dlg.exec() == QDialog::Accepted) {
         newBufferView(dlg.bufferViewName());
     BufferViewEditDlg dlg(QString(), existing, this);
     if (dlg.exec() == QDialog::Accepted) {
         newBufferView(dlg.bufferViewName());
-        changed();
+        setChangedState(true);
     }
 }
 
     }
 }
 
@@ -366,7 +367,7 @@ void BufferViewSettingsPage::on_renameBufferView_clicked()
         BufferViewConfig *changedConfig = cloneConfig(config);
         changedConfig->setBufferViewName(dlg.bufferViewName());
         ui.bufferViewList->item(listPos(config))->setText(dlg.bufferViewName());
         BufferViewConfig *changedConfig = cloneConfig(config);
         changedConfig->setBufferViewName(dlg.bufferViewName());
         ui.bufferViewList->item(listPos(config))->setText(dlg.bufferViewName());
-        changed();
+        setChangedState(true);
     }
 }
 
     }
 }
 
@@ -389,7 +390,7 @@ void BufferViewSettingsPage::on_deleteBufferView_clicked()
         delete currentItem;
         if (viewId >= 0) {
             _deleteBufferViews << viewId;
         delete currentItem;
         if (viewId >= 0) {
             _deleteBufferViews << viewId;
-            changed();
+            setChangedState(true);
         }
         else if (config) {
             QList<BufferViewConfig *>::iterator iter = _newBufferViews.begin();
         }
         else if (config) {
             QList<BufferViewConfig *>::iterator iter = _newBufferViews.begin();
@@ -547,9 +548,9 @@ BufferViewConfig *BufferViewSettingsPage::cloneConfig(BufferViewConfig *config)
     connect(config, &BufferViewConfig::bufferAdded, changedConfig, &BufferViewConfig::addBuffer);
     connect(config, &BufferViewConfig::bufferMoved, changedConfig, &BufferViewConfig::moveBuffer);
     connect(config, &BufferViewConfig::bufferRemoved, changedConfig, &BufferViewConfig::removeBuffer);
     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(config, &BufferViewConfig::addBufferRequested, changedConfig, &BufferViewConfig::addBuffer);
+    // connect(config, &BufferViewConfig::moveBufferRequested, changedConfig, &BufferViewConfig::moveBuffer);
+    // connect(config, &BufferViewconfig::removeBufferRequested, changedConfig, &BufferViewConfig::removeBuffer);
 
     changedConfig->setProperty("OriginalBufferList", toVariantList<BufferId>(config->bufferList()));
     // if this is the currently displayed view we have to change the config of the preview filter
 
     changedConfig->setProperty("OriginalBufferList", toVariantList<BufferId>(config->bufferList()));
     // if this is the currently displayed view we have to change the config of the preview filter
index 460c872..bf546b1 100644 (file)
@@ -60,7 +60,7 @@ ChatMonitorSettingsPage::ChatMonitorSettingsPage(QWidget *parent)
     ui.operationMode->addItem(tr("Opt Out"), ChatViewSettings::OptOut);
 
     // connect slots
     ui.operationMode->addItem(tr("Opt Out"), ChatViewSettings::OptOut);
 
     // connect slots
-    connect(ui.operationMode, SIGNAL(currentIndexChanged(int)), SLOT(switchOperationMode(int)));
+    connect(ui.operationMode, selectOverload<int>(&QComboBox::currentIndexChanged), this, &ChatMonitorSettingsPage::switchOperationMode);
     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.showHighlights, &QAbstractButton::toggled, this, &ChatMonitorSettingsPage::widgetHasChanged);
     connect(ui.showOwnMessages, &QAbstractButton::toggled, this, &ChatMonitorSettingsPage::widgetHasChanged);
     connect(ui.alwaysOwn, &QAbstractButton::toggled, this, &ChatMonitorSettingsPage::widgetHasChanged);
index 7665ce0..f732030 100644 (file)
@@ -24,6 +24,7 @@
 #include "clientsettings.h"
 #include "coreaccountmodel.h"
 #include "icon.h"
 #include "clientsettings.h"
 #include "coreaccountmodel.h"
 #include "icon.h"
+#include "util.h"
 
 CoreAccountSettingsPage::CoreAccountSettingsPage(QWidget *parent)
     : SettingsPage(tr("Remote Cores"), QString(), parent),
 
 CoreAccountSettingsPage::CoreAccountSettingsPage(QWidget *parent)
     : SettingsPage(tr("Remote Cores"), QString(), parent),
@@ -46,7 +47,7 @@ CoreAccountSettingsPage::CoreAccountSettingsPage(QWidget *parent)
     connect(filteredModel(), &QAbstractItemModel::rowsInserted, this, &CoreAccountSettingsPage::rowsInserted);
 
     connect(ui.accountView->selectionModel(), &QItemSelectionModel::selectionChanged, this, &CoreAccountSettingsPage::setWidgetStates);
     connect(filteredModel(), &QAbstractItemModel::rowsInserted, this, &CoreAccountSettingsPage::rowsInserted);
 
     connect(ui.accountView->selectionModel(), &QItemSelectionModel::selectionChanged, this, &CoreAccountSettingsPage::setWidgetStates);
-    connect(ui.autoConnectAccount, SIGNAL(currentIndexChanged(int)), SLOT(widgetHasChanged()));
+    connect(ui.autoConnectAccount, selectOverload<int>(&QComboBox::currentIndexChanged), this, &CoreAccountSettingsPage::widgetHasChanged);
     setWidgetStates();
 }
 
     setWidgetStates();
 }
 
index 923858d..4395724 100644 (file)
@@ -26,6 +26,7 @@
 #include "corehighlightsettingspage.h"
 #include "icon.h"
 #include "qtui.h"
 #include "corehighlightsettingspage.h"
 #include "icon.h"
 #include "qtui.h"
+#include "util.h"
 
 CoreHighlightSettingsPage::CoreHighlightSettingsPage(QWidget *parent)
     : SettingsPage(tr("Interface"),
 
 CoreHighlightSettingsPage::CoreHighlightSettingsPage(QWidget *parent)
     : SettingsPage(tr("Interface"),
@@ -46,30 +47,20 @@ CoreHighlightSettingsPage::CoreHighlightSettingsPage(QWidget *parent)
     coreConnectionStateChanged(Client::isConnected()); // need a core connection!
     connect(Client::instance(), &Client::coreConnectionStateChanged, this, &CoreHighlightSettingsPage::coreConnectionStateChanged);
 
     coreConnectionStateChanged(Client::isConnected()); // need a core connection!
     connect(Client::instance(), &Client::coreConnectionStateChanged, this, &CoreHighlightSettingsPage::coreConnectionStateChanged);
 
-    connect(ui.highlightAdd, SIGNAL(clicked(bool)), this, SLOT(addNewHighlightRow()));
+    connect(ui.highlightAdd, &QAbstractButton::clicked, this, [this]() { addNewHighlightRow(); });
     connect(ui.highlightRemove, &QAbstractButton::clicked, this, &CoreHighlightSettingsPage::removeSelectedHighlightRows);
     connect(ui.highlightImport, &QAbstractButton::clicked, this, &CoreHighlightSettingsPage::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.ignoredAdd, &QAbstractButton::clicked, this, [this]() { addNewIgnoredRow(); });
     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.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,
-            &QTableWidget::itemClicked,
-            this,
-            &CoreHighlightSettingsPage::selectHighlightRow);
-    connect(ui.ignoredTable,
-            &QTableWidget::itemClicked,
-            this,
-            &CoreHighlightSettingsPage::selectIgnoredRow);
+    connect(ui.highlightTable, &QTableWidget::itemClicked, this, &CoreHighlightSettingsPage::selectHighlightRow);
+    connect(ui.ignoredTable, &QTableWidget::itemClicked, this, &CoreHighlightSettingsPage::selectIgnoredRow);
 
     // Update the "Case sensitive" checkbox
 
     // Update the "Case sensitive" checkbox
-    connect(ui.highlightNicksComboBox,
-            SIGNAL(currentIndexChanged(int)),
-            this,
-            SLOT(highlightNicksChanged(int)));
-
-    connect(ui.highlightNicksComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(widgetHasChanged()));
+    connect(ui.highlightNicksComboBox, selectOverload<int>(&QComboBox::currentIndexChanged), this, &CoreHighlightSettingsPage::highlightNicksChanged);
+    connect(ui.highlightNicksComboBox, selectOverload<int>(&QComboBox::currentIndexChanged), this, &CoreHighlightSettingsPage::widgetHasChanged);
     connect(ui.nicksCaseSensitive, &QAbstractButton::clicked, this, &CoreHighlightSettingsPage::widgetHasChanged);
 
     connect(ui.highlightAdd, &QAbstractButton::clicked, this, &CoreHighlightSettingsPage::widgetHasChanged);
     connect(ui.nicksCaseSensitive, &QAbstractButton::clicked, this, &CoreHighlightSettingsPage::widgetHasChanged);
 
     connect(ui.highlightAdd, &QAbstractButton::clicked, this, &CoreHighlightSettingsPage::widgetHasChanged);
index 084236c..f84a81a 100644 (file)
 
 #include "client.h"
 #include "clienttransfermanager.h"
 
 #include "client.h"
 #include "clienttransfermanager.h"
+#include "util.h"
 
 DccSettingsPage::DccSettingsPage(QWidget *parent)
     : SettingsPage(tr("IRC"), tr("DCC"), parent)
 {
     ui.setupUi(this);
     initAutoWidgets();
 
 DccSettingsPage::DccSettingsPage(QWidget *parent)
     : SettingsPage(tr("IRC"), tr("DCC"), parent)
 {
     ui.setupUi(this);
     initAutoWidgets();
-    connect(ui.ipDetectionMode, SIGNAL(currentIndexChanged(int)), SLOT(updateWidgetStates()));
-    connect(ui.portSelectionMode, SIGNAL(currentIndexChanged(int)), SLOT(updateWidgetStates()));
+    connect(ui.ipDetectionMode, selectOverload<int>(&QComboBox::currentIndexChanged), this, &DccSettingsPage::updateWidgetStates);
+    connect(ui.portSelectionMode, selectOverload<int>(&QComboBox::currentIndexChanged), this, &DccSettingsPage::updateWidgetStates);
     updateWidgetStates();
 
     connect(Client::instance(), &Client::coreConnectionStateChanged, this, &DccSettingsPage::onClientConfigChanged);
     updateWidgetStates();
 
     connect(Client::instance(), &Client::coreConnectionStateChanged, this, &DccSettingsPage::onClientConfigChanged);
@@ -56,7 +57,7 @@ void DccSettingsPage::setClientConfig(DccConfig *config)
     }
     _clientConfig = config;
     if (_clientConfig) {
     }
     _clientConfig = config;
     if (_clientConfig) {
-        connect(_clientConfig, SIGNAL(updated()), SLOT(load()));
+        connect(_clientConfig, &DccConfig::updated, this, &DccSettingsPage::load);
         load();
         ui.dccEnabled->setEnabled(true);
     }
         load();
         ui.dccEnabled->setEnabled(true);
     }
index ae2b90a..f881645 100644 (file)
@@ -99,7 +99,7 @@ HighlightSettingsPage::HighlightSettingsPage(QWidget *parent)
         ui.localHighlightsLabel->setText(tr("Local Highlights apply to this device only"));
     }
 
         ui.localHighlightsLabel->setText(tr("Local Highlights apply to this device only"));
     }
 
-    connect(ui.add, SIGNAL(clicked(bool)), this, SLOT(addNewRow()));
+    connect(ui.add, &QAbstractButton::clicked, this, [this]() { addNewRow(); });
     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, &QTableWidget::itemClicked, this, &HighlightSettingsPage::selectRow);
     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, &QTableWidget::itemClicked, this, &HighlightSettingsPage::selectRow);
index af62c9e..027dd34 100644 (file)
@@ -48,8 +48,6 @@ IdentitiesSettingsPage::IdentitiesSettingsPage(QWidget *parent)
 #endif
 
     currentId = 0;
 #endif
 
     currentId = 0;
-
-    //connect(ui.identityList, SIGNAL(editTextChanged(const QString &)), this, SLOT(widgetHasChanged()));
 }
 
 
 }
 
 
index 9fdff26..0e55307 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "client.h"
 #include "icon.h"
 
 #include "client.h"
 #include "icon.h"
+#include "util.h"
 
 IdentityEditWidget::IdentityEditWidget(QWidget *parent)
     : QWidget(parent)
 
 IdentityEditWidget::IdentityEditWidget(QWidget *parent)
     : QWidget(parent)
@@ -48,7 +49,7 @@ IdentityEditWidget::IdentityEditWidget(QWidget *parent)
     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.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.autoAwayTime, selectOverload<int>(&QSpinBox::valueChanged), this, &IdentityEditWidget::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.autoAwayReason, &QLineEdit::textEdited, this, &IdentityEditWidget::widgetHasChanged);
     connect(ui.autoAwayReasonEnabled, &QAbstractButton::clicked, this, &IdentityEditWidget::widgetHasChanged);
     connect(ui.detachAwayEnabled, &QGroupBox::clicked, this, &IdentityEditWidget::widgetHasChanged);
@@ -64,8 +65,8 @@ IdentityEditWidget::IdentityEditWidget(QWidget *parent)
     connect(ui.continueUnsecured, &QAbstractButton::clicked, this, &IdentityEditWidget::requestEditSsl);
 
     // we would need this if we enabled drag and drop in the nicklist...
     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()));
-    //connect(ui.nicknameList->model(), SIGNAL(rowsInserted(const QModelIndex &, int, int)), this, SLOT(nicklistHasChanged()));
+    //connect(ui.nicknameList, &QListWidget::rowsInserted, this, &IdentityEditWidget::setWidgetStates);
+    //connect(ui.nicknameList->model(), &NickListModel::rowsInserted, this, IdentityEditWidget::nicklistHasChanged);
 
     // disabling unused stuff
     ui.autoAwayEnabled->hide();
 
     // disabling unused stuff
     ui.autoAwayEnabled->hide();
index 74df6e1..774c425 100644 (file)
@@ -289,7 +289,7 @@ void IgnoreListModel::initDone()
 
 void IgnoreListModel::clientConnected()
 {
 
 void IgnoreListModel::clientConnected()
 {
-    connect(Client::ignoreListManager(), SIGNAL(updated()), SLOT(revert()));
+    connect(Client::ignoreListManager(), &IgnoreListManager::updated, this, &IgnoreListModel::revert);
     if (Client::ignoreListManager()->isInitialized())
         initDone();
     else
     if (Client::ignoreListManager()->isInitialized())
         initDone();
     else
index 4af351e..9a3a44b 100644 (file)
@@ -47,7 +47,7 @@ public:
     inline int rowCount(const QModelIndex &parent = QModelIndex()) const override;
     inline int columnCount(const QModelIndex &parent = QModelIndex()) const override;
 
     inline int rowCount(const QModelIndex &parent = QModelIndex()) const override;
     inline int columnCount(const QModelIndex &parent = QModelIndex()) const override;
 
-    inline bool configChanged() const { return _configChanged; }
+    inline bool hasConfigChanged() const { return _configChanged; }
     inline bool isReady() const { return _modelReady; }
 
     const IgnoreListManager::IgnoreListItem &ignoreListItemAt(int row) const;
     inline bool isReady() const { return _modelReady; }
 
     const IgnoreListManager::IgnoreListItem &ignoreListItemAt(int row) const;
index 6a942e4..3af4930 100644 (file)
@@ -30,8 +30,8 @@
 #include <QDebug>
 
 #include "expressionmatch.h"
 #include <QDebug>
 
 #include "expressionmatch.h"
-
 #include "icon.h"
 #include "icon.h"
+#include "util.h"
 
 IgnoreListSettingsPage::IgnoreListSettingsPage(QWidget *parent)
     : SettingsPage(tr("IRC"), tr("Ignore List"), parent)
 
 IgnoreListSettingsPage::IgnoreListSettingsPage(QWidget *parent)
     : SettingsPage(tr("IRC"), tr("Ignore List"), parent)
@@ -59,10 +59,10 @@ IgnoreListSettingsPage::IgnoreListSettingsPage(QWidget *parent)
     ui.ignoreListView->viewport()->setMouseTracking(true);
 
     connect(ui.ignoreListView->selectionModel(), &QItemSelectionModel::selectionChanged, this, &IgnoreListSettingsPage::selectionChanged);
     ui.ignoreListView->viewport()->setMouseTracking(true);
 
     connect(ui.ignoreListView->selectionModel(), &QItemSelectionModel::selectionChanged, this, &IgnoreListSettingsPage::selectionChanged);
-    connect(ui.newIgnoreRuleButton, SIGNAL(clicked()), this, SLOT(newIgnoreRule()));
+    connect(ui.newIgnoreRuleButton, &QAbstractButton::clicked, this, [this]() { newIgnoreRule(); });
     connect(ui.deleteIgnoreRuleButton, &QAbstractButton::clicked, this, &IgnoreListSettingsPage::deleteSelectedIgnoreRule);
     connect(ui.editIgnoreRuleButton, &QAbstractButton::clicked, this, &IgnoreListSettingsPage::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, &IgnoreListModel::configChanged, this, &IgnoreListSettingsPage::setChangedState);
     connect(&_ignoreListModel, &IgnoreListModel::modelReady, this, &IgnoreListSettingsPage::enableDialog);
 
     enableDialog(_ignoreListModel.isReady());
     connect(&_ignoreListModel, &IgnoreListModel::modelReady, this, &IgnoreListSettingsPage::enableDialog);
 
     enableDialog(_ignoreListModel.isReady());
@@ -77,7 +77,7 @@ IgnoreListSettingsPage::~IgnoreListSettingsPage()
 
 void IgnoreListSettingsPage::load()
 {
 
 void IgnoreListSettingsPage::load()
 {
-    if (_ignoreListModel.configChanged())
+    if (_ignoreListModel.hasConfigChanged())
         _ignoreListModel.revert();
     ui.ignoreListView->selectionModel()->reset();
     ui.editIgnoreRuleButton->setEnabled(false);
         _ignoreListModel.revert();
     ui.ignoreListView->selectionModel()->reset();
     ui.editIgnoreRuleButton->setEnabled(false);
@@ -92,7 +92,7 @@ void IgnoreListSettingsPage::defaults()
 
 void IgnoreListSettingsPage::save()
 {
 
 void IgnoreListSettingsPage::save()
 {
-    if (_ignoreListModel.configChanged()) {
+    if (_ignoreListModel.hasConfigChanged()) {
         _ignoreListModel.commit();
     }
     ui.ignoreListView->selectionModel()->reset();
         _ignoreListModel.commit();
     }
     ui.ignoreListView->selectionModel()->reset();
@@ -124,7 +124,7 @@ void IgnoreListSettingsPage::deleteSelectedIgnoreRule()
 }
 
 
 }
 
 
-void IgnoreListSettingsPage::newIgnoreRule(QString rule)
+void IgnoreListSettingsPage::newIgnoreRule(const QString &rule)
 {
     IgnoreListManager::IgnoreListItem newItem = IgnoreListManager::IgnoreListItem();
     newItem.setStrictness(IgnoreListManager::SoftStrictness);
 {
     IgnoreListManager::IgnoreListItem newItem = IgnoreListManager::IgnoreListItem();
     newItem.setStrictness(IgnoreListManager::SoftStrictness);
@@ -290,9 +290,9 @@ IgnoreListEditDlg::IgnoreListEditDlg(const IgnoreListManager::IgnoreListItem &it
 
     connect(ui.ignoreRuleLineEdit, &QLineEdit::textChanged, this, &IgnoreListEditDlg::widgetHasChanged);
     connect(ui.scopeRuleTextEdit, &QPlainTextEdit::textChanged, this, &IgnoreListEditDlg::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(&_typeButtonGroup, selectOverload<int>(&QButtonGroup::buttonClicked), this, &IgnoreListEditDlg::widgetHasChanged);
+    connect(&_strictnessButtonGroup, selectOverload<int>(&QButtonGroup::buttonClicked), this, &IgnoreListEditDlg::widgetHasChanged);
+    connect(&_scopeButtonGroup, selectOverload<int>(&QButtonGroup::buttonClicked), this, &IgnoreListEditDlg::widgetHasChanged);
     connect(ui.isRegExCheckBox, &QCheckBox::stateChanged, this, &IgnoreListEditDlg::widgetHasChanged);
     connect(ui.isActiveCheckBox, &QCheckBox::stateChanged, this, &IgnoreListEditDlg::widgetHasChanged);
 
     connect(ui.isRegExCheckBox, &QCheckBox::stateChanged, this, &IgnoreListEditDlg::widgetHasChanged);
     connect(ui.isActiveCheckBox, &QCheckBox::stateChanged, this, &IgnoreListEditDlg::widgetHasChanged);
 
index 41c3971..7dc687a 100644 (file)
@@ -87,7 +87,7 @@ public slots:
     void save() override;
     void load() override;
     void defaults() override;
     void save() override;
     void load() override;
     void defaults() override;
-    void newIgnoreRule(QString rule = QString());
+    void newIgnoreRule(const QString &rule = {});
 
 private slots:
     void enableDialog(bool);
 
 private slots:
     void enableDialog(bool);
index 0a51f4a..1a35fb8 100644 (file)
@@ -43,10 +43,10 @@ ItemViewSettingsPage::ItemViewSettingsPage(QWidget *parent)
     ui.bufferViewPreview->expandAll();
 
     foreach(ColorButton *button, findChildren<ColorButton *>()) {
     ui.bufferViewPreview->expandAll();
 
     foreach(ColorButton *button, findChildren<ColorButton *>()) {
-        connect(button, SIGNAL(colorChanged(QColor)), _mapper, SLOT(map()));
+        connect(button, &ColorButton::colorChanged, _mapper, selectOverload<>(&QSignalMapper::map));
         _mapper->setMapping(button, button);
     }
         _mapper->setMapping(button, button);
     }
-    connect(_mapper, SIGNAL(mapped(QWidget *)), SLOT(updateBufferViewPreview(QWidget *)));
+    connect(_mapper, selectOverload<QWidget*>(&QSignalMapper::mapped), this, &ItemViewSettingsPage::updateBufferViewPreview);
 
     initAutoWidgets();
 }
 
     initAutoWidgets();
 }
index d705eb6..050ffc5 100644 (file)
@@ -91,8 +91,8 @@ NetworksSettingsPage::NetworksSettingsPage(QWidget *parent)
     connect(Client::instance(), &Client::identityCreated, this, &NetworksSettingsPage::clientIdentityAdded);
     connect(Client::instance(), &Client::identityRemoved, this, &NetworksSettingsPage::clientIdentityRemoved);
 
     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.identityList, selectOverload<int>(&QComboBox::currentIndexChanged), this, &NetworksSettingsPage::widgetHasChanged);
+    //connect(ui.randomServer, &QAbstractButton::clicked, this, &NetworksSettingsPage::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.performEdit, &QTextEdit::textChanged, this, &NetworksSettingsPage::widgetHasChanged);
     connect(ui.sasl, &QGroupBox::clicked, this, &NetworksSettingsPage::widgetHasChanged);
     connect(ui.saslAccount, &QLineEdit::textEdited, this, &NetworksSettingsPage::widgetHasChanged);
@@ -101,26 +101,22 @@ NetworksSettingsPage::NetworksSettingsPage(QWidget *parent)
     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.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.sendEncoding, selectOverload<int>(&QComboBox::currentIndexChanged), this, &NetworksSettingsPage::widgetHasChanged);
+    connect(ui.recvEncoding, selectOverload<int>(&QComboBox::currentIndexChanged), this, &NetworksSettingsPage::widgetHasChanged);
+    connect(ui.serverEncoding, selectOverload<int>(&QComboBox::currentIndexChanged), this, &NetworksSettingsPage::widgetHasChanged);
     connect(ui.autoReconnect, &QGroupBox::clicked, this, &NetworksSettingsPage::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.reconnectInterval, selectOverload<int>(&QSpinBox::valueChanged), this, &NetworksSettingsPage::widgetHasChanged);
+    connect(ui.reconnectRetries, selectOverload<int>(&QSpinBox::valueChanged), this, &NetworksSettingsPage::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, &QGroupBox::clicked, this, &NetworksSettingsPage::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, &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.messageRateBurstSize, selectOverload<int>(&QSpinBox::valueChanged), this, &NetworksSettingsPage::widgetHasChanged);
+    connect(ui.messageRateDelay, selectOverload<double>(&QDoubleSpinBox::valueChanged), this, &NetworksSettingsPage::widgetHasChanged);
     connect(ui.unlimitedMessageRate, &QAbstractButton::clicked, this, &NetworksSettingsPage::widgetHasChanged);
 
     connect(ui.unlimitedMessageRate, &QAbstractButton::clicked, this, &NetworksSettingsPage::widgetHasChanged);
 
-    // Add additional widgets here
-    //connect(ui., SIGNAL(), this, SLOT(widgetHasChanged()));
-    //connect(ui., SIGNAL(), this, SLOT(widgetHasChanged()));
-
     foreach(IdentityId id, Client::identityIds()) {
         clientIdentityAdded(id);
     }
     foreach(IdentityId id, Client::identityIds()) {
         clientIdentityAdded(id);
     }
@@ -479,7 +475,7 @@ QListWidgetItem *NetworksSettingsPage::networkItem(NetworkId id) const
 void NetworksSettingsPage::clientNetworkAdded(NetworkId id)
 {
     insertNetwork(id);
 void NetworksSettingsPage::clientNetworkAdded(NetworkId id)
 {
     insertNetwork(id);
-    //connect(Client::network(id), SIGNAL(updatedRemotely()), this, SLOT(clientNetworkUpdated()));
+    //connect(Client::network(id), &Network::updatedRemotely, this, &NetworksSettingsPage::clientNetworkUpdated);
     connect(Client::network(id), &Network::configChanged, this, &NetworksSettingsPage::clientNetworkUpdated);
 
     connect(Client::network(id), &Network::connectionStateSet, this, &NetworksSettingsPage::networkConnectionStateChanged);
     connect(Client::network(id), &Network::configChanged, this, &NetworksSettingsPage::clientNetworkUpdated);
 
     connect(Client::network(id), &Network::connectionStateSet, this, &NetworksSettingsPage::networkConnectionStateChanged);
index 5b9795a..93922ae 100644 (file)
@@ -34,7 +34,7 @@ NotificationsSettingsPage::NotificationsSettingsPage(QWidget *parent)
             cw->setParent(this);
             _configWidgets.append(cw);
             layout->addWidget(cw);
             cw->setParent(this);
             _configWidgets.append(cw);
             layout->addWidget(cw);
-            connect(cw, SIGNAL(changed(bool)), SLOT(widgetHasChanged()));
+            connect(cw, &SettingsPage::changed, this, &NotificationsSettingsPage::widgetHasChanged);
             _hasDefaults |= cw->hasDefaults();
         }
     }
             _hasDefaults |= cw->hasDefaults();
         }
     }
index 372bafa..b4abf87 100644 (file)
@@ -202,11 +202,11 @@ bool ShortcutsModel::setData(const QModelIndex &index, const QVariant &value, in
 
     if (oldSeq == storedSeq && newSeq != storedSeq) {
         if (++_changedCount == 1)
 
     if (oldSeq == storedSeq && newSeq != storedSeq) {
         if (++_changedCount == 1)
-            emit hasChanged(true);
+            emit changed(true);
     }
     else if (oldSeq != storedSeq && newSeq == storedSeq) {
         if (--_changedCount == 0)
     }
     else if (oldSeq != storedSeq && newSeq == storedSeq) {
         if (--_changedCount == 0)
-            emit hasChanged(false);
+            emit changed(false);
     }
 
     return true;
     }
 
     return true;
@@ -223,7 +223,7 @@ void ShortcutsModel::load()
     emit dataChanged(index(0, 1), index(rowCount()-1, 1));
     if (_changedCount != 0) {
         _changedCount = 0;
     emit dataChanged(index(0, 1), index(rowCount()-1, 1));
     if (_changedCount != 0) {
         _changedCount = 0;
-        emit hasChanged(false);
+        emit changed(false);
     }
 }
 
     }
 }
 
@@ -237,7 +237,7 @@ void ShortcutsModel::commit()
     }
     if (_changedCount != 0) {
         _changedCount = 0;
     }
     if (_changedCount != 0) {
         _changedCount = 0;
-        emit hasChanged(false);
+        emit changed(false);
     }
 }
 
     }
 }
 
index 0502b32..12420bd 100644 (file)
@@ -76,7 +76,7 @@ public slots:
 
 signals:
     //! Reflects the difference between model contents and the ActionCollections we loaded this from
 
 signals:
     //! Reflects the difference between model contents and the ActionCollections we loaded this from
-    void hasChanged(bool changed);
+    void changed(bool changed);
 
 private:
     struct Item {
 
 private:
     struct Item {
index 4da905f..46e02b7 100644 (file)
@@ -84,10 +84,10 @@ ShortcutsSettingsPage::ShortcutsSettingsPage(const QHash<QString, ActionCollecti
     connect(ui.useDefault, &QAbstractButton::clicked, this, &ShortcutsSettingsPage::toggledCustomOrDefault);
     connect(ui.useCustom, &QAbstractButton::clicked, this, &ShortcutsSettingsPage::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)));
+    connect(_shortcutsModel, &ShortcutsModel::changed, this, &ShortcutsSettingsPage::setChangedState);
 
     // fugly, but directly setting it from the ctor doesn't seem to work
 
     // fugly, but directly setting it from the ctor doesn't seem to work
-    QTimer::singleShot(0, ui.searchEdit, SLOT(setFocus()));
+    QTimer::singleShot(0, ui.searchEdit, [widget = ui.searchEdit]() { widget->setFocus(); });
 }
 
 
 }
 
 
index 07c6a9a..bdabcf1 100644 (file)
@@ -50,7 +50,7 @@ SnoreNotificationBackend::SnoreNotificationBackend (QObject *parent)
     m_application.hints().setValue("windows-app-id","QuasselProject.QuasselIRC");
     m_application.hints().setValue("pushover-token", "arNtsi983QSZUqU3KAZrFLKHGFPkdL");
 
     m_application.hints().setValue("windows-app-id","QuasselProject.QuasselIRC");
     m_application.hints().setValue("pushover-token", "arNtsi983QSZUqU3KAZrFLKHGFPkdL");
 
-    connect(&Snore::SnoreCore::instance(), SIGNAL(actionInvoked(Snore::Notification)), this, SLOT(actionInvoked(Snore::Notification)));
+    connect(&Snore::SnoreCore::instance(), &Snore::SnoreCore::actionInvoked, this, &SnoreNotificationBackend::actionInvoked);
 
 
     m_alert = Snore::Alert(tr("Private Message"), m_icon);
 
 
     m_alert = Snore::Alert(tr("Private Message"), m_icon);
@@ -140,7 +140,7 @@ SnoreNotificationBackend::ConfigWidget::ConfigWidget(QWidget *parent)
     :SettingsPage("Internal", "SnoreNotification", parent)
 {
     ui.setupUi(this);
     :SettingsPage("Internal", "SnoreNotification", parent)
 {
     ui.setupUi(this);
-    connect(ui.useSnoreCheckBox, SIGNAL(toggled(bool)), this, SLOT(useSnnoreChanged(bool)));
+    connect(ui.useSnoreCheckBox, &QCheckBox::toggled, this, &ConfigWidget::useSnoreChanged);
 }
 
 bool SnoreNotificationBackend::ConfigWidget::hasDefaults() const
 }
 
 bool SnoreNotificationBackend::ConfigWidget::hasDefaults() const
@@ -150,7 +150,7 @@ bool SnoreNotificationBackend::ConfigWidget::hasDefaults() const
 
 void SnoreNotificationBackend::ConfigWidget::defaults()
 {
 
 void SnoreNotificationBackend::ConfigWidget::defaults()
 {
-    useSnnoreChanged(false);
+    useSnoreChanged(false);
     ui.widget->reset();
 }
 
     ui.widget->reset();
 }
 
@@ -172,7 +172,7 @@ void SnoreNotificationBackend::ConfigWidget::save()
     load();
 }
 
     load();
 }
 
-void SnoreNotificationBackend::ConfigWidget::useSnnoreChanged(bool b)
+void SnoreNotificationBackend::ConfigWidget::useSnoreChanged(bool b)
 {
     ui.useSnoreCheckBox->setChecked(b);
     ui.widget->setEnabled(b);
 {
     ui.useSnoreCheckBox->setChecked(b);
     ui.widget->setEnabled(b);
index 10e40cf..00f399b 100644 (file)
@@ -72,7 +72,7 @@ public:
     void load();
     void save();
 private slots:
     void load();
     void save();
 private slots:
-    void useSnnoreChanged(bool);
+    void useSnoreChanged(bool);
 
 private:
     Ui::SnoreNotificationConfigWidget ui;
 
 private:
     Ui::SnoreNotificationConfigWidget ui;
index a549d8f..7db4c3e 100644 (file)
@@ -43,7 +43,7 @@ SslInfoDlg::SslInfoDlg(const QSslSocket *socket, QWidget *parent)
     ui.encryption->setText(cipher.name());
     ui.protocol->setText(cipher.protocolString());
 
     ui.encryption->setText(cipher.name());
     ui.protocol->setText(cipher.protocolString());
 
-    connect(ui.certificateChain, SIGNAL(currentIndexChanged(int)), SLOT(setCurrentCert(int)));
+    connect(ui.certificateChain, selectOverload<int>(&QComboBox::currentIndexChanged), this, &SslInfoDlg::setCurrentCert);
     foreach(const QSslCertificate &cert, socket->peerCertificateChain()) {
         ui.certificateChain->addItem(subjectInfo(cert, QSslCertificate::CommonName));
     }
     foreach(const QSslCertificate &cert, socket->peerCertificateChain()) {
         ui.certificateChain->addItem(subjectInfo(cert, QSslCertificate::CommonName));
     }
index 3f0a3b2..25b14bf 100644 (file)
@@ -84,9 +84,9 @@ StatusNotifierItem::StatusNotifierItem(QWidget *parent)
 
     setMode(Mode::StatusNotifier);
 
 
     setMode(Mode::StatusNotifier);
 
-    connect(this, SIGNAL(visibilityChanged(bool)), this, SLOT(onVisibilityChanged(bool)));
-    connect(this, SIGNAL(modeChanged(Mode)), this, SLOT(onModeChanged(Mode)));
-    connect(this, &SystemTray::stateChanged, this, &StatusNotifierItem::onStateChanged);
+    connect(this, &StatusNotifierItem::visibilityChanged, this, &StatusNotifierItem::onVisibilityChanged);
+    connect(this, &StatusNotifierItem::modeChanged, this, &StatusNotifierItem::onModeChanged);
+    connect(this, &StatusNotifierItem::stateChanged, this, &StatusNotifierItem::onStateChanged);
 
     trayMenu()->installEventFilter(this);
 
 
     trayMenu()->installEventFilter(this);
 
@@ -103,9 +103,9 @@ StatusNotifierItem::StatusNotifierItem(QWidget *parent)
 
     // Our own SNI service
     _statusNotifierItemDBus = new StatusNotifierItemDBus(this);
 
     // Our own SNI service
     _statusNotifierItemDBus = new StatusNotifierItemDBus(this);
-    connect(this, &SystemTray::currentIconNameChanged, _statusNotifierItemDBus, &StatusNotifierItemDBus::NewIcon);
-    connect(this, &SystemTray::currentIconNameChanged, _statusNotifierItemDBus, &StatusNotifierItemDBus::NewAttentionIcon);
-    connect(this, &SystemTray::toolTipChanged, _statusNotifierItemDBus, &StatusNotifierItemDBus::NewToolTip);
+    connect(this, &StatusNotifierItem::currentIconNameChanged, _statusNotifierItemDBus, &StatusNotifierItemDBus::NewIcon);
+    connect(this, &StatusNotifierItem::currentIconNameChanged, _statusNotifierItemDBus, &StatusNotifierItemDBus::NewAttentionIcon);
+    connect(this, &StatusNotifierItem::toolTipChanged, _statusNotifierItemDBus, &StatusNotifierItemDBus::NewToolTip);
 
     // Service watcher to keep track of the StatusNotifierWatcher service
     _serviceWatcher = new QDBusServiceWatcher(kSniWatcherService,
 
     // Service watcher to keep track of the StatusNotifierWatcher service
     _serviceWatcher = new QDBusServiceWatcher(kSniWatcherService,
index 719c825..9eb6e22 100644 (file)
@@ -172,7 +172,7 @@ public:
      */
     QDBusObjectPath Menu() const;
 
      */
     QDBusObjectPath Menu() const;
 
-public Q_SLOTS:
+public slots:
     //interaction
     /**
      * Shows the context menu associated to this item
     //interaction
     /**
      * Shows the context menu associated to this item
@@ -196,7 +196,7 @@ public Q_SLOTS:
      */
     void Scroll(int delta, const QString &orientation);
 
      */
     void Scroll(int delta, const QString &orientation);
 
-Q_SIGNALS:
+signals:
     /**
      * Inform the systemtray that the own main icon has been changed,
      * so should be reloaded
     /**
      * Inform the systemtray that the own main icon has been changed,
      * so should be reloaded
index eaec2f7..db92a9e 100644 (file)
@@ -39,9 +39,10 @@ SystrayNotificationBackend::SystrayNotificationBackend(QObject *parent)
     NotificationSettings notificationSettings;
     notificationSettings.initAndNotify("Systray/ShowBubble", this, SLOT(showBubbleChanged(QVariant)), true);
 
     NotificationSettings notificationSettings;
     notificationSettings.initAndNotify("Systray/ShowBubble", this, SLOT(showBubbleChanged(QVariant)), true);
 
-    connect(QtUi::mainWindow()->systemTray(), SIGNAL(messageClicked(uint)), SLOT(notificationActivated(uint)));
-    connect(QtUi::mainWindow()->systemTray(), SIGNAL(activated(SystemTray::ActivationReason)),
-        SLOT(notificationActivated(SystemTray::ActivationReason)));
+    connect(QtUi::mainWindow()->systemTray(), &SystemTray::messageClicked,
+            this, selectOverload<uint>(&SystrayNotificationBackend::onNotificationActivated));
+    connect(QtUi::mainWindow()->systemTray(), &SystemTray::activated,
+            this, selectOverload<SystemTray::ActivationReason>(&SystrayNotificationBackend::onNotificationActivated));
 
     QApplication::instance()->installEventFilter(this);
 
 
     QApplication::instance()->installEventFilter(this);
 
@@ -81,7 +82,7 @@ void SystrayNotificationBackend::close(uint notificationId)
 }
 
 
 }
 
 
-void SystrayNotificationBackend::notificationActivated(uint notificationId)
+void SystrayNotificationBackend::onNotificationActivated(uint notificationId)
 {
     if (!_blockActivation) {
         QList<Notification>::iterator i = _notifications.begin();
 {
     if (!_blockActivation) {
         QList<Notification>::iterator i = _notifications.begin();
@@ -98,13 +99,15 @@ void SystrayNotificationBackend::notificationActivated(uint notificationId)
 }
 
 
 }
 
 
-void SystrayNotificationBackend::notificationActivated(SystemTray::ActivationReason reason)
+void SystrayNotificationBackend::onNotificationActivated(SystemTray::ActivationReason reason)
 {
     if (reason == SystemTray::Trigger) {
 {
     if (reason == SystemTray::Trigger) {
-        if (_notifications.count())
-            notificationActivated(_notifications.last().notificationId);
-        else
+        if (_notifications.count()) {
+            onNotificationActivated(_notifications.last().notificationId);
+        }
+        else {
             GraphicalUi::toggleMainWidget();
             GraphicalUi::toggleMainWidget();
+        }
     }
 }
 
     }
 }
 
index d8af7e3..0e78600 100644 (file)
@@ -41,8 +41,8 @@ protected:
     bool eventFilter(QObject *obj, QEvent *event) override;
 
 private slots:
     bool eventFilter(QObject *obj, QEvent *event) override;
 
 private slots:
-    void notificationActivated(uint notificationId);
-    void notificationActivated(SystemTray::ActivationReason);
+    void onNotificationActivated(uint notificationId);
+    void onNotificationActivated(SystemTray::ActivationReason);
 
     void showBubbleChanged(const QVariant &);
     void updateToolTip();
 
     void showBubbleChanged(const QVariant &);
     void updateToolTip();
index 8b8b6c8..c86c933 100644 (file)
@@ -97,7 +97,7 @@ TaskbarNotificationBackend::ConfigWidget::ConfigWidget(QWidget *parent) : Settin
 
     connect(enabledBox, &QAbstractButton::toggled, this, &ConfigWidget::widgetChanged);
     connect(enabledBox, &QAbstractButton::toggled, timeoutBox, &QWidget::setEnabled);
 
     connect(enabledBox, &QAbstractButton::toggled, this, &ConfigWidget::widgetChanged);
     connect(enabledBox, &QAbstractButton::toggled, timeoutBox, &QWidget::setEnabled);
-    connect(timeoutBox, SIGNAL(valueChanged(int)), SLOT(widgetChanged()));
+    connect(timeoutBox, selectOverload<int>(&QSpinBox::valueChanged), this, &ConfigWidget::widgetChanged);
 }
 
 
 }
 
 
index 5f00daa..7a48d0e 100644 (file)
@@ -50,10 +50,10 @@ public:
         QString message;
 
         Notification(uint id_, BufferId buf_, NotificationType type_, QString sender_, QString msg_)
         QString message;
 
         Notification(uint id_, BufferId buf_, NotificationType type_, QString sender_, QString msg_)
-            : notificationId(id_), bufferId(buf_), type(type_), sender(std::move(sender_)), message(std::move(msg_)) {};
+            : notificationId(id_), bufferId(buf_), type(type_), sender(std::move(sender_)), message(std::move(msg_)) {}
     };
 
     };
 
-    inline AbstractNotificationBackend(QObject *parent) : QObject(parent) {};
+    using QObject::QObject;
 
     virtual void notify(const Notification &) = 0;
     virtual void close(uint notificationId) { Q_UNUSED(notificationId); }
 
     virtual void notify(const Notification &) = 0;
     virtual void close(uint notificationId) { Q_UNUSED(notificationId); }
index 5542739..a61339a 100644 (file)
@@ -56,7 +56,7 @@ Action::Action(const QIcon &icon, const QString &text, QObject *parent, const QO
 
 void Action::init()
 {
 
 void Action::init()
 {
-    connect(this, SIGNAL(triggered(bool)), this, SLOT(slotTriggered()));
+    connect(this, &QAction::triggered, this, &Action::slotTriggered);
 
     setProperty("isShortcutConfigurable", true);
 }
 
     setProperty("isShortcutConfigurable", true);
 }
index 6a7badd..046dad9 100644 (file)
@@ -91,11 +91,9 @@ void BufferView::init()
 
 #if defined Q_OS_MACOS || defined Q_OS_WIN
     // afaik this is better on Mac and Windows
 
 #if defined Q_OS_MACOS || defined Q_OS_WIN
     // afaik this is better on Mac and Windows
-    disconnect(this, SIGNAL(activated(QModelIndex)), this, SLOT(joinChannel(QModelIndex)));
-    connect(this, SIGNAL(activated(QModelIndex)), SLOT(joinChannel(QModelIndex)));
+    connect(this, &QAbstractItemView::activated, this, &BufferView::joinChannel, Qt::UniqueConnection);
 #else
 #else
-    disconnect(this, &QAbstractItemView::doubleClicked, this, &BufferView::joinChannel);
-    connect(this, &QAbstractItemView::doubleClicked, this, &BufferView::joinChannel);
+    connect(this, &QAbstractItemView::doubleClicked, this, &BufferView::joinChannel, Qt::UniqueConnection);
 #endif
 }
 
 #endif
 }
 
index cc746f2..059e47e 100644 (file)
@@ -96,19 +96,7 @@ void BufferViewFilter::configInitialized()
     if (!config())
         return;
 
     if (!config())
         return;
 
-//   connect(config(), SIGNAL(bufferViewNameSet(const QString &)), this, SLOT(invalidate()));
     connect(config(), &BufferViewConfig::configChanged, this, &QSortFilterProxyModel::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(hideInactiveBuffersSet(bool)), this, SLOT(invalidate()));
-//   connect(config(), SIGNAL(allowedBufferTypesSet(int)), this, SLOT(invalidate()));
-//   connect(config(), SIGNAL(minimumActivitySet(int)), this, SLOT(invalidate()));
-//   connect(config(), SIGNAL(bufferListSet()), this, SLOT(invalidate()));
-//   connect(config(), SIGNAL(bufferAdded(const BufferId &, int)), this, SLOT(invalidate()));
-//   connect(config(), SIGNAL(bufferMoved(const BufferId &, int)), this, SLOT(invalidate()));
-//   connect(config(), SIGNAL(bufferRemoved(const BufferId &)), this, SLOT(invalidate()));
-//   connect(config(), SIGNAL(bufferPermanentlyRemoved(const BufferId &)), this, SLOT(invalidate()));
 
     disconnect(config(), &SyncableObject::initDone, this, &BufferViewFilter::configInitialized);
 
 
     disconnect(config(), &SyncableObject::initDone, this, &BufferViewFilter::configInitialized);
 
index c0c489a..2fdb708 100644 (file)
@@ -53,7 +53,7 @@ NickView::NickView(QWidget *parent)
 
 #if defined Q_OS_MACOS || defined Q_OS_WIN
     // afaik this is better on Mac and Windows
 
 #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)));
+    connect(this, &QAbstractItemView::activated, this, &NickView::startQuery);
 #else
     connect(this, &QAbstractItemView::doubleClicked, this, &NickView::startQuery);
 #endif
 #else
     connect(this, &QAbstractItemView::doubleClicked, this, &NickView::startQuery);
 #endif
index 730418e..994a3e4 100644 (file)
@@ -139,9 +139,6 @@ public slots:
     virtual void defaults();
 
 protected slots:
     virtual void defaults();
 
 protected slots:
-    //! Calling this slot is equivalent to calling setChangedState(true).
-    inline void changed() { setChangedState(true); }
-
     //! This should be called whenever the widget state changes from unchanged to change or the other way round.
     void setChangedState(bool hasChanged = true);
 
     //! This should be called whenever the widget state changes from unchanged to change or the other way round.
     void setChangedState(bool hasChanged = true);
 
index e009a33..b444deb 100644 (file)
@@ -111,14 +111,14 @@ void ToolBarActionProvider::addActions(QToolBar *bar, ToolBarType type)
 }
 
 
 }
 
 
-void ToolBarActionProvider::currentBufferChanged(const QModelIndex &index)
+void ToolBarActionProvider::onCurrentBufferChanged(const QModelIndex &index)
 {
     _currentBuffer = index;
     updateStates();
 }
 
 
 {
     _currentBuffer = index;
     updateStates();
 }
 
 
-void ToolBarActionProvider::nickSelectionChanged(const QModelIndexList &indexList)
+void ToolBarActionProvider::onNickSelectionChanged(const QModelIndexList &indexList)
 {
     _selectedNicks = indexList;
     updateStates();
 {
     _selectedNicks = indexList;
     updateStates();
@@ -161,8 +161,8 @@ void ToolBarActionProvider::networkCreated(NetworkId id)
     _networkActions[id] = act;
     act->setObjectName(QString("NetworkAction-%1").arg(id.toInt()));
     act->setData(QVariant::fromValue<NetworkId>(id));
     _networkActions[id] = act;
     act->setObjectName(QString("NetworkAction-%1").arg(id.toInt()));
     act->setData(QVariant::fromValue<NetworkId>(id));
-    connect(net, SIGNAL(updatedRemotely()), SLOT(networkUpdated()));
-    connect(act, SIGNAL(triggered()), SLOT(connectOrDisconnectNet()));
+    connect(net, &Network::updatedRemotely, this, [this]() { networkUpdated(); });
+    connect(act, &QAction::triggered, this, &ToolBarActionProvider::connectOrDisconnectNet);
     networkUpdated(net);
 }
 
     networkUpdated(net);
 }
 
index 9d80d37..6cb7761 100644 (file)
@@ -43,6 +43,8 @@ public:
 
 public slots:
     void disconnectedFromCore() override;
 
 public slots:
     void disconnectedFromCore() override;
+    void onCurrentBufferChanged(const QModelIndex &);
+    void onNickSelectionChanged(const QModelIndexList &);
 
 protected:
     void handleNetworkAction(ActionType, QAction *) override;
 
 protected:
     void handleNetworkAction(ActionType, QAction *) override;
@@ -56,9 +58,6 @@ private slots:
     void networkUpdated(const Network *net = nullptr);
     void connectOrDisconnectNet();
 
     void networkUpdated(const Network *net = nullptr);
     void connectOrDisconnectNet();
 
-    void currentBufferChanged(const QModelIndex &);
-    void nickSelectionChanged(const QModelIndexList &);
-
     void updateStates();
 
 private:
     void updateStates();
 
 private: