diff options
author | George Hazan <george.hazan@gmail.com> | 2016-07-29 12:36:34 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-07-29 12:36:34 +0000 |
commit | 428bf0cbd77813a43094cb5c984436deff251936 (patch) | |
tree | d7dfa8971153d53a849e45c942be97fe5b90b7ec /src | |
parent | 82ef17ca5286f58ae7af604fb9518e8dc496b7c3 (diff) |
no more TCHARs
git-svn-id: http://svn.miranda-ng.org/main/trunk@17143 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
95 files changed, 401 insertions, 401 deletions
diff --git a/src/core/stdaway/src/sendmsg.cpp b/src/core/stdaway/src/sendmsg.cpp index 409e598a07..982820b259 100644 --- a/src/core/stdaway/src/sendmsg.cpp +++ b/src/core/stdaway/src/sendmsg.cpp @@ -89,11 +89,11 @@ static wchar_t* GetAwayMessage(int statusMode, char *szProto) DBVARIANT dbv;
if ( GetStatusModeByte(statusMode, "UsePrev")) {
- if ( db_get_ts(NULL, "SRAway", StatusModeToDbSetting(statusMode, "Msg"), &dbv))
+ if ( db_get_ws(NULL, "SRAway", StatusModeToDbSetting(statusMode, "Msg"), &dbv))
dbv.ptszVal = mir_wstrdup(GetDefaultMessage(statusMode));
}
else {
- if ( db_get_ts(NULL, "SRAway", StatusModeToDbSetting(statusMode, "Default"), &dbv))
+ if ( db_get_ws(NULL, "SRAway", StatusModeToDbSetting(statusMode, "Default"), &dbv))
dbv.ptszVal = mir_wstrdup(GetDefaultMessage(statusMode));
for (int i=0; dbv.ptszVal[i]; i++) {
@@ -272,7 +272,7 @@ static INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wPa wchar_t str[1024];
GetDlgItemText(hwndDlg, IDC_MSG, str, _countof(str));
ChangeAllProtoMessages(dat->szProto, dat->statusMode, str);
- db_set_ts(NULL, "SRAway", StatusModeToDbSetting(dat->statusMode, "Msg"), str);
+ db_set_ws(NULL, "SRAway", StatusModeToDbSetting(dat->statusMode, "Msg"), str);
DestroyWindow(hwndDlg);
}
else PostMessage(hwndDlg, WM_CLOSE, 0, 0);
@@ -395,8 +395,8 @@ static INT_PTR CALLBACK DlgProcAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam dat->info[j].usePrevious = GetStatusModeByte(statusModes[i], "UsePrev");
DBVARIANT dbv;
- if (db_get_ts(NULL, "SRAway", StatusModeToDbSetting(statusModes[i], "Default"), &dbv))
- if (db_get_ts(NULL, "SRAway", StatusModeToDbSetting(statusModes[i], "Msg"), &dbv))
+ if (db_get_ws(NULL, "SRAway", StatusModeToDbSetting(statusModes[i], "Default"), &dbv))
+ if (db_get_ws(NULL, "SRAway", StatusModeToDbSetting(statusModes[i], "Msg"), &dbv))
dbv.ptszVal = mir_wstrdup(GetDefaultMessage(statusModes[i]));
mir_wstrcpy(dat->info[j].msg, dbv.ptszVal);
mir_free(dbv.ptszVal);
@@ -501,7 +501,7 @@ static INT_PTR CALLBACK DlgProcAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam SetStatusModeByte(status, "Ignore", (BYTE)dat->info[i].ignore);
SetStatusModeByte(status, "NoDlg", (BYTE)dat->info[i].noDialog);
SetStatusModeByte(status, "UsePrev", (BYTE)dat->info[i].usePrevious);
- db_set_ts(NULL, "SRAway", StatusModeToDbSetting(status, "Default"), dat->info[i].msg);
+ db_set_ws(NULL, "SRAway", StatusModeToDbSetting(status, "Default"), dat->info[i].msg);
}
return TRUE;
}
diff --git a/src/core/stdchat/src/main.cpp b/src/core/stdchat/src/main.cpp index 430992defb..07859e361a 100644 --- a/src/core/stdchat/src/main.cpp +++ b/src/core/stdchat/src/main.cpp @@ -285,34 +285,34 @@ static void OnLoadSettings() static void RegisterFonts()
{
- ColourIDT colourid = { sizeof(colourid) };
+ ColourIDW colourid = { sizeof(colourid) };
strncpy(colourid.dbSettingsGroup, CHAT_MODULE, sizeof(colourid.dbSettingsGroup));
wcsncpy(colourid.group, LPGENW("Chat module"), _countof(colourid.group));
strncpy(colourid.setting, "ColorLogBG", _countof(colourid.setting));
wcsncpy(colourid.name, LPGENW("Group chat log background"), _countof(colourid.name));
colourid.defcolour = GetSysColor(COLOR_WINDOW);
- ColourRegisterT(&colourid);
+ ColourRegisterW(&colourid);
strncpy(colourid.setting, "ColorMessageBG", _countof(colourid.setting));
wcsncpy(colourid.name, LPGENW("Message background"), _countof(colourid.name));
colourid.defcolour = GetSysColor(COLOR_WINDOW);
- ColourRegisterT(&colourid);
+ ColourRegisterW(&colourid);
strncpy(colourid.setting, "ColorNicklistBG", _countof(colourid.setting));
wcsncpy(colourid.name, LPGENW("Nick list background"), _countof(colourid.name));
colourid.defcolour = GetSysColor(COLOR_WINDOW);
- ColourRegisterT(&colourid);
+ ColourRegisterW(&colourid);
strncpy(colourid.setting, "ColorNicklistLines", _countof(colourid.setting));
wcsncpy(colourid.name, LPGENW("Nick list lines"), _countof(colourid.name));
colourid.defcolour = GetSysColor(COLOR_INACTIVEBORDER);
- ColourRegisterT(&colourid);
+ ColourRegisterW(&colourid);
strncpy(colourid.setting, "ColorNicklistSelectedBG", _countof(colourid.setting));
wcsncpy(colourid.name, LPGENW("Nick list background (selected)"), _countof(colourid.name));
colourid.defcolour = GetSysColor(COLOR_HIGHLIGHT);
- ColourRegisterT(&colourid);
+ ColourRegisterW(&colourid);
}
static int OnCheckPlugins(WPARAM, LPARAM)
diff --git a/src/core/stdchat/src/options.cpp b/src/core/stdchat/src/options.cpp index 79ea5fc3d2..0635bd0b54 100644 --- a/src/core/stdchat/src/options.cpp +++ b/src/core/stdchat/src/options.cpp @@ -161,7 +161,7 @@ static void FillBranch(HWND hwndTree, HTREEITEM hParent, const struct branch_t * tvis.hInsertAfter = TVI_LAST;
tvis.item.mask = TVIF_TEXT | TVIF_STATE;
for (int i = 0; i < nValues; i++) {
- tvis.item.pszText = TranslateTS(branch[i].szDescr);
+ tvis.item.pszText = TranslateW(branch[i].szDescr);
tvis.item.stateMask = TVIS_STATEIMAGEMASK;
if (branch[i].iMode)
iState = ((db_get_dw(NULL, CHAT_MODULE, branch[i].szDBName, defaultval)&branch[i].iMode)&branch[i].iMode) != 0 ? 2 : 1;
@@ -323,7 +323,7 @@ HANDLE GetIconHandle(const char *pszIcoLibName) static void InitSetting(wchar_t** ppPointer, char* pszSetting, wchar_t* pszDefault)
{
DBVARIANT dbv;
- if (!db_get_ts(NULL, CHAT_MODULE, pszSetting, &dbv)) {
+ if (!db_get_ws(NULL, CHAT_MODULE, pszSetting, &dbv)) {
replaceStrW(*ppPointer, dbv.ptszVal);
db_free(&dbv);
}
@@ -574,7 +574,7 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, *p2 = ' ';
p2 = wcschr(ptszText, ',');
}
- db_set_ts(NULL, CHAT_MODULE, "HighlightWords", ptszText);
+ db_set_ws(NULL, CHAT_MODULE, "HighlightWords", ptszText);
mir_free(ptszText);
}
}
@@ -584,7 +584,7 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, if (iLen > 0) {
pszText = (wchar_t *)mir_realloc(pszText, (iLen + 1) * sizeof(wchar_t));
GetDlgItemText(hwndDlg, IDC_LOGDIRECTORY, pszText, iLen + 1);
- db_set_ts(NULL, CHAT_MODULE, "LogDirectory", pszText);
+ db_set_ws(NULL, CHAT_MODULE, "LogDirectory", pszText);
}
else db_unset(NULL, CHAT_MODULE, "LogDirectory");
pci->SM_InvalidateLogDirectories();
@@ -593,7 +593,7 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, if (iLen > 0) {
pszText = (wchar_t *)mir_realloc(pszText, (iLen + 1) * sizeof(wchar_t));
GetDlgItemText(hwndDlg, IDC_LOGTIMESTAMP, pszText, iLen + 1);
- db_set_ts(NULL, CHAT_MODULE, "LogTimestamp", pszText);
+ db_set_ws(NULL, CHAT_MODULE, "LogTimestamp", pszText);
}
else db_unset(NULL, CHAT_MODULE, "LogTimestamp");
@@ -601,7 +601,7 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, if (iLen > 0) {
pszText = (wchar_t *)mir_realloc(pszText, (iLen + 1) * sizeof(wchar_t));
GetDlgItemText(hwndDlg, IDC_TIMESTAMP, pszText, iLen + 1);
- db_set_ts(NULL, CHAT_MODULE, "HeaderTime", pszText);
+ db_set_ws(NULL, CHAT_MODULE, "HeaderTime", pszText);
}
else db_unset(NULL, CHAT_MODULE, "HeaderTime");
@@ -609,7 +609,7 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, if (iLen > 0) {
pszText = (wchar_t *)mir_realloc(pszText, (iLen + 1) * sizeof(wchar_t));
GetDlgItemText(hwndDlg, IDC_INSTAMP, pszText, iLen + 1);
- db_set_ts(NULL, CHAT_MODULE, "HeaderIncoming", pszText);
+ db_set_ws(NULL, CHAT_MODULE, "HeaderIncoming", pszText);
}
else db_unset(NULL, CHAT_MODULE, "HeaderIncoming");
@@ -617,7 +617,7 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, if (iLen > 0) {
pszText = (wchar_t *)mir_realloc(pszText, (iLen + 1) * sizeof(wchar_t));
GetDlgItemText(hwndDlg, IDC_OUTSTAMP, pszText, iLen + 1);
- db_set_ts(NULL, CHAT_MODULE, "HeaderOutgoing", pszText);
+ db_set_ws(NULL, CHAT_MODULE, "HeaderOutgoing", pszText);
}
else db_unset(NULL, CHAT_MODULE, "HeaderOutgoing");
@@ -636,7 +636,7 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, if (iLen > 0) {
pszText = (wchar_t *)mir_realloc(pszText, (iLen + 1) * sizeof(wchar_t));
GetDlgItemText(hwndDlg, IDC_GROUP, pszText, iLen + 1);
- db_set_ts(NULL, CHAT_MODULE, "AddToGroup", pszText);
+ db_set_ws(NULL, CHAT_MODULE, "AddToGroup", pszText);
}
else db_set_s(NULL, CHAT_MODULE, "AddToGroup", "");
mir_free(pszText);
diff --git a/src/core/stdchat/src/tools.cpp b/src/core/stdchat/src/tools.cpp index 3568f75caf..54dd4cb3e8 100644 --- a/src/core/stdchat/src/tools.cpp +++ b/src/core/stdchat/src/tools.cpp @@ -50,7 +50,7 @@ bool LoadMessageFont(LOGFONT *lf, COLORREF *colour) mir_snprintf(str, "SRMFont%d", i);
DBVARIANT dbv;
- if (db_get_ts(NULL, "SRMM", str, &dbv))
+ if (db_get_ws(NULL, "SRMM", str, &dbv))
mir_wstrcpy(lf->lfFaceName, L"Arial");
else {
mir_wstrncpy(lf->lfFaceName, dbv.ptszVal, _countof(lf->lfFaceName));
@@ -160,7 +160,7 @@ UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO AppendMenu(*hMenu, MF_SEPARATOR, 0, 0);
for (int i = 0; i < gcmi.nItems; i++) {
- wchar_t* ptszText = TranslateTS(gcmi.Item[i].pszDesc);
+ wchar_t* ptszText = TranslateW(gcmi.Item[i].pszDesc);
DWORD dwState = gcmi.Item[i].bDisabled ? MF_GRAYED : 0;
if (gcmi.Item[i].uType == MENU_NEWPOPUP) {
diff --git a/src/core/stdchat/src/window.cpp b/src/core/stdchat/src/window.cpp index b6b54681b8..c9525b7723 100644 --- a/src/core/stdchat/src/window.cpp +++ b/src/core/stdchat/src/window.cpp @@ -2236,14 +2236,14 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar case ID_SEARCH_GOOGLE:
if (pszWord[0])
- Utils_OpenUrlT(CMString(FORMAT, L"http://www.google.com/search?q=%s", pszWord));
+ Utils_OpenUrlT(CMStringW(FORMAT, L"http://www.google.com/search?q=%s", pszWord));
PostMessage(hwndDlg, WM_MOUSEACTIVATE, 0, 0);
break;
case ID_SEARCH_WIKIPEDIA:
if (pszWord[0])
- Utils_OpenUrlT(CMString(FORMAT, L"http://en.wikipedia.org/wiki/%s", pszWord));
+ Utils_OpenUrlT(CMStringW(FORMAT, L"http://en.wikipedia.org/wiki/%s", pszWord));
PostMessage(hwndDlg, WM_MOUSEACTIVATE, 0, 0);
break;
@@ -2388,7 +2388,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar pci->SM_AddCommand(si->ptszID, si->pszModule, pszRtf);
- CMString ptszText(ptrW(mir_utf8decodeW(pszRtf)));
+ CMStringW ptszText(ptrW(mir_utf8decodeW(pszRtf)));
pci->DoRtfToTags(ptszText, mi->nColorCount, mi->crColors);
ptszText.Trim();
ptszText.Replace(L"%", L"%%");
diff --git a/src/core/stdclist/src/clcfonts.cpp b/src/core/stdclist/src/clcfonts.cpp index 74c09a7278..dc53eed62d 100644 --- a/src/core/stdclist/src/clcfonts.cpp +++ b/src/core/stdclist/src/clcfonts.cpp @@ -51,7 +51,7 @@ static int FS_FontsChanged(WPARAM, LPARAM) void RegisterCListFonts()
{
- FontIDT fontid = { sizeof(fontid) };
+ FontIDW fontid = { sizeof(fontid) };
fontid.flags = FIDF_DEFAULTVALID | FIDF_ALLOWREREGISTER | FIDF_APPENDNAME | FIDF_NOAS | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS;
strncpy(fontid.dbSettingsGroup, "CLC", sizeof(fontid.dbSettingsGroup));
wcsncpy(fontid.group, LPGENW("Contact list"), _countof(fontid.group));
@@ -76,13 +76,13 @@ void RegisterCListFonts() mir_snprintf(idstr, "Font%d", i);
strncpy(fontid.prefix, idstr, _countof(fontid.prefix));
fontid.order = i;
- FontRegisterT(&fontid);
+ FontRegisterW(&fontid);
}
ReleaseDC(NULL, hdc);
// and colours
- ColourIDT colourid = { 0 };
- colourid.cbSize = sizeof(ColourIDT);
+ ColourIDW colourid = { 0 };
+ colourid.cbSize = sizeof(ColourIDW);
colourid.order = 0;
strncpy(colourid.dbSettingsGroup, "CLC", sizeof(colourid.dbSettingsGroup));
@@ -90,25 +90,25 @@ void RegisterCListFonts() wcsncpy(colourid.name, LPGENW("Background"), _countof(colourid.name));
wcsncpy(colourid.group, LPGENW("Contact list"), _countof(colourid.group));
colourid.defcolour = CLCDEFAULT_BKCOLOUR;
- ColourRegisterT(&colourid);
+ ColourRegisterW(&colourid);
strncpy(colourid.setting, "SelTextColour", sizeof(colourid.setting));
wcsncpy(colourid.name, LPGENW("Selected text"), _countof(colourid.name));
colourid.order = 1;
colourid.defcolour = CLCDEFAULT_SELTEXTCOLOUR;
- ColourRegisterT(&colourid);
+ ColourRegisterW(&colourid);
strncpy(colourid.setting, "HotTextColour", sizeof(colourid.setting));
wcsncpy(colourid.name, LPGENW("Hottrack text"), _countof(colourid.name));
colourid.order = 1;
colourid.defcolour = CLCDEFAULT_HOTTEXTCOLOUR;
- ColourRegisterT(&colourid);
+ ColourRegisterW(&colourid);
strncpy(colourid.setting, "QuickSearchColour", sizeof(colourid.setting));
wcsncpy(colourid.name, LPGENW("Quicksearch text"), _countof(colourid.name));
colourid.order = 1;
colourid.defcolour = CLCDEFAULT_QUICKSEARCHCOLOUR;
- ColourRegisterT(&colourid);
+ ColourRegisterW(&colourid);
HookEvent(ME_FONT_RELOAD, FS_FontsChanged);
}
diff --git a/src/core/stdclist/src/clcopts.cpp b/src/core/stdclist/src/clcopts.cpp index 53d42c65c3..d0c625c2c7 100644 --- a/src/core/stdclist/src/clcopts.cpp +++ b/src/core/stdclist/src/clcopts.cpp @@ -94,7 +94,7 @@ static void FillCheckBoxTree(HWND hwndTree, const struct CheckBoxValues_t *value tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_STATE;
for (int i = 0; i < nValues; i++) {
tvis.item.lParam = values[i].style;
- tvis.item.pszText = TranslateTS(values[i].szDescr);
+ tvis.item.pszText = TranslateW(values[i].szDescr);
tvis.item.stateMask = TVIS_STATEIMAGEMASK;
tvis.item.state = INDEXTOSTATEIMAGEMASK((style & tvis.item.lParam) != 0 ? 2 : 1);
TreeView_InsertItem(hwndTree, &tvis);
diff --git a/src/core/stdclist/src/cluiopts.cpp b/src/core/stdclist/src/cluiopts.cpp index fdd473a268..d911261f71 100644 --- a/src/core/stdclist/src/cluiopts.cpp +++ b/src/core/stdclist/src/cluiopts.cpp @@ -74,7 +74,7 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L }
{ DBVARIANT dbv;
- if (!db_get_ts(NULL, "CList", "TitleText", &dbv)) {
+ if (!db_get_ws(NULL, "CList", "TitleText", &dbv)) {
SetDlgItemText(hwndDlg, IDC_TITLETEXT, dbv.ptszVal);
db_free(&dbv);
}
@@ -172,7 +172,7 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L {
wchar_t title[256];
GetDlgItemText(hwndDlg, IDC_TITLETEXT, title, _countof(title));
- db_set_ts(NULL, "CList", "TitleText", title);
+ db_set_ws(NULL, "CList", "TitleText", title);
SetWindowText(pcli->hwndContactList, title);
}
diff --git a/src/core/stdfile/src/file.cpp b/src/core/stdfile/src/file.cpp index 2d394b6ab0..3de6a7e28a 100644 --- a/src/core/stdfile/src/file.cpp +++ b/src/core/stdfile/src/file.cpp @@ -36,7 +36,7 @@ wchar_t* GetContactID(MCONTACT hContact) {
char *szProto = GetContactProto(hContact);
if (db_get_b(hContact, szProto, "ChatRoom", 0) == 1)
- if (wchar_t *theValue = db_get_tsa(hContact, szProto, "ChatRoomID"))
+ if (wchar_t *theValue = db_get_wsa(hContact, szProto, "ChatRoomID"))
return theValue;
return Contact_GetInfo(CNF_UNIQUEID, hContact, szProto);
@@ -212,7 +212,7 @@ void CopyProtoFileTransferStatus(PROTOFILETRANSFERSTATUS *dest, PROTOFILETRANSFE }
if (src->tszWorkingDir) dest->tszWorkingDir = PFTS_StringToTchar(src->flags, src->tszWorkingDir);
dest->flags &= ~PFTS_UTF;
- dest->flags |= PFTS_TCHAR;
+ dest->flags |= PFTS_UNICODE;
}
void UpdateProtoFileTransferStatus(PROTOFILETRANSFERSTATUS *dest, PROTOFILETRANSFERSTATUS *src)
@@ -266,7 +266,7 @@ void UpdateProtoFileTransferStatus(PROTOFILETRANSFERSTATUS *dest, PROTOFILETRANS dest->currentFileProgress = src->currentFileProgress;
dest->currentFileTime = src->currentFileTime;
dest->flags &= ~PFTS_UTF;
- dest->flags |= PFTS_TCHAR;
+ dest->flags |= PFTS_UNICODE;
}
static void RemoveUnreadFileEvents(void)
diff --git a/src/core/stdfile/src/fileopts.cpp b/src/core/stdfile/src/fileopts.cpp index 93aca138ae..0a021853a4 100644 --- a/src/core/stdfile/src/fileopts.cpp +++ b/src/core/stdfile/src/fileopts.cpp @@ -90,7 +90,7 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L }
DBVARIANT dbv;
- if (db_get_ts(NULL, "SRFile", "ScanCmdLine", &dbv) == 0) {
+ if (db_get_ws(NULL, "SRFile", "ScanCmdLine", &dbv) == 0) {
SetDlgItemText(hwndDlg, IDC_SCANCMDLINE, dbv.ptszVal);
db_free(&dbv);
}
@@ -165,7 +165,7 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L wchar_t str[MAX_PATH + 2];
GetDlgItemText(hwndDlg, IDC_SCANCMDLINE, str, _countof(str));
- CMString tszFilter;
+ CMStringW tszFilter;
tszFilter.AppendFormat(L"%s (*.exe)%c*.exe%c", TranslateT("Executable files"), 0, 0);
tszFilter.AppendFormat(L"%s (*)%c*%c", TranslateT("All files"), 0, 0);
@@ -205,14 +205,14 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L wchar_t str[512];
GetDlgItemText(hwndDlg, IDC_FILEDIR, str, _countof(str));
RemoveInvalidPathChars(str);
- db_set_ts(NULL, "SRFile", "RecvFilesDirAdv", str);
+ db_set_ws(NULL, "SRFile", "RecvFilesDirAdv", str);
db_set_b(NULL, "SRFile", "AutoAccept", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOACCEPT));
db_set_b(NULL, "SRFile", "AutoMin", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOMIN));
db_set_b(NULL, "SRFile", "AutoClose", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOCLOSE));
db_set_b(NULL, "SRFile", "AutoClear", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOCLEAR));
db_set_b(NULL, "SRFile", "UseScanner", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_SCANAFTERDL) ? VIRUSSCAN_AFTERDL : (IsDlgButtonChecked(hwndDlg, IDC_SCANDURINGDL) ? VIRUSSCAN_DURINGDL : VIRUSSCAN_DISABLE)));
GetDlgItemText(hwndDlg, IDC_SCANCMDLINE, str, _countof(str));
- db_set_ts(NULL, "SRFile", "ScanCmdLine", str);
+ db_set_ws(NULL, "SRFile", "ScanCmdLine", str);
db_set_b(NULL, "SRFile", "WarnBeforeOpening", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_WARNBEFOREOPENING));
db_set_b(NULL, "SRFile", "IfExists", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ASK) ? FILERESUME_ASK : (IsDlgButtonChecked(hwndDlg, IDC_RESUME) ? FILERESUME_RESUMEALL : (IsDlgButtonChecked(hwndDlg, IDC_OVERWRITE) ? FILERESUME_OVERWRITEALL : FILERESUME_RENAMEALL))));
return TRUE;
diff --git a/src/core/stdfile/src/filerecvdlg.cpp b/src/core/stdfile/src/filerecvdlg.cpp index 06f182cd42..660b717bae 100644 --- a/src/core/stdfile/src/filerecvdlg.cpp +++ b/src/core/stdfile/src/filerecvdlg.cpp @@ -125,7 +125,7 @@ void GetContactReceivedFilesDir(MCONTACT hContact, wchar_t *szDir, int cchDir, B {
wchar_t tszTemp[MAX_PATH];
- ptrW tszRecvPath(db_get_tsa(NULL, "SRFile", "RecvFilesDirAdv"));
+ ptrW tszRecvPath(db_get_wsa(NULL, "SRFile", "RecvFilesDirAdv"));
if (tszRecvPath)
wcsncpy_s(tszTemp, tszRecvPath, _TRUNCATE);
else
@@ -165,7 +165,7 @@ void GetReceivedFilesDir(wchar_t *szDir, int cchDir) {
wchar_t tszTemp[MAX_PATH];
- ptrW tszRecvPath(db_get_tsa(NULL, "SRFile", "RecvFilesDirAdv"));
+ ptrW tszRecvPath(db_get_wsa(NULL, "SRFile", "RecvFilesDirAdv"));
if (tszRecvPath)
wcsncpy_s(tszTemp, tszRecvPath, _TRUNCATE);
else
@@ -214,7 +214,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l mir_snprintf(idstr, "MruDir%d", i);
DBVARIANT dbv;
- if (db_get_ts(NULL, "SRFile", idstr, &dbv))
+ if (db_get_ws(NULL, "SRFile", idstr, &dbv))
break;
SendDlgItemMessage(hwndDlg, IDC_FILEDIR, CB_ADDSTRING, 0, (LPARAM)dbv.ptszVal);
db_free(&dbv);
@@ -237,8 +237,8 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l unsigned len = (unsigned)mir_strlen(str) + 1;
if (len + 4 < dbei.cbBlob) {
str += len;
- ptrW ptszDescription(DbGetEventStringT(&dbei, str));
- SetDlgItemText(hwndDlg, IDC_MSG, ptszDescription);
+ ptrW pwszDescription(DbGetEventStringT(&dbei, str));
+ SetDlgItemText(hwndDlg, IDC_MSG, pwszDescription);
}
}
else DestroyWindow(hwndDlg);
@@ -313,12 +313,12 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l DBVARIANT dbv;
for (i = MAX_MRU_DIRS-2;i>=0;i--) {
mir_snprintf(idstr, "MruDir%d", i);
- if (db_get_ts(NULL, "SRFile", idstr, &dbv)) continue;
+ if (db_get_ws(NULL, "SRFile", idstr, &dbv)) continue;
mir_snprintf(idstr, "MruDir%d", i+1);
- db_set_ts(NULL, "SRFile", idstr, dbv.ptszVal);
+ db_set_ws(NULL, "SRFile", idstr, dbv.ptszVal);
db_free(&dbv);
}
- db_set_ts(NULL, "SRFile", idstr, szRecvDir);
+ db_set_ws(NULL, "SRFile", idstr, szRecvDir);
}
}
EnableWindow(GetDlgItem(hwndDlg, IDC_FILENAMES), FALSE);
diff --git a/src/core/stdfile/src/filesenddlg.cpp b/src/core/stdfile/src/filesenddlg.cpp index 4c6089c8c5..3148d36c59 100644 --- a/src/core/stdfile/src/filesenddlg.cpp +++ b/src/core/stdfile/src/filesenddlg.cpp @@ -49,7 +49,7 @@ static void SetFileListAndSizeControls(HWND hwndDlg, FileDlgData *dat) if (i > 1) {
wchar_t szFormat[32];
if (fileCount && dirCount) {
- mir_snwprintf(szFormat, L"%s, %s", TranslateTS(fileCount == 1 ? L"%d file" : L"%d files"), TranslateTS(dirCount == 1 ? L"%d directory" : L"%d directories"));
+ mir_snwprintf(szFormat, L"%s, %s", TranslateW(fileCount == 1 ? L"%d file" : L"%d files"), TranslateW(dirCount == 1 ? L"%d directory" : L"%d directories"));
mir_snwprintf(str, szFormat, fileCount, dirCount);
}
else if (fileCount) {
diff --git a/src/core/stdfile/src/filexferdlg.cpp b/src/core/stdfile/src/filexferdlg.cpp index ed513f02bb..810587b75e 100644 --- a/src/core/stdfile/src/filexferdlg.cpp +++ b/src/core/stdfile/src/filexferdlg.cpp @@ -95,7 +95,7 @@ void FillSendData(FileDlgData *dat, DBEVENTINFO& dbei) static void __cdecl RunVirusScannerThread(struct virusscanthreadstartinfo *info) { DBVARIANT dbv; - if (!db_get_ts(NULL, "SRFile", "ScanCmdLine", &dbv)) { + if (!db_get_ws(NULL, "SRFile", "ScanCmdLine", &dbv)) { if (dbv.ptszVal[0]) { STARTUPINFO si = { 0 }; si.cb = sizeof(si); @@ -168,8 +168,8 @@ static void SetFilenameControls(HWND hwndDlg, FileDlgData *dat, PROTOFILETRANSFE enum { FTS_TEXT, FTS_PROGRESS, FTS_OPEN }; static void SetFtStatus(HWND hwndDlg, wchar_t *text, int mode) { - SetDlgItemText(hwndDlg, IDC_STATUS, TranslateTS(text)); - SetDlgItemText(hwndDlg, IDC_TRANSFERCOMPLETED, TranslateTS(text)); + SetDlgItemText(hwndDlg, IDC_STATUS, TranslateW(text)); + SetDlgItemText(hwndDlg, IDC_TRANSFERCOMPLETED, TranslateW(text)); ShowWindow(GetDlgItem(hwndDlg, IDC_STATUS), (mode == FTS_TEXT) ? SW_SHOW : SW_HIDE); ShowWindow(GetDlgItem(hwndDlg, IDC_ALLFILESPROGRESS), (mode == FTS_PROGRESS) ? SW_SHOW : SW_HIDE); @@ -245,7 +245,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR ShowWindow(GetDlgItem(hwndDlg, IDC_OPENFOLDER), SW_HIDE); } else { //recv - CreateDirectoryTreeT(dat->szSavePath); + CreateDirectoryTreeW(dat->szSavePath); dat->fs = (HANDLE)ProtoChainSend(dat->hContact, PSS_FILEALLOW, (WPARAM)dat->fs, (LPARAM)dat->szSavePath); dat->transferStatus.tszWorkingDir = mir_wstrdup(dat->szSavePath); if (db_get_b(dat->hContact, "CList", "NotOnList", 0)) dat->resumeBehaviour = FILERESUME_ASK; diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index 0c68e5b22d..2c335fec1a 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -763,7 +763,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l //restore saved msg if any...
if (dat->hContact) {
DBVARIANT dbv;
- if (!db_get_ts(dat->hContact, SRMSGMOD, DBSAVEDMSG, &dbv)) {
+ if (!db_get_ws(dat->hContact, SRMSGMOD, DBSAVEDMSG, &dbv)) {
if (dbv.ptszVal[0]) {
SetDlgItemText(hwndDlg, IDC_MESSAGE, dbv.ptszVal);
EnableWindow(GetDlgItem(hwndDlg, IDOK), TRUE);
@@ -1589,7 +1589,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l wchar_t *msg = (wchar_t*)alloca(sizeof(wchar_t)*len);
GetDlgItemText(hwndDlg, IDC_MESSAGE, msg, len);
if (msg[0])
- db_set_ts(dat->hContact, SRMSGMOD, DBSAVEDMSG, msg);
+ db_set_ws(dat->hContact, SRMSGMOD, DBSAVEDMSG, msg);
else
db_unset(dat->hContact, SRMSGMOD, DBSAVEDMSG);
}
diff --git a/src/core/stdmsg/src/msglog.cpp b/src/core/stdmsg/src/msglog.cpp index 7096284dac..4771ce1622 100644 --- a/src/core/stdmsg/src/msglog.cpp +++ b/src/core/stdmsg/src/msglog.cpp @@ -305,7 +305,7 @@ static char* CreateRTFFromDbEvent(SrmmWindowData *dat, MCONTACT hContact, MEVENT AppendToBufferWithRTF(buffer, szName);
AppendToBufferWithRTF(buffer, L" ");
- msg = DbGetEventTextT(&dbei, CP_ACP);
+ msg = DbGetEventTextW(&dbei, CP_ACP);
if (msg) {
AppendToBufferWithRTF(buffer, msg);
mir_free(msg);
@@ -334,7 +334,7 @@ static char* CreateRTFFromDbEvent(SrmmWindowData *dat, MCONTACT hContact, MEVENT case EVENTTYPE_MESSAGE:
default:
- msg = DbGetEventTextT(&dbei, CP_ACP);
+ msg = DbGetEventTextW(&dbei, CP_ACP);
buffer.AppendFormat(" %s ", SetToStyle((dbei.eventType == EVENTTYPE_MESSAGE) ? ((dbei.flags & DBEF_SENT) ? MSGFONTID_MYMSG : MSGFONTID_YOURMSG) : MSGFONTID_NOTICE));
AppendToBufferWithRTF(buffer, msg);
mir_free(msg);
diff --git a/src/core/stdmsg/src/msgoptions.cpp b/src/core/stdmsg/src/msgoptions.cpp index f5968b5cce..5fb40206cf 100644 --- a/src/core/stdmsg/src/msgoptions.cpp +++ b/src/core/stdmsg/src/msgoptions.cpp @@ -81,7 +81,7 @@ bool LoadMsgDlgFont(int i, LOGFONT* lf, COLORREF * colour) mir_snprintf(str, "SRMFont%d", i);
DBVARIANT dbv;
- if (db_get_ts(NULL, SRMMMOD, str, &dbv))
+ if (db_get_ws(NULL, SRMMMOD, str, &dbv))
wcsncpy(lf->lfFaceName, fontOptionsList[i].szDefFace, _countof(lf->lfFaceName)-1);
else {
mir_wstrncpy(lf->lfFaceName, dbv.ptszVal, _countof(lf->lfFaceName));
@@ -97,7 +97,7 @@ void RegisterSRMMFonts(void) {
char idstr[10];
- FontIDT fontid = { sizeof(fontid) };
+ FontIDW fontid = { sizeof(fontid) };
fontid.flags = FIDF_ALLOWREREGISTER | FIDF_DEFAULTVALID;
for (int i = 0; i < _countof(fontOptionsList); i++) {
strncpy_s(fontid.dbSettingsGroup, SRMMMOD, _TRUNCATE);
@@ -117,16 +117,16 @@ void RegisterSRMMFonts(void) fontid.deffontsettings.charset = MsgDlgGetFontDefaultCharset(fontOptionsList[i].szDefFace);
wcsncpy_s(fontid.backgroundGroup, LPGENW("Message log"), _TRUNCATE);
wcsncpy_s(fontid.backgroundName, LPGENW("Background"), _TRUNCATE);
- FontRegisterT(&fontid);
+ FontRegisterW(&fontid);
}
- ColourIDT colourid = { sizeof(colourid) };
+ ColourIDW colourid = { sizeof(colourid) };
strncpy_s(colourid.dbSettingsGroup, SRMMMOD, _TRUNCATE);
strncpy_s(colourid.setting, SRMSGSET_BKGCOLOUR, _TRUNCATE);
colourid.defcolour = SRMSGDEFSET_BKGCOLOUR;
wcsncpy_s(colourid.name, LPGENW("Background"), _TRUNCATE);
wcsncpy_s(colourid.group, LPGENW("Message log"), _TRUNCATE);
- ColourRegisterT(&colourid);
+ ColourRegisterW(&colourid);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -158,7 +158,7 @@ static void FillCheckBoxTree(HWND hwndTree, const struct CheckBoxValues_t *value tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_STATE;
for (int i = 0; i < nValues; i++) {
tvis.item.lParam = values[i].style;
- tvis.item.pszText = TranslateTS(values[i].szDescr);
+ tvis.item.pszText = TranslateW(values[i].szDescr);
tvis.item.stateMask = TVIS_STATEIMAGEMASK;
tvis.item.state = INDEXTOSTATEIMAGEMASK((style & tvis.item.lParam) != 0 ? 2 : 1);
TreeView_InsertItem(hwndTree, &tvis);
diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp index 2737384610..b38fea7b07 100644 --- a/src/core/stdmsg/src/msgs.cpp +++ b/src/core/stdmsg/src/msgs.cpp @@ -407,7 +407,7 @@ static wchar_t tszError[] = LPGENW("Miranda could not load the built-in message int LoadSendRecvMessageModule(void)
{
if ((hMsftEdit = LoadLibrary(L"Msftedit.dll")) == NULL) {
- if (IDYES != MessageBox(0, TranslateTS(tszError), TranslateT("Information"), MB_YESNO | MB_ICONINFORMATION))
+ if (IDYES != MessageBox(0, TranslateW(tszError), TranslateT("Information"), MB_YESNO | MB_ICONINFORMATION))
return 1;
return 0;
}
diff --git a/src/core/stduihist/src/history.cpp b/src/core/stduihist/src/history.cpp index 193e730b19..d87b602c8d 100644 --- a/src/core/stduihist/src/history.cpp +++ b/src/core/stduihist/src/history.cpp @@ -39,7 +39,7 @@ static HGENMENU hContactMenu = 0; static void GetMessageDescription(DBEVENTINFO *dbei, wchar_t* buf, int cbBuf)
{
- wchar_t *msg = DbGetEventTextT(dbei, CP_ACP);
+ wchar_t *msg = DbGetEventTextW(dbei, CP_ACP);
wcsncpy(buf, msg ? msg : TranslateT("Invalid message"), cbBuf);
buf[ cbBuf-1 ] = 0;
mir_free(msg);
@@ -118,7 +118,7 @@ static void GetObjectSummary(DBEVENTINFO *dbei, wchar_t* str, int cbStr) DBEVENTTYPEDESCR* et = (DBEVENTTYPEDESCR*)CallService(MS_DB_EVENT_GETTYPE, (WPARAM)dbei->szModule, (LPARAM)dbei->eventType);
if (et && (et->flags & DETF_HISTORY)) {
pszTmp = mir_a2u(et->descr);
- pszSrc = TranslateTS(pszTmp);
+ pszSrc = TranslateW(pszTmp);
break;
}
*str = 0;
diff --git a/src/core/stduserinfo/src/contactinfo.cpp b/src/core/stduserinfo/src/contactinfo.cpp index ca14e50201..79511853a8 100644 --- a/src/core/stduserinfo/src/contactinfo.cpp +++ b/src/core/stduserinfo/src/contactinfo.cpp @@ -274,13 +274,13 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP lvi.iItem = 0;
for (i = -1;; i++) {
if (i == -1) {
- if (db_get_ts(hContact, szProto, "e-mail", &dbv))
+ if (db_get_ws(hContact, szProto, "e-mail", &dbv))
continue;
lvi.pszText = TranslateT("Primary");
}
else {
mir_snprintf(idstr, "e-mail%d", i);
- if (db_get_ts(hContact, szProto, idstr, &dbv))
+ if (db_get_ws(hContact, szProto, idstr, &dbv))
break;
lvi.pszText = idstr2;
@@ -295,7 +295,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP for (i = 0;; i++) {
lvi.lParam = i;
mir_snprintf(idstr, "Mye-mail%d", i);
- if (db_get_ts(hContact, "UserInfo", idstr, &dbv))
+ if (db_get_ws(hContact, "UserInfo", idstr, &dbv))
break;
lvi.pszText = idstr2;
mir_snwprintf(idstr2, TranslateT("Custom %d"), i + 1);
@@ -313,21 +313,21 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP lvi.lParam = -1;
lvi.iSubItem = 0;
lvi.iItem = 0;
- if (!db_get_ts(hContact, szProto, "Phone", &dbv)) {
+ if (!db_get_ws(hContact, szProto, "Phone", &dbv)) {
lvi.pszText = TranslateT("Primary");
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
db_free(&dbv);
lvi.iItem++;
}
- if (!db_get_ts(hContact, szProto, "Fax", &dbv)) {
+ if (!db_get_ws(hContact, szProto, "Fax", &dbv)) {
lvi.pszText = TranslateT("Fax");
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
db_free(&dbv);
lvi.iItem++;
}
- if (!db_get_ts(hContact, szProto, "Cellular", &dbv)) {
+ if (!db_get_ws(hContact, szProto, "Cellular", &dbv)) {
lvi.pszText = TranslateT("Mobile");
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
if (mir_strlen(dbv.pszVal) > 4 && !mir_strcmp(dbv.pszVal + mir_strlen(dbv.pszVal) - 4, " SMS")) {
@@ -338,14 +338,14 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP db_free(&dbv);
lvi.iItem++;
}
- if (!db_get_ts(hContact, szProto, "CompanyPhone", &dbv)) {
+ if (!db_get_ws(hContact, szProto, "CompanyPhone", &dbv)) {
lvi.pszText = TranslateT("Work phone");
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
db_free(&dbv);
lvi.iItem++;
}
- if (!db_get_ts(hContact, szProto, "CompanyFax", &dbv)) {
+ if (!db_get_ws(hContact, szProto, "CompanyFax", &dbv)) {
lvi.pszText = TranslateT("Work fax");
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
@@ -356,7 +356,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP for (i = 0;; i++) {
lvi.lParam = i;
mir_snprintf(idstr, "MyPhone%d", i);
- if (db_get_ts(hContact, "UserInfo", idstr, &dbv))
+ if (db_get_ws(hContact, "UserInfo", idstr, &dbv))
break;
lvi.pszText = idstr2;
mir_snwprintf(idstr2, TranslateT("Custom %d"), i + 1);
diff --git a/src/core/stduserinfo/src/stdinfo.cpp b/src/core/stduserinfo/src/stdinfo.cpp index bd2420bdca..fd3ae677bc 100644 --- a/src/core/stduserinfo/src/stdinfo.cpp +++ b/src/core/stduserinfo/src/stdinfo.cpp @@ -47,11 +47,11 @@ static int Proto_GetContactInfoSetting(MCONTACT hContact, const char *szProto, c static wchar_t* Proto_GetContactInfoSettingStr(bool proto_service, MCONTACT hContact, const char *szModule, const char *szSetting)
{
if (!proto_service)
- return db_get_tsa(hContact, szModule, szSetting);
+ return db_get_wsa(hContact, szModule, szSetting);
DBVARIANT dbv;
DBCONTACTGETSETTING cgs = { szModule, szSetting, &dbv };
- dbv.type = DBVT_TCHAR;
+ dbv.type = DBVT_WCHAR;
if (CallProtoService(szModule, PS_GETINFOSETTING, hContact, (LPARAM)&cgs))
return NULL;
@@ -148,7 +148,7 @@ static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule if (wSave == (WORD)-1) {
char szSettingName[100];
mir_snprintf(szSettingName, "%sName", szSetting);
- if (!db_get_ts(hContact, szModule, szSettingName, &dbv)) {
+ if (!db_get_ws(hContact, szModule, szSettingName, &dbv)) {
ptstr = dbv.ptszVal;
unspecified = false;
break;
@@ -185,7 +185,7 @@ static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule if (!unspecified) {
WCHAR *wszStr;
Utf8Decode(dbv.pszVal, &wszStr);
- SetDlgItemTextW(hwndDlg, idCtrl, TranslateTS(wszStr));
+ SetDlgItemTextW(hwndDlg, idCtrl, TranslateW(wszStr));
mir_free(wszStr);
goto LBL_Exit;
}
@@ -446,7 +446,7 @@ static INT_PTR CALLBACK BackgroundDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, if (tszColText == NULL)
break;
mir_snprintf(idstr, "Past%dText", i);
- ptrW tszText(db_get_tsa(hContact, szProto, idstr));
+ ptrW tszText(db_get_wsa(hContact, szProto, idstr));
if (tszText == NULL)
break;
@@ -463,7 +463,7 @@ static INT_PTR CALLBACK BackgroundDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, if (tszColText == NULL)
break;
mir_snprintf(idstr, "Affiliation%dText", i);
- ptrW tszText(db_get_tsa(hContact, szProto, idstr));
+ ptrW tszText(db_get_wsa(hContact, szProto, idstr));
if (tszText == NULL)
break;
@@ -486,7 +486,7 @@ static INT_PTR CALLBACK BackgroundDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, if (tszColText == NULL)
break;
mir_snprintf(idstr, "Interest%dText", i);
- ptrW tszText(db_get_tsa(hContact, szProto, idstr));
+ ptrW tszText(db_get_wsa(hContact, szProto, idstr));
if (tszText == NULL)
break;
@@ -548,7 +548,7 @@ static INT_PTR CALLBACK NotesDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR HFONT hFont = CreateFontIndirect(&lf);
SendDlgItemMessage(hwndDlg, IDC_ABOUT, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0));
- ptrW szNotes(db_get_tsa(lParam, "UserInfo", "MyNotes"));
+ ptrW szNotes(db_get_wsa(lParam, "UserInfo", "MyNotes"));
if (szNotes != nullptr)
SetDlgItemText(hwndDlg, IDC_MYNOTES, szNotes);
}
diff --git a/src/core/stduserinfo/src/userinfo.cpp b/src/core/stduserinfo/src/userinfo.cpp index bcb7e20a39..82ce214f67 100644 --- a/src/core/stduserinfo/src/userinfo.cpp +++ b/src/core/stduserinfo/src/userinfo.cpp @@ -66,12 +66,12 @@ struct DetailsData wchar_t* getTitle(OPTIONSDIALOGPAGE *p)
{
- return (p->flags & ODPF_DONTTRANSLATE) ? p->pwszTitle : TranslateTH(p->hLangpack, p->pwszTitle);
+ return (p->flags & ODPF_DONTTRANSLATE) ? p->pwszTitle : TranslateW_LP(p->pwszTitle, p->hLangpack);
}
wchar_t* getTab(OPTIONSDIALOGPAGE *p)
{
- return (p->flags & ODPF_DONTTRANSLATE) ? p->pwszTab : TranslateTH(p->hLangpack, p->pwszTab);
+ return (p->flags & ODPF_DONTTRANSLATE) ? p->pwszTab : TranslateW_LP(p->pwszTab, p->hLangpack);
}
static int PageSortProc(OPTIONSDIALOGPAGE *item1, OPTIONSDIALOGPAGE *item2)
@@ -183,7 +183,7 @@ static void CreateDetailsTabs(HWND hwndDlg, DetailsData *dat, DetailsPageData *p if (!odp.ptszTab || mir_wstrcmp(odp.ptszTitle, ppg->ptszTitle))
continue;
- tie.pszText = TranslateTH(odp.hLangpack, odp.ptszTab);
+ tie.pszText = TranslateW_LP(odp.ptszTab, odp.hLangpack);
tie.lParam = i;
TabCtrl_InsertItem(hwndTab, pages, &tie);
if (!mir_wstrcmp(odp.ptszTab, ppg->ptszTab))
@@ -268,7 +268,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP LPTSTR ptszLastTab;
DBVARIANT dbv;
- if (!db_get_ts(NULL, "UserInfo", "LastTab", &dbv)) {
+ if (!db_get_ws(NULL, "UserInfo", "LastTab", &dbv)) {
ptszLastTab = NEWWSTR_ALLOCA(dbv.ptszVal);
db_free(&dbv);
}
@@ -306,7 +306,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (odp[i].flags & ODPF_DONTTRANSLATE)
tvis.item.pszText = p.ptszTitle;
else
- tvis.item.pszText = TranslateTH(p.hLangpack, p.ptszTitle);
+ tvis.item.pszText = TranslateW_LP(p.ptszTitle, p.hLangpack);
if (ptszLastTab && !mir_wstrcmp(tvis.item.pszText, ptszLastTab))
dat->currentPage = i;
p.hItem = TreeView_InsertItem(hwndTree, &tvis);
@@ -587,7 +587,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP tvi.pszText = name;
tvi.cchTextMax = _countof(name);
TreeView_GetItem(GetDlgItem(hwndDlg, IDC_PAGETREE), &tvi);
- db_set_ts(NULL, "UserInfo", "LastTab", name);
+ db_set_ws(NULL, "UserInfo", "LastTab", name);
Window_FreeIcon_IcoLib(hwndDlg);
SendDlgItemMessage(hwndDlg, IDC_NAME, WM_SETFONT, SendDlgItemMessage(hwndDlg, IDC_WHITERECT, WM_GETFONT, 0, 0), 0);
diff --git a/src/mir_app/src/ExtraIconGroup.cpp b/src/mir_app/src/ExtraIconGroup.cpp index 7101175272..1057ab073e 100644 --- a/src/mir_app/src/ExtraIconGroup.cpp +++ b/src/mir_app/src/ExtraIconGroup.cpp @@ -38,7 +38,7 @@ void ExtraIconGroup::addExtraIcon(BaseExtraIcon *extra) {
m_items.insert(extra);
- CMString description;
+ CMStringW description;
for (int i = 0; i < m_items.getCount(); i++) {
if (i > 0)
description += L" / ";
diff --git a/src/mir_app/src/FontOptions.cpp b/src/mir_app/src/FontOptions.cpp index 30a6aa4d5e..b415cc284b 100644 --- a/src/mir_app/src/FontOptions.cpp +++ b/src/mir_app/src/FontOptions.cpp @@ -121,7 +121,7 @@ int __inline DrawTextWithEffect(HDC hdc, LPCTSTR lpchText, int cchText, RECT * l #define FSUI_FONTFRAMEVERT 4
#define FSUI_FONTLEFT (FSUI_COLORBOXLEFT+FSUI_COLORBOXWIDTH+5)
-void UpdateFontSettings(FontIDW *font_id, FontSettingsT *fontsettings);
+void UpdateFontSettings(FontIDW *font_id, FontSettingsW *fontsettings);
void UpdateColourSettings(ColourIDW *colour_id, COLORREF *colour);
void UpdateEffectSettings(EffectIDW *effect_id, FONTEFFECT* effectsettings);
@@ -340,7 +340,7 @@ static void sttFsuiCreateSettingsTreeNode(HWND hwndTree, const wchar_t *groupNam if (sectionName = wcschr(sectionName, '/'))
*sectionName = 0;
- pItemName = TranslateTH(_hLang, pItemName);
+ pItemName = TranslateW_LP(pItemName, _hLang);
hItem = sttFindNamedTreeItemAt(hwndTree, hSection, pItemName);
if (!sectionName || !hItem) {
@@ -448,7 +448,7 @@ static INT_PTR CALLBACK ChooseEffectDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wPar pEffect = (FONTEFFECT*)lParam;
{
for (int i = 0; i < _countof(ModernEffectNames); i++) {
- int itemid = SendDlgItemMessage(hwndDlg, IDC_EFFECT_COMBO, CB_ADDSTRING, 0, (LPARAM)TranslateTS(ModernEffectNames[i]));
+ int itemid = SendDlgItemMessage(hwndDlg, IDC_EFFECT_COMBO, CB_ADDSTRING, 0, (LPARAM)TranslateW(ModernEffectNames[i]));
SendDlgItemMessage(hwndDlg, IDC_EFFECT_COMBO, CB_SETITEMDATA, itemid, i);
SendDlgItemMessage(hwndDlg, IDC_EFFECT_COMBO, CB_SETCURSEL, 0, 0);
}
@@ -505,7 +505,7 @@ static void sttSaveFontData(HWND hwndDlg, FontInternal &F) else
strncpy_s(str, F.prefix, _TRUNCATE);
- if (db_set_ts(NULL, F.dbSettingsGroup, str, F.value.szFace)) {
+ if (db_set_ws(NULL, F.dbSettingsGroup, str, F.value.szFace)) {
char buff[1024];
WideCharToMultiByte(code_page, 0, F.value.szFace, -1, buff, 1024, 0, 0);
db_set_s(NULL, F.dbSettingsGroup, str, buff);
diff --git a/src/mir_app/src/FontService.cpp b/src/mir_app/src/FontService.cpp index 6e1d678965..58aefe7638 100644 --- a/src/mir_app/src/FontService.cpp +++ b/src/mir_app/src/FontService.cpp @@ -95,24 +95,24 @@ int LoadFontserviceModule(void) hColourReloadEvent = CreateHookableEvent(ME_COLOUR_RELOAD);
// create generic fonts
- FontIDT fontid = { sizeof(fontid) };
+ FontIDW fontid = { sizeof(fontid) };
strncpy(fontid.dbSettingsGroup, "Fonts", sizeof(fontid.dbSettingsGroup));
wcsncpy_s(fontid.group, LPGENW("General"), _TRUNCATE);
wcsncpy_s(fontid.name, LPGENW("Headers"), _TRUNCATE);
fontid.flags = FIDF_APPENDNAME | FIDF_NOAS | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS | FIDF_CLASSHEADER;
strncpy(fontid.prefix, "Header", _countof(fontid.prefix));
- FontRegisterT(&fontid);
+ FontRegisterW(&fontid);
wcsncpy_s(fontid.name, LPGENW("Generic text"), _TRUNCATE);
fontid.flags = FIDF_APPENDNAME | FIDF_NOAS | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS | FIDF_CLASSGENERAL;
strncpy(fontid.prefix, "Generic", _countof(fontid.prefix));
- FontRegisterT(&fontid);
+ FontRegisterW(&fontid);
wcsncpy_s(fontid.name, LPGENW("Small text"), _TRUNCATE);
fontid.flags = FIDF_APPENDNAME | FIDF_NOAS | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS | FIDF_CLASSSMALL;
strncpy(fontid.prefix, "Small", _countof(fontid.prefix));
- FontRegisterT(&fontid);
+ FontRegisterW(&fontid);
// do last for silly dyna plugin
HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
diff --git a/src/mir_app/src/FontService.h b/src/mir_app/src/FontService.h index 9a1ea0c9d0..55d58f4089 100644 --- a/src/mir_app/src/FontService.h +++ b/src/mir_app/src/FontService.h @@ -26,12 +26,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // a font identifier structure - used for registering a font, and getting one out again
-struct FontInternal : public FontIDT
+struct FontInternal : public FontIDW
{
- FontSettingsT value;
+ FontSettingsW value;
int hLangpack;
- __inline wchar_t* getName() const { return TranslateTH(hLangpack, name); }
+ __inline wchar_t* getName() const { return TranslateW_LP(name, hLangpack); }
__inline bool isHeader() const
{
@@ -45,17 +45,17 @@ struct FontInternal : public FontIDT }
};
-struct ColourInternal : public ColourIDT
+struct ColourInternal : public ColourIDW
{
- __inline wchar_t* getName() const { return TranslateTH(hLangpack, name); }
+ __inline wchar_t* getName() const { return TranslateW_LP(name, hLangpack); }
COLORREF value;
int hLangpack;
};
-struct EffectInternal : public EffectIDT
+struct EffectInternal : public EffectIDW
{
- __inline wchar_t* getName() const { return TranslateTH(hLangpack, name); }
+ __inline wchar_t* getName() const { return TranslateW_LP(name, hLangpack); }
int hLangpack;
};
@@ -77,4 +77,4 @@ extern OBJLIST<EffectInternal> effect_id_list; extern int code_page;
extern HANDLE hFontReloadEvent, hColourReloadEvent;
-int CreateFromFontSettings(FontSettingsT *fs, LOGFONT *lf);
+int CreateFromFontSettings(FontSettingsW *fs, LOGFONT *lf);
diff --git a/src/mir_app/src/IcoLib.h b/src/mir_app/src/IcoLib.h index 5510e92996..1356762945 100644 --- a/src/mir_app/src/IcoLib.h +++ b/src/mir_app/src/IcoLib.h @@ -78,7 +78,7 @@ struct IcolibItem : public MZeroedObject char* name;
SectionItem* section;
int orderID;
- wchar_t* description;
+ wchar_t* description;
IconSourceFile* default_file;
int default_indx;
int cx, cy;
@@ -88,12 +88,12 @@ struct IcolibItem : public MZeroedObject IconSourceItem* source_big;
IconSourceItem* default_icon;
- wchar_t* temp_file;
+ wchar_t* temp_file;
HICON temp_icon;
BOOL temp_reset;
__inline ~IcolibItem() { clear(); }
- __inline wchar_t* getDescr() const { return TranslateTH(hLangpack, description); }
+ __inline wchar_t* getDescr() const { return TranslateW_LP(description, hLangpack); }
void clear();
};
diff --git a/src/mir_app/src/addcontact.cpp b/src/mir_app/src/addcontact.cpp index fb6380f9e7..7b049000c0 100644 --- a/src/mir_app/src/addcontact.cpp +++ b/src/mir_app/src/addcontact.cpp @@ -110,7 +110,7 @@ public: }
if (szName && szName[0])
- SetCaption(CMString(FORMAT, TranslateT("Add %s"), szName));
+ SetCaption(CMStringW(FORMAT, TranslateT("Add %s"), szName));
else
SetCaption(TranslateT("Add contact"));
mir_free(tmpStr);
@@ -120,7 +120,7 @@ public: m_acs.szProto = GetContactProto(m_acs.hContact);
int groupSel = 0;
- ptrW tszGroup(db_get_tsa(hContact, "CList", "Group"));
+ ptrW tszGroup(db_get_wsa(hContact, "CList", "Group"));
wchar_t *grpName;
for (int groupId = 1; (grpName = Clist_GroupGetName(groupId, NULL)) != NULL; groupId++) {
int id = m_group.AddString(grpName, groupId);
@@ -200,7 +200,7 @@ public: ptrW szHandle(m_myHandle.GetText());
if (mir_wstrlen(szHandle))
- db_set_ts(hContact, "CList", "MyHandle", szHandle);
+ db_set_ws(hContact, "CList", "MyHandle", szHandle);
int item = m_group.GetCurSel();
if (item > 0)
diff --git a/src/mir_app/src/button.cpp b/src/mir_app/src/button.cpp index c020904f0d..a406d172c0 100644 --- a/src/mir_app/src/button.cpp +++ b/src/mir_app/src/button.cpp @@ -486,7 +486,7 @@ static LRESULT CALLBACK MButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR ti.uFlags = TTF_IDISHWND|TTF_SUBCLASS;
ti.uId = (UINT_PTR)bct->hwnd;
if (lParam & BATF_UNICODE)
- ti.lpszText = mir_wstrdup(TranslateTS((WCHAR*)wParam));
+ ti.lpszText = mir_wstrdup(TranslateW((WCHAR*)wParam));
else
ti.lpszText = Langpack_PcharToTchar((char*)wParam);
diff --git a/src/mir_app/src/chat.h b/src/mir_app/src/chat.h index 7f493c3bcf..84d418ac78 100644 --- a/src/mir_app/src/chat.h +++ b/src/mir_app/src/chat.h @@ -87,7 +87,7 @@ int LoadChatModule(void); void UnloadChatModule(void);
// tools.c
-int DoRtfToTags(CMString &pszText, int iNumColors, COLORREF *pColors);
+int DoRtfToTags(CMStringW &pszText, int iNumColors, COLORREF *pColors);
int GetTextPixelSize(wchar_t* pszText, HFONT hFont, BOOL bWidth);
wchar_t *RemoveFormatting(const wchar_t* pszText);
BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO *si, GCEVENT *gce, BOOL bHighlight, int bManyFix);
diff --git a/src/mir_app/src/chat_clist.cpp b/src/mir_app/src/chat_clist.cpp index ea92494bc7..859c93e59a 100644 --- a/src/mir_app/src/chat_clist.cpp +++ b/src/mir_app/src/chat_clist.cpp @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. MCONTACT AddRoom(const char *pszModule, const wchar_t *pszRoom, const wchar_t *pszDisplayName, int iType)
{
wchar_t pszGroup[50]; *pszGroup = '\0';
- ptrW groupName(db_get_tsa(NULL, CHAT_MODULE, "AddToGroup"));
+ ptrW groupName(db_get_wsa(NULL, CHAT_MODULE, "AddToGroup"));
if (groupName)
wcsncpy_s(pszGroup, groupName, _TRUNCATE);
else
@@ -43,13 +43,13 @@ MCONTACT AddRoom(const char *pszModule, const wchar_t *pszRoom, const wchar_t *p MCONTACT hContact = chatApi.FindRoom(pszModule, pszRoom);
if (hContact) { //contact exist, make sure it is in the right group
if (pszGroup[0]) {
- ptrW grpName(db_get_tsa(hContact, "CList", "Group"));
+ ptrW grpName(db_get_wsa(hContact, "CList", "Group"));
if (!mir_wstrcmp(pszGroup, grpName))
- db_set_ts(hContact, "CList", "Group", pszGroup);
+ db_set_ws(hContact, "CList", "Group", pszGroup);
}
db_set_w(hContact, pszModule, "Status", ID_STATUS_OFFLINE);
- db_set_ts(hContact, pszModule, "Nick", pszDisplayName);
+ db_set_ws(hContact, pszModule, "Nick", pszDisplayName);
return hContact;
}
@@ -59,11 +59,11 @@ MCONTACT AddRoom(const char *pszModule, const wchar_t *pszRoom, const wchar_t *p Proto_AddToContact(hContact, pszModule);
if (pszGroup[0])
- db_set_ts(hContact, "CList", "Group", pszGroup);
+ db_set_ws(hContact, "CList", "Group", pszGroup);
else
db_unset(hContact, "CList", "Group");
- db_set_ts(hContact, pszModule, "Nick", pszDisplayName);
- db_set_ts(hContact, pszModule, "ChatRoomID", pszRoom);
+ db_set_ws(hContact, pszModule, "Nick", pszDisplayName);
+ db_set_ws(hContact, pszModule, "ChatRoomID", pszRoom);
db_set_b(hContact, pszModule, "ChatRoom", (BYTE)iType);
db_set_w(hContact, pszModule, "Status", ID_STATUS_OFFLINE);
return hContact;
@@ -110,7 +110,7 @@ int RoomDoubleclicked(WPARAM hContact, LPARAM) if (db_get_b(hContact, szProto, "ChatRoom", 0) == 0)
return 0;
- ptrW roomid(db_get_tsa(hContact, szProto, "ChatRoomID"));
+ ptrW roomid(db_get_wsa(hContact, szProto, "ChatRoomID"));
if (roomid == NULL)
return 0;
@@ -216,7 +216,7 @@ BOOL AddEvent(MCONTACT hContact, HICON hIcon, MEVENT hEvent, int type, wchar_t* cle.flags = type | CLEF_TCHAR;
cle.hIcon = hIcon;
cle.pszService = "GChat/DblClickEvent" ;
- cle.ptszTooltip = TranslateTS(szBuf);
+ cle.ptszTooltip = TranslateW(szBuf);
if (type) {
if (!cli.pfnGetEvent(hContact, 0))
cli.pfnAddEvent(&cle);
@@ -235,7 +235,7 @@ MCONTACT FindRoom(const char *pszModule, const wchar_t *pszRoom) if (!db_get_b(hContact, pszModule, "ChatRoom", 0))
continue;
- ptrW roomid(db_get_tsa(hContact, pszModule, "ChatRoomID"));
+ ptrW roomid(db_get_wsa(hContact, pszModule, "ChatRoomID"));
if (roomid != NULL && !mir_wstrcmpi(roomid, pszRoom))
return hContact;
}
diff --git a/src/mir_app/src/chat_opts.cpp b/src/mir_app/src/chat_opts.cpp index 969e01ebb6..8fd7591762 100644 --- a/src/mir_app/src/chat_opts.cpp +++ b/src/mir_app/src/chat_opts.cpp @@ -120,7 +120,7 @@ void LoadMsgDlgFont(int i, LOGFONT *lf, COLORREF *colour) lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
mir_snprintf(str, "Font%d", i);
- ptrW tszFace(db_get_tsa(NULL, CHATFONT_MODULE, str));
+ ptrW tszFace(db_get_wsa(NULL, CHATFONT_MODULE, str));
if (tszFace == NULL)
mir_wstrcpy(lf->lfFaceName, FO.szDefFace);
else
@@ -134,7 +134,7 @@ void RegisterFonts(void) SystemParametersInfo(SPI_GETICONTITLELOGFONT, sizeof(lfDefault), &lfDefault, FALSE);
- FontIDT fontid = { sizeof(fontid) };
+ FontIDW fontid = { sizeof(fontid) };
fontid.flags = FIDF_ALLOWREREGISTER | FIDF_DEFAULTVALID | FIDF_NEEDRESTART;
wcsncpy_s(fontid.backgroundGroup, g_szFontGroup, _TRUNCATE);
wcsncpy_s(fontid.group, g_szFontGroup, _TRUNCATE);
@@ -192,7 +192,7 @@ HICON LoadIconEx(char* pszIcoLibName, bool big) static void InitSetting(wchar_t** ppPointer, char* pszSetting, wchar_t* pszDefault)
{
DBVARIANT dbv;
- if (!db_get_ts(NULL, CHAT_MODULE, pszSetting, &dbv)) {
+ if (!db_get_ws(NULL, CHAT_MODULE, pszSetting, &dbv)) {
replaceStrW(*ppPointer, dbv.ptszVal);
db_free(&dbv);
}
diff --git a/src/mir_app/src/chat_rtf.cpp b/src/mir_app/src/chat_rtf.cpp index 1b901c3cb4..d24a9c0a9f 100644 --- a/src/mir_app/src/chat_rtf.cpp +++ b/src/mir_app/src/chat_rtf.cpp @@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static wchar_t tszRtfBreaks[] = L" \\\n\r"; -static void CreateColorMap(CMString &Text, int iCount, COLORREF *pSrc, int *pDst) +static void CreateColorMap(CMStringW &Text, int iCount, COLORREF *pSrc, int *pDst) { const wchar_t *pszText = Text; int iIndex = 1; @@ -73,7 +73,7 @@ static int GetRtfIndex(int iCol, int iCount, int *pIndex) return -1; } -int DoRtfToTags(CMString &pszText, int iNumColors, COLORREF *pColors) +int DoRtfToTags(CMStringW &pszText, int iNumColors, COLORREF *pColors) { if (pszText.IsEmpty()) return FALSE; @@ -93,7 +93,7 @@ int DoRtfToTags(CMString &pszText, int iNumColors, COLORREF *pColors) else idx += 5; bool bInsideColor = false, bInsideUl = false; - CMString res; + CMStringW res; // iterate through all characters, if rtf control character found then take action for (const wchar_t *p = pszText.GetString() + idx; *p;) { diff --git a/src/mir_app/src/chat_svc.cpp b/src/mir_app/src/chat_svc.cpp index dd1ad27d09..58fdbb1bb3 100644 --- a/src/mir_app/src/chat_svc.cpp +++ b/src/mir_app/src/chat_svc.cpp @@ -257,7 +257,7 @@ static INT_PTR Service_NewChat(WPARAM, LPARAM lParam) db_set_s(si->hContact, si->pszModule, "Topic", "");
db_unset(si->hContact, "CList", "StatusMsg");
if (si->ptszStatusbarText)
- db_set_ts(si->hContact, si->pszModule, "StatusBar", si->ptszStatusbarText);
+ db_set_ws(si->hContact, si->pszModule, "StatusBar", si->ptszStatusbarText);
else
db_set_s(si->hContact, si->pszModule, "StatusBar", "");
@@ -358,7 +358,7 @@ static int DoControl(GCEVENT *gce, WPARAM wp) if (si = chatApi.SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule)) {
replaceStrW(si->ptszStatusbarText, gce->ptszText);
if (si->ptszStatusbarText)
- db_set_ts(si->hContact, si->pszModule, "StatusBar", si->ptszStatusbarText);
+ db_set_ws(si->hContact, si->pszModule, "StatusBar", si->ptszStatusbarText);
else
db_set_s(si->hContact, si->pszModule, "StatusBar", "");
@@ -451,11 +451,11 @@ static INT_PTR Service_AddEvent(WPARAM wParam, LPARAM lParam) if (SESSION_INFO *si = chatApi.SM_FindSession(gcd->ptszID, gcd->pszModule)) {
if (gce->ptszText) {
replaceStrW(si->ptszTopic, RemoveFormatting(gce->ptszText));
- db_set_ts(si->hContact, si->pszModule, "Topic", si->ptszTopic);
+ db_set_ws(si->hContact, si->pszModule, "Topic", si->ptszTopic);
if (chatApi.OnSetTopic)
chatApi.OnSetTopic(si);
if (db_get_b(NULL, CHAT_MODULE, "TopicOnClist", 0))
- db_set_ts(si->hContact, "CList", "StatusMsg", si->ptszTopic);
+ db_set_ws(si->hContact, "CList", "StatusMsg", si->ptszTopic);
}
}
break;
diff --git a/src/mir_app/src/chat_tools.cpp b/src/mir_app/src/chat_tools.cpp index 33f7574dd2..0ac5311f81 100644 --- a/src/mir_app/src/chat_tools.cpp +++ b/src/mir_app/src/chat_tools.cpp @@ -185,7 +185,7 @@ int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char *pszProtoNa PROTOACCOUNT *pa = Proto_GetAccount(pszProtoName);
mir_snwprintf(pd.lptzContactName, L"%s - %s", (pa == NULL) ? _A2T(pszProtoName) : pa->tszAccountName, cli.pfnGetContactDisplayName(hContact, 0));
- mir_wstrncpy(pd.lptzText, TranslateTS(szBuf), _countof(pd.lptzText));
+ mir_wstrncpy(pd.lptzText, TranslateW(szBuf), _countof(pd.lptzText));
pd.iSeconds = g_Settings->iPopupTimeout;
if (g_Settings->iPopupStyle == 2) {
@@ -424,10 +424,10 @@ BOOL IsHighlighted(SESSION_INFO *si, GCEVENT *gce) wchar_t *buf = RemoveFormatting(NEWWSTR_ALLOCA(gce->ptszText));
int iStart = 0;
- CMString tszHighlightWords(g_Settings->pszHighlightWords);
+ CMStringW tszHighlightWords(g_Settings->pszHighlightWords);
while (true) {
- CMString tszToken = tszHighlightWords.Tokenize(L"\t ", iStart);
+ CMStringW tszToken = tszHighlightWords.Tokenize(L"\t ", iStart);
if (iStart == -1)
break;
@@ -465,7 +465,7 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce) wcsncpy_s(tszFolder, si->pszLogFileName, _TRUNCATE);
PathRemoveFileSpec(tszFolder);
if (!PathIsDirectory(tszFolder))
- CreateDirectoryTreeT(tszFolder);
+ CreateDirectoryTreeW(tszFolder);
wchar_t szTime[100];
mir_wstrncpy(szTime, chatApi.MakeTimeStamp(g_Settings->pszTimeStampLog, gce->time), 99);
@@ -588,7 +588,7 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce) wchar_t tszNewPath[_MAX_DRIVE + _MAX_DIR + _MAX_FNAME + _MAX_EXT + 20];
mir_snwprintf(tszNewPath, L"%s%sarchived\\", tszDrive, tszDir);
- CreateDirectoryTreeT(tszNewPath);
+ CreateDirectoryTreeW(tszNewPath);
wchar_t tszNewName[_MAX_DRIVE + _MAX_DIR + _MAX_FNAME + _MAX_EXT + 20];
mir_snwprintf(tszNewName, L"%s%s-%s%s", tszNewPath, tszName, tszTimestamp, tszExt);
@@ -748,7 +748,7 @@ wchar_t* GetChatLogsFilename(SESSION_INFO *si, time_t tTime) if (chatApi.OnGetLogName)
chatApi.OnGetLogName(si, tszParsedName);
else
- PathToAbsoluteT(tszParsedName, si->pszLogFileName);
+ PathToAbsoluteW(tszParsedName, si->pszLogFileName);
mir_free(tszParsedName);
for (int i = 0; i < _countof(rva); i++)
diff --git a/src/mir_app/src/clc.cpp b/src/mir_app/src/clc.cpp index d331cbbb51..23fcc6e060 100644 --- a/src/mir_app/src/clc.cpp +++ b/src/mir_app/src/clc.cpp @@ -389,7 +389,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam int i, eq;
//check name of group and ignore message if just being expanded/collapsed
if (cli.pfnFindItem(hwnd, dat, groupId | HCONTACT_ISGROUP, &contact, &group, NULL)) {
- CMString szFullName(contact->szText);
+ CMStringW szFullName(contact->szText);
while (group->parent) {
ClcContact *cc = NULL;
for (i = 0; i < group->parent->cl.getCount(); i++) {
@@ -401,7 +401,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam szFullName.Empty();
break;
}
- szFullName = CMString(cc->szText) + L"\\" + szFullName;
+ szFullName = CMStringW(cc->szText) + L"\\" + szFullName;
group = group->parent;
}
diff --git a/src/mir_app/src/clcitems.cpp b/src/mir_app/src/clcitems.cpp index c8de95e416..7305d6658e 100644 --- a/src/mir_app/src/clcitems.cpp +++ b/src/mir_app/src/clcitems.cpp @@ -224,7 +224,7 @@ void fnAddContactToTree(HWND hwnd, ClcData *dat, MCONTACT hContact, int updateTo int i; DWORD groupFlags; ClcGroup *group; - ptrW tszGroup(db_get_tsa(hContact, "CList", "Group")); + ptrW tszGroup(db_get_wsa(hContact, "CList", "Group")); if (tszGroup == NULL) group = &dat->list; else { @@ -310,7 +310,7 @@ void fnDeleteItemFromTree(HWND hwnd, MCONTACT hItem) int i, nameOffset; if (!IsHContactContact(hItem)) return; - if (db_get_ts(hItem, "CList", "Group", &dbv)) + if (db_get_ws(hItem, "CList", "Group", &dbv)) return; //decrease member counts of all parent groups too @@ -365,7 +365,7 @@ void fnRebuildEntireList(HWND hwnd, ClcData *dat) ClcCacheEntry *pce = cli.pfnGetCacheEntry(hContact); ClcGroup *group; - ptrW tszGroupName(db_get_tsa(hContact, "CList", "Group")); + ptrW tszGroupName(db_get_wsa(hContact, "CList", "Group")); if (tszGroupName == NULL) group = &dat->list; else { diff --git a/src/mir_app/src/clcutils.cpp b/src/mir_app/src/clcutils.cpp index e1814d1f37..de469d6a17 100644 --- a/src/mir_app/src/clcutils.cpp +++ b/src/mir_app/src/clcutils.cpp @@ -434,7 +434,7 @@ void fnEndRename(HWND, ClcData *dat, int save) if (!text[0] || !mir_wstrcmp(otherName, text))
db_unset(contact->hContact, "CList", "MyHandle");
else
- db_set_ts(contact->hContact, "CList", "MyHandle", text);
+ db_set_ws(contact->hContact, "CList", "MyHandle", text);
mir_free(otherName);
}
}
@@ -698,7 +698,7 @@ void fnGetFontSetting(int i, LOGFONT* lf, COLORREF* colour) char idstr[20];
mir_snprintf(idstr, "Font%dName", i);
- ptrW tszFace(db_get_tsa(NULL, "CLC", idstr));
+ ptrW tszFace(db_get_wsa(NULL, "CLC", idstr));
if (tszFace)
mir_wstrcpy(lf->lfFaceName, tszFace);
@@ -769,7 +769,7 @@ void fnLoadClcOptions(HWND hwnd, ClcData *dat, BOOL bFirst) dat->hBmpBackground = NULL;
}
if (db_get_b(NULL, "CLC", "UseBitmap", CLCDEFAULT_USEBITMAP)) {
- ptrW tszBitmap(db_get_tsa(NULL, "CLC", "BkBitmap"));
+ ptrW tszBitmap(db_get_wsa(NULL, "CLC", "BkBitmap"));
if (tszBitmap)
dat->hBmpBackground = Bitmap_Load(tszBitmap);
}
diff --git a/src/mir_app/src/clistgroups.cpp b/src/mir_app/src/clistgroups.cpp index a9b1e0ab2f..b8b3bbdb0e 100644 --- a/src/mir_app/src/clistgroups.cpp +++ b/src/mir_app/src/clistgroups.cpp @@ -43,7 +43,7 @@ struct CGroupInternal {
char idstr[33];
itoa(groupId, idstr, 10);
- db_set_ts(NULL, "CListGroups", idstr, groupName);
+ db_set_ws(NULL, "CListGroups", idstr, groupName);
}
};
@@ -204,14 +204,14 @@ MIR_APP_DLL(int) Clist_GroupDelete(MGROUP hGroup) }
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- ptrW tszGroupName(db_get_tsa(hContact, "CList", "Group"));
+ ptrW tszGroupName(db_get_wsa(hContact, "CList", "Group"));
if (mir_wstrcmp(tszGroupName, pGroup->groupName+1))
continue;
CLISTGROUPCHANGE grpChg = { sizeof(grpChg), NULL, NULL };
grpChg.pszOldName = pGroup->groupName+1;
if (szNewParent[0]) {
- db_set_ts(hContact, "CList", "Group", szNewParent);
+ db_set_ws(hContact, "CList", "Group", szNewParent);
grpChg.pszNewName = szNewParent;
}
else {
@@ -340,7 +340,7 @@ static int RenameGroupWithMove(int groupId, const wchar_t *szName, int move) for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
ClcCacheEntry *cache = cli.pfnGetCacheEntry(hContact);
if (!mir_wstrcmp(cache->tszGroup, oldName)) {
- db_set_ts(hContact, "CList", "Group", szName);
+ db_set_ws(hContact, "CList", "Group", szName);
replaceStrW(cache->tszGroup, szName);
}
}
@@ -512,7 +512,7 @@ int InitGroupServices(void) for (int i = 0;; i++) {
char str[32];
_itoa(i, str, 10);
- ptrW tszGroup(db_get_tsa(NULL, "CListGroups", str));
+ ptrW tszGroup(db_get_wsa(NULL, "CListGroups", str));
if (tszGroup == NULL)
break;
diff --git a/src/mir_app/src/clistmod.cpp b/src/mir_app/src/clistmod.cpp index f33faa939a..844027ecf1 100644 --- a/src/mir_app/src/clistmod.cpp +++ b/src/mir_app/src/clistmod.cpp @@ -101,13 +101,13 @@ wchar_t* fnGetStatusModeDescription(int mode, int flags) default:
if (IsStatusConnecting(mode)) {
const wchar_t* connFmt = LPGENW("Connecting (attempt %d)");
- mir_snwprintf(szMode, (flags & GSMDF_UNTRANSLATED) ? connFmt : TranslateTS(connFmt), mode - ID_STATUS_CONNECTING + 1);
+ mir_snwprintf(szMode, (flags & GSMDF_UNTRANSLATED) ? connFmt : TranslateW(connFmt), mode - ID_STATUS_CONNECTING + 1);
return szMode;
}
return NULL;
}
- return (flags & GSMDF_UNTRANSLATED) ? descr : TranslateTS(descr);
+ return (flags & GSMDF_UNTRANSLATED) ? descr : TranslateW(descr);
}
static int ProtocolAck(WPARAM, LPARAM lParam)
diff --git a/src/mir_app/src/clistsettings.cpp b/src/mir_app/src/clistsettings.cpp index b82bc7c746..86652d5078 100644 --- a/src/mir_app/src/clistsettings.cpp +++ b/src/mir_app/src/clistsettings.cpp @@ -55,7 +55,7 @@ ClcCacheEntry* fnCreateCacheItem(MCONTACT hContact) void fnCheckCacheItem(ClcCacheEntry *p)
{
if (p->tszGroup == NULL) {
- p->tszGroup = db_get_tsa(p->hContact, "CList", "Group");
+ p->tszGroup = db_get_wsa(p->hContact, "CList", "Group");
if (p->tszGroup == NULL)
p->tszGroup = mir_wstrdup(L"");
}
diff --git a/src/mir_app/src/clisttray.cpp b/src/mir_app/src/clisttray.cpp index aafe45ab1c..5254bb9372 100644 --- a/src/mir_app/src/clisttray.cpp +++ b/src/mir_app/src/clisttray.cpp @@ -49,7 +49,7 @@ static wchar_t* sttGetXStatus(const char *szProto) if (CallProtoServiceInt(NULL, szProto, PS_GETSTATUS, 0, 0) > ID_STATUS_OFFLINE) {
wchar_t tszStatus[512];
CUSTOM_STATUS cs = { sizeof(cs) };
- cs.flags = CSSF_MASK_MESSAGE | CSSF_TCHAR;
+ cs.flags = CSSF_MASK_MESSAGE | CSSF_UNICODE;
cs.ptszMessage = tszStatus;
if (CallProtoServiceInt(NULL, szProto, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&cs) == 0)
return mir_wstrdup(tszStatus);
@@ -81,7 +81,7 @@ wchar_t* fnTrayIconMakeTooltip(const wchar_t *szPrefix, const char *szProto) if (accounts.getCount() == 1)
return cli.pfnTrayIconMakeTooltip(szPrefix, accounts[0]->szModuleName);
- CMString tszTip;
+ CMStringW tszTip;
if (szPrefix && szPrefix[0]) {
if (!db_get_b(NULL, "CList", "AlwaysStatus", SETTING_ALWAYSSTATUS_DEFAULT)) {
diff --git a/src/mir_app/src/clui.cpp b/src/mir_app/src/clui.cpp index 37a7fc8739..250287f634 100644 --- a/src/mir_app/src/clui.cpp +++ b/src/mir_app/src/clui.cpp @@ -275,7 +275,7 @@ int LoadCLUIModule(void) wndclass.hIconSm = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
RegisterClassEx(&wndclass);
- if (db_get_ts(NULL, "CList", "TitleText", &dbv))
+ if (db_get_ws(NULL, "CList", "TitleText", &dbv))
mir_wstrncpy(titleText, _T(MIRANDANAME), _countof(titleText));
else {
mir_wstrncpy(titleText, dbv.ptszVal, _countof(titleText));
@@ -412,7 +412,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM if (msg == uMsgProcessProfile) {
wchar_t profile[MAX_PATH];
if (GlobalGetAtomName((ATOM)wParam, profile, _countof(profile))) {
- int rc = mir_wstrcmpi(profile, VARST(L"%miranda_userdata%\\%miranda_profilename%.dat")) == 0;
+ int rc = mir_wstrcmpi(profile, VARSW(L"%miranda_userdata%\\%miranda_profilename%.dat")) == 0;
ReplyMessage(rc);
if (rc) {
ShowWindow(hwnd, SW_RESTORE);
diff --git a/src/mir_app/src/contact.cpp b/src/mir_app/src/contact.cpp index ceedd7a125..c482deed19 100644 --- a/src/mir_app/src/contact.cpp +++ b/src/mir_app/src/contact.cpp @@ -54,7 +54,7 @@ INT_PTR ContactChangeGroup(WPARAM wParam, LPARAM lParam) db_unset(wParam, "CList", "Group"); else { grpChg.pszNewName = Clist_GroupGetName(lParam, NULL); - db_set_ts(wParam, "CList", "Group", grpChg.pszNewName); + db_set_ws(wParam, "CList", "Group", grpChg.pszNewName); } NotifyEventHooks(hGroupChangeEvent, wParam, (LPARAM)&grpChg); diff --git a/src/mir_app/src/contacts.cpp b/src/mir_app/src/contacts.cpp index f9e717d541..ced2f8ab5a 100644 --- a/src/mir_app/src/contacts.cpp +++ b/src/mir_app/src/contacts.cpp @@ -309,7 +309,7 @@ public: tvis.item.mask = TVIF_TEXT | TVIF_PARAM;
for (int i = 0; i < _countof(nameOrderDescr); i++) {
tvis.item.lParam = nameOrder[i];
- tvis.item.pszText = TranslateTS(nameOrderDescr[nameOrder[i]]);
+ tvis.item.pszText = TranslateW(nameOrderDescr[nameOrder[i]]);
m_nameOrder.InsertItem(&tvis);
}
}
diff --git a/src/mir_app/src/database.cpp b/src/mir_app/src/database.cpp index 2331ee3159..420e442f15 100644 --- a/src/mir_app/src/database.cpp +++ b/src/mir_app/src/database.cpp @@ -62,7 +62,7 @@ static void fillProfileName(const wchar_t* ptszFileName) bool IsInsideRootDir(wchar_t* profiledir, bool exact)
{
- VARST pfd(L"%miranda_path%");
+ VARSW pfd(L"%miranda_path%");
if (exact)
return mir_wstrcmpi(profiledir, pfd) == 0;
@@ -78,7 +78,7 @@ int getProfilePath(wchar_t *buf, size_t) if (profiledir[0] == 0)
mir_wstrcpy(profiledir, L"%miranda_path%\\Profiles");
- size_t len = PathToAbsoluteT(VARST(profiledir), buf);
+ size_t len = PathToAbsoluteW(VARSW(profiledir), buf);
if (buf[len - 1] == '/' || buf[len - 1] == '\\')
buf[len - 1] = 0;
@@ -124,7 +124,7 @@ static void getDefaultProfile(wchar_t *szProfile, size_t cch) if (defaultProfile[0] == 0)
return;
- VARST res(defaultProfile);
+ VARSW res(defaultProfile);
if (res)
mir_snwprintf(szProfile, cch, L"%s\\%s\\%s%s", g_profileDir, (wchar_t*)res, (wchar_t*)res, isValidProfileName(res) ? L"" : L".dat");
else
@@ -150,7 +150,7 @@ static void loadProfileByShortName(const wchar_t* src, wchar_t *szProfile, size_ p = wcsrchr(profileName, '.'); if (p) *p = 0;
mir_snwprintf(newProfileDir, cch, L"%s\\%s\\", g_profileDir, profileName);
- PathToAbsoluteT(buf, szProfile, newProfileDir);
+ PathToAbsoluteW(buf, szProfile, newProfileDir);
if (wcschr(buf, '\\')) {
wcsncpy_s(g_profileDir, szProfile, _TRUNCATE);
@@ -184,7 +184,7 @@ static void moveProfileDirProfiles(wchar_t *profiledir, BOOL isRootDir = TRUE) {
wchar_t pfd[MAX_PATH];
if (isRootDir)
- wcsncpy_s(pfd, VARST(L"%miranda_path%\\*.dat"), _TRUNCATE);
+ wcsncpy_s(pfd, VARSW(L"%miranda_path%\\*.dat"), _TRUNCATE);
else
mir_snwprintf(pfd, L"%s\\*.dat", profiledir);
@@ -198,7 +198,7 @@ static void moveProfileDirProfiles(wchar_t *profiledir, BOOL isRootDir = TRUE) c = wcsrchr(profile, '.'); if (c) *c = 0;
mir_snwprintf(path, L"%s\\%s", pfd, ffd.cFileName);
mir_snwprintf(path2, L"%s\\%s", profiledir, profile);
- CreateDirectoryTreeT(path2);
+ CreateDirectoryTreeW(path2);
mir_snwprintf(path2, L"%s\\%s\\%s", profiledir, profile, ffd.cFileName);
if (_waccess(path2, 0) == 0) {
wchar_t buf[512];
@@ -420,7 +420,7 @@ int tryOpenDatabase(const wchar_t *tszProfile) static int tryCreateDatabase(const wchar_t *ptszProfile)
{
wchar_t *tszProfile = NEWWSTR_ALLOCA(ptszProfile);
- CreatePathToFileT(tszProfile);
+ CreatePathToFileW(tszProfile);
for (int i = 0; i < arDbPlugins.getCount(); i++) {
DATABASELINK* p = arDbPlugins[i];
@@ -482,7 +482,7 @@ static wchar_t tszNoSuitableDriver[] = LPGENW("Miranda was unable to open '%s'\n int LoadDatabaseModule(void)
{
wchar_t szProfile[MAX_PATH];
- PathToAbsoluteT(L".", szProfile);
+ PathToAbsoluteW(L".", szProfile);
_tchdir(szProfile);
szProfile[0] = 0;
@@ -497,7 +497,7 @@ int LoadDatabaseModule(void) if (arDbPlugins.getCount() == 0) {
MessageBox(NULL,
- CMString(FORMAT, TranslateTS(tszNoDrivers), ptszFileName),
+ CMStringW(FORMAT, TranslateW(tszNoDrivers), ptszFileName),
TranslateT("No profile support installed!"), MB_OK | MB_ICONERROR);
return 1;
}
@@ -515,7 +515,7 @@ int LoadDatabaseModule(void) // there were no suitable driver installed
if (rc == -1) {
MessageBox(NULL,
- CMString(FORMAT, TranslateTS(tszNoSuitableDriver), ptszFileName),
+ CMStringW(FORMAT, TranslateW(tszNoSuitableDriver), ptszFileName),
TranslateT("Miranda can't open that profile"), MB_OK | MB_ICONERROR);
}
else if (rc > 0) {
@@ -523,12 +523,12 @@ int LoadDatabaseModule(void) if (fileExist(szProfile)) {
// file isn't locked, just no driver could open it.
MessageBox(NULL,
- CMString(FORMAT, TranslateTS(tszUnknownFormat), ptszFileName),
+ CMStringW(FORMAT, TranslateW(tszUnknownFormat), ptszFileName),
TranslateT("Miranda can't understand that profile"), MB_OK | MB_ICONERROR);
}
else if (!FindMirandaForProfile(szProfile)) {
retry = IDRETRY == MessageBox(NULL,
- CMString(FORMAT, TranslateTS(tszProfileLocked), ptszFileName),
+ CMStringW(FORMAT, TranslateW(tszProfileLocked), ptszFileName),
TranslateT("Miranda can't open that profile"), MB_RETRYCANCEL | MB_ICONERROR);
}
}
diff --git a/src/mir_app/src/dbini.cpp b/src/mir_app/src/dbini.cpp index b545aae71c..09d6a336ff 100644 --- a/src/mir_app/src/dbini.cpp +++ b/src/mir_app/src/dbini.cpp @@ -46,7 +46,7 @@ static INT_PTR CALLBACK InstallIniDlgProc(HWND hwndDlg, UINT message, WPARAM wPa else if (!mir_wstrcmpi(szSecurity, L"none"))
pszSecurityInfo = LPGENW("Security systems to prevent malicious changes have been disabled. You will receive no further warnings.");
else pszSecurityInfo = NULL;
- if (pszSecurityInfo) SetDlgItemText(hwndDlg, IDC_SECURITYINFO, TranslateTS(pszSecurityInfo));
+ if (pszSecurityInfo) SetDlgItemText(hwndDlg, IDC_SECURITYINFO, TranslateW(pszSecurityInfo));
}
return TRUE;
@@ -122,7 +122,7 @@ static INT_PTR CALLBACK WarnIniChangeDlgProc(HWND hwndDlg, UINT message, WPARAM pszSecurityInfo = LPGENW("This change is known to be potentially hazardous.");
else
pszSecurityInfo = LPGENW("This change is not known to be safe.");
- SetDlgItemText(hwndDlg, IDC_SECURITYINFO, TranslateTS(pszSecurityInfo));
+ SetDlgItemText(hwndDlg, IDC_SECURITYINFO, TranslateW(pszSecurityInfo));
}
return TRUE;
@@ -455,11 +455,11 @@ static void DoAutoExec(void) GetPrivateProfileString(L"AutoExec", L"Glob", L"autoexec_*.ini", szFindPath, _countof(szFindPath), mirandabootini);
if (g_bDbCreated && szOnCreateFilename[0]) {
- PathToAbsoluteT(VARST(szOnCreateFilename), szIniPath);
+ PathToAbsoluteW(VARSW(szOnCreateFilename), szIniPath);
ProcessIniFile(szIniPath, szSafeSections, szUnsafeSections, 0, 1);
}
- PathToAbsoluteT(VARST(szFindPath), szFindPath);
+ PathToAbsoluteW(VARSW(szFindPath), szFindPath);
WIN32_FIND_DATA fd;
HANDLE hFind = FindFirstFile(szFindPath, &fd);
@@ -537,7 +537,7 @@ int InitIni(void) DoAutoExec();
wchar_t szMirandaDir[MAX_PATH];
- PathToAbsoluteT(L".", szMirandaDir);
+ PathToAbsoluteW(L".", szMirandaDir);
hIniChangeNotification = FindFirstChangeNotification(szMirandaDir, 0, FILE_NOTIFY_CHANGE_FILE_NAME);
if (hIniChangeNotification != INVALID_HANDLE_VALUE) {
CreateServiceFunction("DB/Ini/CheckImportNow", CheckIniImportNow);
diff --git a/src/mir_app/src/dbintf.cpp b/src/mir_app/src/dbintf.cpp index dca13b96f3..ffa510f9e9 100644 --- a/src/mir_app/src/dbintf.cpp +++ b/src/mir_app/src/dbintf.cpp @@ -48,7 +48,7 @@ static INT_PTR srvGetContactCount(WPARAM, LPARAM) static INT_PTR srvDeleteContact(WPARAM wParam, LPARAM)
{
DBVARIANT dbv = { 0 };
- if (!db_get_ts(wParam, "ContactPhoto", "File", &dbv)) {
+ if (!db_get_ws(wParam, "ContactPhoto", "File", &dbv)) {
DeleteFile(dbv.ptszVal);
db_free(&dbv);
}
diff --git a/src/mir_app/src/dbutils.cpp b/src/mir_app/src/dbutils.cpp index 8f63f74dbf..a8003bec86 100644 --- a/src/mir_app/src/dbutils.cpp +++ b/src/mir_app/src/dbutils.cpp @@ -118,7 +118,7 @@ static INT_PTR DbEventGetText(WPARAM wParam, LPARAM lParam) ptrW tszLast(getEventString(dbei, buf));
ptrW tszEmail(getEventString(dbei, buf));
- CMString nick, text;
+ CMStringW nick, text;
if (tszFirst || tszLast) {
nick.AppendFormat(L"%s %s", tszFirst, tszLast);
nick.Trim();
@@ -147,7 +147,7 @@ static INT_PTR DbEventGetText(WPARAM wParam, LPARAM lParam) }
if (dbei->eventType == EVENTTYPE_CONTACTS) {
- CMString text(TranslateT("Contacts: "));
+ CMStringW text(TranslateT("Contacts: "));
// blob is: [uin(ASCIIZ), nick(ASCIIZ)]*
char *buf = LPSTR(dbei->pBlob), *limit = LPSTR(dbei->pBlob) + dbei->cbBlob;
while (buf < limit) {
diff --git a/src/mir_app/src/enterstring.cpp b/src/mir_app/src/enterstring.cpp index b68b24b661..5632a6acf1 100644 --- a/src/mir_app/src/enterstring.cpp +++ b/src/mir_app/src/enterstring.cpp @@ -57,7 +57,7 @@ static void ComboLoadRecentStrings(HWND hwndDlg, EnterStringFormParam *pForm) for (int i = 0; i < pForm->recentCount; i++) {
char setting[MAXMODULELABELLENGTH];
mir_snprintf(setting, "%s%d", pForm->szDataPrefix, i);
- ptrW tszRecent(db_get_tsa(NULL, pForm->szModuleName, setting));
+ ptrW tszRecent(db_get_wsa(NULL, pForm->szModuleName, setting));
if (tszRecent != NULL)
SendDlgItemMessage(hwndDlg, pForm->idcControl, CB_ADDSTRING, 0, tszRecent);
}
@@ -83,7 +83,7 @@ static void ComboAddRecentString(HWND hwndDlg, EnterStringFormParam *pForm) id = db_get_b(NULL, pForm->szModuleName, pForm->szDataPrefix, 0);
char setting[MAXMODULELABELLENGTH];
mir_snprintf(setting, "%s%d", pForm->szDataPrefix, id);
- db_set_ts(NULL, pForm->szModuleName, setting, string);
+ db_set_ws(NULL, pForm->szModuleName, setting, string);
db_set_b(NULL, pForm->szModuleName, pForm->szDataPrefix, (id + 1) % pForm->idcControl);
}
diff --git a/src/mir_app/src/extraicons.cpp b/src/mir_app/src/extraicons.cpp index bcdeea5161..aae28f5ff2 100644 --- a/src/mir_app/src/extraicons.cpp +++ b/src/mir_app/src/extraicons.cpp @@ -395,7 +395,7 @@ EXTERN_C MIR_APP_DLL(HANDLE) ExtraIcon_RegisterCallback(const char *name, const return 0;
ptrW tszDesc(mir_a2u(description));
- wchar_t *desc = TranslateTH(_hLang, tszDesc);
+ wchar_t *desc = TranslateW_LP(tszDesc, _hLang);
int id = registeredExtraIcons.getCount() + 1;
BaseExtraIcon *extra = new CallbackExtraIcon(id, name, desc, descIcon == NULL ? "" : descIcon, RebuildIcons, ApplyIcon, OnClick, onClickParam);
@@ -410,7 +410,7 @@ EXTERN_C MIR_APP_DLL(HANDLE) ExtraIcon_RegisterIcolib(const char *name, const ch return 0;
ptrW tszDesc(mir_a2u(description));
- wchar_t *desc = TranslateTH(_hLang, tszDesc);
+ wchar_t *desc = TranslateW_LP(tszDesc, _hLang);
BaseExtraIcon *extra = GetExtraIconByName(name);
if (extra != NULL) {
@@ -419,7 +419,7 @@ EXTERN_C MIR_APP_DLL(HANDLE) ExtraIcon_RegisterIcolib(const char *name, const ch // Found one, now merge it
if (mir_wstrcmpi(extra->getDescription(), desc)) {
- CMString newDesc = extra->getDescription();
+ CMStringW newDesc = extra->getDescription();
newDesc += L" / ";
newDesc += desc;
extra->setDescription(newDesc.c_str());
diff --git a/src/mir_app/src/findadd.cpp b/src/mir_app/src/findadd.cpp index cef250a96c..bf17091830 100644 --- a/src/mir_app/src/findadd.cpp +++ b/src/mir_app/src/findadd.cpp @@ -326,7 +326,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP dat->iLastColumnSortIndex = 1; dat->bSortAscending = 1; SendDlgItemMessage(hwndDlg, IDC_MOREOPTIONS, BUTTONSETARROW, 1, 0); - SendDlgItemMessage(hwndDlg, IDOK, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Ctrl+Search add contact"), BATF_TCHAR); + SendDlgItemMessage(hwndDlg, IDOK, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Ctrl+Search add contact"), BATF_UNICODE); ListView_SetExtendedListViewStyle(hwndList, LVS_EX_FULLROWSELECT | LVS_EX_HEADERDRAGDROP); @@ -364,7 +364,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP SetStatusBarSearchInfo(GetDlgItem(hwndDlg, IDC_STATUSBAR), dat); wchar_t *szProto = NULL; - ptrW tszLast(db_get_tsa(NULL, "FindAdd", "LastSearched")); + ptrW tszLast(db_get_wsa(NULL, "FindAdd", "LastSearched")); if (tszLast) szProto = NEWWSTR_ALLOCA(tszLast); @@ -765,7 +765,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP PROTOSEARCHRESULT psr = { 0 }; psr.cbSize = sizeof(psr); - psr.flags = PSR_TCHAR; + psr.flags = PSR_UNICODE; psr.id.w = str; acs.psr = &psr; @@ -854,7 +854,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP LVCOLUMN lvc = { 0 }; lvc.mask = LVCF_TEXT; for (int iColumn = 0; iColumn < csr->nFieldCount; iColumn++) { - lvc.pszText = TranslateTS(csr->pszFields[iColumn]); + lvc.pszText = TranslateW(csr->pszFields[iColumn]); ListView_InsertColumn(hwndList, iColumn + 1, &lvc); } } @@ -869,7 +869,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP lsr->psr.firstName.w = sttDecodeString(psr->flags, psr->firstName); lsr->psr.lastName.w = sttDecodeString(psr->flags, psr->lastName); lsr->psr.email.w = sttDecodeString(psr->flags, psr->email); - lsr->psr.flags = psr->flags & ~PSR_UNICODE | PSR_TCHAR; + lsr->psr.flags = psr->flags & ~PSR_UNICODE | PSR_UNICODE; LVITEM lvi = { 0 }; lvi.mask = LVIF_PARAM | LVIF_IMAGE; @@ -909,7 +909,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP lsr->psr.lastName.w = sttDecodeString(psr->flags, psr->lastName); lsr->psr.email.w = sttDecodeString(psr->flags, psr->email); lsr->psr.id.w = sttDecodeString(psr->flags, psr->id); - lsr->psr.flags = psr->flags & ~PSR_UNICODE | PSR_TCHAR; + lsr->psr.flags = psr->flags & ~PSR_UNICODE | PSR_UNICODE; LVITEM lvi = { 0 }; lvi.mask = LVIF_PARAM | LVIF_IMAGE; @@ -948,7 +948,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (szProto != NULL) { *szProto = '\0'; SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETLBTEXT, SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETCURSEL, 0, 0), (LPARAM)szProto); - db_set_ts(NULL, "FindAdd", "LastSearched", szProto); + db_set_ws(NULL, "FindAdd", "LastSearched", szProto); } SaveColumnSizes(hwndList); diff --git a/src/mir_app/src/hotkey_opts.cpp b/src/mir_app/src/hotkey_opts.cpp index cb02b5496e..d85da9566e 100644 --- a/src/mir_app/src/hotkey_opts.cpp +++ b/src/mir_app/src/hotkey_opts.cpp @@ -311,8 +311,8 @@ static void sttOptionsAddHotkey(HWND hwndList, THotkeyItem *item) THotkeyItem *newItem = (THotkeyItem *)mir_alloc(sizeof(THotkeyItem)); newItem->pszName = NULL; newItem->pszService = item->pszService ? mir_strdup(item->pszService) : NULL; - newItem->ptszSection = mir_wstrdup(item->ptszSection); - newItem->ptszDescription = mir_wstrdup(item->ptszDescription); + newItem->pwszSection = mir_wstrdup(item->pwszSection); + newItem->pwszDescription = mir_wstrdup(item->pwszDescription); newItem->lParam = item->lParam; newItem->idHotkey = GlobalAddAtomA(buf); newItem->rootHotkey = item; @@ -393,7 +393,7 @@ static void sttBuildHotkeyList(HWND hwndList) if (item->OptDeleted) continue; - if (!i || mir_wstrcmp(item->ptszSection, hotkeys[i - 1]->ptszSection)) { + if (!i || mir_wstrcmp(item->pwszSection, hotkeys[i - 1]->pwszSection)) { lvi.mask = LVIF_TEXT | LVIF_PARAM; lvi.iItem = nItems++; lvi.iSubItem = 0; @@ -404,7 +404,7 @@ static void sttBuildHotkeyList(HWND hwndList) lvi.mask = LVIF_TEXT; lvi.iSubItem = 1; - lvi.pszText = item->ptszSection; + lvi.pszText = item->pwszSection; ListView_SetItem(hwndList, &lvi); lvi.iSubItem = 0; diff --git a/src/mir_app/src/hotkeys.cpp b/src/mir_app/src/hotkeys.cpp index 7ecb0b1c3a..e4884e26d7 100644 --- a/src/mir_app/src/hotkeys.cpp +++ b/src/mir_app/src/hotkeys.cpp @@ -29,9 +29,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static int sttCompareHotkeys(const THotkeyItem *p1, const THotkeyItem *p2)
{
int res;
- if (res = mir_wstrcmp(p1->ptszSection, p2->ptszSection))
+ if (res = mir_wstrcmp(p1->pwszSection, p2->pwszSection))
return res;
- if (res = mir_wstrcmp(p1->ptszDescription, p2->ptszDescription))
+ if (res = mir_wstrcmp(p1->pwszDescription, p2->pwszDescription))
return res;
if (!p1->rootHotkey && p2->rootHotkey)
return -1;
@@ -138,12 +138,12 @@ static INT_PTR svcHotkeyRegister(WPARAM wParam, LPARAM lParam) THotkeyItem *p = (THotkeyItem*)mir_alloc(sizeof(THotkeyItem));
DWORD dwFlags = (desc->cbSize >= sizeof(HOTKEYDESC)) ? desc->dwFlags : 0;
if (dwFlags & HKD_UNICODE) {
- p->ptszSection = mir_wstrdup(desc->ptszSection);
- p->ptszDescription = mir_wstrdup(desc->ptszDescription);
+ p->pwszSection = mir_wstrdup(desc->pwszSection);
+ p->pwszDescription = mir_wstrdup(desc->pwszDescription);
}
else {
- p->ptszSection = mir_a2u(desc->pszSection);
- p->ptszDescription = mir_a2u(desc->pszDescription);
+ p->pwszSection = mir_a2u(desc->pszSection);
+ p->pwszDescription = mir_a2u(desc->pszDescription);
}
p->hLangpack = (int)wParam;
@@ -161,8 +161,8 @@ static INT_PTR svcHotkeyRegister(WPARAM wParam, LPARAM lParam) p->rootHotkey->nSubHotkeys++;
}
else {
- mir_free(p->ptszSection);
- mir_free(p->ptszDescription);
+ mir_free(p->pwszSection);
+ mir_free(p->pwszDescription);
mir_free(p);
return 0;
}
@@ -264,7 +264,7 @@ static INT_PTR svcHotkeyCheck(WPARAM wParam, LPARAM lParam) for (i = 0; i < hotkeys.getCount(); i++) {
THotkeyItem *p = hotkeys[i];
- if ((p->type != HKT_MANUAL) || mir_wstrcmp(pszSection, p->ptszSection))
+ if ((p->type != HKT_MANUAL) || mir_wstrcmp(pszSection, p->pwszSection))
continue;
BYTE hkMod, hkVk;
@@ -290,8 +290,8 @@ void FreeHotkey(THotkeyItem *p) GlobalDeleteAtom(p->idHotkey);
mir_free(p->pszName);
mir_free(p->pszService);
- mir_free(p->ptszDescription);
- mir_free(p->ptszSection);
+ mir_free(p->pwszDescription);
+ mir_free(p->pwszSection);
mir_free(p);
}
diff --git a/src/mir_app/src/icolib.cpp b/src/mir_app/src/icolib.cpp index d2f8f34e24..692f695819 100644 --- a/src/mir_app/src/icolib.cpp +++ b/src/mir_app/src/icolib.cpp @@ -81,7 +81,7 @@ static IconSourceFile* IconSourceFile_Get(const wchar_t *file, bool isPath) IconSourceFile key;
if (isPath)
- PathToAbsoluteT(file, key.file); /// TODO: convert path to long - eliminate duplicate items
+ PathToAbsoluteW(file, key.file); /// TODO: convert path to long - eliminate duplicate items
else
wcsncpy_s(key.file, file, _TRUNCATE);
@@ -667,10 +667,10 @@ HICON IconItem_GetIcon(HANDLE hIcoLib, bool big) big = big && !item->cx;
IconSourceItem* &source = big ? item->source_big : item->source_small;
if (source == NULL) {
- ptrW tszCustomPath(db_get_tsa(NULL, "SkinIcons", item->name));
+ ptrW tszCustomPath(db_get_wsa(NULL, "SkinIcons", item->name));
if (tszCustomPath != NULL) {
wchar_t tszFullPath[MAX_PATH];
- PathToAbsoluteT(tszCustomPath, tszFullPath);
+ PathToAbsoluteW(tszCustomPath, tszFullPath);
int cx = item->cx ? item->cx : (big ? g_iIconX : g_iIconSX);
int cy = item->cy ? item->cy : (big ? g_iIconY : g_iIconSY);
source = GetIconSourceItemFromPath(tszFullPath, cx, cy);
diff --git a/src/mir_app/src/keyboard.cpp b/src/mir_app/src/keyboard.cpp index e71b72c9c9..fbda9d07bf 100644 --- a/src/mir_app/src/keyboard.cpp +++ b/src/mir_app/src/keyboard.cpp @@ -53,38 +53,38 @@ int InitClistHotKeys(void) CreateServiceFunction("CLIST/HK/Read", hkRead);
HOTKEYDESC shk = { sizeof(shk) };
- shk.dwFlags = HKD_TCHAR;
- shk.ptszDescription = LPGENW("Show/Hide contact list");
+ shk.dwFlags = HKD_UNICODE;
+ shk.pwszDescription = LPGENW("Show/Hide contact list");
shk.pszName = "ShowHide";
- shk.ptszSection = L"Main";
+ shk.pwszSection = L"Main";
shk.pszService = "CLIST/HK/SHOWHIDE";
shk.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, 'A');
Hotkey_Register(&shk);
- shk.ptszDescription = LPGENW("Read message");
+ shk.pwszDescription = LPGENW("Read message");
shk.pszName = "ReadMessage";
- shk.ptszSection = L"Main";
+ shk.pwszSection = L"Main";
shk.pszService = "CLIST/HK/Read";
shk.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, 'I');
Hotkey_Register(&shk);
- shk.ptszDescription = LPGENW("Open Options page");
+ shk.pwszDescription = LPGENW("Open Options page");
shk.pszName = "ShowOptions";
- shk.ptszSection = L"Main";
+ shk.pwszSection = L"Main";
shk.pszService = "CLIST/HK/Opts";
shk.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, 'O') | HKF_MIRANDA_LOCAL;
Hotkey_Register(&shk);
- shk.ptszDescription = LPGENW("Open logging options");
+ shk.pwszDescription = LPGENW("Open logging options");
shk.pszName = "ShowLogOptions";
- shk.ptszSection = L"Main";
+ shk.pwszSection = L"Main";
shk.pszService = "Netlib/Log/Win";
shk.DefHotKey = 0;
Hotkey_Register(&shk);
- shk.ptszDescription = LPGENW("Open 'Find user' dialog");
+ shk.pwszDescription = LPGENW("Open 'Find user' dialog");
shk.pszName = "FindUsers";
- shk.ptszSection = L"Main";
+ shk.pwszSection = L"Main";
shk.pszService = "FindAdd/FindAddCommand";
shk.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, 'F') | HKF_MIRANDA_LOCAL;
Hotkey_Register(&shk);
diff --git a/src/mir_app/src/langpack.cpp b/src/mir_app/src/langpack.cpp index 3a17d94307..b7f1bf02b0 100644 --- a/src/mir_app/src/langpack.cpp +++ b/src/mir_app/src/langpack.cpp @@ -34,10 +34,10 @@ BOOL EnumLangpacks(ENUM_PACKS_CALLBACK callback, WPARAM wParam, LPARAM lParam) BOOL res = FALSE;
/* language folder */
- ptrW langpack(db_get_tsa(NULL, "Langpack", "Current"));
+ ptrW langpack(db_get_wsa(NULL, "Langpack", "Current"));
wchar_t tszFullPath[MAX_PATH];
- PathToAbsoluteT(L"\\Languages\\langpack_*.txt", tszFullPath);
+ PathToAbsoluteW(L"\\Languages\\langpack_*.txt", tszFullPath);
BOOL fPackFound = FALSE;
WIN32_FIND_DATA wfd;
@@ -46,7 +46,7 @@ BOOL EnumLangpacks(ENUM_PACKS_CALLBACK callback, WPARAM wParam, LPARAM lParam) do {
if (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) continue;
/* get data */
- PathToAbsoluteT(L"\\Languages\\", tszFullPath);
+ PathToAbsoluteW(L"\\Languages\\", tszFullPath);
mir_wstrcat(tszFullPath, wfd.cFileName);
LANGPACK_INFO pack;
diff --git a/src/mir_app/src/lpopts.cpp b/src/mir_app/src/lpopts.cpp index c8e7ed7602..ef319c03ac 100644 --- a/src/mir_app/src/lpopts.cpp +++ b/src/mir_app/src/lpopts.cpp @@ -43,7 +43,7 @@ static void DisplayPackInfo(HWND hwndDlg, const LANGPACK_INFO *pack) /* add some note if its incompatible */
if (szLanguageName[0] && szContryName[0]) {
- mir_snwprintf(szLocaleName, L"%s (%s)", TranslateTS(szLanguageName), TranslateTS(szContryName));
+ mir_snwprintf(szLocaleName, L"%s (%s)", TranslateW(szLanguageName), TranslateW(szContryName));
if (!IsValidLocale(pack->Locale, LCID_INSTALLED)) {
wchar_t *pszIncompat;
pszIncompat = TranslateT("(incompatible)");
@@ -67,7 +67,7 @@ static void DisplayPackInfo(HWND hwndDlg, const LANGPACK_INFO *pack) SetDlgItemText_CP(hwndDlg, IDC_LANGMODUSING, pack->szLastModifiedUsing);
SetDlgItemText_CP(hwndDlg, IDC_LANGAUTHORS, pack->szAuthors);
SetDlgItemText_CP(hwndDlg, IDC_LANGEMAIL, pack->szAuthorEmail);
- SetDlgItemText(hwndDlg, IDC_LANGINFOFRAME, TranslateTS(pack->tszLanguage));
+ SetDlgItemText(hwndDlg, IDC_LANGINFOFRAME, TranslateW(pack->tszLanguage));
}
static BOOL InsertPackItemEnumProc(LANGPACK_INFO *pack, WPARAM wParam, LPARAM)
@@ -78,7 +78,7 @@ static BOOL InsertPackItemEnumProc(LANGPACK_INFO *pack, WPARAM wParam, LPARAM) /* insert */
wchar_t tszName[512];
mir_snwprintf(tszName, L"%s [%s]",
- TranslateTS(pack->tszLanguage),
+ TranslateW(pack->tszLanguage),
pack->flags & LPF_DEFAULT ? TranslateT("built-in") : pack->tszFileName);
UINT message = pack->flags & LPF_DEFAULT ? CB_INSERTSTRING : CB_ADDSTRING;
int idx = SendMessage((HWND)wParam, message, 0, (LPARAM)tszName);
@@ -166,7 +166,7 @@ INT_PTR CALLBACK DlgLangpackOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP for (int i = 0; i < count; i++) {
LANGPACK_INFO *pack = (LANGPACK_INFO*)ComboBox_GetItemData(hwndList, i);
if (i == idx) {
- db_set_ts(NULL, "Langpack", "Current", pack->tszFileName);
+ db_set_ws(NULL, "Langpack", "Current", pack->tszFileName);
mir_wstrcpy(tszPath, pack->tszFullPath);
pack->flags |= LPF_ENABLED;
}
diff --git a/src/mir_app/src/menu_clist.cpp b/src/mir_app/src/menu_clist.cpp index 894c323e3b..524e19b75b 100644 --- a/src/mir_app/src/menu_clist.cpp +++ b/src/mir_app/src/menu_clist.cpp @@ -467,7 +467,7 @@ INT_PTR StatusMenuCheckService(WPARAM wParam, LPARAM) if (reset || check) {
TMO_IntMenuItem *timiParent = MO_GetIntMenuItem(pimi->mi.root);
if (timiParent) {
- LPTSTR ptszName = TranslateTH(pimi->mi.hLangpack, pimi->mi.hIcolibItem ? pimi->mi.name.w : LPGENW("Custom status"));
+ LPTSTR ptszName = TranslateW_LP(pimi->mi.hIcolibItem ? pimi->mi.name.w : LPGENW("Custom status"), pimi->mi.hLangpack);
timiParent = MO_GetIntMenuItem(pimi->mi.root);
@@ -816,7 +816,7 @@ void RebuildMenuOrder(void) // adding root
CMenuItem mi;
- mi.flags = CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
+ mi.flags = CMIF_UNICODE | CMIF_KEEPUNTRANSLATED;
mi.position = pos++;
mi.hIcon = ic = (HICON)CallProtoServiceInt(NULL, pa->szModuleName, PS_LOADICON, PLI_PROTOCOL | PLIF_SMALL, 0);
@@ -832,7 +832,7 @@ void RebuildMenuOrder(void) TMO_IntMenuItem *rootmenu = Menu_AddItem(hStatusMenuObject, &mi, smep);
memset(&mi, 0, sizeof(mi));
- mi.flags = CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
+ mi.flags = CMIF_UNICODE | CMIF_KEEPUNTRANSLATED;
mi.root = rootmenu;
mi.position = pos++;
mi.hIcon = ic;
@@ -873,7 +873,7 @@ void RebuildMenuOrder(void) // adding
memset(&mi, 0, sizeof(mi));
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
if (statusModeList[j] == ID_STATUS_OFFLINE)
mi.flags |= CMIF_CHECKED;
mi.root = rootmenu;
@@ -914,7 +914,7 @@ void RebuildMenuOrder(void) continue;
CMenuItem mi;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
if (statusModeList[j] == ID_STATUS_OFFLINE)
mi.flags |= CMIF_CHECKED;
@@ -1145,14 +1145,14 @@ void InitCustomMenus(void) CreateServiceFunction(MS_CLIST_HKSTATUS, HotkeySetStatus);
HOTKEYDESC hkd = { sizeof(hkd) };
- hkd.ptszSection = L"Status";
- hkd.dwFlags = HKD_TCHAR;
+ hkd.pwszSection = L"Status";
+ hkd.dwFlags = HKD_UNICODE;
for (int i = 0; i < _countof(statusHotkeys); i++) {
char szName[30];
mir_snprintf(szName, "StatusHotKey_%d", i);
hkd.pszName = szName;
hkd.lParam = statusModeList[i];
- hkd.ptszDescription = fnGetStatusModeDescription(hkd.lParam, 0);
+ hkd.pwszDescription = fnGetStatusModeDescription(hkd.lParam, 0);
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, '0' + i) | HKF_MIRANDA_LOCAL;
hkd.pszService = MS_CLIST_HKSTATUS;
statusHotkeys[i] = Hotkey_Register(&hkd);
diff --git a/src/mir_app/src/menu_options.cpp b/src/mir_app/src/menu_options.cpp index a2acb5dfaa..c2d1bf2b5a 100644 --- a/src/mir_app/src/menu_options.cpp +++ b/src/mir_app/src/menu_options.cpp @@ -96,8 +96,8 @@ class CGenMenuOptionsPage : public CDlgBase else ptszCustomName = L""; - CMString tszValue(FORMAT, L"%d;%d;%S;%s", visible, runtimepos, pszParent, ptszCustomName); - db_set_ts(NULL, szModule, menuItemName, tszValue); + CMStringW tszValue(FORMAT, L"%d;%d;%S;%s", visible, runtimepos, pszParent, ptszCustomName); + db_set_ws(NULL, szModule, menuItemName, tszValue); if (pimi->mi.flags & CMIF_CUSTOM) db_set_s(NULL, szModule, CMStringA(FORMAT, "Custom%d", customOrder++), menuItemName); @@ -321,7 +321,7 @@ public: for (int i = 0; i < g_menus.getCount(); i++) { TIntMenuObject *p = g_menus[i]; if (p->id != (int)hStatusMenuObject && p->m_bUseUserDefinedItems) - m_menuObjects.AddString(TranslateTS(p->ptszDisplayName), p->id); + m_menuObjects.AddString(TranslateW(p->ptszDisplayName), p->id); } m_menuObjects.SetCurSel(0); diff --git a/src/mir_app/src/menu_utils.cpp b/src/mir_app/src/menu_utils.cpp index 838eb24344..b301b8cac0 100644 --- a/src/mir_app/src/menu_utils.cpp +++ b/src/mir_app/src/menu_utils.cpp @@ -78,7 +78,7 @@ LPTSTR GetMenuItemText(TMO_IntMenuItem *pimi) if (pimi->mi.flags & CMIF_KEEPUNTRANSLATED)
return pimi->mi.name.w;
- return TranslateTH(pimi->mi.hLangpack, pimi->mi.name.w);
+ return TranslateW_LP(pimi->mi.name.w, pimi->mi.hLangpack);
}
///////////////////////////////////////////////////////////////////////////////
@@ -241,7 +241,7 @@ MIR_APP_DLL(HGENMENU) Menu_GetProtocolRoot(PROTO_INTERFACE *pThis) CMenuItem mi;
mi.name.w = pThis->m_tszUserName;
mi.position = 500090000;
- mi.flags = CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
+ mi.flags = CMIF_UNICODE | CMIF_KEEPUNTRANSLATED;
mi.hIcolibItem = pThis->m_hProtoIcon;
char szUid[33];
@@ -685,7 +685,7 @@ MIR_APP_DLL(HGENMENU) Menu_CreateRoot(int hMenuObject, LPCTSTR ptszName, int pos return oldroot;
CMenuItem mi;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.hIcolibItem = hIcoLib;
mi.hLangpack = _hLang;
mi.name.w = (wchar_t*)ptszName;
@@ -875,7 +875,7 @@ static int sttReadOldItem(TMO_IntMenuItem *pmi, void *szModule) // mi.name.w
mir_snprintf(szSetting, "%s_name", menuItemName);
- wchar_t *tszCustomName = db_get_tsa(NULL, (char*)szModule, szSetting);
+ wchar_t *tszCustomName = db_get_wsa(NULL, (char*)szModule, szSetting);
if (tszCustomName != NULL) {
mir_free(pmi->ptszCustomName);
pmi->ptszCustomName = tszCustomName;
@@ -906,8 +906,8 @@ static int sttDumpItem(TMO_IntMenuItem *pmi, void *szModule) else
bin2hex(&pmi->mi.root->mi.uid, sizeof(MUUID), szRootUid);
- CMString szNewValue(FORMAT, L"%d;%d;%S;%s", bVisible, pmi->mi.position, szRootUid, ptszName);
- db_set_ts(NULL, (char*)szModule, menuItemName, szNewValue);
+ CMStringW szNewValue(FORMAT, L"%d;%d;%S;%s", bVisible, pmi->mi.position, szRootUid, ptszName);
+ db_set_ws(NULL, (char*)szModule, menuItemName, szNewValue);
Netlib_Logf(NULL, "MENU[%s] => %s, %d, %d", menuItemName, pmi->pszUniqName, bVisible, pmi->mi.position);
}
@@ -989,7 +989,7 @@ int Menu_LoadFromDatabase(TMO_IntMenuItem *pimi, void *szModule) bin2hex(&pimi->mi.uid, sizeof(pimi->mi.uid), menuItemName);
TIntMenuObject *pmo = pimi->parent;
- ptrW szValue(db_get_tsa(NULL, (char*)szModule, menuItemName));
+ ptrW szValue(db_get_wsa(NULL, (char*)szModule, menuItemName));
if (szValue == NULL)
return 0;
@@ -1221,7 +1221,7 @@ static int MO_RegisterIcon(TMO_IntMenuItem *pmi, void*) HICON hIcon = ImageList_GetIcon(pmi->parent->m_hMenuIcons, pmi->iconId, 0);
wchar_t sectionName[256];
- mir_snwprintf(sectionName, LPGENW("Menu icons") L"/%s", TranslateTS(pmi->parent->ptszDisplayName));
+ mir_snwprintf(sectionName, LPGENW("Menu icons") L"/%s", TranslateW(pmi->parent->ptszDisplayName));
char iconame[256], uname[100];
bin2hex(&pmi->mi.uid, sizeof(pmi->mi.uid), uname);
@@ -1242,7 +1242,7 @@ static int MO_RegisterIcon(TMO_IntMenuItem *pmi, void*) }
SKINICONDESC sid = { 0 };
- sid.flags = SIDF_TCHAR;
+ sid.flags = SIDF_UNICODE;
sid.section.w = sectionName;
sid.pszName = iconame;
sid.description.w = descr;
diff --git a/src/mir_app/src/meta_addto.cpp b/src/mir_app/src/meta_addto.cpp index 41e4d349d9..2a65e52656 100644 --- a/src/mir_app/src/meta_addto.cpp +++ b/src/mir_app/src/meta_addto.cpp @@ -141,7 +141,7 @@ static INT_PTR CALLBACK Meta_SelectDialogProc(HWND hwndDlg, UINT msg, WPARAM wPa CheckDlgButton(hwndDlg, IDC_ONLYAVAIL, BST_CHECKED); // Initially checked; display all metacontacts is only an option
// Besides, we can check if there is at least one metacontact to add the contact to.
if (BuildList(GetDlgItem(hwndDlg, IDC_METALIST), FALSE) <= 0) {
- if (MessageBox(hwndDlg, TranslateTS(szConvMsg), TranslateT("No suitable metacontact found"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1) == IDYES)
+ if (MessageBox(hwndDlg, TranslateW(szConvMsg), TranslateT("No suitable metacontact found"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1) == IDYES)
Meta_Convert(lParam, 0);
DestroyWindow(hwndDlg);
return TRUE;
@@ -187,7 +187,7 @@ static INT_PTR CALLBACK Meta_SelectDialogProc(HWND hwndDlg, UINT msg, WPARAM wPa case IDC_CHK_SRT:
SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_METALIST), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_METALIST), GWL_STYLE) ^ LBS_SORT);
if (BuildList(GetDlgItem(hwndDlg, IDC_METALIST), IsDlgButtonChecked(hwndDlg, IDC_CHK_SRT) ? TRUE : FALSE) <= 0) {
- if (MessageBox(hwndDlg, TranslateTS(szConvMsg), TranslateT("No suitable metacontact found"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1) == IDYES)
+ if (MessageBox(hwndDlg, TranslateW(szConvMsg), TranslateT("No suitable metacontact found"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1) == IDYES)
Meta_Convert(lParam, 0);
DestroyWindow(hwndDlg);
return TRUE;
diff --git a/src/mir_app/src/meta_edit.cpp b/src/mir_app/src/meta_edit.cpp index ecb690d268..67e593666e 100644 --- a/src/mir_app/src/meta_edit.cpp +++ b/src/mir_app/src/meta_edit.cpp @@ -169,7 +169,7 @@ static void ApplyChanges() ai.format = PA_FORMAT_UNKNOWN;
wcsncpy_s(ai.filename, L"X", _TRUNCATE);
if (CallProtoService(META_PROTO, PS_GETAVATARINFO, 0, (LPARAM)&ai) == GAIR_SUCCESS)
- db_set_ts(g_data.hMeta, "ContactPhoto", "File", ai.filename);
+ db_set_ws(g_data.hMeta, "ContactPhoto", "File", ai.filename);
}
}
@@ -304,7 +304,7 @@ static INT_PTR CALLBACK Meta_EditDialogProc(HWND hwndDlg, UINT msg, WPARAM wPara switch (LOWORD(wParam)) {
case IDC_VALIDATE: // Apply changes, if there is still one contact attached to the metacontact.
if (g_data.num_contacts == 0) { // Otherwise, delete the metacontact.
- if (IDYES == MessageBox(hwndDlg, TranslateTS(szDelMsg), TranslateT("Delete metacontact?"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1)) {
+ if (IDYES == MessageBox(hwndDlg, TranslateW(szDelMsg), TranslateT("Delete metacontact?"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1)) {
Meta_Delete(g_data.hMeta, 0);
DestroyWindow(hwndDlg);
}
@@ -319,7 +319,7 @@ static INT_PTR CALLBACK Meta_EditDialogProc(HWND hwndDlg, UINT msg, WPARAM wPara case IDOK:
if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_VALIDATE))) { // If there are changes that could be made,
if (g_data.num_contacts == 0) { // do the work that would have be done if the 'Apply' button was clicked.
- if (IDYES == MessageBox(hwndDlg, TranslateTS(szDelMsg), TranslateT("Delete metacontact?"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1)) {
+ if (IDYES == MessageBox(hwndDlg, TranslateW(szDelMsg), TranslateT("Delete metacontact?"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1)) {
Meta_Delete(g_data.hMeta, 0);
DestroyWindow(hwndDlg);
}
diff --git a/src/mir_app/src/meta_menu.cpp b/src/mir_app/src/meta_menu.cpp index 3929c057e8..cac1b4bdb2 100644 --- a/src/mir_app/src/meta_menu.cpp +++ b/src/mir_app/src/meta_menu.cpp @@ -49,7 +49,7 @@ static HGENMENU INT_PTR Meta_Convert(WPARAM wParam, LPARAM)
{
- ptrW tszGroup(db_get_tsa(wParam, "CList", "Group"));
+ ptrW tszGroup(db_get_wsa(wParam, "CList", "Group"));
// Create a new metacontact
MCONTACT hMetaContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
@@ -68,7 +68,7 @@ INT_PTR Meta_Convert(WPARAM wParam, LPARAM) Proto_AddToContact(hMetaContact, META_PROTO);
if (tszGroup)
- db_set_ts(hMetaContact, "CList", "Group", tszGroup);
+ db_set_ws(hMetaContact, "CList", "Group", tszGroup);
// Assign the contact to the MetaContact just created (and make default).
if (!Meta_Assign(wParam, hMetaContact, TRUE)) {
@@ -167,7 +167,7 @@ void Meta_RemoveContactNumber(DBCachedContact *ccMeta, int number, bool bUpdateI wcsncpy_s(ai.filename, L"X", _TRUNCATE);
if (CallProtoService(META_PROTO, PS_GETAVATARINFO, 0, (LPARAM)&ai) == GAIR_SUCCESS)
- db_set_ts(ccMeta->contactID, "ContactPhoto", "File", ai.filename);
+ db_set_ws(ccMeta->contactID, "ContactPhoto", "File", ai.filename);
}
}
}
@@ -207,7 +207,7 @@ INT_PTR Meta_Delete(WPARAM hContact, LPARAM bSkipQuestion) return 2;
if (cc->nSubs == 1) {
- if (IDYES == MessageBox(0, TranslateTS(szDelMsg), TranslateT("Delete metacontact?"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1))
+ if (IDYES == MessageBox(0, TranslateW(szDelMsg), TranslateT("Delete metacontact?"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1))
Meta_Delete(cc->contactID, 1);
return 0;
@@ -266,7 +266,7 @@ int Meta_ModifyMenu(WPARAM hMeta, LPARAM) Menu_ModifyItem(hMenuDelete, LPGENW("Remove from metacontact"));
// show subcontact menu items
- CMString tszNick;
+ CMStringW tszNick;
for (int i = 0; i < MAX_CONTACTS; i++) {
if (i >= cc->nSubs) {
Menu_ShowItem(hMenuContact[i], false);
diff --git a/src/mir_app/src/meta_services.cpp b/src/mir_app/src/meta_services.cpp index ae59188348..f42d3de877 100644 --- a/src/mir_app/src/meta_services.cpp +++ b/src/mir_app/src/meta_services.cpp @@ -299,7 +299,7 @@ int Meta_HandleACK(WPARAM, LPARAM lParam) return 0;
if (!db_get(ack->hContact, "ContactPhoto", "File", &dbv)) {
- db_set_ts(cc->contactID, "ContactPhoto", "File", dbv.ptszVal);
+ db_set_ws(cc->contactID, "ContactPhoto", "File", dbv.ptszVal);
db_free(&dbv);
}
@@ -380,7 +380,7 @@ int Meta_SettingChanged(WPARAM hContact, LPARAM lParam) mir_snprintf(buffer, "Nick%d", contact_number);
db_set(ccMeta->contactID, META_PROTO, buffer, &dcws->value);
- ptrW tszMyhandle(db_get_tsa(hContact, "CList", "MyHandle"));
+ ptrW tszMyhandle(db_get_wsa(hContact, "CList", "MyHandle"));
if (tszMyhandle == NULL) {
mir_snprintf(buffer, "CListName%d", contact_number);
db_set(ccMeta->contactID, META_PROTO, buffer, &dcws->value);
@@ -408,8 +408,8 @@ int Meta_SettingChanged(WPARAM hContact, LPARAM lParam) mir_snprintf(buffer, "CListName%d", contact_number);
DBVARIANT dbv;
- if (proto && !db_get_ts(hContact, proto, "Nick", &dbv)) {
- db_set_ts(ccMeta->contactID, META_PROTO, buffer, dbv.ptszVal);
+ if (proto && !db_get_ws(hContact, proto, "Nick", &dbv)) {
+ db_set_ws(ccMeta->contactID, META_PROTO, buffer, dbv.ptszVal);
db_free(&dbv);
}
else db_unset(ccMeta->contactID, META_PROTO, buffer);
@@ -430,7 +430,7 @@ int Meta_SettingChanged(WPARAM hContact, LPARAM lParam) db_set_w(ccMeta->contactID, META_PROTO, buffer, dcws->value.wVal);
mir_snprintf(buffer, "StatusString%d", contact_number);
- db_set_ts(ccMeta->contactID, META_PROTO, buffer, cli.pfnGetStatusModeDescription(dcws->value.wVal, 0));
+ db_set_ws(ccMeta->contactID, META_PROTO, buffer, cli.pfnGetStatusModeDescription(dcws->value.wVal, 0));
// set status to that of most online contact
MCONTACT hMostOnline = Meta_GetMostOnline(ccMeta);
@@ -448,7 +448,7 @@ int Meta_SettingChanged(WPARAM hContact, LPARAM lParam) ai.format = PA_FORMAT_UNKNOWN;
wcsncpy_s(ai.filename, L"X", _TRUNCATE);
if (CallProtoService(META_PROTO, PS_GETAVATARINFO, 0, (LPARAM)&ai) == GAIR_SUCCESS)
- db_set_ts(ccMeta->contactID, "ContactPhoto", "File", ai.filename);
+ db_set_ws(ccMeta->contactID, "ContactPhoto", "File", ai.filename);
}
}
@@ -607,7 +607,7 @@ static int Meta_SrmmIconClicked(WPARAM hMeta, LPARAM lParam) if (pa == NULL)
continue;
- CMString tszNick;
+ CMStringW tszNick;
if (options.menu_contact_label == DNT_DID)
tszNick = cli.pfnGetContactDisplayName(cc->pSubs[i], 0);
else
@@ -653,7 +653,7 @@ int Meta_ModulesLoaded(WPARAM, LPARAM) // create srmm icon
StatusIconData sid = { sizeof(sid) };
sid.szModule = META_PROTO;
- sid.flags = MBF_TCHAR;
+ sid.flags = MBF_UNICODE;
sid.tszTooltip = LPGENW("Select metacontact");
sid.hIcon = Skin_LoadProtoIcon(META_PROTO, ID_STATUS_ONLINE);
Srmm_AddIcon(&sid);
@@ -692,7 +692,7 @@ INT_PTR Meta_ContactMenuFunc(WPARAM hMeta, LPARAM lParam) // set default contact for sending/status and open message window
Meta_SetSrmmSub(hMeta, hContact);
db_mc_setDefaultNum(hMeta, lParam, false);
- CallService(MS_MSG_SENDMESSAGET, hMeta, 0);
+ CallService(MS_MSG_SENDMESSAGEW, hMeta, 0);
}
else // protocol does not support messaging - simulate double click
CallService(MS_CLIST_CONTACTDOUBLECLICKED, hContact, 0);
@@ -798,7 +798,7 @@ INT_PTR Meta_GetInfo(WPARAM, LPARAM lParam) ai.format = PA_FORMAT_UNKNOWN;
wcsncpy_s(ai.filename, L"X", _TRUNCATE);
if (CallProtoService(META_PROTO, PS_GETAVATARINFO, 0, (LPARAM)&ai) == GAIR_SUCCESS)
- db_set_ts(ccs->hContact, "ContactPhoto", "File", ai.filename);
+ db_set_ws(ccs->hContact, "ContactPhoto", "File", ai.filename);
hMostOnline = Meta_GetMostOnline(cc);
Meta_CopyContactNick(cc, hMostOnline);
diff --git a/src/mir_app/src/meta_utils.cpp b/src/mir_app/src/meta_utils.cpp index 8ef0a9876f..d15be199ec 100644 --- a/src/mir_app/src/meta_utils.cpp +++ b/src/mir_app/src/meta_utils.cpp @@ -44,7 +44,7 @@ int Meta_SetNick(char *szProto) if (tszNick == NULL)
return 1;
- db_set_ts(NULL, META_PROTO, "Nick", tszNick);
+ db_set_ws(NULL, META_PROTO, "Nick", tszNick);
return 0;
}
@@ -124,7 +124,7 @@ BOOL Meta_Assign(MCONTACT hSub, MCONTACT hMeta, BOOL set_as_default) // write the display name
mir_snprintf(buffer, "CListName%d", ccDest->nSubs);
- db_set_ts(hMeta, META_PROTO, buffer, cli.pfnGetContactDisplayName(hSub, 0));
+ db_set_ws(hMeta, META_PROTO, buffer, cli.pfnGetContactDisplayName(hSub, 0));
// Get the status
WORD status = db_get_w(hSub, szProto, "Status", ID_STATUS_OFFLINE);
@@ -141,7 +141,7 @@ BOOL Meta_Assign(MCONTACT hSub, MCONTACT hMeta, BOOL set_as_default) mir_snprintf(buffer, "StatusString%d", ccDest->nSubs);
wchar_t *szStatus = cli.pfnGetStatusModeDescription(status, 0);
- db_set_ts(hMeta, META_PROTO, buffer, szStatus);
+ db_set_ws(hMeta, META_PROTO, buffer, szStatus);
// Write the link in the contact
db_set_dw(hSub, META_PROTO, "ParentMeta", hMeta);
@@ -173,7 +173,7 @@ BOOL Meta_Assign(MCONTACT hSub, MCONTACT hMeta, BOOL set_as_default) wcsncpy_s(ai.filename, L"X", _TRUNCATE);
if (CallProtoService(META_PROTO, PS_GETAVATARINFO, 0, (LPARAM)&ai) == GAIR_SUCCESS)
- db_set_ts(hMeta, "ContactPhoto", "File", ai.filename);
+ db_set_ws(hMeta, "ContactPhoto", "File", ai.filename);
}
// merge sub's events to the meta-history
@@ -431,16 +431,16 @@ int Meta_CopyContactNick(DBCachedContact *ccMeta, MCONTACT hContact) return 1;
if (options.clist_contact_name == CNNT_NICK) {
- ptrW tszNick(db_get_tsa(hContact, szProto, "Nick"));
+ ptrW tszNick(db_get_wsa(hContact, szProto, "Nick"));
if (tszNick) {
- db_set_ts(ccMeta->contactID, META_PROTO, "Nick", tszNick);
+ db_set_ws(ccMeta->contactID, META_PROTO, "Nick", tszNick);
return 0;
}
}
else if (options.clist_contact_name == CNNT_DISPLAYNAME) {
wchar_t *name = cli.pfnGetContactDisplayName(hContact, 0);
if (name && mir_wstrcmp(name, TranslateT("(Unknown contact)")) != 0) {
- db_set_ts(ccMeta->contactID, META_PROTO, "Nick", name);
+ db_set_ws(ccMeta->contactID, META_PROTO, "Nick", name);
return 0;
}
}
@@ -499,7 +499,7 @@ int Meta_SwapContacts(DBCachedContact *cc, int n1, int n2) /////////////////////////////////////////////////////////////////////////////////////////
-void Meta_GetSubNick(MCONTACT hMeta, int i, CMString &tszDest)
+void Meta_GetSubNick(MCONTACT hMeta, int i, CMStringW &tszDest)
{
char idStr[50];
mir_snprintf(idStr, "Login%d", i);
diff --git a/src/mir_app/src/metacontacts.h b/src/mir_app/src/metacontacts.h index c47b419729..8aadcca5cb 100644 --- a/src/mir_app/src/metacontacts.h +++ b/src/mir_app/src/metacontacts.h @@ -55,7 +55,7 @@ int Meta_SuppressStatus(int suppress); int Meta_CopyContactNick(DBCachedContact *cc, MCONTACT hContact);
int Meta_SetAllNicks();
int Meta_SwapContacts(DBCachedContact *cc, int contact_number1, int contact_number2);
-void Meta_GetSubNick(MCONTACT hMeta, int i, CMString &tszDest);
+void Meta_GetSubNick(MCONTACT hMeta, int i, CMStringW &tszDest);
MCONTACT Meta_GetMostOnline(DBCachedContact *cc);
MCONTACT Meta_GetMostOnlineSupporting(DBCachedContact *cc, int pflagnum, unsigned long capability);
diff --git a/src/mir_app/src/movetogroup.cpp b/src/mir_app/src/movetogroup.cpp index 541404e28b..6f229c38d7 100644 --- a/src/mir_app/src/movetogroup.cpp +++ b/src/mir_app/src/movetogroup.cpp @@ -70,7 +70,7 @@ static void AddGroupItem(HGENMENU hRoot, wchar_t* name, int pos, WPARAM param, b mi.root = hRoot;
mi.position = pos;
mi.name.w = PrepareGroupName(name);
- mi.flags = CMIF_SYSTEM | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
+ mi.flags = CMIF_SYSTEM | CMIF_UNICODE | CMIF_KEEPUNTRANSLATED;
if (checked)
mi.flags |= CMIF_CHECKED;
mi.pszService = MTG_MOVE;
@@ -92,7 +92,7 @@ static int OnContactMenuBuild(WPARAM wParam, LPARAM) Menu_RemoveItem((HGENMENU)lphGroupsItems[i]);
lphGroupsItems.destroy();
- ptrW szContactGroup(db_get_tsa(wParam, "CList", "Group"));
+ ptrW szContactGroup(db_get_wsa(wParam, "CList", "Group"));
int pos = 1000;
@@ -105,7 +105,7 @@ static int OnContactMenuBuild(WPARAM wParam, LPARAM) _itoa(i, intname, 10);
DBVARIANT dbv;
- if (db_get_ts(NULL, "CListGroups", intname, &dbv))
+ if (db_get_ws(NULL, "CListGroups", intname, &dbv))
break;
if (dbv.ptszVal[0])
diff --git a/src/mir_app/src/netliblog.cpp b/src/mir_app/src/netliblog.cpp index 7c78bf6561..300caa9684 100644 --- a/src/mir_app/src/netliblog.cpp +++ b/src/mir_app/src/netliblog.cpp @@ -42,7 +42,7 @@ struct { int showUser;
int dumpSent, dumpRecv, dumpProxy, dumpSsl;
int textDumps, autoDetectText;
- CMString tszFile, tszUserFile;
+ CMStringW tszFile, tszUserFile;
}
static logOptions = { 0 };
@@ -64,16 +64,16 @@ static void InitLog() hLogger = NULL;
}
- ptrW szBuf(db_get_tsa(NULL, "Netlib", "File"));
+ ptrW szBuf(db_get_wsa(NULL, "Netlib", "File"));
if (mir_wstrlen(szBuf)) {
logOptions.tszUserFile = szBuf.get();
wchar_t path[MAX_PATH];
- PathToAbsoluteT(VARST(szBuf), path);
+ PathToAbsoluteW(VARSW(szBuf), path);
logOptions.tszFile = path;
}
else {
- db_set_ts(NULL, "Netlib", "File", logOptions.tszUserFile = L"%miranda_logpath%\\netlog.txt");
+ db_set_ws(NULL, "Netlib", "File", logOptions.tszUserFile = L"%miranda_logpath%\\netlog.txt");
logOptions.tszFile = Utils_ReplaceVarsT(logOptions.tszUserFile);
}
@@ -105,7 +105,7 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wPa CheckDlgButton(hwndDlg, IDC_AUTODETECTTEXT, logOptions.autoDetectText ? BST_CHECKED : BST_UNCHECKED);
{
for (int i=0; i < _countof(szTimeFormats); i++)
- SendDlgItemMessage(hwndDlg, IDC_TIMEFORMAT, CB_ADDSTRING, 0, (LPARAM)TranslateTS(szTimeFormats[i]));
+ SendDlgItemMessage(hwndDlg, IDC_TIMEFORMAT, CB_ADDSTRING, 0, (LPARAM)TranslateW(szTimeFormats[i]));
}
SendDlgItemMessage(hwndDlg, IDC_TIMEFORMAT, CB_SETCURSEL, logOptions.timeFormat, 0);
CheckDlgButton(hwndDlg, IDC_SHOWNAMES, logOptions.showUser ? BST_CHECKED : BST_UNCHECKED);
@@ -150,7 +150,7 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wPa wchar_t path[MAX_PATH];
GetWindowText((HWND)lParam, path, _countof(path));
- PathToAbsoluteT(VARST(path), path);
+ PathToAbsoluteW(VARSW(path), path);
SetDlgItemText(hwndDlg, IDC_PATH, path);
}
break;
@@ -202,12 +202,12 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wPa case IDOK:
GetDlgItemText(hwndDlg, IDC_RUNATSTART, str, _countof(str));
- db_set_ts(NULL, "Netlib", "RunAtStart", str);
+ db_set_ws(NULL, "Netlib", "RunAtStart", str);
db_set_b(NULL, "Netlib", "ShowLogOptsAtStart", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWTHISDLGATSTART));
GetDlgItemText(hwndDlg, IDC_FILENAME, str, _countof(str));
logOptions.tszUserFile = rtrimw(str);
- db_set_ts(NULL, "Netlib", "File", str);
+ db_set_ws(NULL, "Netlib", "File", str);
GetDlgItemText(hwndDlg, IDC_PATH, str, _countof(str));
logOptions.tszFile = rtrimw(str);
@@ -515,7 +515,7 @@ void NetlibLogInit(void) if (db_get_b(NULL, "Netlib", "ShowLogOptsAtStart", 0))
NetlibLogShowOptions();
- ptrW szBuf(db_get_tsa(NULL, "Netlib", "RunAtStart"));
+ ptrW szBuf(db_get_wsa(NULL, "Netlib", "RunAtStart"));
if (szBuf) {
STARTUPINFO si = { sizeof(si) };
PROCESS_INFORMATION pi;
diff --git a/src/mir_app/src/netlibopts.cpp b/src/mir_app/src/netlibopts.cpp index 3a3c3512a5..aaa22b5887 100644 --- a/src/mir_app/src/netlibopts.cpp +++ b/src/mir_app/src/netlibopts.cpp @@ -87,7 +87,7 @@ static void EnableMultipleControls(HWND hwndDlg, const UINT *controls, int cCont static void AddProxyTypeItem(HWND hwndDlg, int type, int selectType)
{
- int i = SendDlgItemMessage(hwndDlg, IDC_PROXYTYPE, CB_ADDSTRING, 0, (LPARAM)(type == 0 ? TranslateTS(szProxyTypes[type]) : szProxyTypes[type]));
+ int i = SendDlgItemMessage(hwndDlg, IDC_PROXYTYPE, CB_ADDSTRING, 0, (LPARAM)(type == 0 ? TranslateW(szProxyTypes[type]) : szProxyTypes[type]));
SendDlgItemMessage(hwndDlg, IDC_PROXYTYPE, CB_SETITEMDATA, i, type);
if (type == selectType)
SendDlgItemMessage(hwndDlg, IDC_PROXYTYPE, CB_SETCURSEL, i, 0);
diff --git a/src/mir_app/src/newplugins.cpp b/src/mir_app/src/newplugins.cpp index 51edc215b1..1f22c5e15e 100644 --- a/src/mir_app/src/newplugins.cpp +++ b/src/mir_app/src/newplugins.cpp @@ -569,7 +569,7 @@ bool LoadCorePlugin(MuuidReplacement &mr) pluginEntry* pPlug = OpenPlugin(tszPlugName, L"Core", exe);
if (pPlug->pclass & PCLASS_FAILED) {
LBL_Error:
- MessageBox(NULL, CMString(FORMAT, TranslateTS(tszCoreErr), mr.stdplugname), TranslateT("Fatal error"), MB_OK | MB_ICONSTOP);
+ MessageBox(NULL, CMStringW(FORMAT, TranslateW(tszCoreErr), mr.stdplugname), TranslateT("Fatal error"), MB_OK | MB_ICONSTOP);
Plugin_UnloadDyn(pPlug);
mr.pImpl = NULL;
@@ -862,7 +862,7 @@ int LoadNewPluginsModuleInfos(void) mirandaVersion = (DWORD)CallService(MS_SYSTEM_GETVERSION, 0, 0);
// remember where the mirandaboot.ini goes
- PathToAbsoluteT(L"mirandaboot.ini", mirandabootini);
+ PathToAbsoluteW(L"mirandaboot.ini", mirandabootini);
// look for all *.dll's
enumPlugins(scanPluginsDir, 0, 0);
diff --git a/src/mir_app/src/options.cpp b/src/mir_app/src/options.cpp index 556fb50687..f572d9865a 100644 --- a/src/mir_app/src/options.cpp +++ b/src/mir_app/src/options.cpp @@ -130,7 +130,7 @@ struct OptionsPageData : public MZeroedObject {
if (flags & ODPF_DONTTRANSLATE)
return ptszStr;
- return TranslateTH(hLangpack, ptszStr);
+ return TranslateW_LP(ptszStr, hLangpack);
}
};
@@ -564,7 +564,7 @@ static void RebuildPageTree(HWND hdlg, OptionsDlgData *dat) HWND oldWnd = NULL;
HWND oldTab = NULL;
- CMString fullTitle;
+ CMStringW fullTitle;
OptionsPageData *opd = dat->getCurrent();
if (opd != NULL) {
@@ -588,9 +588,9 @@ static void RebuildPageTree(HWND hdlg, OptionsDlgData *dat) continue;
opd = dat->arOpd[i];
- wchar_t *ptszGroup = TranslateTH(opd->hLangpack, opd->ptszGroup);
+ wchar_t *ptszGroup = TranslateW_LP(opd->ptszGroup, opd->hLangpack);
wchar_t *ptszTitle = opd->getString(opd->ptszTitle), *useTitle;
- wchar_t *ptszTab = TranslateTH(opd->hLangpack, opd->ptszTab);
+ wchar_t *ptszTab = TranslateW_LP(opd->ptszTab, opd->hLangpack);
tvis.hParent = NULL;
useTitle = ptszTitle;
@@ -798,10 +798,10 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L ptrW lastPage, lastGroup, lastTab;
OPENOPTIONSDIALOG *ood = (OPENOPTIONSDIALOG*)psh->pStartPage;
if (ood->pszPage == NULL) {
- lastPage = db_get_tsa(NULL, "Options", "LastPage");
+ lastPage = db_get_wsa(NULL, "Options", "LastPage");
if (ood->pszGroup == NULL)
- lastGroup = db_get_tsa(NULL, "Options", "LastGroup");
+ lastGroup = db_get_wsa(NULL, "Options", "LastGroup");
else
lastGroup = mir_a2u(ood->pszGroup);
}
@@ -811,7 +811,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L }
if (ood->pszTab == NULL)
- lastTab = db_get_tsa(NULL, "Options", "LastTab");
+ lastTab = db_get_wsa(NULL, "Options", "LastTab");
else
lastTab = mir_a2u(ood->pszTab);
@@ -979,7 +979,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L if (mir_wstrcmp(opd->ptszTitle, p->ptszTitle) || mir_wstrcmp(opd->ptszGroup, p->ptszGroup))
continue;
- tie.pszText = TranslateTH(p->hLangpack, p->ptszTab);
+ tie.pszText = TranslateW_LP(p->ptszTab, p->hLangpack);
tie.lParam = i;
TabCtrl_InsertItem(hwndTab, pages, &tie);
if (!mir_wstrcmp(opd->ptszTab, p->ptszTab))
@@ -1107,14 +1107,14 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L opd = dat->getCurrent();
if (opd) {
if (opd->ptszTab)
- db_set_ts(NULL, "Options", "LastTab", opd->ptszTab);
+ db_set_ws(NULL, "Options", "LastTab", opd->ptszTab);
else
db_unset(NULL, "Options", "LastTab");
if (opd->ptszGroup)
- db_set_ts(NULL, "Options", "LastGroup", opd->ptszGroup);
+ db_set_ws(NULL, "Options", "LastGroup", opd->ptszGroup);
else
db_unset(NULL, "Options", "LastGroup");
- db_set_ts(NULL, "Options", "LastPage", opd->ptszTitle);
+ db_set_ws(NULL, "Options", "LastPage", opd->ptszTitle);
}
else {
db_unset(NULL, "Options", "LastTab");
@@ -1176,11 +1176,11 @@ static void OpenOptionsNow(int _hLang, const char *pszGroup, const char *pszPage HTREEITEM hItem = NULL;
if (pszGroup != NULL) {
ptrW ptszGroup(mir_a2u(pszGroup));
- hItem = FindNamedTreeItemAtRoot(GetDlgItem(hwndOptions, IDC_PAGETREE), TranslateTH(_hLang, ptszGroup));
+ hItem = FindNamedTreeItemAtRoot(GetDlgItem(hwndOptions, IDC_PAGETREE), TranslateW_LP(ptszGroup, _hLang));
if (hItem != NULL)
- hItem = FindNamedTreeItemAtChildren(GetDlgItem(hwndOptions, IDC_PAGETREE), hItem, TranslateTH(_hLang, ptszPage));
+ hItem = FindNamedTreeItemAtChildren(GetDlgItem(hwndOptions, IDC_PAGETREE), hItem, TranslateW_LP(ptszPage, _hLang));
}
- else hItem = FindNamedTreeItemAtRoot(GetDlgItem(hwndOptions, IDC_PAGETREE), TranslateTH(_hLang, ptszPage));
+ else hItem = FindNamedTreeItemAtRoot(GetDlgItem(hwndOptions, IDC_PAGETREE), TranslateW_LP(ptszPage, _hLang));
if (hItem != NULL)
TreeView_SelectItem(GetDlgItem(hwndOptions, IDC_PAGETREE), hItem);
diff --git a/src/mir_app/src/options_ei.cpp b/src/mir_app/src/options_ei.cpp index fb6f3778dd..060fa85b93 100644 --- a/src/mir_app/src/options_ei.cpp +++ b/src/mir_app/src/options_ei.cpp @@ -111,7 +111,7 @@ class CExtraIconOptsDlg : public CDlgBase HTREEITEM Tree_AddExtraIconGroup(intlist &group, bool selected, HTREEITEM hAfter = TVI_LAST)
{
intlist *ids = new intlist();
- CMString desc;
+ CMStringW desc;
int img = 0;
for (int i = 0; i < group.count; i++) {
BaseExtraIcon *extra = registeredExtraIcons[group.data[i] - 1];
@@ -254,7 +254,7 @@ public: int numSlots = GetNumberOfSlots();
if (numSlots < (int)registeredExtraIcons.getCount()) {
HWND label = GetDlgItem(m_hwnd, IDC_MAX_ICONS_L);
- SetWindowText(label, CMString(FORMAT, TranslateT("*only the first %d icons will be shown"), numSlots));
+ SetWindowText(label, CMStringW(FORMAT, TranslateT("*only the first %d icons will be shown"), numSlots));
ShowWindow(label, SW_SHOW);
}
diff --git a/src/mir_app/src/path.cpp b/src/mir_app/src/path.cpp index cc1986da61..60687a30e4 100644 --- a/src/mir_app/src/path.cpp +++ b/src/mir_app/src/path.cpp @@ -36,7 +36,7 @@ wchar_t* GetContactID(MCONTACT hContact) {
char *szProto = GetContactProto(hContact);
if (db_get_b(hContact, szProto, "ChatRoom", 0) == 1)
- return db_get_tsa(hContact, szProto, "ChatRoomID");
+ return db_get_wsa(hContact, szProto, "ChatRoomID");
return Contact_GetInfo(CNF_UNIQUEID, hContact, szProto);
}
diff --git a/src/mir_app/src/pluginopts.cpp b/src/mir_app/src/pluginopts.cpp index cc4e3132b5..42c20aabe3 100644 --- a/src/mir_app/src/pluginopts.cpp +++ b/src/mir_app/src/pluginopts.cpp @@ -32,7 +32,7 @@ extern MUUID miid_clist, miid_database, miid_protocol; HANDLE hevLoadModule, hevUnloadModule;
static bool bOldMode = false;
-static CMString szFilter;
+static CMStringW szFilter;
static UINT_PTR timerID;
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/mir_app/src/profilemanager.cpp b/src/mir_app/src/profilemanager.cpp index bac436b91a..0c24f1738c 100644 --- a/src/mir_app/src/profilemanager.cpp +++ b/src/mir_app/src/profilemanager.cpp @@ -115,7 +115,7 @@ class CCreateProfileDlg : public CDlgBase // now the file should be gone! } // ask the database to create the profile - CreatePathToFileT(profile); + CreatePathToFileW(profile); if ((err = link->makeDatabase(profile)) != ERROR_SUCCESS) { mir_snwprintf(buf, TranslateT("Unable to create the profile '%s', the error was %x"), file, err); MessageBox(m_hwnd, buf, TranslateT("Problem creating profile"), MB_ICONERROR | MB_OK); @@ -154,7 +154,7 @@ public: else { for (int i = 0; i < arDbPlugins.getCount(); i++) { DATABASELINK *p = arDbPlugins[i]; - m_driverList.AddString(TranslateTS(p->szFullName), (LPARAM)p); + m_driverList.AddString(TranslateW(p->szFullName), (LPARAM)p); } } @@ -302,7 +302,7 @@ class CChooseProfileDlg : public CDlgBase if (bFileLocked) // file locked list.SetItemText(iItem, 1, TranslateT("<In use>")); else - list.SetItemText(iItem, 1, TranslateTS(dblink->szFullName)); + list.SetItemText(iItem, 1, TranslateW(dblink->szFullName)); } else list.SetItemText(iItem, 1, TranslateT("<Unknown format>")); @@ -615,7 +615,7 @@ public: for (int i = 0; i < servicePlugins.getCount(); i++) { pluginEntry *p = servicePlugins[i]; - m_servicePlugs.AddString(TranslateTS(p->pluginname), i); + m_servicePlugs.AddString(TranslateW(p->pluginname), i); } } } diff --git a/src/mir_app/src/proto_accs.cpp b/src/mir_app/src/proto_accs.cpp index c6fdab3704..8999e88f06 100644 --- a/src/mir_app/src/proto_accs.cpp +++ b/src/mir_app/src/proto_accs.cpp @@ -90,7 +90,7 @@ void LoadDbAccounts(void) if (ver >= 4) {
_itoa(OFFSET_NAME + i, buf, 10);
- pa->tszAccountName = db_get_tsa(NULL, "Protocols", buf);
+ pa->tszAccountName = db_get_wsa(NULL, "Protocols", buf);
_itoa(OFFSET_ENABLED + i, buf, 10);
pa->bIsEnabled = db_get_dw(NULL, "Protocols", buf, 1) != 0;
@@ -179,7 +179,7 @@ void WriteDbAccounts() db_set_dw(NULL, "Protocols", buf, pa->bIsEnabled);
_itoa(OFFSET_NAME + i, buf, 10);
- db_set_ts(NULL, "Protocols", buf, pa->tszAccountName);
+ db_set_ws(NULL, "Protocols", buf, pa->tszAccountName);
}
db_unset(0, "Protocols", "ProtoCount");
diff --git a/src/mir_app/src/protocols.cpp b/src/mir_app/src/protocols.cpp index 4f1f1cde42..acbcf1c409 100644 --- a/src/mir_app/src/protocols.cpp +++ b/src/mir_app/src/protocols.cpp @@ -244,7 +244,7 @@ static INT_PTR Proto_ContactIsTyping(WPARAM wParam, LPARAM lParam) void Proto_SetStatus(const char *szProto, unsigned status)
{
if (CallProtoServiceInt(NULL, szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND) {
- ptrW tszAwayMsg((wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGT, status, (LPARAM)szProto));
+ ptrW tszAwayMsg((wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGW, status, (LPARAM)szProto));
CallProtoServiceInt(NULL, szProto, PS_SETAWAYMSG, status, tszAwayMsg);
}
CallProtoServiceInt(NULL, szProto, PS_SETSTATUS, status, 0);
diff --git a/src/mir_app/src/searchresults.cpp b/src/mir_app/src/searchresults.cpp index 571712de7b..8f05b95e4d 100644 --- a/src/mir_app/src/searchresults.cpp +++ b/src/mir_app/src/searchresults.cpp @@ -71,7 +71,7 @@ void LoadColumnSizes(HWND hwndResults, const char *szProto) bool bNeedsFree = false;
lvc.mask = LVCF_TEXT | LVCF_WIDTH;
if (szColumnNames[i] != NULL)
- lvc.pszText = TranslateTS(szColumnNames[i]);
+ lvc.pszText = TranslateW(szColumnNames[i]);
else {
if (i == COLUMNID_HANDLE) {
lvc.pszText = L"ID";
@@ -243,7 +243,7 @@ int BeginSearch(HWND, struct FindAddDlgData *dat, const char *szProto, const cha void SetStatusBarSearchInfo(HWND hwndStatus, struct FindAddDlgData *dat)
{
- CMString str;
+ CMStringW str;
if (dat->searchCount != 0) {
str = TranslateT("Searching");
@@ -270,7 +270,7 @@ struct ProtoResultsSummary void SetStatusBarResultInfo(HWND hwndDlg)
{
HWND hwndResults = GetDlgItem(hwndDlg, IDC_RESULTS);
- CMString str;
+ CMStringW str;
int total = ListView_GetItemCount(hwndResults);
if (total != 0) {
diff --git a/src/mir_app/src/services.cpp b/src/mir_app/src/services.cpp index fc081a19ce..65b27c4862 100644 --- a/src/mir_app/src/services.cpp +++ b/src/mir_app/src/services.cpp @@ -142,7 +142,7 @@ int GetFontSettingFromDB(char *settings_group, char *prefix, LOGFONT *lf, COLORR strncpy_s(idstr, prefix, _TRUNCATE);
int retval = 0;
- ptrW tszGroup(db_get_tsa(NULL, settings_group, idstr));
+ ptrW tszGroup(db_get_wsa(NULL, settings_group, idstr));
if (tszGroup != NULL)
wcsncpy_s(lf->lfFaceName, tszGroup, _TRUNCATE);
else
@@ -196,7 +196,7 @@ int GetFontSettingFromDB(char *settings_group, char *prefix, LOGFONT *lf, COLORR return retval;
}
-int CreateFromFontSettings(FontSettingsT *fs, LOGFONT *lf)
+int CreateFromFontSettings(FontSettingsW *fs, LOGFONT *lf)
{
GetDefaultFontSetting(lf, 0);
@@ -217,7 +217,7 @@ int CreateFromFontSettings(FontSettingsT *fs, LOGFONT *lf) return 0;
}
-void UpdateFontSettings(FontIDW *font_id, FontSettingsT *fontsettings)
+void UpdateFontSettings(FontIDW *font_id, FontSettingsW *fontsettings)
{
LOGFONT lf;
COLORREF colour;
diff --git a/src/mir_app/src/skin.h b/src/mir_app/src/skin.h index 121169f8c3..2b78632534 100644 --- a/src/mir_app/src/skin.h +++ b/src/mir_app/src/skin.h @@ -38,7 +38,7 @@ struct THotkeyItem {
THotkeyType type;
char *pszService, *pszName; // pszName is valid _only_ for "root" hotkeys
- wchar_t *ptszSection, *ptszDescription;
+ wchar_t *pwszSection, *pwszDescription;
LPARAM lParam;
WORD DefHotkey, Hotkey;
bool Enabled;
@@ -56,8 +56,8 @@ struct THotkeyItem bool UnregisterHotkey; // valid only during WM_APP message in options UI, used to remove unregistered hotkeys from options
- __inline wchar_t* getSection() const { return TranslateTH(hLangpack, ptszSection); }
- __inline wchar_t* getDescr() const { return TranslateTH(hLangpack, ptszDescription); }
+ __inline wchar_t* getSection() const { return TranslateW_LP(pwszSection, hLangpack); }
+ __inline wchar_t* getDescr() const { return TranslateW_LP(pwszDescription, hLangpack); }
};
extern LIST<THotkeyItem> hotkeys;
diff --git a/src/mir_app/src/skin2opts.cpp b/src/mir_app/src/skin2opts.cpp index bfaf0c505e..7c240f1a6d 100644 --- a/src/mir_app/src/skin2opts.cpp +++ b/src/mir_app/src/skin2opts.cpp @@ -57,7 +57,7 @@ static HICON ExtractIconFromPath(const wchar_t *path, int cxIcon, int cyIcon) n = _wtoi(comma + 1);
*comma = 0;
}
- PathToAbsoluteT(file, fileFull);
+ PathToAbsoluteW(file, fileFull);
hIcon = NULL;
//SHOULD BE REPLACED WITH GOOD ENOUGH FUNCTION
@@ -681,7 +681,7 @@ INT_PTR CALLBACK DlgProcIcoLibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM *sectionName = 0;
}
- pItemName = TranslateTS(pItemName);
+ pItemName = TranslateW(pItemName);
hItem = FindNamedTreeItemAt(hwndTree, hSection, pItemName);
if (!sectionName || !hItem) {
if (!hItem) {
@@ -908,7 +908,7 @@ INT_PTR CALLBACK DlgProcIcoLibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM }
}
else if (item->temp_file) {
- db_set_ts(NULL, "SkinIcons", item->name, item->temp_file);
+ db_set_ws(NULL, "SkinIcons", item->name, item->temp_file);
item->source_small->release();
item->source_small = NULL;
SafeDestroyIcon(item->temp_icon);
diff --git a/src/mir_app/src/skinicons.cpp b/src/mir_app/src/skinicons.cpp index d653fb7aaf..f9c5a83088 100644 --- a/src/mir_app/src/skinicons.cpp +++ b/src/mir_app/src/skinicons.cpp @@ -282,7 +282,7 @@ MIR_APP_DLL(HICON) Skin_LoadProtoIcon(const char *szProto, int status, bool big) SKINICONDESC sid = { 0 };
sid.section.w = tszSection;
- sid.flags = SIDF_ALL_TCHAR;
+ sid.flags = SIDF_ALL_UNICODE;
str = wcsrchr(szPath, '\\');
if (str != NULL)
@@ -385,7 +385,7 @@ int LoadSkinIcons(void) char iconName[MAX_PATH];
SKINICONDESC sid = { 0 };
sid.defaultFile.w = modulePath;
- sid.flags = SIDF_PATH_TCHAR;
+ sid.flags = SIDF_PATH_UNICODE;
sid.pszName = iconName;
// Add main icons to list
diff --git a/src/mir_app/src/sounds.cpp b/src/mir_app/src/sounds.cpp index 847b456494..ebc1ea7cc6 100644 --- a/src/mir_app/src/sounds.cpp +++ b/src/mir_app/src/sounds.cpp @@ -29,19 +29,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct SoundItem
{
char* name;
- wchar_t* ptszSection;
- wchar_t* ptszDescription;
+ wchar_t* pwszSection;
+ wchar_t* pwszDescription;
wchar_t* ptszTempFile;
int hLangpack;
- __inline wchar_t* getSection() const { return TranslateTH(hLangpack, ptszSection); }
- __inline wchar_t* getDescr() const { return TranslateTH(hLangpack, ptszDescription); }
+ __inline wchar_t* getSection() const { return TranslateW_LP(pwszSection, hLangpack); }
+ __inline wchar_t* getDescr() const { return TranslateW_LP(pwszDescription, hLangpack); }
__inline void clear(void)
{
mir_free(name);
- mir_free(ptszSection);
- mir_free(ptszDescription);
+ mir_free(pwszSection);
+ mir_free(pwszDescription);
mir_free(ptszTempFile);
}
};
@@ -77,31 +77,31 @@ static INT_PTR ServiceSkinAddNewSound(WPARAM wParam, LPARAM lParam) if (ssd->cbSize != sizeof(SKINSOUNDDESCEX) || ssd->pszName == NULL || ssd->pszDescription == NULL)
return 1;
- SoundItem* item = new SoundItem; // due to OBJLIST
+ SoundItem *item = new SoundItem; // due to OBJLIST
item->name = mir_strdup(ssd->pszName);
item->ptszTempFile = NULL;
item->hLangpack = (int)wParam;
arSounds.insert(item);
- wchar_t* ptszDefaultFile;
+ wchar_t *pwszDefaultFile;
if (ssd->dwFlags & SSDF_UNICODE) {
- item->ptszDescription = mir_wstrdup(ssd->ptszDescription);
- item->ptszSection = mir_wstrdup((ssd->pszSection != NULL) ? ssd->ptszSection : L"Other");
- ptszDefaultFile = mir_wstrdup(ssd->ptszDefaultFile);
+ item->pwszDescription = mir_wstrdup(ssd->pwszDescription);
+ item->pwszSection = mir_wstrdup((ssd->pszSection != NULL) ? ssd->pwszSection : L"Other");
+ pwszDefaultFile = mir_wstrdup(ssd->pwszDefaultFile);
}
else {
- item->ptszDescription = mir_a2u(ssd->pszDescription);
- item->ptszSection = mir_a2u((ssd->pszSection != NULL) ? ssd->pszSection : "Other");
- ptszDefaultFile = mir_a2u(ssd->pszDefaultFile);
+ item->pwszDescription = mir_a2u(ssd->pszDescription);
+ item->pwszSection = mir_a2u((ssd->pszSection != NULL) ? ssd->pszSection : "Other");
+ pwszDefaultFile = mir_a2u(ssd->pszDefaultFile);
}
- if (ptszDefaultFile) {
+ if (pwszDefaultFile) {
DBVARIANT dbv;
if (db_get_s(NULL, "SkinSounds", item->name, &dbv))
- db_set_ts(NULL, "SkinSounds", item->name, ptszDefaultFile);
+ db_set_ws(NULL, "SkinSounds", item->name, pwszDefaultFile);
else
db_free(&dbv);
- mir_free(ptszDefaultFile);
+ mir_free(pwszDefaultFile);
}
return 0;
@@ -109,7 +109,7 @@ static INT_PTR ServiceSkinAddNewSound(WPARAM wParam, LPARAM lParam) static int SkinPlaySoundDefault(WPARAM wParam, LPARAM lParam)
{
- wchar_t* pszFile = (wchar_t*) lParam;
+ wchar_t *pszFile = (wchar_t*) lParam;
if (pszFile && (db_get_b(NULL, "Skin", "UseSound", 0) || (int)wParam == 1))
PlaySound(pszFile, NULL, SND_ASYNC | SND_FILENAME | SND_NOSTOP);
@@ -123,7 +123,7 @@ static INT_PTR ServiceSkinPlaySoundFile(WPARAM, LPARAM lParam) return 1;
wchar_t tszFull[MAX_PATH];
- PathToAbsoluteT(ptszFileName, tszFull);
+ PathToAbsoluteW(ptszFileName, tszFull);
NotifyEventHooks(hPlayEvent, 0, (LPARAM)tszFull);
return 0;
}
@@ -143,7 +143,7 @@ static INT_PTR ServiceSkinPlaySound(WPARAM, LPARAM lParam) return 1;
DBVARIANT dbv;
- if ( db_get_ts(NULL, "SkinSounds", pszSoundName, &dbv) == 0) {
+ if ( db_get_ws(NULL, "SkinSounds", pszSoundName, &dbv) == 0) {
ServiceSkinPlaySoundFile(0, (LPARAM)dbv.ptszVal);
db_free(&dbv);
return 0;
@@ -265,9 +265,9 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM NotifyEventHooks(hPlayEvent, 1, (LPARAM)arSounds[tvi.lParam].ptszTempFile);
else {
DBVARIANT dbv;
- if (!db_get_ts(NULL, "SkinSounds", arSounds[tvi.lParam].name, &dbv)) {
+ if (!db_get_ws(NULL, "SkinSounds", arSounds[tvi.lParam].name, &dbv)) {
wchar_t szPathFull[MAX_PATH];
- PathToAbsoluteT(dbv.ptszVal, szPathFull);
+ PathToAbsoluteW(dbv.ptszVal, szPathFull);
NotifyEventHooks(hPlayEvent, 1, (LPARAM)szPathFull);
db_free(&dbv);
}
@@ -296,13 +296,13 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM else {
if (db_get_b(NULL, "SkinSoundsOff", snd.name, 0) == 0) {
DBVARIANT dbv;
- if (db_get_ts(NULL, "SkinSounds", snd.name, &dbv) == 0) {
- PathToAbsoluteT(dbv.ptszVal, strdir);
+ if (db_get_ws(NULL, "SkinSounds", snd.name, &dbv) == 0) {
+ PathToAbsoluteW(dbv.ptszVal, strdir);
db_free(&dbv);
} } }
wcsncpy_s(strFull, (snd.ptszTempFile ? snd.ptszTempFile : L""), _TRUNCATE);
- PathToAbsoluteT(strFull, strdir);
+ PathToAbsoluteW(strFull, strdir);
OPENFILENAME ofn;
memset(&ofn, 0, sizeof(ofn));
@@ -352,7 +352,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM for (int i=0; i < arSounds.getCount(); i++)
if (arSounds[i].ptszTempFile)
- db_set_ts(NULL, "SkinSounds", arSounds[i].name, arSounds[i].ptszTempFile);
+ db_set_ws(NULL, "SkinSounds", arSounds[i].name, arSounds[i].ptszTempFile);
TVITEM tvi, tvic;
tvi.hItem = TreeView_GetRoot(hwndTree);
@@ -394,7 +394,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM SetDlgItemText(hwndDlg, IDC_LOCATION, arSounds[tvi.lParam].ptszTempFile);
else {
DBVARIANT dbv;
- if (!db_get_ts(NULL, "SkinSounds", arSounds[tvi.lParam].name, &dbv)) {
+ if (!db_get_ws(NULL, "SkinSounds", arSounds[tvi.lParam].name, &dbv)) {
SetDlgItemText(hwndDlg, IDC_LOCATION, dbv.ptszVal);
db_free(&dbv);
}
diff --git a/src/mir_app/src/srmm_statusicon.cpp b/src/mir_app/src/srmm_statusicon.cpp index bcf7a8a0b7..dbc6daff65 100644 --- a/src/mir_app/src/srmm_statusicon.cpp +++ b/src/mir_app/src/srmm_statusicon.cpp @@ -180,7 +180,7 @@ static INT_PTR GetNthIcon(WPARAM wParam, LPARAM lParam) if (pc->tszTooltip) res.tszTooltip = pc->tszTooltip;
res.flags = pc->flags;
}
- res.tszTooltip = TranslateTH(p.hLangpack, res.tszTooltip);
+ res.tszTooltip = TranslateW_LP(res.tszTooltip, p.hLangpack);
return (INT_PTR)&res;
}
nVis++;
diff --git a/src/mir_core/src/bitmaps.cpp b/src/mir_core/src/bitmaps.cpp index 5a06bb50ff..42db450952 100644 --- a/src/mir_core/src/bitmaps.cpp +++ b/src/mir_core/src/bitmaps.cpp @@ -28,13 +28,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. MIR_CORE_DLL(HBITMAP) Bitmap_Load(const wchar_t *ptszFileName)
{
wchar_t szFilename[MAX_PATH];
- if (!PathToAbsoluteT(ptszFileName, szFilename))
+ if (!PathToAbsoluteW(ptszFileName, szFilename))
wcsncpy_s(szFilename, ptszFileName, _TRUNCATE);
if (!ServiceExists(MS_IMG_LOAD))
return NULL;
- return (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)szFilename, IMGL_TCHAR);
+ return (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)szFilename, IMGL_WCHAR);
}
MIR_CORE_DLL(void) Bitmap_GetFilter(wchar_t *dest, size_t destLen)
diff --git a/src/mir_core/src/db.cpp b/src/mir_core/src/db.cpp index 0e028bb398..8bac3b89bb 100644 --- a/src/mir_core/src/db.cpp +++ b/src/mir_core/src/db.cpp @@ -351,7 +351,7 @@ extern "C" MIR_CORE_DLL(void) db_setCurrent(MIDatabase *_db) currDb = _db;
// try to get the langpack's name from a profile
- ptrW langpack(db_get_tsa(NULL, "Langpack", "Current"));
+ ptrW langpack(db_get_wsa(NULL, "Langpack", "Current"));
if (langpack && langpack[0] != '\0')
LoadLangPack(langpack);
else
diff --git a/src/mir_core/src/icons.cpp b/src/mir_core/src/icons.cpp index 9b2ee4a65c..a5c310d6b8 100644 --- a/src/mir_core/src/icons.cpp +++ b/src/mir_core/src/icons.cpp @@ -31,7 +31,7 @@ MIR_CORE_DLL(void) Icon_Register(HINSTANCE hInst, const char *szSection, IconIte SKINICONDESC sid = { 0 };
sid.defaultFile.w = szFile;
sid.section.a = (char*)szSection;
- sid.flags = SIDF_PATH_TCHAR;
+ sid.flags = SIDF_PATH_UNICODE;
for (unsigned i = 0; i < iCount; i++) {
char szSetting[100];
@@ -56,7 +56,7 @@ MIR_CORE_DLL(void) Icon_RegisterT(HINSTANCE hInst, const wchar_t *szSection, Ico SKINICONDESC sid = { 0 };
sid.defaultFile.w = szFile;
sid.section.w = (wchar_t*)szSection;
- sid.flags = SIDF_ALL_TCHAR;
+ sid.flags = SIDF_ALL_UNICODE;
for (unsigned i = 0; i < iCount; i++) {
char szSetting[100];
diff --git a/src/mir_core/src/langpack.cpp b/src/mir_core/src/langpack.cpp index 9c29fc24da..a59aa89b0d 100644 --- a/src/mir_core/src/langpack.cpp +++ b/src/mir_core/src/langpack.cpp @@ -379,7 +379,7 @@ MIR_CORE_DLL(int) LoadLangPack(const wchar_t *ptszLangPack) // ensure that a lang's name is a full file name
wchar_t tszFullPath[MAX_PATH];
- if (!PathIsAbsoluteT(ptszLangPack))
+ if (!PathIsAbsoluteW(ptszLangPack))
mir_snwprintf(tszFullPath, L"%s\\%s", g_tszRoot, ptszLangPack);
else
wcsncpy_s(tszFullPath, ptszLangPack, _TRUNCATE);
@@ -503,7 +503,7 @@ MIR_CORE_DLL(wchar_t*) Langpack_PcharToTchar(const char *pszStr) wchar_t *result = (wchar_t*)alloca((len + 1)*sizeof(wchar_t));
MultiByteToWideChar(Langpack_GetDefaultCodePage(), 0, pszStr, -1, result, len);
result[len] = 0;
- return mir_wstrdup(TranslateTS(result));
+ return mir_wstrdup(TranslateW(result));
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -632,21 +632,21 @@ MIR_CORE_DLL(void) Langpack_SortDuplicates(void) void GetDefaultLang()
{
// calculate the langpacks' root
- PathToAbsoluteT(L"\\Languages", g_tszRoot);
+ PathToAbsoluteW(L"\\Languages", g_tszRoot);
if (_waccess(g_tszRoot, 0) != 0) // directory Languages exists
- PathToAbsoluteT(L".", g_tszRoot);
+ PathToAbsoluteW(L".", g_tszRoot);
// look into mirandaboot.ini
wchar_t tszPath[MAX_PATH], tszLangName[256];
- PathToAbsoluteT(L"\\mirandaboot.ini", tszPath);
+ PathToAbsoluteW(L"\\mirandaboot.ini", tszPath);
GetPrivateProfileString(L"Language", L"DefaultLanguage", L"", tszLangName, _countof(tszLangName), tszPath);
if (tszLangName[0]) {
if (!mir_wstrcmpi(tszLangName, L"default")) {
- db_set_ts(NULL, "Langpack", "Current", L"default");
+ db_set_ws(NULL, "Langpack", "Current", L"default");
return;
}
if (!LoadLangPack(tszLangName)) {
- db_set_ts(NULL, "Langpack", "Current", tszLangName);
+ db_set_ws(NULL, "Langpack", "Current", tszLangName);
return;
}
}
@@ -655,7 +655,7 @@ void GetDefaultLang() if (GetLocaleInfo(MAKELCID(GetUserDefaultUILanguage(), SORT_DEFAULT), LOCALE_SENGLANGUAGE, tszLangName, _countof(tszLangName))) {
mir_snwprintf(tszPath, L"langpack_%s.txt", wcslwr(tszLangName));
if (!LoadLangPack(tszPath)) {
- db_set_ts(NULL, "Langpack", "Current", tszPath);
+ db_set_ws(NULL, "Langpack", "Current", tszPath);
return;
}
}
@@ -672,13 +672,13 @@ void GetDefaultLang() continue;
if (!LoadLangPack(fd.cFileName)) {
- db_set_ts(NULL, "Langpack", "Current", fd.cFileName);
+ db_set_ws(NULL, "Langpack", "Current", fd.cFileName);
break;
}
} while (FindNextFile(hFind, &fd));
FindClose(hFind);
}
- else db_set_ts(NULL, "Langpack", "Current", L"default");
+ else db_set_ws(NULL, "Langpack", "Current", L"default");
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/mir_core/src/logger.cpp b/src/mir_core/src/logger.cpp index a2e526a6a2..5dbc758b2e 100644 --- a/src/mir_core/src/logger.cpp +++ b/src/mir_core/src/logger.cpp @@ -112,7 +112,7 @@ MIR_CORE_DLL(HANDLE) mir_createLog(const char* pszName, const wchar_t *ptszDescr if (fp == NULL) {
wchar_t tszPath[MAX_PATH];
wcsncpy_s(tszPath, ptszFile, _TRUNCATE);
- CreatePathToFileT(tszPath);
+ CreatePathToFileW(tszPath);
}
else fclose(fp);
diff --git a/src/mir_core/src/miranda.cpp b/src/mir_core/src/miranda.cpp index c2b4208b54..596d8c7b25 100644 --- a/src/mir_core/src/miranda.cpp +++ b/src/mir_core/src/miranda.cpp @@ -57,7 +57,7 @@ static INT_PTR RestartMiranda(WPARAM wParam, LPARAM lParam) GetModuleFileName(NULL, mirandaPath, _countof(mirandaPath));
if (wParam) {
- VARST profilename(L"%miranda_profilename%");
+ VARSW profilename(L"%miranda_profilename%");
mir_snwprintf(cmdLine, L"\"%s\" /restart:%d /profile=%s", mirandaPath, GetCurrentProcessId(), (wchar_t*)profilename);
}
else mir_snwprintf(cmdLine, L"\"%s\" /restart:%d", mirandaPath, GetCurrentProcessId());
diff --git a/src/mir_core/src/mstring.cpp b/src/mir_core/src/mstring.cpp index eaef7b0d8a..47875a439e 100644 --- a/src/mir_core/src/mstring.cpp +++ b/src/mir_core/src/mstring.cpp @@ -121,7 +121,7 @@ MIR_CORE_DLL(void) mirstr_unlock(CMStringData* pThis) /////////////////////////////////////////////////////////////////////////////////////////
// don't remove it
-// this code just instantiates templates for CMString[A/W]
+// this code just instantiates templates for CMStringW[A/W]
template CMStringW;
template MIR_CORE_EXPORT CMStringW CALLBACK operator + (const CMStringW& str1, const CMStringW& str2);
diff --git a/src/mir_core/src/openurl.cpp b/src/mir_core/src/openurl.cpp index 93aab27ec2..49b2f57309 100644 --- a/src/mir_core/src/openurl.cpp +++ b/src/mir_core/src/openurl.cpp @@ -41,7 +41,7 @@ static void OpenURLThread(void *arg) TOpenUrlInfo *hUrlInfo = (TOpenUrlInfo*)arg;
// wack a protocol on it
- CMString tszUrl;
+ CMStringW tszUrl;
if ((isalpha(hUrlInfo->szUrl[0]) && hUrlInfo->szUrl[1] == ':') || hUrlInfo->szUrl[0] == '\\')
tszUrl.Format(L"file:///%s", hUrlInfo->szUrl);
else {
@@ -56,7 +56,7 @@ static void OpenURLThread(void *arg) }
// check user defined browser for opening urls
- ptrW tszBrowser(db_get_tsa(NULL, "Miranda", "OpenUrlBrowser"));
+ ptrW tszBrowser(db_get_wsa(NULL, "Miranda", "OpenUrlBrowser"));
if (tszBrowser)
ShellExecute(NULL, L"open", tszBrowser, tszUrl, NULL, (hUrlInfo->newWindow) ? SW_NORMAL : SW_SHOWDEFAULT);
else
diff --git a/src/mir_core/src/timezones.cpp b/src/mir_core/src/timezones.cpp index e8f0e05356..bb12b1e673 100644 --- a/src/mir_core/src/timezones.cpp +++ b/src/mir_core/src/timezones.cpp @@ -86,7 +86,7 @@ void FormatTime(const SYSTEMTIME *st, const wchar_t *szFormat, wchar_t *szDest, {
if (szDest == NULL || cbDest == 0) return;
- CMString tszTemp;
+ CMStringW tszTemp;
for (const wchar_t* pFormat = szFormat; *pFormat; ++pFormat) {
DWORD fmt = 0;
@@ -242,7 +242,7 @@ MIR_CORE_DLL(HANDLE) TimeZone_CreateByContact(MCONTACT hContact, LPCSTR szModule if (szModule == NULL) szModule = "UserInfo";
DBVARIANT dbv;
- if (!db_get_ts(hContact, szModule, "TzName", &dbv)) {
+ if (!db_get_ws(hContact, szModule, "TzName", &dbv)) {
HANDLE res = TimeZone_CreateByName(dbv.ptszVal, dwFlags);
db_free(&dbv);
if (res) return res;
@@ -251,7 +251,7 @@ MIR_CORE_DLL(HANDLE) TimeZone_CreateByContact(MCONTACT hContact, LPCSTR szModule signed char timezone = (signed char)db_get_b(hContact, szModule, "Timezone", -1);
if (timezone == -1) {
char *szProto = GetContactProto(hContact);
- if (!db_get_ts(hContact, szProto, "TzName", &dbv)) {
+ if (!db_get_ws(hContact, szProto, "TzName", &dbv)) {
HANDLE res = TimeZone_CreateByName(dbv.ptszVal, dwFlags);
db_free(&dbv);
if (res) return res;
@@ -293,7 +293,7 @@ MIR_CORE_DLL(void) TimeZone_StoreByContact(MCONTACT hContact, LPCSTR szModule, H MIM_TIMEZONE *tz = (MIM_TIMEZONE*)hTZ;
if (tz) {
- db_set_ts(hContact, szModule, "TzName", tz->tszName);
+ db_set_ws(hContact, szModule, "TzName", tz->tszName);
db_set_b(hContact, szModule, "Timezone", (char)((tz->tzi.Bias + tz->tzi.StandardBias) / 30));
}
else {
@@ -405,7 +405,7 @@ MIR_CORE_DLL(int) TimeZone_SelectListItem(MCONTACT hContact, LPCSTR szModule, HW if (szModule == NULL) szModule = "UserInfo";
int iSelection = 0;
- ptrW tszName(db_get_tsa(hContact, szModule, "TzName"));
+ ptrW tszName(db_get_wsa(hContact, szModule, "TzName"));
if (tszName != NULL) {
unsigned hash = mir_hashstrT(tszName);
for (int i = 0; i < g_timezonesBias.getCount(); i++) {
diff --git a/src/mir_core/src/ui_utils.cpp b/src/mir_core/src/ui_utils.cpp index 8de4a148e7..307298a86d 100644 --- a/src/mir_core/src/ui_utils.cpp +++ b/src/mir_core/src/ui_utils.cpp @@ -308,7 +308,7 @@ void CCtrlCombo::OnApply() {
CSuper::OnApply();
- if (GetDataType() == DBVT_TCHAR) {
+ if (GetDataType() == DBVT_WCHAR) {
int len = GetWindowTextLength(m_hwnd) + 1;
wchar_t *buf = (wchar_t *)_alloca(sizeof(wchar_t) * len);
GetWindowText(m_hwnd, buf, len);
@@ -321,7 +321,7 @@ void CCtrlCombo::OnApply() void CCtrlCombo::OnReset()
{
- if (GetDataType() == DBVT_TCHAR)
+ if (GetDataType() == DBVT_WCHAR)
SetText(LoadText());
else if (GetDataType() != DBVT_DELETED)
SetInt(LoadInt());
@@ -573,7 +573,7 @@ void CCtrlEdit::OnApply() {
CSuper::OnApply();
- if (GetDataType() == DBVT_TCHAR) {
+ if (GetDataType() == DBVT_WCHAR) {
int len = GetWindowTextLength(m_hwnd) + 1;
wchar_t *buf = (wchar_t *)_alloca(sizeof(wchar_t) * len);
GetWindowText(m_hwnd, buf, len);
@@ -586,7 +586,7 @@ void CCtrlEdit::OnApply() void CCtrlEdit::OnReset()
{
- if (GetDataType() == DBVT_TCHAR)
+ if (GetDataType() == DBVT_WCHAR)
SetText(LoadText());
else if (GetDataType() != DBVT_DELETED)
SetInt(LoadInt());
@@ -619,7 +619,7 @@ void CCtrlData::CreateDbLink(const char* szModuleName, const char* szSetting, BY void CCtrlData::CreateDbLink(const char* szModuleName, const char* szSetting, wchar_t* szValue)
{
- m_dbLink = new CDbLink(szModuleName, szSetting, DBVT_TCHAR, szValue);
+ m_dbLink = new CDbLink(szModuleName, szSetting, DBVT_WCHAR, szValue);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -1632,7 +1632,7 @@ void CCtrlTreeView::TranslateItem(HTREEITEM hItem) TVITEMEX tvi;
wchar_t buf[128];
GetItem(hItem, &tvi, buf, _countof(buf));
- tvi.pszText = TranslateTS(tvi.pszText);
+ tvi.pszText = TranslateW(tvi.pszText);
SetItem(&tvi);
}
@@ -2067,7 +2067,7 @@ void CCtrlPages::OnInit() TCITEM tci = { 0 };
tci.mask = TCIF_PARAM | TCIF_TEXT;
tci.lParam = (LPARAM)p;
- tci.pszText = TranslateTS(p->m_ptszHeader);
+ tci.pszText = TranslateW(p->m_ptszHeader);
if (p->m_hIcon) {
if (!m_hIml) {
m_hIml = ImageList_Create(16, 16, ILC_COLOR32 | ILC_MASK, 0, 1);
@@ -2504,8 +2504,8 @@ void CDbLink::SaveInt(DWORD value) wchar_t* CDbLink::LoadText()
{
if (dbv.type != DBVT_DELETED) db_free(&dbv);
- if (!db_get_ts(NULL, m_szModule, m_szSetting, &dbv)) {
- if (dbv.type == DBVT_TCHAR)
+ if (!db_get_ws(NULL, m_szModule, m_szSetting, &dbv)) {
+ if (dbv.type == DBVT_WCHAR)
return dbv.ptszVal;
return m_szDefault;
}
@@ -2516,5 +2516,5 @@ wchar_t* CDbLink::LoadText() void CDbLink::SaveText(wchar_t *value)
{
- db_set_ts(NULL, m_szModule, m_szSetting, value);
+ db_set_ws(NULL, m_szModule, m_szSetting, value);
}
diff --git a/src/mir_core/src/winver.cpp b/src/mir_core/src/winver.cpp index 8c7d73e98a..6e86300372 100644 --- a/src/mir_core/src/winver.cpp +++ b/src/mir_core/src/winver.cpp @@ -220,7 +220,7 @@ MIR_CORE_DLL(BOOL) GetOSDisplayString(wchar_t *buf, size_t bufSize) SYSTEM_INFO sysInfo = { 0 };
GetNativeSystemInfo(&sysInfo);
- CMString ret(L"Microsoft ");
+ CMStringW ret(L"Microsoft ");
// Test for the specific product.
if (osvi.dwMajorVersion >= 6) {
|