diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2016-02-25 16:30:28 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2016-02-25 16:30:28 +0000 |
commit | c600be64cf8246cf9054bbb775fec21cf1ecdba9 (patch) | |
tree | 5e9106e44bf6115673d3e3fd21c669c343a7190a /plugins/Dropbox/src/dropbox_transfers.cpp | |
parent | b7ed1f2179ca045c16a007f1fabb1a44587d9426 (diff) |
Dropbox: transfer refactiring
git-svn-id: http://svn.miranda-ng.org/main/trunk@16339 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dropbox/src/dropbox_transfers.cpp')
-rw-r--r-- | plugins/Dropbox/src/dropbox_transfers.cpp | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/plugins/Dropbox/src/dropbox_transfers.cpp b/plugins/Dropbox/src/dropbox_transfers.cpp index f97f6d2f01..ae4c50896b 100644 --- a/plugins/Dropbox/src/dropbox_transfers.cpp +++ b/plugins/Dropbox/src/dropbox_transfers.cpp @@ -96,26 +96,10 @@ UINT CDropbox::SendFilesAsync(void *owner, void *arg) FileTransferParam *ftp = (FileTransferParam*)arg;
try {
- if (ftp->ptszFolders) {
- for (int i = 0; ftp->ptszFolders[i]; i++) {
- if (ftp->isTerminated)
- throw DropboxException("Transfer was terminated");
-
- char path[MAX_PATH];
- PreparePath(ftp->ptszFolders[i], path);
- instance->CreateFolder(path);
- if (!strchr(path, '\\')) {
- char url[MAX_PATH];
- instance->CreateDownloadUrl(path, url);
- ftp->AddUrl(url);
- }
- }
- }
-
- ftp->First();
+ ftp->FirstFile();
do
{
- const TCHAR *fileName = &ftp->GetCurrentFileName()[ftp->relativePathStart];
+ const TCHAR *fileName = &ftp->GetCurrentFilePath()[ftp->relativePathStart];
uint64_t fileSize = ftp->GetCurrentFileSize();
int chunkSize = ftp->GetCurrentFileChunkSize();
@@ -154,7 +138,7 @@ UINT CDropbox::SendFilesAsync(void *owner, void *arg) instance->CreateDownloadUrl(path, url);
ftp->AddUrl(url);
}
- } while (ftp->Next());
+ } while (ftp->NextFile());
}
catch (DropboxException &ex) {
Netlib_Logf(instance->hNetlibConnection, "%s: %s", MODULE, ex.what());
@@ -175,8 +159,8 @@ UINT CDropbox::SendFilesAndReportAsync(void *owner, void *arg) if (res == ACKRESULT_SUCCESS)
{
CMStringA urls;
- for (int i = 0; i < ftp->urlList.getCount(); i++)
- urls.AppendFormat("%s\r\n", ftp->urlList[i]);
+ for (int i = 0; i < ftp->urls.getCount(); i++)
+ urls.AppendFormat("%s\r\n", ftp->urls[i]);
instance->Report(ftp->hContact, urls.GetBuffer());
}
@@ -197,7 +181,7 @@ UINT CDropbox::SendFilesAndEventAsync(void *owner, void *arg) TRANSFERINFO ti = { 0 };
ti.hProcess = ftp->hProcess;
ti.status = res;
- ti.data = ftp->urlList.getArray();
+ ti.data = ftp->urls.getArray();
NotifyEventHooks(instance->hFileSentEventHook, ftp->hContact, (LPARAM)&ti);
|