summaryrefslogtreecommitdiff
path: root/plugins/Dropbox/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-07-26 09:20:25 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-07-26 09:20:25 +0000
commit6e53dfca72b932c4bdcd7aa02ca62bf8b2630eac (patch)
tree2e8bb660c908b54914abd562af8aafa4a486c846 /plugins/Dropbox/src
parenta61c8728b379057fe7f0a0d86fe0b037598229dd (diff)
less TCHARs:
- TCHAR is replaced with wchar_t everywhere; - LPGENT replaced with either LPGENW or LPGEN; - fixes for ANSI plugins that improperly used _t functions; - TCHAR *t removed from MAllStrings; - ptszGroup, ptszTitle & ptszTab in OPTIONSDIALOGPAGE replaced with pwsz* git-svn-id: http://svn.miranda-ng.org/main/trunk@17133 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dropbox/src')
-rw-r--r--plugins/Dropbox/src/dropbox.cpp4
-rw-r--r--plugins/Dropbox/src/dropbox.h10
-rw-r--r--plugins/Dropbox/src/dropbox_options.cpp8
-rw-r--r--plugins/Dropbox/src/dropbox_services.cpp6
-rw-r--r--plugins/Dropbox/src/dropbox_transfers.cpp10
-rw-r--r--plugins/Dropbox/src/dropbox_utils.cpp16
-rw-r--r--plugins/Dropbox/src/file_transfer.h42
-rw-r--r--plugins/Dropbox/src/stdafx.h1
8 files changed, 49 insertions, 48 deletions
diff --git a/plugins/Dropbox/src/dropbox.cpp b/plugins/Dropbox/src/dropbox.cpp
index f7b4b62731..4a6faac5b1 100644
--- a/plugins/Dropbox/src/dropbox.cpp
+++ b/plugins/Dropbox/src/dropbox.cpp
@@ -167,7 +167,7 @@ UINT CDropbox::RequestAccessTokenAsync(void *owner, void *param)
if (hwndDlg)
SetDlgItemText(hwndDlg, IDC_AUTH_STATUS, TranslateT("server does not respond"));
/*else
- ShowNotification((TCHAR*)error_description, MB_ICONERROR);*/
+ ShowNotification((wchar_t*)error_description, MB_ICONERROR);*/
return 0;
}
@@ -178,7 +178,7 @@ UINT CDropbox::RequestAccessTokenAsync(void *owner, void *param)
if (hwndDlg)
SetDlgItemText(hwndDlg, IDC_AUTH_STATUS, error_description);
/*else
- ShowNotification((TCHAR*)error_description, MB_ICONERROR);*/
+ ShowNotification((wchar_t*)error_description, MB_ICONERROR);*/
return 0;
}
diff --git a/plugins/Dropbox/src/dropbox.h b/plugins/Dropbox/src/dropbox.h
index 1b2272729d..5c1efa5d08 100644
--- a/plugins/Dropbox/src/dropbox.h
+++ b/plugins/Dropbox/src/dropbox.h
@@ -109,7 +109,7 @@ private:
// utils
static char* PreparePath(const char *oldPath, char *newPath);
- static char* PreparePath(const TCHAR *oldPath, char *newPath);
+ static char* PreparePath(const wchar_t *oldPath, char *newPath);
static bool IsAccountIntercepted(const char *module);
@@ -118,10 +118,10 @@ private:
static MEVENT AddEventToDb(MCONTACT hContact, WORD type, DWORD flags, DWORD cbBlob, PBYTE pBlob);
- void SendToContact(MCONTACT hContact, const TCHAR *data);
- void PasteToInputArea(MCONTACT hContact, const TCHAR *data);
- void PasteToClipboard(const TCHAR *data);
- void Report(MCONTACT hContact, const TCHAR *data);
+ void SendToContact(MCONTACT hContact, const wchar_t *data);
+ void PasteToInputArea(MCONTACT hContact, const wchar_t *data);
+ void PasteToClipboard(const wchar_t *data);
+ void Report(MCONTACT hContact, const wchar_t *data);
template<int(CDropbox::*Event)(WPARAM, LPARAM)>
static int GlobalEvent(void *obj, WPARAM wParam, LPARAM lParam)
diff --git a/plugins/Dropbox/src/dropbox_options.cpp b/plugins/Dropbox/src/dropbox_options.cpp
index 9f7bd0221b..f5ff7516fd 100644
--- a/plugins/Dropbox/src/dropbox_options.cpp
+++ b/plugins/Dropbox/src/dropbox_options.cpp
@@ -152,15 +152,15 @@ void CDropboxOptionsInterception::OnApply()
int CDropbox::OnOptionsInitialized(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
- odp.ptszTitle = _T(MODULE);
+ odp.pwszTitle = MODULEW;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
- odp.ptszGroup = LPGENT("Network");
+ odp.pwszGroup = LPGENW("Network");
- odp.ptszTab = LPGENT("General");
+ odp.pwszTab = LPGENW("General");
odp.pDialog = CDropboxOptionsMain::CreateOptionsPage(this);
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Interception");
+ odp.pwszTab = LPGENW("Interception");
odp.pDialog = CDropboxOptionsInterception::CreateOptionsPage(this);
Options_AddPage(wParam, &odp);
diff --git a/plugins/Dropbox/src/dropbox_services.cpp b/plugins/Dropbox/src/dropbox_services.cpp
index dbe8602112..6896398ced 100644
--- a/plugins/Dropbox/src/dropbox_services.cpp
+++ b/plugins/Dropbox/src/dropbox_services.cpp
@@ -45,11 +45,11 @@ INT_PTR CDropbox::ProtoSendFile(WPARAM, LPARAM lParam)
FileTransferParam *ftp = new FileTransferParam(pccsd->hContact);
- const TCHAR *description = (TCHAR*)pccsd->wParam;
+ const wchar_t *description = (wchar_t*)pccsd->wParam;
if (description && description[0])
- ftp->AppendFormatData(L"%s\r\n", (TCHAR*)pccsd->wParam);
+ ftp->AppendFormatData(L"%s\r\n", (wchar_t*)pccsd->wParam);
- TCHAR **paths = (TCHAR**)pccsd->lParam;
+ wchar_t **paths = (wchar_t**)pccsd->lParam;
ftp->SetWorkingDirectory(paths[0]);
for (int i = 0; paths[i]; i++) {
if (PathIsDirectory(paths[i]))
diff --git a/plugins/Dropbox/src/dropbox_transfers.cpp b/plugins/Dropbox/src/dropbox_transfers.cpp
index c41bcdf290..33d9ed8613 100644
--- a/plugins/Dropbox/src/dropbox_transfers.cpp
+++ b/plugins/Dropbox/src/dropbox_transfers.cpp
@@ -96,7 +96,7 @@ UINT CDropbox::UploadToDropbox(void *owner, void *arg)
FileTransferParam *ftp = (FileTransferParam*)arg;
try {
- const TCHAR *folderName = ftp->GetFolderName();
+ const wchar_t *folderName = ftp->GetFolderName();
if (folderName) {
char path[MAX_PATH], url[MAX_PATH];
PreparePath(folderName, path);
@@ -108,7 +108,7 @@ UINT CDropbox::UploadToDropbox(void *owner, void *arg)
ftp->FirstFile();
do
{
- const TCHAR *fileName = ftp->GetCurrentRelativeFilePath();
+ const wchar_t *fileName = ftp->GetCurrentRelativeFilePath();
uint64_t fileSize = ftp->GetCurrentFileSize();
int chunkSize = ftp->GetCurrentFileChunkSize();
@@ -139,9 +139,9 @@ UINT CDropbox::UploadToDropbox(void *owner, void *arg)
size = 0;
char path[MAX_PATH];
- const TCHAR *serverFolder = ftp->GetServerFolder();
+ const wchar_t *serverFolder = ftp->GetServerFolder();
if (serverFolder) {
- TCHAR serverPath[MAX_PATH] = { 0 };
+ wchar_t serverPath[MAX_PATH] = { 0 };
mir_sntprintf(serverPath, L"%s\\%s", serverFolder, fileName);
PreparePath(serverPath, path);
}
@@ -151,7 +151,7 @@ UINT CDropbox::UploadToDropbox(void *owner, void *arg)
ftp->Progress(size);
- if (!_tcschr(fileName, L'\\')) {
+ if (!wcschr(fileName, L'\\')) {
char url[MAX_PATH];
instance->CreateDownloadUrl(path, url);
ftp->AppendFormatData(L"%s\r\n", ptrT(mir_utf8decodeT(url)));
diff --git a/plugins/Dropbox/src/dropbox_utils.cpp b/plugins/Dropbox/src/dropbox_utils.cpp
index 67994b6e1b..28bf244984 100644
--- a/plugins/Dropbox/src/dropbox_utils.cpp
+++ b/plugins/Dropbox/src/dropbox_utils.cpp
@@ -16,7 +16,7 @@ char* CDropbox::PreparePath(const char *oldPath, char *newPath)
return newPath;
}
-char* CDropbox::PreparePath(const TCHAR *oldPath, char *newPath)
+char* CDropbox::PreparePath(const wchar_t *oldPath, char *newPath)
{
return PreparePath(ptrA(mir_utf8encodeW(oldPath)), newPath);
}
@@ -95,7 +95,7 @@ MEVENT CDropbox::AddEventToDb(MCONTACT hContact, WORD type, DWORD flags, DWORD c
return db_event_add(hContact, &dbei);
}
-void CDropbox::SendToContact(MCONTACT hContact, const TCHAR *data)
+void CDropbox::SendToContact(MCONTACT hContact, const wchar_t *data)
{
if (hContact == GetDefaultContact()) {
char *message = mir_utf8encodeT(data);
@@ -122,7 +122,7 @@ void CDropbox::SendToContact(MCONTACT hContact, const TCHAR *data)
AddEventToDb(hContact, EVENTTYPE_MESSAGE, DBEF_UTF | DBEF_SENT, (DWORD)mir_strlen(message), (PBYTE)message);
}
-void CDropbox::PasteToInputArea(MCONTACT hContact, const TCHAR *data)
+void CDropbox::PasteToInputArea(MCONTACT hContact, const wchar_t *data)
{
MessageWindowInputData mwid = { sizeof(MessageWindowInputData) };
mwid.hContact = hContact;
@@ -137,17 +137,17 @@ void CDropbox::PasteToInputArea(MCONTACT hContact, const TCHAR *data)
}
}
-void CDropbox::PasteToClipboard(const TCHAR *data)
+void CDropbox::PasteToClipboard(const wchar_t *data)
{
if (OpenClipboard(NULL)) {
EmptyClipboard();
- size_t size = sizeof(TCHAR) * (mir_tstrlen(data) + 1);
+ size_t size = sizeof(wchar_t) * (mir_tstrlen(data) + 1);
HGLOBAL hClipboardData = GlobalAlloc(NULL, size);
if (hClipboardData) {
- TCHAR *pchData = (TCHAR*)GlobalLock(hClipboardData);
+ wchar_t *pchData = (wchar_t*)GlobalLock(hClipboardData);
if (pchData) {
- memcpy(pchData, (TCHAR*)data, size);
+ memcpy(pchData, (wchar_t*)data, size);
GlobalUnlock(hClipboardData);
SetClipboardData(CF_UNICODETEXT, hClipboardData);
}
@@ -156,7 +156,7 @@ void CDropbox::PasteToClipboard(const TCHAR *data)
}
}
-void CDropbox::Report(MCONTACT hContact, const TCHAR *data)
+void CDropbox::Report(MCONTACT hContact, const wchar_t *data)
{
if (db_get_b(NULL, MODULE, "UrlAutoSend", 1))
SendToContact(hContact, data);
diff --git a/plugins/Dropbox/src/file_transfer.h b/plugins/Dropbox/src/file_transfer.h
index 0800903627..6feacbb445 100644
--- a/plugins/Dropbox/src/file_transfer.h
+++ b/plugins/Dropbox/src/file_transfer.h
@@ -12,7 +12,7 @@ private:
bool isTerminated;
- const TCHAR* folderName;
+ const wchar_t* folderName;
int relativePathStart;
CMString serverFolder;
@@ -40,7 +40,7 @@ public:
pfts.totalBytes = 0;
pfts.totalFiles = 0;
pfts.totalProgress = 0;
- pfts.ptszFiles = (TCHAR**)mir_alloc(sizeof(TCHAR*) * (pfts.totalFiles + 1));
+ pfts.ptszFiles = (wchar_t**)mir_alloc(sizeof(wchar_t*) * (pfts.totalFiles + 1));
pfts.ptszFiles[pfts.totalFiles] = NULL;
pfts.tszWorkingDir = NULL;
pfts.tszCurrentFile = NULL;
@@ -75,7 +75,7 @@ public:
return pfts.hContact;
}
- const TCHAR* GetData() const
+ const wchar_t* GetData() const
{
if (data.IsEmpty())
return NULL;
@@ -87,40 +87,40 @@ public:
isTerminated = true;
}
- void SetWorkingDirectory(const TCHAR *path)
+ void SetWorkingDirectory(const wchar_t *path)
{
- relativePathStart = _tcsrchr(path, '\\') - path + 1;
- pfts.tszWorkingDir = (TCHAR*)mir_calloc(sizeof(TCHAR) * relativePathStart);
+ relativePathStart = wcsrchr(path, '\\') - path + 1;
+ pfts.tszWorkingDir = (wchar_t*)mir_calloc(sizeof(wchar_t) * relativePathStart);
mir_tstrncpy(pfts.tszWorkingDir, path, relativePathStart);
if (PathIsDirectory(path))
- folderName = _tcsrchr(path, '\\') + 1;
+ folderName = wcsrchr(path, '\\') + 1;
}
- void SetServerFolder(const TCHAR *path)
+ void SetServerFolder(const wchar_t *path)
{
if (path)
serverFolder = path;
}
- const TCHAR* GetServerFolder() const
+ const wchar_t* GetServerFolder() const
{
if (serverFolder.IsEmpty())
return NULL;
return serverFolder;
}
- const TCHAR* GetFolderName() const
+ const wchar_t* GetFolderName() const
{
return folderName;
}
- void AddFile(const TCHAR *path)
+ void AddFile(const wchar_t *path)
{
- pfts.ptszFiles = (TCHAR**)mir_realloc(pfts.ptszFiles, sizeof(TCHAR*) * (pfts.totalFiles + 2));
+ pfts.ptszFiles = (wchar_t**)mir_realloc(pfts.ptszFiles, sizeof(wchar_t*) * (pfts.totalFiles + 2));
pfts.ptszFiles[pfts.totalFiles++] = mir_tstrdup(path);
pfts.ptszFiles[pfts.totalFiles] = NULL;
- FILE *file = _tfopen(path, L"rb");
+ FILE *file = _wfopen(path, L"rb");
if (file != NULL) {
_fseeki64(file, 0, SEEK_END);
pfts.totalBytes += _ftelli64(file);
@@ -128,7 +128,7 @@ public:
}
}
- void AppendFormatData(const TCHAR *format, ...)
+ void AppendFormatData(const wchar_t *format, ...)
{
va_list args;
va_start(args, format);
@@ -136,24 +136,24 @@ public:
va_end(args);
}
- const TCHAR* GetCurrentFilePath() const
+ const wchar_t* GetCurrentFilePath() const
{
return pfts.ptszFiles[pfts.currentFileNumber];
}
- const TCHAR* GetCurrentRelativeFilePath() const
+ const wchar_t* GetCurrentRelativeFilePath() const
{
return &GetCurrentFilePath()[relativePathStart];
}
- const TCHAR* GetCurrentFileName() const
+ const wchar_t* GetCurrentFileName() const
{
- return _tcsrchr(pfts.ptszFiles[pfts.currentFileNumber], '\\') + 1;
+ return wcsrchr(pfts.ptszFiles[pfts.currentFileNumber], '\\') + 1;
}
void OpenCurrentFile()
{
- hFile = _tfopen(GetCurrentFilePath(), L"rb");
+ hFile = _wfopen(GetCurrentFilePath(), L"rb");
if (!hFile)
throw DropboxException("Unable to open file");
_fseeki64(hFile, 0, SEEK_END);
@@ -212,7 +212,7 @@ public:
pfts.currentFileNumber = 0;
pfts.currentFileProgress = 0;
- pfts.tszCurrentFile = _tcsrchr(pfts.ptszFiles[pfts.currentFileNumber], '\\') + 1;
+ pfts.tszCurrentFile = wcsrchr(pfts.ptszFiles[pfts.currentFileNumber], '\\') + 1;
ProtoBroadcastAck(MODULE, pfts.hContact, ACKTYPE_FILE, ACKRESULT_DATA, (HANDLE)id, (LPARAM)&pfts);
OpenCurrentFile();
@@ -227,7 +227,7 @@ public:
return false;
pfts.currentFileProgress = 0;
- pfts.tszCurrentFile = _tcsrchr(pfts.ptszFiles[pfts.currentFileNumber], '\\') + 1;
+ pfts.tszCurrentFile = wcsrchr(pfts.ptszFiles[pfts.currentFileNumber], '\\') + 1;
ProtoBroadcastAck(MODULE, pfts.hContact, ACKTYPE_FILE, ACKRESULT_NEXTFILE, (HANDLE)id, 0);
OpenCurrentFile();
diff --git a/plugins/Dropbox/src/stdafx.h b/plugins/Dropbox/src/stdafx.h
index 21da021e56..56ebe56e24 100644
--- a/plugins/Dropbox/src/stdafx.h
+++ b/plugins/Dropbox/src/stdafx.h
@@ -65,6 +65,7 @@ public:
};
#define MODULE "Dropbox"
+#define MODULEW L"Dropbox"
#include "dropbox_options.h"
#include "http_request.h"