diff options
author | George Hazan <george.hazan@gmail.com> | 2015-05-11 17:13:29 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-05-11 17:13:29 +0000 |
commit | 9418930c2d211feca1ddeaafa160c3d8ca9a581a (patch) | |
tree | 827695e66cc8403f295c56f68fd39c07b38f9543 /plugins/Dropbox/src/dropbox_services.cpp | |
parent | e8ab90ab839ce55a399280f1920e1afd0fb28424 (diff) |
- protocol icon is used in all menus & buttons;
- code formatting
git-svn-id: http://svn.miranda-ng.org/main/trunk@13551 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dropbox/src/dropbox_services.cpp')
-rw-r--r-- | plugins/Dropbox/src/dropbox_services.cpp | 38 |
1 files changed, 15 insertions, 23 deletions
diff --git a/plugins/Dropbox/src/dropbox_services.cpp b/plugins/Dropbox/src/dropbox_services.cpp index 4667998633..fa823c3726 100644 --- a/plugins/Dropbox/src/dropbox_services.cpp +++ b/plugins/Dropbox/src/dropbox_services.cpp @@ -12,8 +12,7 @@ HANDLE CDropbox::CreateProtoServiceFunctionObj(const char *szService, MIRANDASER INT_PTR CDropbox::ProtoGetCaps(WPARAM wParam, LPARAM)
{
- switch (wParam)
- {
+ switch (wParam) {
case PFLAGNUM_1:
return PF1_IM | PF1_FILESEND;
case PFLAGNUM_2:
@@ -37,7 +36,7 @@ INT_PTR CDropbox::ProtoGetName(WPARAM wParam, LPARAM lParam) INT_PTR CDropbox::ProtoLoadIcon(WPARAM wParam, LPARAM)
{
- return (LOWORD(wParam) == PLI_PROTOCOL) ? (INT_PTR)CopyIcon(LoadIconEx("main", FALSE)) : 0;
+ return (LOWORD(wParam) == PLI_PROTOCOL) ? (INT_PTR)CopyIcon(LoadIconEx(IDI_DROPBOX)) : 0;
}
INT_PTR CDropbox::ProtoGetStatus(WPARAM, LPARAM)
@@ -80,8 +79,7 @@ INT_PTR CDropbox::ProtoSendFile(void *obj, WPARAM, LPARAM lParam) wchar_t **paths = (wchar_t**)pccsd->lParam;
- for (int i = 0; paths[i]; i++)
- {
+ for (int i = 0; paths[i]; i++) {
if (PathIsDirectory(paths[i]))
ftp->totalFolders++;
else
@@ -94,12 +92,9 @@ INT_PTR CDropbox::ProtoSendFile(void *obj, WPARAM, LPARAM lParam) ftp->pfts.pwszFiles = (wchar_t**)mir_alloc(sizeof(wchar_t*) * (ftp->pfts.totalFiles + 1));
ftp->pfts.pwszFiles[ftp->pfts.totalFiles] = NULL;
- for (int i = 0, j = 0, k = 0; paths[i]; i++)
- {
- if (PathIsDirectory(paths[i]))
- {
- if (!ftp->relativePathStart)
- {
+ for (int i = 0, j = 0, k = 0; paths[i]; i++) {
+ if (PathIsDirectory(paths[i])) {
+ if (!ftp->relativePathStart) {
wchar_t *rootFolder = paths[j];
wchar_t *relativePath = wcsrchr(rootFolder, '\\') + 1;
ftp->relativePathStart = relativePath - rootFolder;
@@ -109,10 +104,8 @@ INT_PTR CDropbox::ProtoSendFile(void *obj, WPARAM, LPARAM lParam) j++;
}
- else
- {
- if (!ftp->pfts.wszWorkingDir)
- {
+ else {
+ if (!ftp->pfts.wszWorkingDir) {
wchar_t *path = paths[j];
int length = wcsrchr(path, '\\') - path;
ftp->pfts.wszWorkingDir = (wchar_t*)mir_alloc(sizeof(wchar_t) * (length + 1));
@@ -124,8 +117,7 @@ INT_PTR CDropbox::ProtoSendFile(void *obj, WPARAM, LPARAM lParam) ftp->pfts.pwszFiles[k] = mir_wstrdup(paths[i]);
FILE *file = _wfopen(paths[i], L"rb");
- if (file != NULL)
- {
+ if (file != NULL) {
fseek(file, 0, SEEK_END);
ftp->pfts.totalBytes += ftell(file);
fseek(file, 0, SEEK_SET);
@@ -174,14 +166,14 @@ INT_PTR CDropbox::ProtoSendMessage(void *obj, WPARAM, LPARAM lParam) }
static commands[] =
{
- { "help", &CDropbox::CommandHelp },
+ { "help", &CDropbox::CommandHelp },
{ "content", &CDropbox::CommandContent },
- { "share", &CDropbox::CommandShare },
- { "delete", &CDropbox::CommandDelete }
+ { "share", &CDropbox::CommandShare },
+ { "delete", &CDropbox::CommandDelete }
};
- for (int i=0; i < SIZEOF(commands); i++) {
- if (!strcmp(message+1, commands[i].szCommand)) {
+ for (int i = 0; i < SIZEOF(commands); i++) {
+ if (!strcmp(message + 1, commands[i].szCommand)) {
ULONG messageId = InterlockedIncrement(&instance->hMessageProcess);
CommandParam *param = new CommandParam();
@@ -253,4 +245,4 @@ INT_PTR CDropbox::SendFileToDropbox(void *obj, WPARAM hContact, LPARAM lParam) mir_forkthreadowner(CDropbox::SendFilesAndEventAsync, obj, ftp, 0);
return fileId;
-}
\ No newline at end of file +}
|