diff -Nur src.orig/engine/ftpcontrolsocket.cpp src/engine/ftpcontrolsocket.cpp
old
|
new
|
|
1505 | 1505 | // Be quiet |
1506 | 1506 | wxLogNull nullLog; |
1507 | 1507 | |
| 1508 | // twu2, create an empty directory only |
| 1509 | if (pData->localFile.Last() == wxFileName::GetPathSeparator()) { |
| 1510 | // create dir |
| 1511 | wxFileName fn(pData->localFile); |
| 1512 | wxFileName::Mkdir(fn.GetPath(), 0777, wxPATH_MKDIR_FULL); |
| 1513 | ResetOperation(FZ_REPLY_OK); |
| 1514 | return FZ_REPLY_OK; |
| 1515 | } |
| 1516 | |
1508 | 1517 | wxFileOffset startOffset; |
1509 | 1518 | if (pData->resume) |
1510 | 1519 | { |
… |
… |
|
1570 | 1579 | } |
1571 | 1580 | else |
1572 | 1581 | { |
| 1582 | // twu2, create an empty directory only |
| 1583 | if (pData->localFile.Last() == wxFileName::GetPathSeparator()) { |
| 1584 | // already created |
| 1585 | ResetOperation(FZ_REPLY_OK); |
| 1586 | return FZ_REPLY_OK; |
| 1587 | } |
| 1588 | |
1573 | 1589 | if (!pFile->Open(pData->localFile, wxFile::read)) |
1574 | 1590 | { |
1575 | 1591 | delete pFile; |
diff -Nur src.orig/engine/sftpcontrolsocket.cpp src/engine/sftpcontrolsocket.cpp
old
|
new
|
|
1392 | 1392 | wxFileName fn(pData->localFile); |
1393 | 1393 | wxFileName::Mkdir(fn.GetPath(), 0777, wxPATH_MKDIR_FULL); |
1394 | 1394 | } |
| 1395 | // twu2, create an empty directory only |
| 1396 | if (pData->localFile.Last() == wxFileName::GetPathSeparator()) { |
| 1397 | // already created |
| 1398 | ResetOperation(FZ_REPLY_OK); |
| 1399 | return FZ_REPLY_OK; |
| 1400 | } |
1395 | 1401 | |
1396 | 1402 | InitTransferStatus(pData->remoteFileSize, pData->resume ? pData->localFileSize : 0); |
1397 | 1403 | cmd += _T("get "); |
… |
… |
|
1400 | 1406 | } |
1401 | 1407 | else |
1402 | 1408 | { |
| 1409 | // twu2, create an empty directory only |
| 1410 | if (pData->localFile.Last() == wxFileName::GetPathSeparator()) { |
| 1411 | // already created |
| 1412 | ResetOperation(FZ_REPLY_OK); |
| 1413 | return FZ_REPLY_OK; |
| 1414 | } |
1403 | 1415 | InitTransferStatus(pData->localFileSize, pData->resume ? pData->remoteFileSize : 0); |
1404 | 1416 | cmd += _T("put "); |
1405 | 1417 | cmd += QuoteFilename(pData->localFile) + _T(" "); |
diff -Nur src.orig/interface/QueueView.cpp src/interface/QueueView.cpp
old
|
new
|
|
97 | 97 | m_pFolderItem->m_currentRemotePath = pair.remotePath; |
98 | 98 | |
99 | 99 | found = m_pFolderItem->m_pDir->GetFirst(&file); |
| 100 | // twu2, empty directory |
| 101 | if (!found) { |
| 102 | // add empty directory |
| 103 | wxFileName fn(pair.localPath); |
| 104 | t_newEntry entry; |
| 105 | entry.localFile = pair.localPath + wxFileName::GetPathSeparator(); |
| 106 | entry.remoteFile = fn.GetName(); |
| 107 | entry.remotePath = m_pFolderItem->m_currentRemotePath; |
| 108 | entry.size = 0; |
| 109 | |
| 110 | bool send = false; |
| 111 | m_sync.Enter();; |
| 112 | if (!m_entryList.size()) |
| 113 | send = true; |
| 114 | m_entryList.push_back(entry); |
| 115 | m_sync.Leave(); |
| 116 | |
| 117 | if (send) |
| 118 | { |
| 119 | wxCommandEvent evt(fzEVT_FOLDERTHREAD_FILES, wxID_ANY); |
| 120 | wxPostEvent(m_pOwner, evt); |
| 121 | } |
| 122 | } |
100 | 123 | } |
101 | 124 | else |
102 | 125 | found = false; |
diff -Nur src.orig/interface/RemoteListView.cpp src/interface/RemoteListView.cpp
old
|
new
|
|
738 | 738 | { |
739 | 739 | wxFileName fn = wxFileName(m_pState->GetLocalDir(), _T("")); |
740 | 740 | fn.AppendDir(name); |
| 741 | // twu2, add directory also |
| 742 | m_pQueue->QueueFile(event.GetId() == XRCID("ID_ADDTOQUEUE"), true, fn.GetFullPath(), name, m_pDirectoryListing->path, *pServer, 0); |
741 | 743 | CServerPath remotePath = m_pDirectoryListing->path; |
742 | 744 | if (remotePath.AddSegment(name)) |
743 | 745 | { |
… |
… |
|
955 | 957 | m_dirsToVisit.push_back(dirToVisit); |
956 | 958 | if (m_operationMode == recursive_delete) |
957 | 959 | m_dirsToDelete.push_front(dirToVisit); |
| 960 | // twu2, add directory also |
| 961 | if (m_operationMode == recursive_addtoqueue || m_operationMode == recursive_download) |
| 962 | m_pQueue->QueueFile(m_operationMode == recursive_addtoqueue, true, fn.GetFullPath(), entry.name, m_pDirectoryListing->path, *pServer, 0); |
958 | 963 | } |
959 | 964 | else |
960 | 965 | { |