| 61 | } |
| 62 | |
| 63 | bool CBackendFileTransfer::event(QEvent *event) |
| 64 | { |
| 65 | if(event->type() == QEvent::Type::User) { |
| 66 | CFileTransferEvent* pEvent = (CFileTransferEvent*)event; |
| 67 | switch(pEvent->m_Command) { |
| 68 | case CFileTransferEvent::Command::MakeDir: |
| 69 | #if HAVE_LIBSSH |
| 70 | if(m_pSFTP) |
| 71 | m_pSFTP->MakeDir(pEvent->m_szSourcePath); |
| 72 | #endif |
| 73 | break; |
| 74 | case CFileTransferEvent::Command::RemoveDir: |
| 75 | #if HAVE_LIBSSH |
| 76 | if(m_pSFTP) |
| 77 | m_pSFTP->RemoveDir(pEvent->m_szSourcePath); |
| 78 | #endif |
| 79 | break; |
| 80 | case CFileTransferEvent::Command::RemoveFile: |
| 81 | #if HAVE_LIBSSH |
| 82 | if(m_pSFTP) |
| 83 | m_pSFTP->RemoveFile(pEvent->m_szSourcePath); |
| 84 | #endif |
| 85 | break; |
| 86 | case CFileTransferEvent::Command::Rename: |
| 87 | #if HAVE_LIBSSH |
| 88 | if(m_pSFTP) |
| 89 | m_pSFTP->Rename(pEvent->m_szSourcePath, pEvent->m_szDestination); |
| 90 | #endif |
| 91 | break; |
| 92 | case CFileTransferEvent::Command::GetDir: |
| 93 | { |
| 94 | #if HAVE_LIBSSH |
| 95 | if(m_pSFTP) |
| 96 | m_pSFTP->slotGetDir(pEvent->m_szSourcePath, pEvent->m_pRemoteFileSystem); |
| 97 | #endif |
| 98 | break; |
| 99 | } |
| 100 | case CFileTransferEvent::Command::StartFileTransfer: |
| 101 | { |
| 102 | #if HAVE_LIBSSH |
| 103 | if(m_pSFTP) |
| 104 | m_pSFTP->slotStartFileTransfer(pEvent->m_FileTransfer); |
| 105 | #endif |
| 106 | break; |
| 107 | } |
| 108 | case CFileTransferEvent::Command::StopFileTransfer: |
| 109 | { |
| 110 | #if HAVE_LIBSSH |
| 111 | if(m_pSFTP) |
| 112 | m_pSFTP->slotStopFileTransfer(pEvent->m_FileTransfer); |
| 113 | #endif |
| 114 | break; |
| 115 | } |
| 116 | default: |
| 117 | break; |
| 118 | } |
| 119 | } |
| 120 | return CBackend::event(event); |
nothing calls this directly
no test coverage detected