Commit a1340c80 authored by Albert Vaca Cintora's avatar Albert Vaca Cintora

Fixed old style connects with clazy

parent 63dad0e8
...@@ -39,14 +39,14 @@ LanDeviceLink::LanDeviceLink(const QString& deviceId, LinkProvider* parent, QSsl ...@@ -39,14 +39,14 @@ LanDeviceLink::LanDeviceLink(const QString& deviceId, LinkProvider* parent, QSsl
void LanDeviceLink::reset(QSslSocket* socket, ConnectionStarted connectionSource) void LanDeviceLink::reset(QSslSocket* socket, ConnectionStarted connectionSource)
{ {
if (mSocketLineReader) { if (mSocketLineReader) {
disconnect(mSocketLineReader->mSocket, SIGNAL(disconnected()), this, SLOT(deleteLater())); disconnect(mSocketLineReader->mSocket, &QAbstractSocket::disconnected, this, &QObject::deleteLater);
delete mSocketLineReader; delete mSocketLineReader;
} }
mSocketLineReader = new SocketLineReader(socket, this); mSocketLineReader = new SocketLineReader(socket, this);
connect(socket, SIGNAL(disconnected()), this, SLOT(deleteLater())); connect(socket, &QAbstractSocket::disconnected, this, &QObject::deleteLater);
connect(mSocketLineReader, SIGNAL(readyRead()), this, SLOT(dataReceived())); connect(mSocketLineReader, &SocketLineReader::readyRead, this, &LanDeviceLink::dataReceived);
//We take ownership of the socket. //We take ownership of the socket.
//When the link provider destroys us, //When the link provider destroys us,
......
...@@ -50,12 +50,12 @@ LanLinkProvider::LanLinkProvider(bool testMode) ...@@ -50,12 +50,12 @@ LanLinkProvider::LanLinkProvider(bool testMode)
combineBroadcastsTimer.setInterval(0); // increase this if waiting a single event-loop iteration is not enough combineBroadcastsTimer.setInterval(0); // increase this if waiting a single event-loop iteration is not enough
combineBroadcastsTimer.setSingleShot(true); combineBroadcastsTimer.setSingleShot(true);
connect(&combineBroadcastsTimer, SIGNAL(timeout()), this, SLOT(broadcastToNetwork())); connect(&combineBroadcastsTimer, &QTimer::timeout, this, &LanLinkProvider::broadcastToNetwork);
connect(&mUdpSocket, SIGNAL(readyRead()), this, SLOT(newUdpConnection())); connect(&mUdpSocket, &QIODevice::readyRead, this, &LanLinkProvider::newUdpConnection);
mServer = new Server(this); mServer = new Server(this);
connect(mServer,SIGNAL(newConnection()),this, SLOT(newConnection())); connect(mServer,&QTcpServer::newConnection,this, &LanLinkProvider::newConnection);
//Detect when a network interface changes status, so we announce ourelves in the new network //Detect when a network interface changes status, so we announce ourelves in the new network
QNetworkConfigurationManager* networkManager = new QNetworkConfigurationManager(this); QNetworkConfigurationManager* networkManager = new QNetworkConfigurationManager(this);
...@@ -196,7 +196,7 @@ void LanLinkProvider::newUdpConnection() //udpBroadcastReceived ...@@ -196,7 +196,7 @@ void LanLinkProvider::newUdpConnection() //udpBroadcastReceived
QSslSocket* socket = new QSslSocket(this); QSslSocket* socket = new QSslSocket(this);
receivedIdentityPackages[socket].np = receivedPackage; receivedIdentityPackages[socket].np = receivedPackage;
receivedIdentityPackages[socket].sender = sender; receivedIdentityPackages[socket].sender = sender;
connect(socket, SIGNAL(connected()), this, SLOT(connected())); connect(socket, &QAbstractSocket::connected, this, &LanLinkProvider::connected);
connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(connectError())); connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(connectError()));
socket->connectToHost(sender, tcpPort); socket->connectToHost(sender, tcpPort);
} }
...@@ -206,7 +206,7 @@ void LanLinkProvider::connectError() ...@@ -206,7 +206,7 @@ void LanLinkProvider::connectError()
{ {
QSslSocket* socket = qobject_cast<QSslSocket*>(sender()); QSslSocket* socket = qobject_cast<QSslSocket*>(sender());
if (!socket) return; if (!socket) return;
disconnect(socket, SIGNAL(connected()), this, SLOT(connected())); disconnect(socket, &QAbstractSocket::connected, this, &LanLinkProvider::connected);
disconnect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(connectError())); disconnect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(connectError()));
qCDebug(KDECONNECT_CORE) << "Fallback (1), try reverse connection (send udp packet)" << socket->errorString(); qCDebug(KDECONNECT_CORE) << "Fallback (1), try reverse connection (send udp packet)" << socket->errorString();
...@@ -228,13 +228,13 @@ void LanLinkProvider::connected() ...@@ -228,13 +228,13 @@ void LanLinkProvider::connected()
QSslSocket* socket = qobject_cast<QSslSocket*>(sender()); QSslSocket* socket = qobject_cast<QSslSocket*>(sender());
if (!socket) return; if (!socket) return;
disconnect(socket, SIGNAL(connected()), this, SLOT(connected())); disconnect(socket, &QAbstractSocket::connected, this, &LanLinkProvider::connected);
disconnect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(connectError())); disconnect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(connectError()));
configureSocket(socket); configureSocket(socket);
// If socket disconnects due to any reason after connection, link on ssl faliure // If socket disconnects due to any reason after connection, link on ssl faliure
connect(socket, SIGNAL(disconnected()), socket, SLOT(deleteLater())); connect(socket, &QAbstractSocket::disconnected, socket, &QObject::deleteLater);
NetworkPackage* receivedPackage = receivedIdentityPackages[socket].np; NetworkPackage* receivedPackage = receivedIdentityPackages[socket].np;
const QString& deviceId = receivedPackage->get<QString>("deviceId"); const QString& deviceId = receivedPackage->get<QString>("deviceId");
...@@ -258,7 +258,7 @@ void LanLinkProvider::connected() ...@@ -258,7 +258,7 @@ void LanLinkProvider::connected()
qCDebug(KDECONNECT_CORE) << "Starting server ssl (I'm the client TCP socket)"; qCDebug(KDECONNECT_CORE) << "Starting server ssl (I'm the client TCP socket)";
connect(socket, SIGNAL(encrypted()), this, SLOT(encrypted())); connect(socket, &QSslSocket::encrypted, this, &LanLinkProvider::encrypted);
if (isDeviceTrusted) { if (isDeviceTrusted) {
connect(socket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(sslErrors(QList<QSslError>))); connect(socket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(sslErrors(QList<QSslError>)));
...@@ -289,7 +289,7 @@ void LanLinkProvider::encrypted() ...@@ -289,7 +289,7 @@ void LanLinkProvider::encrypted()
QSslSocket* socket = qobject_cast<QSslSocket*>(sender()); QSslSocket* socket = qobject_cast<QSslSocket*>(sender());
if (!socket) return; if (!socket) return;
disconnect(socket, SIGNAL(encrypted()), this, SLOT(encrypted())); disconnect(socket, &QSslSocket::encrypted, this, &LanLinkProvider::encrypted);
disconnect(socket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(sslErrors(QList<QSslError>))); disconnect(socket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(sslErrors(QList<QSslError>)));
Q_ASSERT(socket->mode() != QSslSocket::UnencryptedMode); Q_ASSERT(socket->mode() != QSslSocket::UnencryptedMode);
...@@ -309,7 +309,7 @@ void LanLinkProvider::sslErrors(const QList<QSslError>& errors) ...@@ -309,7 +309,7 @@ void LanLinkProvider::sslErrors(const QList<QSslError>& errors)
QSslSocket* socket = qobject_cast<QSslSocket*>(sender()); QSslSocket* socket = qobject_cast<QSslSocket*>(sender());
if (!socket) return; if (!socket) return;
disconnect(socket, SIGNAL(encrypted()), this, SLOT(encrypted())); disconnect(socket, &QSslSocket::encrypted, this, &LanLinkProvider::encrypted);
disconnect(socket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(sslErrors(QList<QSslError>))); disconnect(socket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(sslErrors(QList<QSslError>)));
Q_FOREACH (const QSslError &error, errors) { Q_FOREACH (const QSslError &error, errors) {
...@@ -347,10 +347,10 @@ void LanLinkProvider::newConnection() ...@@ -347,10 +347,10 @@ void LanLinkProvider::newConnection()
//This socket is still managed by us (and child of the QTcpServer), if //This socket is still managed by us (and child of the QTcpServer), if
//it disconnects before we manage to pass it to a LanDeviceLink, it's //it disconnects before we manage to pass it to a LanDeviceLink, it's
//our responsibility to delete it. We do so with this connection. //our responsibility to delete it. We do so with this connection.
connect(socket, SIGNAL(disconnected()), connect(socket, &QAbstractSocket::disconnected,
socket, SLOT(deleteLater())); socket, &QObject::deleteLater);
connect(socket, SIGNAL(readyRead()), connect(socket, &QIODevice::readyRead,
this, SLOT(dataReceived())); this, &LanLinkProvider::dataReceived);
} }
} }
...@@ -385,7 +385,7 @@ void LanLinkProvider::dataReceived() ...@@ -385,7 +385,7 @@ void LanLinkProvider::dataReceived()
//qCDebug(KDECONNECT_CORE) << "Handshaking done (i'm the new device)"; //qCDebug(KDECONNECT_CORE) << "Handshaking done (i'm the new device)";
//This socket will now be owned by the LanDeviceLink or we don't want more data to be received, forget about it //This socket will now be owned by the LanDeviceLink or we don't want more data to be received, forget about it
disconnect(socket, SIGNAL(readyRead()), this, SLOT(dataReceived())); disconnect(socket, &QIODevice::readyRead, this, &LanLinkProvider::dataReceived);
if (np->get<int>("protocolVersion") >= MIN_VERSION_WITH_SSL_SUPPORT) { if (np->get<int>("protocolVersion") >= MIN_VERSION_WITH_SSL_SUPPORT) {
...@@ -394,7 +394,7 @@ void LanLinkProvider::dataReceived() ...@@ -394,7 +394,7 @@ void LanLinkProvider::dataReceived()
qCDebug(KDECONNECT_CORE) << "Starting client ssl (but I'm the server TCP socket)"; qCDebug(KDECONNECT_CORE) << "Starting client ssl (but I'm the server TCP socket)";
connect(socket, SIGNAL(encrypted()), this, SLOT(encrypted())); connect(socket, &QSslSocket::encrypted, this, &LanLinkProvider::encrypted);
if (isDeviceTrusted) { if (isDeviceTrusted) {
connect(socket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(sslErrors(QList<QSslError>))); connect(socket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(sslErrors(QList<QSslError>)));
...@@ -489,7 +489,7 @@ void LanLinkProvider::configureSocket(QSslSocket* socket) { ...@@ -489,7 +489,7 @@ void LanLinkProvider::configureSocket(QSslSocket* socket) {
void LanLinkProvider::addLink(const QString& deviceId, QSslSocket* socket, NetworkPackage* receivedPackage, LanDeviceLink::ConnectionStarted connectionOrigin) void LanLinkProvider::addLink(const QString& deviceId, QSslSocket* socket, NetworkPackage* receivedPackage, LanDeviceLink::ConnectionStarted connectionOrigin)
{ {
// Socket disconnection will now be handled by LanDeviceLink // Socket disconnection will now be handled by LanDeviceLink
disconnect(socket, SIGNAL(disconnected()), socket, SLOT(deleteLater())); disconnect(socket, &QAbstractSocket::disconnected, socket, &QObject::deleteLater);
LanDeviceLink* deviceLink; LanDeviceLink* deviceLink;
//Do we have a link for this device already? //Do we have a link for this device already?
...@@ -500,7 +500,7 @@ void LanLinkProvider::addLink(const QString& deviceId, QSslSocket* socket, Netwo ...@@ -500,7 +500,7 @@ void LanLinkProvider::addLink(const QString& deviceId, QSslSocket* socket, Netwo
deviceLink->reset(socket, connectionOrigin); deviceLink->reset(socket, connectionOrigin);
} else { } else {
deviceLink = new LanDeviceLink(deviceId, this, socket, connectionOrigin); deviceLink = new LanDeviceLink(deviceId, this, socket, connectionOrigin);
connect(deviceLink, SIGNAL(destroyed(QObject*)), this, SLOT(deviceLinkDestroyed(QObject*))); connect(deviceLink, &QObject::destroyed, this, &LanLinkProvider::deviceLinkDestroyed);
mLinks[deviceId] = deviceLink; mLinks[deviceId] = deviceLink;
if (mPairingHandlers.contains(deviceId)) { if (mPairingHandlers.contains(deviceId)) {
//We shouldn't have a pairinghandler if we didn't have a link. //We shouldn't have a pairinghandler if we didn't have a link.
......
...@@ -25,8 +25,8 @@ SocketLineReader::SocketLineReader(QSslSocket* socket, QObject* parent) ...@@ -25,8 +25,8 @@ SocketLineReader::SocketLineReader(QSslSocket* socket, QObject* parent)
: QObject(parent) : QObject(parent)
, mSocket(socket) , mSocket(socket)
{ {
connect(mSocket, SIGNAL(readyRead()), connect(mSocket, &QIODevice::readyRead,
this, SLOT(dataReceived())); this, &SocketLineReader::dataReceived);
} }
void SocketLineReader::dataReceived() void SocketLineReader::dataReceived()
......
...@@ -34,8 +34,8 @@ UploadJob::UploadJob(const QSharedPointer<QIODevice>& source, const QString& dev ...@@ -34,8 +34,8 @@ UploadJob::UploadJob(const QSharedPointer<QIODevice>& source, const QString& dev
, mPort(0) , mPort(0)
, mDeviceId(deviceId) // We will use this info if link is on ssl, to send encrypted payload , mDeviceId(deviceId) // We will use this info if link is on ssl, to send encrypted payload
{ {
connect(mInput.data(), SIGNAL(readyRead()), this, SLOT(startUploading())); connect(mInput.data(), &QIODevice::readyRead, this, &UploadJob::startUploading);
connect(mInput.data(), SIGNAL(aboutToClose()), this, SLOT(aboutToClose())); connect(mInput.data(), &QIODevice::aboutToClose, this, &UploadJob::aboutToClose);
} }
void UploadJob::start() void UploadJob::start()
...@@ -52,7 +52,7 @@ void UploadJob::start() ...@@ -52,7 +52,7 @@ void UploadJob::start()
return; return;
} }
} }
connect(mServer, SIGNAL(newConnection()), this, SLOT(newConnection())); connect(mServer, &QTcpServer::newConnection, this, &UploadJob::newConnection);
} }
void UploadJob::newConnection() void UploadJob::newConnection()
...@@ -64,7 +64,7 @@ void UploadJob::newConnection() ...@@ -64,7 +64,7 @@ void UploadJob::newConnection()
Server* server = qobject_cast<Server*>(sender()); Server* server = qobject_cast<Server*>(sender());
// FIXME : It is called again when payload sending is finished. Unsolved mystery :( // FIXME : It is called again when payload sending is finished. Unsolved mystery :(
disconnect(mServer, SIGNAL(newConnection()), this, SLOT(newConnection())); disconnect(mServer, &QTcpServer::newConnection, this, &UploadJob::newConnection);
mSocket = server->nextPendingConnection(); mSocket = server->nextPendingConnection();
mSocket->setParent(this); mSocket->setParent(this);
......
...@@ -79,8 +79,8 @@ Daemon::Daemon(QObject *parent, bool testMode) ...@@ -79,8 +79,8 @@ Daemon::Daemon(QObject *parent, bool testMode)
//Listen to new devices //Listen to new devices
Q_FOREACH (LinkProvider* a, d->mLinkProviders) { Q_FOREACH (LinkProvider* a, d->mLinkProviders) {
connect(a, SIGNAL(onConnectionReceived(NetworkPackage,DeviceLink*)), connect(a, &LinkProvider::onConnectionReceived,
this, SLOT(onNewDeviceLink(NetworkPackage,DeviceLink*))); this, &Daemon::onNewDeviceLink);
a->onStart(); a->onStart();
} }
......
...@@ -211,8 +211,8 @@ void Device::addLink(const NetworkPackage& identityPackage, DeviceLink* link) ...@@ -211,8 +211,8 @@ void Device::addLink(const NetworkPackage& identityPackage, DeviceLink* link)
qCWarning(KDECONNECT_CORE) << m_deviceName << "- warning, device uses a different protocol version" << m_protocolVersion << "expected" << NetworkPackage::ProtocolVersion; qCWarning(KDECONNECT_CORE) << m_deviceName << "- warning, device uses a different protocol version" << m_protocolVersion << "expected" << NetworkPackage::ProtocolVersion;
} }
connect(link, SIGNAL(destroyed(QObject*)), connect(link, &QObject::destroyed,
this, SLOT(linkDestroyed(QObject*))); this, &Device::linkDestroyed);
m_deviceLinks.append(link); m_deviceLinks.append(link);
...@@ -224,8 +224,8 @@ void Device::addLink(const NetworkPackage& identityPackage, DeviceLink* link) ...@@ -224,8 +224,8 @@ void Device::addLink(const NetworkPackage& identityPackage, DeviceLink* link)
//the old one before this is called), so we do not have to worry about destroying old links. //the old one before this is called), so we do not have to worry about destroying old links.
//-- Actually, we should not destroy them or the provider will store an invalid ref! //-- Actually, we should not destroy them or the provider will store an invalid ref!
connect(link, SIGNAL(receivedPackage(NetworkPackage)), connect(link, &DeviceLink::receivedPackage,
this, SLOT(privateReceivedPackage(NetworkPackage))); this, &Device::privateReceivedPackage);
qSort(m_deviceLinks.begin(), m_deviceLinks.end(), lessThan); qSort(m_deviceLinks.begin(), m_deviceLinks.end(), lessThan);
......
...@@ -67,7 +67,7 @@ QList<QAction*> SendFileItemAction::actions(const KFileItemListProperties& fileI ...@@ -67,7 +67,7 @@ QList<QAction*> SendFileItemAction::actions(const KFileItemListProperties& fileI
action->setProperty("id", id); action->setProperty("id", id);
action->setProperty("urls", QVariant::fromValue(fileItemInfos.urlList())); action->setProperty("urls", QVariant::fromValue(fileItemInfos.urlList()));
action->setProperty("parentWidget", QVariant::fromValue(parentWidget)); action->setProperty("parentWidget", QVariant::fromValue(parentWidget));
connect(action, SIGNAL(triggered(bool)), this, SLOT(sendFile())); connect(action, &QAction::triggered, this, &SendFileItemAction::sendFile);
actions += action; actions += action;
} }
......
...@@ -46,17 +46,17 @@ DevicesModel::DevicesModel(QObject *parent) ...@@ -46,17 +46,17 @@ DevicesModel::DevicesModel(QObject *parent)
//new ModelTest(this, this); //new ModelTest(this, this);
connect(this, SIGNAL(rowsRemoved(QModelIndex,int,int)), connect(this, &QAbstractItemModel::rowsRemoved,
this, SIGNAL(rowsChanged())); this, &DevicesModel::rowsChanged);
connect(this, SIGNAL(rowsInserted(QModelIndex,int,int)), connect(this, &QAbstractItemModel::rowsInserted,
this, SIGNAL(rowsChanged())); this, &DevicesModel::rowsChanged);
connect(m_dbusInterface, SIGNAL(deviceAdded(QString)), connect(m_dbusInterface, SIGNAL(deviceAdded(QString)),
this, SLOT(deviceAdded(QString))); this, SLOT(deviceAdded(QString)));
connect(m_dbusInterface, SIGNAL(deviceVisibilityChanged(QString,bool)), connect(m_dbusInterface, &OrgKdeKdeconnectDaemonInterface::deviceVisibilityChanged,
this, SLOT(deviceUpdated(QString,bool))); this, &DevicesModel::deviceUpdated);
connect(m_dbusInterface, SIGNAL(deviceRemoved(QString)), connect(m_dbusInterface, &OrgKdeKdeconnectDaemonInterface::deviceRemoved,
this, SLOT(deviceRemoved(QString))); this, &DevicesModel::deviceRemoved);
QDBusServiceWatcher* watcher = new QDBusServiceWatcher(DaemonDbusInterface::activatedService(), QDBusServiceWatcher* watcher = new QDBusServiceWatcher(DaemonDbusInterface::activatedService(),
QDBusConnection::sessionBus(), QDBusServiceWatcher::WatchForOwnerChange, this); QDBusConnection::sessionBus(), QDBusServiceWatcher::WatchForOwnerChange, this);
...@@ -182,8 +182,8 @@ void DevicesModel::refreshDeviceList() ...@@ -182,8 +182,8 @@ void DevicesModel::refreshDeviceList()
QDBusPendingReply<QStringList> pendingDeviceIds = m_dbusInterface->devices(onlyReachable, onlyPaired); QDBusPendingReply<QStringList> pendingDeviceIds = m_dbusInterface->devices(onlyReachable, onlyPaired);
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingDeviceIds, this); QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingDeviceIds, this);
QObject::connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), QObject::connect(watcher, &QDBusPendingCallWatcher::finished,
this, SLOT(receivedDeviceList(QDBusPendingCallWatcher*))); this, &DevicesModel::receivedDeviceList);
} }
void DevicesModel::receivedDeviceList(QDBusPendingCallWatcher* watcher) void DevicesModel::receivedDeviceList(QDBusPendingCallWatcher* watcher)
...@@ -212,7 +212,7 @@ void DevicesModel::receivedDeviceList(QDBusPendingCallWatcher* watcher) ...@@ -212,7 +212,7 @@ void DevicesModel::receivedDeviceList(QDBusPendingCallWatcher* watcher)
void DevicesModel::appendDevice(DeviceDbusInterface* dev) void DevicesModel::appendDevice(DeviceDbusInterface* dev)
{ {
m_deviceList.append(dev); m_deviceList.append(dev);
connect(dev, SIGNAL(nameChanged(QString)), SLOT(nameChanged(QString))); connect(dev, &OrgKdeKdeconnectDeviceInterface::nameChanged, this, &DevicesModel::nameChanged);
} }
void DevicesModel::nameChanged(const QString& newName) void DevicesModel::nameChanged(const QString& newName)
......
...@@ -34,7 +34,7 @@ void DevicesSortProxyModel::setSourceModel(QAbstractItemModel *devicesModel) ...@@ -34,7 +34,7 @@ void DevicesSortProxyModel::setSourceModel(QAbstractItemModel *devicesModel)
QSortFilterProxyModel::setSourceModel(devicesModel); QSortFilterProxyModel::setSourceModel(devicesModel);
if (devicesModel) { if (devicesModel) {
setSortRole(DevicesModel::StatusModelRole); setSortRole(DevicesModel::StatusModelRole);
connect(devicesModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(sourceDataChanged())); connect(devicesModel, &QAbstractItemModel::dataChanged, this, &DevicesSortProxyModel::sourceDataChanged);
} }
sort(0); sort(0);
} }
......
...@@ -36,15 +36,15 @@ NotificationsModel::NotificationsModel(QObject* parent) ...@@ -36,15 +36,15 @@ NotificationsModel::NotificationsModel(QObject* parent)
//new ModelTest(this, this); //new ModelTest(this, this);
connect(this, SIGNAL(rowsInserted(QModelIndex,int,int)), connect(this, &QAbstractItemModel::rowsInserted,
this, SIGNAL(rowsChanged())); this, &NotificationsModel::rowsChanged);
connect(this, SIGNAL(rowsRemoved(QModelIndex,int,int)), connect(this, &QAbstractItemModel::rowsRemoved,
this, SIGNAL(rowsChanged())); this, &NotificationsModel::rowsChanged);
connect(this, SIGNAL(dataChanged(QModelIndex,QModelIndex)), connect(this, &QAbstractItemModel::dataChanged,
this, SIGNAL(anyDismissableChanged())); this, &NotificationsModel::anyDismissableChanged);
connect(this, SIGNAL(rowsInserted(QModelIndex,int,int)), connect(this, &QAbstractItemModel::rowsInserted,
this, SIGNAL(anyDismissableChanged())); this, &NotificationsModel::anyDismissableChanged);
QDBusServiceWatcher* watcher = new QDBusServiceWatcher(DaemonDbusInterface::activatedService(), QDBusServiceWatcher* watcher = new QDBusServiceWatcher(DaemonDbusInterface::activatedService(),
QDBusConnection::sessionBus(), QDBusServiceWatcher::WatchForOwnerChange, this); QDBusConnection::sessionBus(), QDBusServiceWatcher::WatchForOwnerChange, this);
...@@ -82,12 +82,12 @@ void NotificationsModel::setDeviceId(const QString& deviceId) ...@@ -82,12 +82,12 @@ void NotificationsModel::setDeviceId(const QString& deviceId)
m_dbusInterface = new DeviceNotificationsDbusInterface(deviceId, this); m_dbusInterface = new DeviceNotificationsDbusInterface(deviceId, this);
connect(m_dbusInterface, SIGNAL(notificationPosted(QString)), connect(m_dbusInterface, &OrgKdeKdeconnectDeviceNotificationsInterface::notificationPosted,
this, SLOT(notificationAdded(QString))); this, &NotificationsModel::notificationAdded);
connect(m_dbusInterface, SIGNAL(notificationRemoved(QString)), connect(m_dbusInterface, &OrgKdeKdeconnectDeviceNotificationsInterface::notificationRemoved,
this, SLOT(notificationRemoved(QString))); this, &NotificationsModel::notificationRemoved);
connect(m_dbusInterface, SIGNAL(allNotificationsRemoved()), connect(m_dbusInterface, &OrgKdeKdeconnectDeviceNotificationsInterface::allNotificationsRemoved,
this, SLOT(clearNotifications())); this, &NotificationsModel::clearNotifications);
refreshNotificationList(); refreshNotificationList();
...@@ -132,8 +132,8 @@ void NotificationsModel::refreshNotificationList() ...@@ -132,8 +132,8 @@ void NotificationsModel::refreshNotificationList()
QDBusPendingReply<QStringList> pendingNotificationIds = m_dbusInterface->activeNotifications(); QDBusPendingReply<QStringList> pendingNotificationIds = m_dbusInterface->activeNotifications();
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingNotificationIds, this); QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingNotificationIds, this);
QObject::connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), QObject::connect(watcher, &QDBusPendingCallWatcher::finished,
this, SLOT(receivedNotifications(QDBusPendingCallWatcher*))); this, &NotificationsModel::receivedNotifications);
} }
void NotificationsModel::receivedNotifications(QDBusPendingCallWatcher* watcher) void NotificationsModel::receivedNotifications(QDBusPendingCallWatcher* watcher)
......
...@@ -91,24 +91,24 @@ KdeConnectKcm::KdeConnectKcm(QWidget *parent, const QVariantList&) ...@@ -91,24 +91,24 @@ KdeConnectKcm::KdeConnectKcm(QWidget *parent, const QVariantList&)
setButtons(KCModule::Help | KCModule::NoAdditionalButton); setButtons(KCModule::Help | KCModule::NoAdditionalButton);
connect(devicesModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), connect(devicesModel, &QAbstractItemModel::dataChanged,
this, SLOT(resetSelection())); this, &KdeConnectKcm::resetSelection);
connect(kcmUi->deviceList->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), connect(kcmUi->deviceList->selectionModel(), &QItemSelectionModel::currentChanged,
this, SLOT(deviceSelected(QModelIndex))); this, &KdeConnectKcm::deviceSelected);
connect(kcmUi->pair_button, SIGNAL(clicked()), connect(kcmUi->pair_button, &QAbstractButton::clicked,
this, SLOT(requestPair())); this, &KdeConnectKcm::requestPair);
connect(kcmUi->unpair_button, SIGNAL(clicked()), connect(kcmUi->unpair_button, &QAbstractButton::clicked,
this, SLOT(unpair())); this, &KdeConnectKcm::unpair);
connect(kcmUi->ping_button, SIGNAL(clicked()), connect(kcmUi->ping_button, &QAbstractButton::clicked,
this, SLOT(sendPing())); this, &KdeConnectKcm::sendPing);
connect(kcmUi->refresh_button,SIGNAL(clicked()), connect(kcmUi->refresh_button,&QAbstractButton::clicked,
this, SLOT(refresh())); this, &KdeConnectKcm::refresh);
connect(kcmUi->rename_edit,SIGNAL(returnPressed()), connect(kcmUi->rename_edit,&QLineEdit::returnPressed,
this, SLOT(renameDone())); this, &KdeConnectKcm::renameDone);
connect(kcmUi->renameDone_button,SIGNAL(clicked()), connect(kcmUi->renameDone_button,&QAbstractButton::clicked,
this, SLOT(renameDone())); this, &KdeConnectKcm::renameDone);
connect(kcmUi->renameShow_button,SIGNAL(clicked()), connect(kcmUi->renameShow_button,&QAbstractButton::clicked,
this, SLOT(renameShow())); this, &KdeConnectKcm::renameShow);
daemon->acquireDiscoveryMode(createId()); daemon->acquireDiscoveryMode(createId());
} }
...@@ -234,7 +234,7 @@ void KdeConnectKcm::resetDeviceView() ...@@ -234,7 +234,7 @@ void KdeConnectKcm::resetDeviceView()
KSharedConfigPtr deviceConfig = KSharedConfig::openConfig(currentDevice->pluginsConfigFile()); KSharedConfigPtr deviceConfig = KSharedConfig::openConfig(currentDevice->pluginsConfigFile());
kcmUi->pluginSelector->addPlugins(availablePluginInfo, KPluginSelector::ReadConfigFile, i18n("Available plugins"), QString(), deviceConfig); kcmUi->pluginSelector->addPlugins(availablePluginInfo, KPluginSelector::ReadConfigFile, i18n("Available plugins"), QString(), deviceConfig);
connect(kcmUi->pluginSelector, SIGNAL(changed(bool)), this, SLOT(pluginsConfigChanged())); connect(kcmUi->pluginSelector, &KPluginSelector::changed, this, &KdeConnectKcm::pluginsConfigChanged);
} }
......
...@@ -62,7 +62,7 @@ DBusAsyncResponse::DBusAsyncResponse(QObject* parent) ...@@ -62,7 +62,7 @@ DBusAsyncResponse::DBusAsyncResponse(QObject* parent)
{ {
m_timeout.setSingleShot(true); m_timeout.setSingleShot(true);
m_timeout.setInterval(15000); m_timeout.setInterval(15000);
connect(&m_timeout, SIGNAL(timeout()), this, SLOT(onTimeout())); connect(&m_timeout, &QTimer::timeout, this, &DBusAsyncResponse::onTimeout);
} }
...@@ -72,9 +72,9 @@ void DBusAsyncResponse::setPendingCall(QVariant variant) ...@@ -72,9 +72,9 @@ void DBusAsyncResponse::setPendingCall(QVariant variant)
{ {
QDBusPendingCallWatcher* watcher = new QDBusPendingCallWatcher(*call); QDBusPendingCallWatcher* watcher = new QDBusPendingCallWatcher(*call);
watcher->setProperty("pengingCallVariant", variant); watcher->setProperty("pengingCallVariant", variant);
connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), this, SLOT(onCallFinished(QDBusPendingCallWatcher*))); connect(watcher, &QDBusPendingCallWatcher::finished, this, &DBusAsyncResponse::onCallFinished);
connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), watcher, SLOT(deleteLater())); connect(watcher, &QDBusPendingCallWatcher::finished, watcher, &QObject::deleteLater);
connect(&m_timeout, SIGNAL(timeout()), watcher, SLOT(deleteLater())); connect(&m_timeout, &QTimer::timeout, watcher, &QObject::deleteLater);
m_timeout.start(); m_timeout.start();
} }
} }
......
...@@ -90,10 +90,10 @@ void MprisControlPlugin::addPlayer(const QString& service) ...@@ -90,10 +90,10 @@ void MprisControlPlugin::addPlayer(const QString& service)
sendPlayerList(); sendPlayerList();
OrgFreedesktopDBusPropertiesInterface* freedesktopInterface = new OrgFreedesktopDBusPropertiesInterface(service, "/org/mpris/MediaPlayer2", QDBusConnection::sessionBus(), this); OrgFreedesktopDBusPropertiesInterface* freedesktopInterface = new OrgFreedesktopDBusPropertiesInterface(service, "/org/mpris/MediaPlayer2", QDBusConnection::sessionBus(), this);
connect(freedesktopInterface, SIGNAL(PropertiesChanged(QString,QVariantMap,QStringList)), this, SLOT(propertiesChanged(QString,QVariantMap))); connect(freedesktopInterface, &OrgFreedesktopDBusPropertiesInterface::PropertiesChanged, this, &MprisControlPlugin::propertiesChanged);
OrgMprisMediaPlayer2PlayerInterface* mprisInterface0 = new OrgMprisMediaPlayer2PlayerInterface(service, "/org/mpris/MediaPlayer2", QDBusConnection::sessionBus()); OrgMprisMediaPlayer2PlayerInterface* mprisInterface0 = new OrgMprisMediaPlayer2PlayerInterface(service, "/org/mpris/MediaPlayer2", QDBusConnection::sessionBus());
connect(mprisInterface0, SIGNAL(Seeked(qlonglong)), this, SLOT(seeked(qlonglong))); connect(mprisInterface0, &OrgMprisMediaPlayer2PlayerInterface::Seeked, this, &MprisControlPlugin::seeked);
} }
void MprisControlPlugin::seeked(qlonglong position){