diff --git a/src/libs/ssh/sftpfilesystemmodel.cpp b/src/libs/ssh/sftpfilesystemmodel.cpp index 6e244a80355..922ca57b54e 100644 --- a/src/libs/ssh/sftpfilesystemmodel.cpp +++ b/src/libs/ssh/sftpfilesystemmodel.cpp @@ -284,19 +284,20 @@ void SftpFileSystemModel::handleSshConnectionFailure() void SftpFileSystemModel::handleSftpChannelInitialized() { connect(d->sftpChannel.data(), - SIGNAL(fileInfoAvailable(QSsh::SftpJobId,QList)), - SLOT(handleFileInfo(QSsh::SftpJobId,QList))); - connect(d->sftpChannel.data(), SIGNAL(finished(QSsh::SftpJobId,QString)), - SLOT(handleSftpJobFinished(QSsh::SftpJobId,QString))); + &SftpChannel::fileInfoAvailable, + this, &SftpFileSystemModel::handleFileInfo); + connect(d->sftpChannel.data(), &SftpChannel::finished, + this, &SftpFileSystemModel::handleSftpJobFinished); statRootDirectory(); } void SftpFileSystemModel::handleSshConnectionEstablished() { d->sftpChannel = d->sshConnection->createSftpChannel(); - connect(d->sftpChannel.data(), SIGNAL(initialized()), SLOT(handleSftpChannelInitialized())); - connect(d->sftpChannel.data(), SIGNAL(channelError(QString)), - SLOT(handleSftpChannelError(QString))); + connect(d->sftpChannel.data(), &SftpChannel::initialized, + this, &SftpFileSystemModel::handleSftpChannelInitialized); + connect(d->sftpChannel.data(), &SftpChannel::channelError, + this, &SftpFileSystemModel::handleSftpChannelError); d->sftpChannel->initialize(); } diff --git a/src/libs/ssh/sftpfilesystemmodel.h b/src/libs/ssh/sftpfilesystemmodel.h index 0dc1401fe62..99f26ee1e29 100644 --- a/src/libs/ssh/sftpfilesystemmodel.h +++ b/src/libs/ssh/sftpfilesystemmodel.h @@ -76,7 +76,7 @@ signals: // Success <=> error.isEmpty(). void sftpOperationFinished(QSsh::SftpJobId, const QString &error); -private slots: +private: void handleSshConnectionEstablished(); void handleSshConnectionFailure(); void handleSftpChannelInitialized(); @@ -84,7 +84,6 @@ private slots: void handleFileInfo(QSsh::SftpJobId jobId, const QList &fileInfoList); void handleSftpJobFinished(QSsh::SftpJobId jobId, const QString &errorMessage); -private: int columnCount(const QModelIndex &parent = QModelIndex()) const; Qt::ItemFlags flags(const QModelIndex &index) const; QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; diff --git a/src/libs/ssh/sshchannelmanager.cpp b/src/libs/ssh/sshchannelmanager.cpp index 291c6d9273f..d3e8e4dd3b2 100644 --- a/src/libs/ssh/sshchannelmanager.cpp +++ b/src/libs/ssh/sshchannelmanager.cpp @@ -281,7 +281,7 @@ SshTcpIpForwardServer::Ptr SshChannelManager::createForwardServer(const QString void SshChannelManager::insertChannel(AbstractSshChannel *priv, const QSharedPointer &pub) { - connect(priv, SIGNAL(timeout()), this, SIGNAL(timeout())); + connect(priv, &AbstractSshChannel::timeout, this, &SshChannelManager::timeout); m_channels.insert(priv->localChannelId(), priv); m_sessions.insert(priv, pub); } diff --git a/src/libs/ssh/sshconnection.cpp b/src/libs/ssh/sshconnection.cpp index 557fb5e0c84..3cfd0adef15 100644 --- a/src/libs/ssh/sshconnection.cpp +++ b/src/libs/ssh/sshconnection.cpp @@ -100,14 +100,14 @@ SshConnection::SshConnection(const SshConnectionParameters &serverInfo, QObject qRegisterMetaType >("QList"); d = new Internal::SshConnectionPrivate(this, serverInfo); - connect(d, SIGNAL(connected()), this, SIGNAL(connected()), + connect(d, &Internal::SshConnectionPrivate::connected, this, &SshConnection::connected, Qt::QueuedConnection); - connect(d, SIGNAL(dataAvailable(QString)), this, - SIGNAL(dataAvailable(QString)), Qt::QueuedConnection); - connect(d, SIGNAL(disconnected()), this, SIGNAL(disconnected()), + connect(d, &Internal::SshConnectionPrivate::dataAvailable, this, + &SshConnection::dataAvailable, Qt::QueuedConnection); + connect(d, &Internal::SshConnectionPrivate::disconnected, this, &SshConnection::disconnected, Qt::QueuedConnection); - connect(d, SIGNAL(error(QSsh::SshError)), this, - SIGNAL(error(QSsh::SshError)), Qt::QueuedConnection); + connect(d, &Internal::SshConnectionPrivate::error, this, + &SshConnection::error, Qt::QueuedConnection); } void SshConnection::connectToHost() @@ -135,7 +135,7 @@ SshConnection::State SshConnection::state() const SshError SshConnection::errorState() const { - return d->error(); + return d->errorState(); } QString SshConnection::errorString() const @@ -227,7 +227,8 @@ SshConnectionPrivate::SshConnectionPrivate(SshConnection *conn, m_timeoutTimer.setInterval(m_connParams.timeout * 1000); m_keepAliveTimer.setSingleShot(true); m_keepAliveTimer.setInterval(10000); - connect(m_channelManager, SIGNAL(timeout()), this, SLOT(handleTimeout())); + connect(m_channelManager, &SshChannelManager::timeout, + this, &SshConnectionPrivate::handleTimeout); } SshConnectionPrivate::~SshConnectionPrivate() @@ -589,7 +590,7 @@ void SshConnectionPrivate::handleUserAuthSuccessPacket() m_timeoutTimer.stop(); emit connected(); m_lastInvalidMsgSeqNr = InvalidSeqNr; - connect(&m_keepAliveTimer, SIGNAL(timeout()), SLOT(sendKeepAlivePacket())); + connect(&m_keepAliveTimer, &QTimer::timeout, this, &SshConnectionPrivate::sendKeepAlivePacket); m_keepAliveTimer.start(); } @@ -767,13 +768,16 @@ void SshConnectionPrivate::connectToHost() return; } - connect(m_socket, SIGNAL(connected()), this, SLOT(handleSocketConnected())); - connect(m_socket, SIGNAL(readyRead()), this, SLOT(handleIncomingData())); - connect(m_socket, SIGNAL(error(QAbstractSocket::SocketError)), this, - SLOT(handleSocketError())); - connect(m_socket, SIGNAL(disconnected()), this, - SLOT(handleSocketDisconnected())); - connect(&m_timeoutTimer, SIGNAL(timeout()), this, SLOT(handleTimeout())); + connect(m_socket, &QAbstractSocket::connected, + this, &SshConnectionPrivate::handleSocketConnected); + connect(m_socket, &QIODevice::readyRead, + this, &SshConnectionPrivate::handleIncomingData); + connect(m_socket, + static_cast(&QAbstractSocket::error), + this, &SshConnectionPrivate::handleSocketError); + connect(m_socket, &QAbstractSocket::disconnected, + this, &SshConnectionPrivate::handleSocketDisconnected); + connect(&m_timeoutTimer, &QTimer::timeout, this, &SshConnectionPrivate::handleTimeout); m_state = SocketConnecting; m_keyExchangeState = NoKeyExchange; m_timeoutTimer.start(); diff --git a/src/libs/ssh/sshconnection_p.h b/src/libs/ssh/sshconnection_p.h index ede1ceaa819..7c8198bf200 100644 --- a/src/libs/ssh/sshconnection_p.h +++ b/src/libs/ssh/sshconnection_p.h @@ -90,7 +90,7 @@ public: quint16 remotePort); SshStateInternal state() const { return m_state; } - SshError error() const { return m_error; } + SshError errorState() const { return m_error; } QString errorString() const { return m_errorString; } signals: @@ -100,12 +100,12 @@ signals: void error(QSsh::SshError); private: - Q_SLOT void handleSocketConnected(); - Q_SLOT void handleIncomingData(); - Q_SLOT void handleSocketError(); - Q_SLOT void handleSocketDisconnected(); - Q_SLOT void handleTimeout(); - Q_SLOT void sendKeepAlivePacket(); + void handleSocketConnected(); + void handleIncomingData(); + void handleSocketError(); + void handleSocketDisconnected(); + void handleTimeout(); + void sendKeepAlivePacket(); void handleServerId(); void handlePackets(); diff --git a/src/libs/ssh/sshconnectionmanager.cpp b/src/libs/ssh/sshconnectionmanager.cpp index 90f903b3482..c6a35bd4b8a 100644 --- a/src/libs/ssh/sshconnectionmanager.cpp +++ b/src/libs/ssh/sshconnectionmanager.cpp @@ -194,7 +194,6 @@ private: connection->moveToThread(qobject_cast(threadObj)); } -private slots: void cleanup() { QMutexLocker locker(&m_listMutex); diff --git a/src/libs/ssh/sshkeycreationdialog.h b/src/libs/ssh/sshkeycreationdialog.h index adeaae0396b..31059c0213e 100644 --- a/src/libs/ssh/sshkeycreationdialog.h +++ b/src/libs/ssh/sshkeycreationdialog.h @@ -44,12 +44,10 @@ public: QString privateKeyFilePath() const; QString publicKeyFilePath() const; -private slots: +private: void keyTypeChanged(); void generateKeys(); void handleBrowseButtonClicked(); - -private: void setPrivateKeyFile(const QString &filePath); void saveKeys(); bool userForbidsOverwriting(); diff --git a/src/libs/ssh/sshremoteprocessrunner.cpp b/src/libs/ssh/sshremoteprocessrunner.cpp index a7e050dbf93..b3f55257e72 100644 --- a/src/libs/ssh/sshremoteprocessrunner.cpp +++ b/src/libs/ssh/sshremoteprocessrunner.cpp @@ -127,10 +127,14 @@ void SshRemoteProcessRunner::handleConnected() setState(Connected); d->m_process = d->m_connection->createRemoteProcess(d->m_command); - connect(d->m_process.data(), SIGNAL(started()), SLOT(handleProcessStarted())); - connect(d->m_process.data(), SIGNAL(closed(int)), SLOT(handleProcessFinished(int))); - connect(d->m_process.data(), SIGNAL(readyReadStandardOutput()), SLOT(handleStdout())); - connect(d->m_process.data(), SIGNAL(readyReadStandardError()), SLOT(handleStderr())); + connect(d->m_process.data(), &SshRemoteProcess::started, + this, &SshRemoteProcessRunner::handleProcessStarted); + connect(d->m_process.data(), &SshRemoteProcess::closed, + this, &SshRemoteProcessRunner::handleProcessFinished); + connect(d->m_process.data(), &SshRemoteProcess::readyReadStandardOutput, + this, &SshRemoteProcessRunner::handleStdout); + connect(d->m_process.data(), &SshRemoteProcess::readyReadStandardError, + this, &SshRemoteProcessRunner::handleStderr); if (d->m_runInTerminal) d->m_process->requestTerminal(d->m_terminal); d->m_process->start(); diff --git a/src/libs/ssh/sshremoteprocessrunner.h b/src/libs/ssh/sshremoteprocessrunner.h index a217d0c94cb..0a2ee578e9f 100644 --- a/src/libs/ssh/sshremoteprocessrunner.h +++ b/src/libs/ssh/sshremoteprocessrunner.h @@ -65,7 +65,7 @@ signals: void readyReadStandardError(); void processClosed(int exitStatus); // values are of type SshRemoteProcess::ExitStatus -private slots: +private: void handleConnected(); void handleConnectionError(QSsh::SshError error); void handleDisconnected(); @@ -73,8 +73,6 @@ private slots: void handleProcessFinished(int exitStatus); void handleStdout(); void handleStderr(); - -private: void runInternal(const QByteArray &command, const QSsh::SshConnectionParameters &sshParams); void setState(int newState); diff --git a/src/libs/ssh/sshtcpiptunnel_p.h b/src/libs/ssh/sshtcpiptunnel_p.h index f75541f1188..a9f2844cbc6 100644 --- a/src/libs/ssh/sshtcpiptunnel_p.h +++ b/src/libs/ssh/sshtcpiptunnel_p.h @@ -64,9 +64,6 @@ signals: void error(const QString &reason); void closed(); -private slots: - void handleEof(); - protected: void handleOpenFailureInternal(const QString &reason) override; void handleChannelDataInternal(const QByteArray &data) override; @@ -76,6 +73,9 @@ protected: void closeHook() override; QByteArray m_data; + +private: + void handleEof(); }; } // namespace Internal