MCPcopy Create free account
hub / github.com/KangLin/RabbitRemoteControl / InitSFTP

Method InitSFTP

Plugins/FileTransfer/BackendFileTransfer.cpp:191–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189}
190
191CBackendFileTransfer::OnInitReturnValue CBackendFileTransfer::InitSFTP()
192{
193 CParameterSSH* ssh = &m_pOperate->GetParameter()->m_SSH;
194#if HAVE_LIBSSH
195 m_pSFTP = new CChannelSFTP(this, ssh);
196 if(!m_pSFTP) {
197 return OnInitReturnValue::Fail;
198 }
199 bool bRet = m_pSFTP->open(QIODevice::ReadWrite);
200 if(!bRet) {
201 QString szErr;
202 szErr = tr("Open SFTP fail.") + m_pSFTP->errorString();
203 qCritical(log) << szErr;
204 emit sigShowMessageBox(tr("Error"), szErr, QMessageBox::Critical);
205 return OnInitReturnValue::Fail;
206 }
207#endif
208 emit sigRunning();
209 return OnInitReturnValue::UseOnProcess;
210}
211
212void CBackendFileTransfer::slotMakeDir(const QString &szDir)
213{

Callers

nothing calls this directly

Calls 3

errorStringMethod · 0.80
GetParameterMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected