From 428bf0cbd77813a43094cb5c984436deff251936 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 29 Jul 2016 12:36:34 +0000 Subject: no more TCHARs git-svn-id: http://svn.miranda-ng.org/main/trunk@17143 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Gadu-Gadu/src/avatar.cpp | 14 ++++---- protocols/Gadu-Gadu/src/core.cpp | 58 ++++++++++++++++---------------- protocols/Gadu-Gadu/src/dialogs.cpp | 8 ++--- protocols/Gadu-Gadu/src/filetransfer.cpp | 2 +- protocols/Gadu-Gadu/src/gg.cpp | 8 ++--- protocols/Gadu-Gadu/src/gg_proto.cpp | 10 +++--- protocols/Gadu-Gadu/src/groupchat.cpp | 30 ++++++++--------- protocols/Gadu-Gadu/src/image.cpp | 57 +++++++++++++++---------------- protocols/Gadu-Gadu/src/import.cpp | 28 +++++++-------- protocols/Gadu-Gadu/src/links.cpp | 2 +- protocols/Gadu-Gadu/src/ownerinfo.cpp | 2 +- protocols/Gadu-Gadu/src/popups.cpp | 2 +- protocols/Gadu-Gadu/src/services.cpp | 10 +++--- protocols/Gadu-Gadu/src/sessions.cpp | 2 +- protocols/Gadu-Gadu/src/userutils.cpp | 8 ++--- 15 files changed, 120 insertions(+), 121 deletions(-) (limited to 'protocols/Gadu-Gadu/src') diff --git a/protocols/Gadu-Gadu/src/avatar.cpp b/protocols/Gadu-Gadu/src/avatar.cpp index 764cc426ef..9587cd11b0 100644 --- a/protocols/Gadu-Gadu/src/avatar.cpp +++ b/protocols/Gadu-Gadu/src/avatar.cpp @@ -28,14 +28,14 @@ // void GGPROTO::getAvatarFilename(MCONTACT hContact, wchar_t *pszDest, int cbLen) { - int tPathLen = mir_snwprintf(pszDest, cbLen, L"%s\\%S", VARST( L"%miranda_avatarcache%"), m_szModuleName); + int tPathLen = mir_snwprintf(pszDest, cbLen, L"%s\\%S", VARSW( L"%miranda_avatarcache%"), m_szModuleName); if (_waccess(pszDest, 0)) { - int ret = CreateDirectoryTreeT(pszDest); + int ret = CreateDirectoryTreeW(pszDest); if (ret == 0) - debugLog(L"getAvatarFilename(): Created new directory for avatar cache: %s.", pszDest); + debugLogW(L"getAvatarFilename(): Created new directory for avatar cache: %s.", pszDest); else { - debugLog(L"getAvatarFilename(): Can not create directory for avatar cache: %s. errno=%d: %s", pszDest, errno, ws_strerror(errno)); + debugLogW(L"getAvatarFilename(): Can not create directory for avatar cache: %s. errno=%d: %s", pszDest, errno, ws_strerror(errno)); wchar_t error[512]; mir_snwprintf(error, TranslateT("Cannot create avatars cache directory. ERROR: %d: %s\n%s"), errno, ws_strerror(errno), pszDest); showpopup(m_tszUserName, error, GG_POPUP_ERROR | GG_POPUP_ALLOW_MSGBOX | GG_POPUP_ONCE); @@ -267,9 +267,9 @@ void __cdecl GGPROTO::avatarrequestthread(void*) _write(file_fd, resp->pData, resp->dataLength); _close(file_fd); result = 1; - debugLog(L"avatarrequestthread() new avatar_transfers item. Saved data to file=%s.", ai.filename); + debugLogW(L"avatarrequestthread() new avatar_transfers item. Saved data to file=%s.", ai.filename); } else { - debugLog(L"avatarrequestthread(): _wopen file %s error. errno=%d: %s", ai.filename, errno, ws_strerror(errno)); + debugLogW(L"avatarrequestthread(): _wopen file %s error. errno=%d: %s", ai.filename, errno, ws_strerror(errno)); wchar_t error[512]; mir_snwprintf(error, TranslateT("Cannot create avatar file. ERROR: %d: %s\n%s"), errno, ws_strerror(errno), ai.filename); showpopup(m_tszUserName, error, GG_POPUP_ERROR); @@ -361,7 +361,7 @@ void __cdecl GGPROTO::setavatarthread(void *param) wchar_t *szFilename = (wchar_t*)param; int file_fd = _wopen(szFilename, _O_RDONLY | _O_BINARY, _S_IREAD); if (file_fd == -1) { - debugLog(L"setavatarthread(): Failed to open avatar file errno=%d: %s", errno, ws_strerror(errno)); + debugLogW(L"setavatarthread(): Failed to open avatar file errno=%d: %s", errno, ws_strerror(errno)); wchar_t error[512]; mir_snwprintf(error, TranslateT("Cannot open avatar file. ERROR: %d: %s\n%s"), errno, ws_strerror(errno), szFilename); showpopup(m_tszUserName, error, GG_POPUP_ERROR); diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp index dec48051e4..8440ab94ab 100644 --- a/protocols/Gadu-Gadu/src/core.cpp +++ b/protocols/Gadu-Gadu/src/core.cpp @@ -69,7 +69,7 @@ void GGPROTO::disconnect() gg_EnterCriticalSection(&modemsg_mutex, "disconnect", 6, "modemsg_mutex", 1); szMsg = mir_utf8encodeW(modemsg.online); gg_LeaveCriticalSection(&modemsg_mutex, "disconnect", 6, 1, "modemsg_mutex", 1); - if (!szMsg && !db_get_s(NULL, "SRAway", gg_status2db(ID_STATUS_ONLINE, "Default"), &dbv, DBVT_TCHAR)) { + if (!szMsg && !db_get_s(NULL, "SRAway", gg_status2db(ID_STATUS_ONLINE, "Default"), &dbv, DBVT_WCHAR)) { if (dbv.ptszVal && *(dbv.ptszVal)) szMsg = mir_utf8encodeW(dbv.ptszVal); db_free(&dbv); @@ -79,7 +79,7 @@ void GGPROTO::disconnect() gg_EnterCriticalSection(&modemsg_mutex, "disconnect", 7, "modemsg_mutex", 1); szMsg = mir_utf8encodeW(modemsg.away); gg_LeaveCriticalSection(&modemsg_mutex, "disconnect", 7, 1, "modemsg_mutex", 1); - if (!szMsg && !db_get_s(NULL, "SRAway", gg_status2db(ID_STATUS_AWAY, "Default"), &dbv, DBVT_TCHAR)) { + if (!szMsg && !db_get_s(NULL, "SRAway", gg_status2db(ID_STATUS_AWAY, "Default"), &dbv, DBVT_WCHAR)) { if (dbv.ptszVal && *(dbv.ptszVal)) szMsg = mir_utf8encodeW(dbv.ptszVal); db_free(&dbv); @@ -89,7 +89,7 @@ void GGPROTO::disconnect() gg_EnterCriticalSection(&modemsg_mutex, "disconnect", 8, "modemsg_mutex", 1); szMsg = mir_utf8encodeW(modemsg.dnd); gg_LeaveCriticalSection(&modemsg_mutex, "disconnect", 8, 1, "modemsg_mutex", 1); - if (!szMsg && !db_get_s(NULL, "SRAway", gg_status2db(ID_STATUS_DND, "Default"), &dbv, DBVT_TCHAR)) { + if (!szMsg && !db_get_s(NULL, "SRAway", gg_status2db(ID_STATUS_DND, "Default"), &dbv, DBVT_WCHAR)) { if (dbv.ptszVal && *(dbv.ptszVal)) szMsg = mir_utf8encodeW(dbv.ptszVal); db_free(&dbv); @@ -99,7 +99,7 @@ void GGPROTO::disconnect() gg_EnterCriticalSection(&modemsg_mutex, "disconnect", 9, "modemsg_mutex", 1); szMsg = mir_utf8encodeW(modemsg.freechat); gg_LeaveCriticalSection(&modemsg_mutex, "disconnect", 9, 1, "modemsg_mutex", 1); - if (!szMsg && !db_get_s(NULL, "SRAway", gg_status2db(ID_STATUS_FREECHAT, "Default"), &dbv, DBVT_TCHAR)) { + if (!szMsg && !db_get_s(NULL, "SRAway", gg_status2db(ID_STATUS_FREECHAT, "Default"), &dbv, DBVT_WCHAR)) { if (dbv.ptszVal && *(dbv.ptszVal)) szMsg = mir_utf8encodeW(dbv.ptszVal); db_free(&dbv); @@ -109,7 +109,7 @@ void GGPROTO::disconnect() gg_EnterCriticalSection(&modemsg_mutex, "disconnect", 10, "modemsg_mutex", 1); szMsg = mir_utf8encodeW(modemsg.invisible); gg_LeaveCriticalSection(&modemsg_mutex, "disconnect", 10, 1, "modemsg_mutex", 1); - if (!szMsg && !db_get_s(NULL, "SRAway", gg_status2db(ID_STATUS_INVISIBLE, "Default"), &dbv, DBVT_TCHAR)) { + if (!szMsg && !db_get_s(NULL, "SRAway", gg_status2db(ID_STATUS_INVISIBLE, "Default"), &dbv, DBVT_WCHAR)) { if (dbv.ptszVal && *(dbv.ptszVal)) szMsg = mir_utf8encodeW(dbv.ptszVal); db_free(&dbv); @@ -381,7 +381,7 @@ retry: p.status_descr = mir_utf8encodeW(getstatusmsg(m_iDesiredStatus)); p.status = status_m2gg(m_iDesiredStatus, p.status_descr != NULL); - debugLog(L"mainthread() (%x): Connecting with number %d, status %d and description \"%s\".", this, p.uin, m_iDesiredStatus, + debugLogW(L"mainthread() (%x): Connecting with number %d, status %d and description \"%s\".", this, p.uin, m_iDesiredStatus, p.status_descr ? getstatusmsg(m_iDesiredStatus) : L""); gg_LeaveCriticalSection(&modemsg_mutex, "mainthread", 13, 1, "modemsg_mutex", 1); @@ -418,7 +418,7 @@ retry: // Lookup for error desciption if (errno == EACCES) { for (int i = 0; reason[i].type; i++) if (reason[i].type == gg_failno) { - perror = TranslateTS(reason[i].str); + perror = TranslateW(reason[i].str); break; } } @@ -426,7 +426,7 @@ retry: mir_snwprintf(error, TranslateT("Connection cannot be established. errno=%d: %s"), errno, ws_strerror(errno)); perror = error; } - debugLog(L"mainthread() (%x): %s", this, perror); + debugLogW(L"mainthread() (%x): %s", this, perror); if (getByte(GG_KEY_SHOWCERRORS, GG_KEYDEF_SHOWCERRORS)) showpopup(m_tszUserName, perror, GG_POPUP_ERROR | GG_POPUP_ALLOW_MSGBOX | GG_POPUP_ONCE); @@ -548,7 +548,7 @@ retry: if (e->event.ack.seq && e->event.ack.recipient) { ProtoBroadcastAck(getcontact((DWORD)e->event.ack.recipient, 0, 0, NULL), - ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE) e->event.ack.seq, 0); + ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)e->event.ack.seq, 0); } break; @@ -654,7 +654,7 @@ retry: GGSEARCHRESULT psr; memset(&psr, 0, sizeof(psr)); psr.cbSize = sizeof(psr); - psr.flags = PSR_TCHAR; + psr.flags = PSR_UNICODE; psr.nick.w = __nickname; psr.firstName.w = __firstname; psr.lastName.w = __lastname; @@ -669,36 +669,36 @@ retry: { // Change nickname if it's not present if (__nickname && (res->seq == GG_SEQ_GETNICK || res->seq == GG_SEQ_CHINFO)) - setTString(hContact, GG_KEY_NICK, __nickname); + setWString(hContact, GG_KEY_NICK, __nickname); if (__nickname) - setTString(hContact, GG_KEY_PD_NICKNAME, __nickname); + setWString(hContact, GG_KEY_PD_NICKNAME, __nickname); else if (res->seq == GG_SEQ_CHINFO) delSetting(GG_KEY_PD_NICKNAME); // Change other info if (__city) - setTString(hContact, GG_KEY_PD_CITY, __city); + setWString(hContact, GG_KEY_PD_CITY, __city); else if (res->seq == GG_SEQ_CHINFO) delSetting(GG_KEY_PD_CITY); if (__firstname) - setTString(hContact, GG_KEY_PD_FIRSTNAME, __firstname); + setWString(hContact, GG_KEY_PD_FIRSTNAME, __firstname); else if (res->seq == GG_SEQ_CHINFO) delSetting(GG_KEY_PD_FIRSTNAME); if (__lastname) - setTString(hContact, GG_KEY_PD_LASTNAME, __lastname); + setWString(hContact, GG_KEY_PD_LASTNAME, __lastname); else if (res->seq == GG_SEQ_CHINFO) delSetting(GG_KEY_PD_LASTNAME); if (__familyname) - setTString(hContact, GG_KEY_PD_FAMILYNAME, __familyname); + setWString(hContact, GG_KEY_PD_FAMILYNAME, __familyname); else if (res->seq == GG_SEQ_CHINFO) delSetting(GG_KEY_PD_FAMILYNAME); if (__familycity) - setTString(hContact, GG_KEY_PD_FAMILYCITY, __familycity); + setWString(hContact, GG_KEY_PD_FAMILYCITY, __familycity); else if (res->seq == GG_SEQ_CHINFO) delSetting(GG_KEY_PD_FAMILYCITY); @@ -837,7 +837,7 @@ retry: gce.ptszNick = (wchar_t*) pcli->pfnGetContactDisplayName( getcontact(e->event.msg.sender, 1, 0, NULL), 0); gce.time = (!(e->event.msg.msgclass & GG_CLASS_OFFLINE) || e->event.msg.time > (t - timeDeviation)) ? t : e->event.msg.time; gce.dwFlags = GCEF_ADDTOLOG; - debugLog(L"mainthread() (%x): Conference message to room %s & id %s.", this, chat, id); + debugLogW(L"mainthread() (%x): Conference message to room %s & id %s.", this, chat, id); CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce); mir_free(messageT); } @@ -898,7 +898,7 @@ retry: wchar_t* messageT = mir_utf8decodeW(e->event.multilogon_msg.message); gce.ptszText = messageT; wchar_t* nickT; - if (!getTString(GG_KEY_NICK, &dbv)){ + if (!getWString(GG_KEY_NICK, &dbv)){ nickT = mir_wstrdup(dbv.ptszVal); db_free(&dbv); } @@ -907,7 +907,7 @@ retry: gce.time = e->event.multilogon_msg.time; gce.bIsMe = 1; gce.dwFlags = GCEF_ADDTOLOG; - debugLog(L"mainthread() (%x): Sent conference message to room %s.", this, chat); + debugLogW(L"mainthread() (%x): Sent conference message to room %s.", this, chat); CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce); mir_free(messageT); mir_free(nickT); @@ -1055,7 +1055,7 @@ retry: wchar_t* filenameT = mir_a2u((char*)dcc7->filename); PROTORECVFILET pre = {0}; - pre.dwFlags = PRFF_TCHAR; + pre.dwFlags = PRFF_UNICODE; pre.fileCount = 1; pre.timestamp = time(NULL); pre.descr.w = filenameT; @@ -1273,7 +1273,7 @@ int GGPROTO::contactdeleted(WPARAM hContact, LPARAM) // Terminate conference if contact is deleted DBVARIANT dbv; - if ( isChatRoom(hContact) && !getTString(hContact, "ChatRoomID", &dbv) && gc_enabled) + if ( isChatRoom(hContact) && !getWString(hContact, "ChatRoomID", &dbv) && gc_enabled) { GCDEST gcd = { m_szModuleName, dbv.ptszVal, GC_EVENT_CONTROL }; GCEVENT gce = { sizeof(gce), &gcd }; @@ -1347,7 +1347,7 @@ int GGPROTO::dbsettingchanged(WPARAM hContact, LPARAM lParam) // Groupchat window contact is being renamed DBVARIANT dbv; - if (isChatRoom(hContact) && !getTString(hContact, "ChatRoomID", &dbv)) + if (isChatRoom(hContact) && !getWString(hContact, "ChatRoomID", &dbv)) { // Most important... check redundancy (fucking cascading) static int cascade = 0; @@ -1377,7 +1377,7 @@ int GGPROTO::dbsettingchanged(WPARAM hContact, LPARAM lParam) if (!strcmp(cws->szSetting, "MyHandle")){ wchar_t* ptszVal = sttSettingToTchar(&(cws->value)); if(ptszVal==NULL) return 0; - setTString(hContact, GG_KEY_NICK, ptszVal); + setWString(hContact, GG_KEY_NICK, ptszVal); mir_free(ptszVal); } @@ -1538,7 +1538,7 @@ MCONTACT GGPROTO::getcontact(uin_t uin, int create, int inlist, wchar_t *szNick) MCONTACT hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); if (!hContact) { - debugLog(L"getcontact(): Failed to create Gadu-Gadu contact %s", szNick); + debugLogW(L"getcontact(): Failed to create Gadu-Gadu contact %s", szNick); return NULL; } @@ -1558,7 +1558,7 @@ MCONTACT GGPROTO::getcontact(uin_t uin, int create, int inlist, wchar_t *szNick) // If nick specified use it if (szNick) - setTString(hContact, GG_KEY_NICK, szNick); + setWString(hContact, GG_KEY_NICK, szNick); else if (isonline()) { // Search for that nick gg_pubdir50_t req = gg_pubdir50_new(GG_PUBDIR50_SEARCH); @@ -1571,7 +1571,7 @@ MCONTACT GGPROTO::getcontact(uin_t uin, int create, int inlist, wchar_t *szNick) gg_LeaveCriticalSection(&sess_mutex, "getcontact", 31, 1, "sess_mutex", 1); gg_pubdir50_free(req); wchar_t* uinT = mir_a2u(ditoa(uin)); - setTString(hContact, GG_KEY_NICK, uinT); + setWString(hContact, GG_KEY_NICK, uinT); mir_free(uinT); debugLogA("getcontact(): Search for nick on uin: %d", uin); } @@ -1701,8 +1701,8 @@ void GGPROTO::changecontactstatus(uin_t uin, int status, const wchar_t *idescr, // Check if there's description and if it's not empty if (idescr && *idescr) { - debugLog(L"changecontactstatus(): Saving for %d status descr \"%s\".", uin, idescr); - db_set_ts(hContact, "CList", GG_KEY_STATUSDESCR, idescr); + debugLogW(L"changecontactstatus(): Saving for %d status descr \"%s\".", uin, idescr); + db_set_ws(hContact, "CList", GG_KEY_STATUSDESCR, idescr); } else { // Remove status if there's nothing db_unset(hContact, "CList", GG_KEY_STATUSDESCR); diff --git a/protocols/Gadu-Gadu/src/dialogs.cpp b/protocols/Gadu-Gadu/src/dialogs.cpp index 1aceff00a9..a662970ddf 100644 --- a/protocols/Gadu-Gadu/src/dialogs.cpp +++ b/protocols/Gadu-Gadu/src/dialogs.cpp @@ -112,7 +112,7 @@ static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule ptstr = str; mir_snwprintf(str, L"%S", dbv.pszVal); break; - case DBVT_TCHAR: + case DBVT_WCHAR: unspecified = (special == SVS_ZEROISUNSPEC && dbv.ptszVal[0] == '\0'); ptstr = dbv.ptszVal; break; @@ -870,13 +870,13 @@ static INT_PTR CALLBACK gg_detailsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, int GGPROTO::options_init(WPARAM wParam, LPARAM) { OPTIONSDIALOGPAGE odp = { 0 }; - odp.flags = ODPF_TCHAR; + odp.flags = ODPF_UNICODE; odp.position = 1003000; odp.hInstance = hInstance; odp.pwszGroup = LPGENW("Network"); odp.pwszTitle = m_tszUserName; odp.dwInitParam = (LPARAM)this; - odp.flags = ODPF_TCHAR | ODPF_BOLDGROUPS | ODPF_DONTTRANSLATE; + odp.flags = ODPF_UNICODE | ODPF_BOLDGROUPS | ODPF_DONTTRANSLATE; odp.pwszTab = LPGENW("General"); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_GG_GENERAL); @@ -918,7 +918,7 @@ int GGPROTO::details_init(WPARAM wParam, LPARAM lParam) } OPTIONSDIALOGPAGE odp = { 0 }; - odp.flags = ODPF_DONTTRANSLATE | ODPF_TCHAR; + odp.flags = ODPF_DONTTRANSLATE | ODPF_UNICODE; odp.hInstance = hInstance; odp.pfnDlgProc = gg_detailsdlgproc; odp.position = -1900000000; diff --git a/protocols/Gadu-Gadu/src/filetransfer.cpp b/protocols/Gadu-Gadu/src/filetransfer.cpp index 38909300a0..682e3656d0 100644 --- a/protocols/Gadu-Gadu/src/filetransfer.cpp +++ b/protocols/Gadu-Gadu/src/filetransfer.cpp @@ -384,7 +384,7 @@ void __cdecl GGPROTO::dccmainthread(void*) wchar_t* filenameT = mir_utf8decodeW((char*)dcc->file_info.filename); PROTORECVFILET pre = {0}; - pre.dwFlags = PRFF_TCHAR; + pre.dwFlags = PRFF_UNICODE; pre.fileCount = 1; pre.timestamp = time(NULL); pre.descr.w = filenameT; diff --git a/protocols/Gadu-Gadu/src/gg.cpp b/protocols/Gadu-Gadu/src/gg.cpp index 18e264e031..88b3c060f5 100644 --- a/protocols/Gadu-Gadu/src/gg.cpp +++ b/protocols/Gadu-Gadu/src/gg.cpp @@ -174,9 +174,9 @@ void GGPROTO::cleanuplastplugin(DWORD version) debugLogA("cleanuplastplugin() 1: version=%d Cleaning junk avatar files from < 0.11.0.2", version); wchar_t avatarsPath[MAX_PATH]; - mir_snwprintf(avatarsPath, L"%s\\%s", VARST( L"%miranda_avatarcache%"), m_tszUserName); + mir_snwprintf(avatarsPath, L"%s\\%s", VARSW( L"%miranda_avatarcache%"), m_tszUserName); - debugLog(L"cleanuplastplugin() 1: miranda_avatarcache = %s", avatarsPath); + debugLogW(L"cleanuplastplugin() 1: miranda_avatarcache = %s", avatarsPath); wchar_t spec[MAX_PATH + 10]; mir_snwprintf(spec, L"%s\\*.(null)", avatarsPath); @@ -187,7 +187,7 @@ void GGPROTO::cleanuplastplugin(DWORD version) wchar_t filePathT [2*MAX_PATH + 10]; mir_snwprintf(filePathT, L"%s\\%s", avatarsPath, ffd.cFileName); if (!_waccess(filePathT, 0)){ - debugLog(L"cleanuplastplugin() 1: remove file = %s", filePathT); + debugLogW(L"cleanuplastplugin() 1: remove file = %s", filePathT); _wremove(filePathT); } } while (FindNextFile(hFind, &ffd) != 0); @@ -287,7 +287,7 @@ void GGPROTO::menus_init() CMenuItem mi; mi.root = hRoot; - mi.flags = CMIF_TCHAR; + mi.flags = CMIF_UNICODE; mi.name.w = LPGENW("Conference"); mi.position = 200001; diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp index be0a8943fe..1001112208 100644 --- a/protocols/Gadu-Gadu/src/gg_proto.cpp +++ b/protocols/Gadu-Gadu/src/gg_proto.cpp @@ -44,7 +44,7 @@ GGPROTO::GGPROTO(const char *pszProtoName, const wchar_t *tszUserName) : NETLIBUSER nlu = { 0 }; nlu.cbSize = sizeof(nlu); - nlu.flags = NUF_TCHAR | NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS; + nlu.flags = NUF_UNICODE | NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS; nlu.szSettingsModule = m_szModuleName; nlu.ptszDescriptiveName = name; @@ -68,7 +68,7 @@ GGPROTO::GGPROTO(const char *pszProtoName, const wchar_t *tszUserName) : db_set_resident(m_szModuleName, GG_KEY_AVATARREQUESTED); wchar_t szPath[MAX_PATH]; - mir_snwprintf(szPath, L"%s\\%s\\ImageCache", (wchar_t*)VARST(L"%miranda_userdata%"), m_tszUserName); + mir_snwprintf(szPath, L"%s\\%s\\ImageCache", (wchar_t*)VARSW(L"%miranda_userdata%"), m_tszUserName); hImagesFolder = FoldersRegisterCustomPathT(LPGEN("Images"), m_szModuleName, szPath, m_tszUserName); DWORD dwVersion; @@ -595,9 +595,9 @@ void __cdecl GGPROTO::getawaymsgthread(void *arg) MCONTACT hContact = (UINT_PTR)arg; debugLogA("getawaymsgthread(): started"); gg_sleep(100, FALSE, "getawaymsgthread", 106, 1); - if (!db_get_s(hContact, "CList", GG_KEY_STATUSDESCR, &dbv, DBVT_TCHAR)) { + if (!db_get_s(hContact, "CList", GG_KEY_STATUSDESCR, &dbv, DBVT_WCHAR)) { ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)dbv.ptszVal); - debugLog(L"getawaymsgthread(): Reading away msg <%s>.", dbv.ptszVal); + debugLogW(L"getawaymsgthread(): Reading away msg <%s>.", dbv.ptszVal); db_free(&dbv); } else { @@ -627,7 +627,7 @@ int GGPROTO::SetAwayMsg(int iStatus, const wchar_t *newMsg) int status = gg_normalizestatus(iStatus); wchar_t **msgPtr; - debugLog(L"SetAwayMsg(): PS_SETAWAYMSG(%d, \"%s\".)", iStatus, newMsg); + debugLogW(L"SetAwayMsg(): PS_SETAWAYMSG(%d, \"%s\".)", iStatus, newMsg); gg_EnterCriticalSection(&modemsg_mutex, "SetAwayMsg", 55, "modemsg_mutex", 1); // Select proper our msg ptr diff --git a/protocols/Gadu-Gadu/src/groupchat.cpp b/protocols/Gadu-Gadu/src/groupchat.cpp index 52d5399ef8..29f3e39abc 100644 --- a/protocols/Gadu-Gadu/src/groupchat.cpp +++ b/protocols/Gadu-Gadu/src/groupchat.cpp @@ -58,7 +58,7 @@ void GGPROTO::gc_menus_init(HGENMENU hRoot) { if (gc_enabled) { CMenuItem mi; - mi.flags = CMIF_TCHAR; + mi.flags = CMIF_UNICODE; mi.root = hRoot; // Conferencing @@ -128,7 +128,7 @@ int GGPROTO::gc_event(WPARAM, LPARAM lParam) // Window terminated (Miranda exit) if (gch->pDest->iType == SESSION_TERMINATE) { - debugLog(L"gc_event(): Terminating chat %x, id %s from chat window...", chat, gch->pDest->ptszID); + debugLogW(L"gc_event(): Terminating chat %x, id %s from chat window...", chat, gch->pDest->ptszID); // Destroy chat entry free(chat->recipients); list_remove(&chats, chat, 1); @@ -137,7 +137,7 @@ int GGPROTO::gc_event(WPARAM, LPARAM lParam) for (MCONTACT hContact = db_find_first(); hContact; ) { MCONTACT hNext = db_find_next(hContact); DBVARIANT dbv; - if (!getTString(hContact, "ChatRoomID", &dbv)) { + if (!getWString(hContact, "ChatRoomID", &dbv)) { if (dbv.ptszVal && !mir_wstrcmp(gch->pDest->ptszID, dbv.ptszVal)) CallService(MS_DB_CONTACT_DELETE, hContact, 0); db_free(&dbv); @@ -158,7 +158,7 @@ int GGPROTO::gc_event(WPARAM, LPARAM lParam) gce.ptszUID = id; gce.ptszText = gch->ptszText; wchar_t* nickT; - if (!getTString(GG_KEY_NICK, &dbv)){ + if (!getWString(GG_KEY_NICK, &dbv)){ nickT = mir_wstrdup(dbv.ptszVal); db_free(&dbv); } @@ -173,7 +173,7 @@ int GGPROTO::gc_event(WPARAM, LPARAM lParam) gce.time = time(NULL); gce.bIsMe = 1; gce.dwFlags = GCEF_ADDTOLOG; - debugLog(L"gc_event(): Sending conference message to room %s, \"%s\".", gch->pDest->ptszID, gch->ptszText); + debugLogW(L"gc_event(): Sending conference message to room %s, \"%s\".", gch->pDest->ptszID, gch->ptszText); CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce); mir_free(nickT); @@ -191,7 +191,7 @@ int GGPROTO::gc_event(WPARAM, LPARAM lParam) if ((uin = _wtoi(gch->ptszUID)) && (hContact = getcontact(uin, 1, 0, NULL))) CallService(MS_MSG_SENDMESSAGE, hContact, 0); } - debugLog(L"gc_event(): Unhandled event %d, chat %x, uin %d, text \"%s\".", gch->pDest->iType, chat, uin, gch->ptszText); + debugLogW(L"gc_event(): Unhandled event %d, chat %x, uin %d, text \"%s\".", gch->pDest->iType, chat, uin, gch->ptszText); return 0; } @@ -246,9 +246,9 @@ wchar_t* GGPROTO::gc_getchat(uin_t sender, uin_t *recipients, int recipients_cou if (found == recipients_count) { if (chat->ignore) - debugLog(L"gc_getchat(): Ignoring existing id %s, size %d.", chat->id, chat->recipients_count); + debugLogW(L"gc_getchat(): Ignoring existing id %s, size %d.", chat->id, chat->recipients_count); else - debugLog(L"gc_getchat(): Returning existing id %s, size %d.", chat->id, chat->recipients_count); + debugLogW(L"gc_getchat(): Returning existing id %s, size %d.", chat->id, chat->recipients_count); return !(chat->ignore) ? chat->id : NULL; } } @@ -295,7 +295,7 @@ wchar_t* GGPROTO::gc_getchat(uin_t sender, uin_t *recipients, int recipients_cou for(; i < recipients_count; i++) chat->recipients[i] = recipients[i]; if (sender) chat->recipients[i] = sender; - debugLog(L"gc_getchat(): Ignoring new chat %s, count %d.", chat->id, chat->recipients_count); + debugLogW(L"gc_getchat(): Ignoring new chat %s, count %d.", chat->id, chat->recipients_count); list_add(&chats, chat, 0); return NULL; } @@ -330,7 +330,7 @@ wchar_t* GGPROTO::gc_getchat(uin_t sender, uin_t *recipients, int recipients_cou // Create new room if (CallServiceSync(MS_GC_NEWSESSION, 0, (LPARAM) &gcwindow)) { - debugLog(L"gc_getchat(): Cannot create new chat window %s.", chat->id); + debugLogW(L"gc_getchat(): Cannot create new chat window %s.", chat->id); free(name); free(chat); return NULL; @@ -353,7 +353,7 @@ wchar_t* GGPROTO::gc_getchat(uin_t sender, uin_t *recipients, int recipients_cou UIN2IDT(uin, id); wchar_t* nickT; - if (!getTString(GG_KEY_NICK, &dbv)) { + if (!getWString(GG_KEY_NICK, &dbv)) { nickT = mir_wstrdup(dbv.ptszVal); db_free(&dbv); } else { @@ -364,7 +364,7 @@ wchar_t* GGPROTO::gc_getchat(uin_t sender, uin_t *recipients, int recipients_cou gce.bIsMe = 1; CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce); mir_free(nickT); - debugLog(L"gc_getchat(): Myself %s: %s (%s) to the list...", gce.ptszUID, gce.ptszNick, gce.ptszStatus); + debugLogW(L"gc_getchat(): Myself %s: %s (%s) to the list...", gce.ptszUID, gce.ptszNick, gce.ptszStatus); } else debugLogA("gc_getchat(): Myself adding failed with uin %d !!!", uin); @@ -386,14 +386,14 @@ wchar_t* GGPROTO::gc_getchat(uin_t sender, uin_t *recipients, int recipients_cou gce.ptszNick = TranslateT("'Unknown'"); gce.bIsMe = 0; gce.dwFlags = 0; - debugLog(L"gc_getchat(): Added %s: %s (%s) to the list...", gce.ptszUID, gce.ptszNick, gce.ptszStatus); + debugLogW(L"gc_getchat(): Added %s: %s (%s) to the list...", gce.ptszUID, gce.ptszNick, gce.ptszStatus); CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce); } gcd.iType = GC_EVENT_CONTROL; CallServiceSync(MS_GC_EVENT, SESSION_INITDONE, (LPARAM)&gce); CallServiceSync(MS_GC_EVENT, SESSION_ONLINE, (LPARAM)&gce); - debugLog(L"gc_getchat(): Returning new chat window %s, count %d.", chat->id, chat->recipients_count); + debugLogW(L"gc_getchat(): Returning new chat window %s, count %d.", chat->id, chat->recipients_count); list_add(&chats, chat, 0); return chat->id; } @@ -641,7 +641,7 @@ int GGPROTO::gc_changenick(MCONTACT hContact, wchar_t *ptszNick) gce.ptszUID = id; gce.ptszText = ptszNick; - debugLog(L"gc_changenick(): Found room %s with uin %d, sending nick change %s.", chat->id, uin, id); + debugLogW(L"gc_changenick(): Found room %s with uin %d, sending nick change %s.", chat->id, uin, id); CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce); break; diff --git a/protocols/Gadu-Gadu/src/image.cpp b/protocols/Gadu-Gadu/src/image.cpp index 106b8e2d5f..719d78591d 100644 --- a/protocols/Gadu-Gadu/src/image.cpp +++ b/protocols/Gadu-Gadu/src/image.cpp @@ -264,11 +264,11 @@ int gg_img_saveimage(HWND hwnd, GGIMAGEENTRY *dat) { fwrite(dat->lpData, dat->nSize, 1, fp); fclose(fp); - gg->debugLog(L"gg_img_saveimage(): Image saved to %s.", szFileName); + gg->debugLogW(L"gg_img_saveimage(): Image saved to %s.", szFileName); } else { - gg->debugLog(L"gg_img_saveimage(): Cannot save image to %s.", szFileName); + gg->debugLogW(L"gg_img_saveimage(): Cannot save image to %s.", szFileName); MessageBox(hwnd, TranslateT("Image cannot be written to disk."), gg->m_tszUserName, MB_OK | MB_ICONERROR); } } @@ -398,22 +398,21 @@ static INT_PTR CALLBACK gg_img_dlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, LP else dat->gg->debugLogA("gg_img_dlgproc(): WM_INITDIALOG Creation event not found, but someone might be waiting."); // Making buttons flat - SendDlgItemMessage(hwndDlg, IDC_IMG_PREV, BUTTONSETASFLATBTN, TRUE, 0); - SendDlgItemMessage(hwndDlg, IDC_IMG_NEXT, BUTTONSETASFLATBTN, TRUE, 0); - SendDlgItemMessage(hwndDlg, IDC_IMG_DELETE, BUTTONSETASFLATBTN, TRUE, 0); - SendDlgItemMessage(hwndDlg, IDC_IMG_SAVE, BUTTONSETASFLATBTN, TRUE, 0); - - // Setting images for buttons - SendDlgItemMessage(hwndDlg, IDC_IMG_PREV, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadIconEx("previous", FALSE)); - SendDlgItemMessage(hwndDlg, IDC_IMG_NEXT, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadIconEx("next", FALSE)); - SendDlgItemMessage(hwndDlg, IDC_IMG_DELETE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadIconEx("delete", FALSE)); - SendDlgItemMessage(hwndDlg, IDC_IMG_SAVE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadIconEx("save", FALSE)); - - // Setting tooltips for buttons - SendDlgItemMessage(hwndDlg, IDC_IMG_PREV, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Previous image"), BATF_TCHAR); - SendDlgItemMessage(hwndDlg, IDC_IMG_NEXT, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Next image"), BATF_TCHAR); - SendDlgItemMessage(hwndDlg, IDC_IMG_DELETE, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Delete image from the list"), BATF_TCHAR); - SendDlgItemMessage(hwndDlg, IDC_IMG_SAVE, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Save image to disk"), BATF_TCHAR); + SendDlgItemMessage(hwndDlg, IDC_IMG_PREV, BUTTONSETASFLATBTN, TRUE, 0); + SendDlgItemMessage(hwndDlg, IDC_IMG_PREV, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadIconEx("previous", FALSE)); + SendDlgItemMessage(hwndDlg, IDC_IMG_PREV, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Previous image"), BATF_UNICODE); + + SendDlgItemMessage(hwndDlg, IDC_IMG_NEXT, BUTTONSETASFLATBTN, TRUE, 0); + SendDlgItemMessage(hwndDlg, IDC_IMG_NEXT, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadIconEx("next", FALSE)); + SendDlgItemMessage(hwndDlg, IDC_IMG_NEXT, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Next image"), BATF_UNICODE); + + SendDlgItemMessage(hwndDlg, IDC_IMG_SAVE, BUTTONSETASFLATBTN, TRUE, 0); + SendDlgItemMessage(hwndDlg, IDC_IMG_SAVE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadIconEx("save", FALSE)); + SendDlgItemMessage(hwndDlg, IDC_IMG_SAVE, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Save image to disk"), BATF_UNICODE); + + SendDlgItemMessage(hwndDlg, IDC_IMG_DELETE, BUTTONSETASFLATBTN, TRUE, 0); + SendDlgItemMessage(hwndDlg, IDC_IMG_DELETE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadIconEx("delete", FALSE)); + SendDlgItemMessage(hwndDlg, IDC_IMG_DELETE, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Delete image from the list"), BATF_UNICODE); // Set main window image Window_SetIcon_IcoLib(hwndDlg, GetIconHandle(IDI_IMAGE)); @@ -812,11 +811,11 @@ int GGPROTO::img_displayasmsg(MCONTACT hContact, void *img) } if ( _waccess(szPath, 0)){ - int ret = CreateDirectoryTreeT(szPath); + int ret = CreateDirectoryTreeW(szPath); if (ret == 0){ - debugLog(L"img_displayasmsg(): Created new directory for image cache: %s.", szPath); + debugLogW(L"img_displayasmsg(): Created new directory for image cache: %s.", szPath); } else { - debugLog(L"img_displayasmsg(): Can not create directory for image cache: %s. errno=%d: %s", szPath, errno, strerror(errno)); + debugLogW(L"img_displayasmsg(): Can not create directory for image cache: %s. errno=%d: %s", szPath, errno, strerror(errno)); wchar_t error[512]; mir_snwprintf(error, TranslateT("Cannot create image cache directory. ERROR: %d: %s\n%s"), errno, _tcserror(errno), szPath); showpopup(m_tszUserName, error, GG_POPUP_ERROR | GG_POPUP_ALLOW_MSGBOX | GG_POPUP_ONCE); @@ -840,7 +839,7 @@ int GGPROTO::img_displayasmsg(MCONTACT hContact, void *img) res = fwrite(dat->lpData, dat->nSize, 1, fp) > 0; fclose(fp); } else { - debugLog(L"img_displayasmsg(): Cannot open file %s for write image. errno=%d: %s", szPath, errno, strerror(errno)); + debugLogW(L"img_displayasmsg(): Cannot open file %s for write image. errno=%d: %s", szPath, errno, strerror(errno)); wchar_t error[512]; mir_snwprintf(error, TranslateT("Cannot save received image to file. ERROR: %d: %s\n%s"), errno, _tcserror(errno), szPath); showpopup(m_tszUserName, error, GG_POPUP_ERROR); @@ -857,9 +856,9 @@ int GGPROTO::img_displayasmsg(MCONTACT hContact, void *img) pre.timestamp = time(NULL); pre.szMessage = szMessage; ProtoChainRecvMsg(hContact, &pre); - debugLog(L"img_displayasmsg(): Image saved to %s.", szPath); + debugLogW(L"img_displayasmsg(): Image saved to %s.", szPath); } - else debugLog(L"img_displayasmsg(): Cannot save image to %s.", szPath); + else debugLogW(L"img_displayasmsg(): Cannot save image to %s.", szPath); return 0; } @@ -961,7 +960,7 @@ void* GGPROTO::img_loadpicture(gg_event* e, wchar_t *szFileName) FILE *fp = _wfopen(szFileName, L"rb"); if (!fp) { free(dat); - debugLog(L"img_loadpicture(): fopen(\"%s\", \"rb\" failed. errno=%d: %s)", szFileName, errno, strerror(errno)); + debugLogW(L"img_loadpicture(): fopen(\"%s\", \"rb\" failed. errno=%d: %s)", szFileName, errno, strerror(errno)); wchar_t error[512]; mir_snwprintf(error, TranslateT("Cannot open image file. ERROR: %d: %s\n%s"), errno, _tcserror(errno), szFileName); showpopup(m_tszUserName, error, GG_POPUP_ERROR); @@ -973,7 +972,7 @@ void* GGPROTO::img_loadpicture(gg_event* e, wchar_t *szFileName) { fclose(fp); free(dat); - debugLog(L"img_loadpicture(): Zero file size \"%s\" failed.", szFileName); + debugLogW(L"img_loadpicture(): Zero file size \"%s\" failed.", szFileName); return NULL; } // Maximum acceptable image size @@ -981,7 +980,7 @@ void* GGPROTO::img_loadpicture(gg_event* e, wchar_t *szFileName) { fclose(fp); free(dat); - debugLog(L"img_loadpicture(): Image size of \"%s\" exceeds 255 KB.", szFileName); + debugLogW(L"img_loadpicture(): Image size of \"%s\" exceeds 255 KB.", szFileName); MessageBox(NULL, TranslateT("Image exceeds maximum allowed size of 255 KB."), m_tszUserName, MB_OK | MB_ICONEXCLAMATION); return NULL; } @@ -992,7 +991,7 @@ void* GGPROTO::img_loadpicture(gg_event* e, wchar_t *szFileName) free(dat->lpData); fclose(fp); free(dat); - debugLog(L"img_loadpicture(): Reading file \"%s\" failed.", szFileName); + debugLogW(L"img_loadpicture(): Reading file \"%s\" failed.", szFileName); return NULL; } fclose(fp); @@ -1037,7 +1036,7 @@ void* GGPROTO::img_loadpicture(gg_event* e, wchar_t *szFileName) } // Load image from file else - dat->hBitmap = (HBITMAP) CallService(MS_IMG_LOAD, (WPARAM) szFileName, IMGL_TCHAR); + dat->hBitmap = (HBITMAP) CallService(MS_IMG_LOAD, (WPARAM) szFileName, IMGL_WCHAR); // If everything is fine return the handle if (dat->hBitmap) return dat; diff --git a/protocols/Gadu-Gadu/src/import.cpp b/protocols/Gadu-Gadu/src/import.cpp index 6e8e3f43f0..b2b686b4dc 100644 --- a/protocols/Gadu-Gadu/src/import.cpp +++ b/protocols/Gadu-Gadu/src/import.cpp @@ -32,7 +32,7 @@ char *gg_makecontacts(GGPROTO *gg, int cr) // Readup FirstName DBVARIANT dbv; - if (!gg->getTString(hContact, GG_KEY_PD_FIRSTNAME, &dbv)) + if (!gg->getWString(hContact, GG_KEY_PD_FIRSTNAME, &dbv)) { char* pszValA = mir_u2a(dbv.ptszVal); string_append(s, dbv.pszVal); @@ -41,7 +41,7 @@ char *gg_makecontacts(GGPROTO *gg, int cr) } string_append_c(s, ';'); // Readup LastName - if (!gg->getTString(hContact, GG_KEY_PD_LASTNAME, &dbv)) + if (!gg->getWString(hContact, GG_KEY_PD_LASTNAME, &dbv)) { char* pszValA = mir_u2a(dbv.ptszVal); string_append(s, dbv.pszVal); @@ -51,11 +51,11 @@ char *gg_makecontacts(GGPROTO *gg, int cr) string_append_c(s, ';'); // Readup Nick - if (!db_get_ts(hContact, "CList", "MyHandle", &dbv) || !gg->getTString(hContact, GG_KEY_NICK, &dbv)) + if (!db_get_ws(hContact, "CList", "MyHandle", &dbv) || !gg->getWString(hContact, GG_KEY_NICK, &dbv)) { char* dbvA = mir_u2a(dbv.ptszVal); DBVARIANT dbv2; - if (!gg->getTString(hContact, GG_KEY_PD_NICKNAME, &dbv2)) + if (!gg->getWString(hContact, GG_KEY_PD_NICKNAME, &dbv2)) { char* pszValA = mir_u2a(dbv2.ptszVal); string_append(s, pszValA); @@ -218,18 +218,18 @@ void GGPROTO::parsecontacts(char *contacts) if (hContact && strGroup) { ptrW tszGrpName( mir_a2u(strGroup)); Clist_GroupCreate(0, tszGrpName); - db_set_ts(hContact, "CList", "Group", tszGrpName); + db_set_ws(hContact, "CList", "Group", tszGrpName); } // Write misc data if (hContact && strFirstName){ wchar_t *tstrFirstName = mir_a2u(strFirstName); - setTString(hContact, GG_KEY_PD_FIRSTNAME, tstrFirstName); + setWString(hContact, GG_KEY_PD_FIRSTNAME, tstrFirstName); mir_free(tstrFirstName); } if (hContact && strLastName){ wchar_t *tstrLastName = mir_a2u(strLastName); - setTString(hContact, GG_KEY_PD_LASTNAME, tstrLastName); + setWString(hContact, GG_KEY_PD_LASTNAME, tstrLastName); mir_free(tstrLastName); } if (hContact && strPhone) db_set_s(hContact, "UserInfo", "MyPhone0", strPhone); // Store now in User Info @@ -280,7 +280,7 @@ INT_PTR GGPROTO::import_server(WPARAM, LPARAM) gg_LeaveCriticalSection(&sess_mutex, "import_server", 65, 1, "sess_mutex", 1); mir_snwprintf(error, TranslateT("List cannot be imported because of error:\n\t%s (Error: %d)"), ws_strerror(errno), errno); MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP); - debugLog(L"import_server(): Cannot import list. errno:%d: %s", errno, ws_strerror(errno)); + debugLogW(L"import_server(): Cannot import list. errno:%d: %s", errno, ws_strerror(errno)); } gg_LeaveCriticalSection(&sess_mutex, "import_server", 65, 2, "sess_mutex", 1); @@ -318,7 +318,7 @@ INT_PTR GGPROTO::remove_server(WPARAM, LPARAM) gg_LeaveCriticalSection(&sess_mutex, "remove_server", 66, 1, "sess_mutex", 1); mir_snwprintf(error, TranslateT("List cannot be removed because of error: %s (Error: %d)"), ws_strerror(errno), errno); MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP); - debugLog(L"remove_server(): Cannot remove list. errno=%d: %s", errno, ws_strerror(errno)); + debugLogW(L"remove_server(): Cannot remove list. errno=%d: %s", errno, ws_strerror(errno)); } gg_LeaveCriticalSection(&sess_mutex, "remove_server", 66, 2, "sess_mutex", 1); @@ -392,7 +392,7 @@ INT_PTR GGPROTO::import_text(WPARAM, LPARAM) wchar_t error[256]; mir_snwprintf(error, TranslateT("List cannot be imported from file \"%s\" because of error:\n\t%s (Error: %d)"), str, _tcserror(errno), errno); MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP); - debugLog(L"import_text(): Cannot import list from file \"%s\". errno=%d: %s", str, errno, _tcserror(errno)); + debugLogW(L"import_text(): Cannot import list from file \"%s\". errno=%d: %s", str, errno, _tcserror(errno)); if (f) fclose(f); return 0; @@ -436,7 +436,7 @@ INT_PTR GGPROTO::export_text(WPARAM, LPARAM) ofn.lpstrDefExt = L"txt"; #ifdef DEBUGMODE - debugLog(L"export_text(%s).", str); + debugLogW(L"export_text(%s).", str); #endif if (!GetSaveFileName(&ofn)) return 0; @@ -454,7 +454,7 @@ INT_PTR GGPROTO::export_text(WPARAM, LPARAM) wchar_t error[128]; mir_snwprintf(error, TranslateT("List cannot be exported to file \"%s\" because of error:\n\t%s (Error: %d)"), str, _tcserror(errno), errno); MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP); - debugLog(L"export_text(): Cannot export list to file \"%s\". errno=%d: %s", str, errno, _tcserror(errno)); + debugLogW(L"export_text(): Cannot export list to file \"%s\". errno=%d: %s", str, errno, _tcserror(errno)); } return 0; @@ -498,7 +498,7 @@ INT_PTR GGPROTO::export_server(WPARAM, LPARAM) gg_LeaveCriticalSection(&sess_mutex, "export_server", 67, 1, "sess_mutex", 1); mir_snwprintf(error, TranslateT("List cannot be exported because of error:\n\t%s (Error: %d)"), ws_strerror(errno), errno); MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP); - debugLog(L"export_server(): Cannot export list. errno=%d: %s", errno, ws_strerror(errno)); + debugLogW(L"export_server(): Cannot export list. errno=%d: %s", errno, ws_strerror(errno)); } gg_LeaveCriticalSection(&sess_mutex, "export_server", 67, 2, "sess_mutex", 1); @@ -515,7 +515,7 @@ INT_PTR GGPROTO::export_server(WPARAM, LPARAM) void GGPROTO::import_init(HGENMENU hRoot) { CMenuItem mi; - mi.flags = CMIF_TCHAR; + mi.flags = CMIF_UNICODE; mi.root = hRoot; // Import from server item diff --git a/protocols/Gadu-Gadu/src/links.cpp b/protocols/Gadu-Gadu/src/links.cpp index cc388ac8e8..6fc1a996ca 100644 --- a/protocols/Gadu-Gadu/src/links.cpp +++ b/protocols/Gadu-Gadu/src/links.cpp @@ -116,7 +116,7 @@ void GGPROTO::links_instance_init() { if (ServiceExists(MS_ASSOCMGR_ADDNEWURLTYPE)) { CMenuItem mi; - mi.flags = CMIF_TCHAR; + mi.flags = CMIF_UNICODE; mi.position = g_Instances.getCount(); mi.name.w = m_tszUserName; hInstanceMenuItem = Menu_AddItem(hInstanceMenu, &mi, this); diff --git a/protocols/Gadu-Gadu/src/ownerinfo.cpp b/protocols/Gadu-Gadu/src/ownerinfo.cpp index c89521354f..6a11db6a33 100644 --- a/protocols/Gadu-Gadu/src/ownerinfo.cpp +++ b/protocols/Gadu-Gadu/src/ownerinfo.cpp @@ -59,7 +59,7 @@ void __cdecl GGPROTO::remindpasswordthread(void *param) wchar_t error[128]; mir_snwprintf(error, TranslateT("Password could not be reminded because of error:\n\t%s (Error: %d)"), ws_strerror(errno), errno); MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP); - debugLog(L"remindpasswordthread(): Password could not be reminded. errno=%d: %s", errno, ws_strerror(errno)); + debugLogW(L"remindpasswordthread(): Password could not be reminded. errno=%d: %s", errno, ws_strerror(errno)); } else { diff --git a/protocols/Gadu-Gadu/src/popups.cpp b/protocols/Gadu-Gadu/src/popups.cpp index 7712477bc2..0d68758a86 100644 --- a/protocols/Gadu-Gadu/src/popups.cpp +++ b/protocols/Gadu-Gadu/src/popups.cpp @@ -79,7 +79,7 @@ void GGPROTO::initpopups() puc.cbSize = sizeof(puc); puc.PluginWindowProc = PopupWindowProc; puc.flags = PCF_TCHAR; - puc.ptszDescription = szDescr; + puc.pwszDescription = szDescr; puc.pszName = szName; puc.colorBack = RGB(173, 206, 247); diff --git a/protocols/Gadu-Gadu/src/services.cpp b/protocols/Gadu-Gadu/src/services.cpp index e0fde48c40..fbb314a22c 100644 --- a/protocols/Gadu-Gadu/src/services.cpp +++ b/protocols/Gadu-Gadu/src/services.cpp @@ -188,7 +188,7 @@ INT_PTR GGPROTO::getavatarinfo(WPARAM wParam, LPARAM lParam) //directly check if contact has protected user avatar set by AVS, and if yes return it as protocol avatar DBVARIANT dbv; - if (!db_get_ts(pai->hContact, "ContactPhoto", "Backup", &dbv)) { + if (!db_get_ws(pai->hContact, "ContactPhoto", "Backup", &dbv)) { if ((mir_wstrlen(dbv.ptszVal)>0) && db_get_b(pai->hContact, "ContactPhoto", "Locked", 0)){ debugLogA("getavatarinfo(): Incoming request for avatar information. Contact has assigned Locked ContactPhoto. return GAIR_SUCCESS"); wcscpy_s(pai->filename, _countof(pai->filename) ,dbv.ptszVal); @@ -235,12 +235,12 @@ INT_PTR GGPROTO::getavatarinfo(WPARAM wParam, LPARAM lParam) } requestAvatarTransfer(pai->hContact, AvatarURL); - debugLog(L"getavatarinfo(): Incoming request for avatar information. uin=%d. Avatar hash unchanged but file %s does not exist. errno=%d: %s. requestAvatarTransfer() fired. return GAIR_WAITFOR", uin, pai->filename, errno, ws_strerror(errno)); + debugLogW(L"getavatarinfo(): Incoming request for avatar information. uin=%d. Avatar hash unchanged but file %s does not exist. errno=%d: %s. requestAvatarTransfer() fired. return GAIR_WAITFOR", uin, pai->filename, errno, ws_strerror(errno)); return GAIR_WAITFOR; } if ((wParam & GAIF_FORCE) != 0) { if (_wremove(pai->filename) != 0){ - debugLog(L"getavatarinfo(): refresh. _wremove 1 file %s error. errno=%d: %s", pai->filename, errno, _tcserror(errno)); + debugLogW(L"getavatarinfo(): refresh. _wremove 1 file %s error. errno=%d: %s", pai->filename, errno, _tcserror(errno)); wchar_t error[512]; mir_snwprintf(error, TranslateT("Cannot remove old avatar file before refresh. ERROR: %d: %s\n%s"), errno, _tcserror(errno), pai->filename); showpopup(m_tszUserName, error, GG_POPUP_ERROR); @@ -255,7 +255,7 @@ INT_PTR GGPROTO::getavatarinfo(WPARAM wParam, LPARAM lParam) if (AvatarHash == NULL && AvatarSavedHash != NULL) { getAvatarFilename(pai->hContact, pai->filename, _countof(pai->filename)); if (_wremove(pai->filename) != 0){ - debugLog(L"getavatarinfo(): delete. _wremove file %s error. errno=%d: %s", pai->filename, errno, _tcserror(errno)); + debugLogW(L"getavatarinfo(): delete. _wremove file %s error. errno=%d: %s", pai->filename, errno, _tcserror(errno)); wchar_t error[512]; mir_snwprintf(error, TranslateT("Cannot remove old avatar file. ERROR: %d: %s\n%s"), errno, _tcserror(errno), pai->filename); showpopup(m_tszUserName, error, GG_POPUP_ERROR); @@ -302,7 +302,7 @@ INT_PTR GGPROTO::getmyavatar(WPARAM wParam, LPARAM lParam) debugLogA("getmyavatar(): Incoming request for self avatar information. returned ok."); return 0; } else { - debugLog(L"getmyavatar(): Incoming request for self avatar information. saved avatar file %s does not exist. return -1 (error)", szFilename); + debugLogW(L"getmyavatar(): Incoming request for self avatar information. saved avatar file %s does not exist. return -1 (error)", szFilename); return -1; } diff --git a/protocols/Gadu-Gadu/src/sessions.cpp b/protocols/Gadu-Gadu/src/sessions.cpp index cd2225ddad..cdf748a66d 100644 --- a/protocols/Gadu-Gadu/src/sessions.cpp +++ b/protocols/Gadu-Gadu/src/sessions.cpp @@ -417,7 +417,7 @@ BOOL GGPROTO::sessions_closedlg() void GGPROTO::sessions_menus_init(HGENMENU hRoot) { CMenuItem mi; - mi.flags = CMIF_TCHAR; + mi.flags = CMIF_UNICODE; mi.root = hRoot; mi.pszService = GGS_CONCUR_SESS; diff --git a/protocols/Gadu-Gadu/src/userutils.cpp b/protocols/Gadu-Gadu/src/userutils.cpp index 2b8be7fb7a..6fea4ce96e 100644 --- a/protocols/Gadu-Gadu/src/userutils.cpp +++ b/protocols/Gadu-Gadu/src/userutils.cpp @@ -44,7 +44,7 @@ void *gg_doregister(GGPROTO *gg, char *newPass, char *newEmail) (h && !s) ? http_error_string(h->error) : (s ? TranslateT("Registration rejected") : ws_strerror(errno))); MessageBox(NULL, error, gg->m_tszUserName, MB_OK | MB_ICONSTOP); - gg->debugLog(L"gg_doregister(): Cannot register. errno=%d: %s", errno, ws_strerror(errno)); + gg->debugLogW(L"gg_doregister(): Cannot register. errno=%d: %s", errno, ws_strerror(errno)); } else { gg->setDword(GG_KEY_UIN, s->uin); @@ -90,7 +90,7 @@ void *gg_dounregister(GGPROTO *gg, uin_t uin, char *password) (h && !s) ? http_error_string(h->error) : (s ? TranslateT("Bad number or password") : ws_strerror(errno))); MessageBox(NULL, error, gg->m_tszUserName, MB_OK | MB_ICONSTOP); - gg->debugLog(L"gg_dounregister(): Cannot remove account. errno=%d: %s", errno, ws_strerror(errno)); + gg->debugLogW(L"gg_dounregister(): Cannot remove account. errno=%d: %s", errno, ws_strerror(errno)); } else { @@ -142,7 +142,7 @@ void *gg_dochpass(GGPROTO *gg, uin_t uin, char *password, char *newPass) (h && !s) ? http_error_string(h->error) : (s ? TranslateT("Invalid data entered") : ws_strerror(errno))); MessageBox(NULL, error, gg->m_tszUserName, MB_OK | MB_ICONSTOP); - gg->debugLog(L"gg_dochpass(): Cannot change password. errno=%d: %s", errno, ws_strerror(errno)); + gg->debugLogW(L"gg_dochpass(): Cannot change password. errno=%d: %s", errno, ws_strerror(errno)); } else { @@ -183,7 +183,7 @@ void *gg_dochemail(GGPROTO *gg, uin_t uin, char *password, char *email, char *ne mir_snwprintf(error, TranslateT("Your e-mail cannot be changed because of error:\n\t%s"), (h && !s) ? http_error_string(h->error) : (s ? TranslateT("Bad old e-mail or password") : ws_strerror(errno))); MessageBox(NULL, error, gg->m_tszUserName, MB_OK | MB_ICONSTOP); - gg->debugLog(L"gg_dochemail(): Cannot change e-mail. errno=%d: %s", errno, ws_strerror(errno)); + gg->debugLogW(L"gg_dochemail(): Cannot change e-mail. errno=%d: %s", errno, ws_strerror(errno)); } else { -- cgit v1.2.3