diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2016-02-26 18:15:28 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2016-02-26 18:15:28 +0000 |
commit | 134773092963feea383ea315604bd1b996cdc6c5 (patch) | |
tree | 95ff0a97ebb7eaffee495e815004ea20f3537c79 /plugins/Dropbox/src/file_transfer.h | |
parent | bac49aec1a9a616cd3393048419e68ce176eee5f (diff) |
Dropbox: fixed folder sending
git-svn-id: http://svn.miranda-ng.org/main/trunk@16350 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dropbox/src/file_transfer.h')
-rw-r--r-- | plugins/Dropbox/src/file_transfer.h | 46 |
1 files changed, 21 insertions, 25 deletions
diff --git a/plugins/Dropbox/src/file_transfer.h b/plugins/Dropbox/src/file_transfer.h index 24c4735f6e..ec81ded7b0 100644 --- a/plugins/Dropbox/src/file_transfer.h +++ b/plugins/Dropbox/src/file_transfer.h @@ -10,13 +10,12 @@ struct FileTransferParam bool isTerminated;
+ const TCHAR* directoryName;
int relativePathStart;
- LIST<char> urls;
+ CMString data;
- TCHAR *description;
-
- FileTransferParam() : urls(1)
+ FileTransferParam()
{
hFile = NULL;
hProcess = NULL;
@@ -24,6 +23,7 @@ struct FileTransferParam isTerminated = false;
+ directoryName = NULL;
relativePathStart = 0;
pfts.cbSize = sizeof(this->pfts);
@@ -40,8 +40,6 @@ struct FileTransferParam pfts.ptszFiles[pfts.totalFiles] = NULL;
pfts.tszWorkingDir = NULL;
pfts.tszCurrentFile = NULL;
-
- description = NULL;
ProtoBroadcastAck(MODULE, pfts.hContact, ACKTYPE_FILE, ACKRESULT_INITIALISING, hProcess, 0);
}
@@ -61,28 +59,23 @@ struct FileTransferParam }
mir_free(pfts.pszFiles);
}
-
- for (int i = 0; i < urls.getCount(); i++)
- mir_free(urls[i]);
- urls.destroy();
-
- if (description)
- mir_free(description);
- }
-
- void SetDescription(const TCHAR *text)
- {
- if (text[0] == 0)
- return;
- description = mir_tstrdup(text);
}
void SetWorkingDirectory(const TCHAR *path)
{
relativePathStart = _tcsrchr(path, '\\') - path + 1;
- pfts.tszWorkingDir = (TCHAR*)mir_alloc(sizeof(TCHAR) * relativePathStart);
- mir_tstrncpy(pfts.tszWorkingDir, path, relativePathStart);
- pfts.tszWorkingDir[relativePathStart - 1] = '\0';
+ if (PathIsDirectory(path))
+ {
+ size_t length = mir_tstrlen(path) + 1;
+ pfts.tszWorkingDir = (TCHAR*)mir_calloc(sizeof(TCHAR) * length);
+ mir_tstrncpy(pfts.tszWorkingDir, path, length);
+ directoryName = _tcsrchr(pfts.tszWorkingDir, '\\') + 1;
+ }
+ else
+ {
+ pfts.tszWorkingDir = (TCHAR*)mir_calloc(sizeof(TCHAR) * relativePathStart);
+ mir_tstrncpy(pfts.tszWorkingDir, path, relativePathStart);
+ }
}
void AddFile(const TCHAR *path)
@@ -99,9 +92,12 @@ struct FileTransferParam }
}
- void AddUrl(const char *url)
+ void AppendFormatData(const TCHAR *format, ...)
{
- urls.insert(mir_strdup(url));
+ va_list args;
+ va_start(args, format);
+ data.AppendFormatV(format, args);
+ va_end(args);
}
const TCHAR* GetCurrentFilePath() const
|