Ssh: Re-base SshProcess on top of QtcProcess

Change-Id: I266820e0e2ea12d6e4a5a83a679a7279fab9cd83
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2021-06-25 14:54:27 +02:00
parent 77fed0b0fd
commit f72c4cb8ac
18 changed files with 116 additions and 105 deletions

View File

@@ -123,19 +123,19 @@ void RsyncDeployService::createRemoteDirectories()
void RsyncDeployService::deployFiles()
{
connect(&m_rsync, &QProcess::readyReadStandardOutput, this, [this] {
connect(&m_rsync, &QtcProcess::readyReadStandardOutput, this, [this] {
emit progressMessage(QString::fromLocal8Bit(m_rsync.readAllStandardOutput()));
});
connect(&m_rsync, &QProcess::readyReadStandardError, this, [this] {
connect(&m_rsync, &QtcProcess::readyReadStandardError, this, [this] {
emit warningMessage(QString::fromLocal8Bit(m_rsync.readAllStandardError()));
});
connect(&m_rsync, &QProcess::errorOccurred, this, [this] {
connect(&m_rsync, &QtcProcess::errorOccurred, this, [this] {
if (m_rsync.error() == QProcess::FailedToStart) {
emit errorMessage(tr("rsync failed to start: %1").arg(m_rsync.errorString()));
setFinished();
}
});
connect(&m_rsync, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), this, [this] {
connect(&m_rsync, &QtcProcess::finished, this, [this] {
if (m_rsync.exitStatus() == QProcess::CrashExit) {
emit errorMessage(tr("rsync crashed."));
setFinished();
@@ -173,7 +173,8 @@ void RsyncDeployService::deployNextFile()
const QStringList args = QStringList(cmdLine.options)
<< (localFilePath + (file.localFilePath().isDir() ? "/" : QString()))
<< (cmdLine.remoteHostSpec + ':' + file.remoteFilePath());
m_rsync.start("rsync", args); // TODO: Get rsync location from settings?
m_rsync.setCommand(CommandLine("rsync", args));
m_rsync.start(); // TODO: Get rsync location from settings?
}
void RsyncDeployService::setFinished()