From 428bf0cbd77813a43094cb5c984436deff251936 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 29 Jul 2016 12:36:34 +0000 Subject: no more TCHARs git-svn-id: http://svn.miranda-ng.org/main/trunk@17143 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/NewXstatusNotify/src/indsnd.cpp | 22 ++++++------- plugins/NewXstatusNotify/src/main.cpp | 18 +++++------ plugins/NewXstatusNotify/src/options.cpp | 54 ++++++++++++++++---------------- plugins/NewXstatusNotify/src/popup.cpp | 8 ++--- plugins/NewXstatusNotify/src/utils.cpp | 6 ++-- plugins/NewXstatusNotify/src/utils.h | 2 +- plugins/NewXstatusNotify/src/xstatus.cpp | 18 +++++------ 7 files changed, 64 insertions(+), 64 deletions(-) (limited to 'plugins/NewXstatusNotify/src') diff --git a/plugins/NewXstatusNotify/src/indsnd.cpp b/plugins/NewXstatusNotify/src/indsnd.cpp index eeceb22253..504d63ddc3 100644 --- a/plugins/NewXstatusNotify/src/indsnd.cpp +++ b/plugins/NewXstatusNotify/src/indsnd.cpp @@ -33,14 +33,14 @@ void PreviewSound(HWND hList) int hlpStatus = lvi.lParam; ListView_GetItemText(hList, lvi.iItem, 1, buff, _countof(buff)); - if (!mir_wstrcmp(buff, TranslateTS(DEFAULT_SOUND))) { + if (!mir_wstrcmp(buff, TranslateW(DEFAULT_SOUND))) { if (hlpStatus < ID_STATUS_MIN) SkinPlaySound(StatusListEx[hlpStatus].lpzSkinSoundName); else SkinPlaySound(StatusList[Index(hlpStatus)].lpzSkinSoundName); } else { - PathToAbsoluteT(buff, stzSoundPath); + PathToAbsoluteW(buff, stzSoundPath); SkinPlaySoundFile(stzSoundPath); } } @@ -51,7 +51,7 @@ BOOL RemoveSoundFromList(HWND hList) if (iSel != -1) { iSel = -1; while ((iSel = ListView_GetNextItem(hList, iSel, LVNI_SELECTED)) != -1) - ListView_SetItemText(hList, iSel, 1, TranslateTS(DEFAULT_SOUND)); + ListView_SetItemText(hList, iSel, 1, TranslateW(DEFAULT_SOUND)); return TRUE; } @@ -64,7 +64,7 @@ wchar_t *SelectSound(HWND hwndDlg, wchar_t *buff, size_t bufflen) HWND hList = GetDlgItem(hwndDlg, IDC_INDSNDLIST); ListView_GetItemText(hList, ListView_GetNextItem(hList, -1, LVNI_SELECTED), 1, buff, (DWORD)bufflen); - if (!mir_wstrcmp(buff, TranslateTS(DEFAULT_SOUND))) + if (!mir_wstrcmp(buff, TranslateW(DEFAULT_SOUND))) buff = NULL; ofn.lStructSize = sizeof(ofn); @@ -146,14 +146,14 @@ INT_PTR CALLBACK DlgProcSoundUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA lvi.iSubItem = 0; lvi.iImage = Index(i); lvi.lParam = (LPARAM)i; - lvi.pszText = TranslateTS(StatusList[Index(i)].lpzSkinSoundDesc); + lvi.pszText = TranslateW(StatusList[Index(i)].lpzSkinSoundDesc); lvi.iItem = ListView_InsertItem(hList, &lvi); - if (!db_get_ts(hContact, MODULE, StatusList[Index(i)].lpzSkinSoundName, &dbv)) { + if (!db_get_ws(hContact, MODULE, StatusList[Index(i)].lpzSkinSoundName, &dbv)) { mir_wstrcpy(buff, dbv.ptszVal); db_free(&dbv); } - else mir_wstrcpy(buff, TranslateTS(DEFAULT_SOUND)); + else mir_wstrcpy(buff, TranslateW(DEFAULT_SOUND)); ListView_SetItemText(hList, lvi.iItem, 1, buff); } @@ -166,14 +166,14 @@ INT_PTR CALLBACK DlgProcSoundUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA lvi.iSubItem = 0; lvi.iImage = Index(ID_STATUS_MAX) + 1; // additional icon lvi.lParam = (LPARAM)i; - lvi.pszText = TranslateTS(StatusListEx[i].lpzSkinSoundDesc); + lvi.pszText = TranslateW(StatusListEx[i].lpzSkinSoundDesc); lvi.iItem = ListView_InsertItem(hList, &lvi); - if (!db_get_ts(hContact, MODULE, StatusList[i].lpzSkinSoundName, &dbv)) { + if (!db_get_ws(hContact, MODULE, StatusList[i].lpzSkinSoundName, &dbv)) { wcsncpy(buff, dbv.ptszVal, _countof(buff)-1); db_free(&dbv); } - else wcsncpy(buff, TranslateTS(DEFAULT_SOUND), _countof(buff)-1); + else wcsncpy(buff, TranslateW(DEFAULT_SOUND), _countof(buff)-1); ListView_SetItemText(hList, lvi.iItem, 1, buff); } @@ -236,7 +236,7 @@ INT_PTR CALLBACK DlgProcSoundUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA ListView_GetItem(hList, &lvi); ListView_GetItemText(hList, lvi.iItem, 1, buff, _countof(buff)); - if (!mir_wstrcmp(buff, TranslateTS(DEFAULT_SOUND))) { + if (!mir_wstrcmp(buff, TranslateW(DEFAULT_SOUND))) { if (lvi.lParam < ID_STATUS_MIN) db_unset(hContact, MODULE, StatusListEx[lvi.lParam].lpzSkinSoundName); else diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp index bf7ef10106..337a197494 100644 --- a/plugins/NewXstatusNotify/src/main.cpp +++ b/plugins/NewXstatusNotify/src/main.cpp @@ -187,7 +187,7 @@ wchar_t* GetStr(STATUSMSGINFO *n, const wchar_t *tmplt) if (n == NULL || tmplt == NULL || tmplt[0] == '\0') return NULL; - CMString res; + CMStringW res; size_t len = mir_wstrlen(tmplt); for (size_t i = 0; i < len; i++) { @@ -304,7 +304,7 @@ void GetStatusText(MCONTACT hContact, WORD newStatus, WORD oldStatus, wchar_t *s if (opt.ShowPreviousStatus) { wchar_t buff[MAX_STATUSTEXT]; - mir_snwprintf(buff, TranslateTS(STRING_SHOWPREVIOUSSTATUS), StatusList[Index(oldStatus)].lpzStandardText); + mir_snwprintf(buff, TranslateW(STRING_SHOWPREVIOUSSTATUS), StatusList[Index(oldStatus)].lpzStandardText); mir_wstrcat(mir_wstrcat(stzStatusText, L" "), buff); } } @@ -326,7 +326,7 @@ void PlayChangeSound(MCONTACT hContact, const char *name) if (opt.UseIndSnd) { DBVARIANT dbv; wchar_t stzSoundFile[MAX_PATH] = { 0 }; - if (!db_get_ts(hContact, MODULE, name, &dbv)) { + if (!db_get_ws(hContact, MODULE, name, &dbv)) { wcsncpy(stzSoundFile, dbv.ptszVal, _countof(stzSoundFile)-1); db_free(&dbv); } @@ -334,7 +334,7 @@ void PlayChangeSound(MCONTACT hContact, const char *name) if (stzSoundFile[0]) { //Now make path to IndSound absolute, as it isn't registered wchar_t stzSoundPath[MAX_PATH]; - PathToAbsoluteT(stzSoundFile, stzSoundPath); + PathToAbsoluteW(stzSoundFile, stzSoundPath); SkinPlaySoundFile(stzSoundPath); return; } @@ -695,7 +695,7 @@ int ProcessStatusMessage(DBCONTACTWRITESETTING *cws, MCONTACT hContact) char protoname[MAX_PATH]; mir_snprintf(protoname, "%s_TPopupSMsgRemoved", szProto); DBVARIANT dbVar = { 0 }; - if (db_get_ts(NULL, MODULE, protoname, &dbVar)) { + if (db_get_ws(NULL, MODULE, protoname, &dbVar)) { str = GetStr(&smi, DEFAULT_POPUP_SMSGREMOVED); } else { @@ -707,7 +707,7 @@ int ProcessStatusMessage(DBCONTACTWRITESETTING *cws, MCONTACT hContact) char protoname[MAX_PATH]; mir_snprintf(protoname, "%s_TPopupSMsgChanged", szProto); DBVARIANT dbVar = { 0 }; - if (db_get_ts(NULL, MODULE, protoname, &dbVar)) { + if (db_get_ws(NULL, MODULE, protoname, &dbVar)) { str = GetStr(&smi, DEFAULT_POPUP_SMSGCHANGED); } else { @@ -1072,7 +1072,7 @@ void InitMainMenuItem() { CMenuItem mi; SET_UID(mi, 0x22b7b4db, 0xa9a1, 0x4d43, 0x88, 0x80, 0x4c, 0x23, 0x20, 0x31, 0xc6, 0xa0); - mi.flags = CMIF_TCHAR; + mi.flags = CMIF_UNICODE; if (ServiceExists(MS_POPUP_ADDPOPUPT)) mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Popups"), 0); mi.pszService = MS_STATUSCHANGE_MENUCOMMAND; @@ -1096,10 +1096,10 @@ void InitIcolib() void InitSound() { for (int i = ID_STATUS_MIN; i <= ID_STATUS_MAX; i++) - SkinAddNewSoundExT(StatusList[Index(i)].lpzSkinSoundName, LPGENW("Status Notify"), StatusList[Index(i)].lpzSkinSoundDesc); + SkinAddNewSoundExW(StatusList[Index(i)].lpzSkinSoundName, LPGENW("Status Notify"), StatusList[Index(i)].lpzSkinSoundDesc); for (int i = 0; i <= ID_STATUSEX_MAX; i++) - SkinAddNewSoundExT(StatusListEx[i].lpzSkinSoundName, LPGENW("Status Notify"), StatusListEx[i].lpzSkinSoundDesc); + SkinAddNewSoundExW(StatusListEx[i].lpzSkinSoundName, LPGENW("Status Notify"), StatusListEx[i].lpzSkinSoundDesc); } int InitTopToolbar(WPARAM, LPARAM) diff --git a/plugins/NewXstatusNotify/src/options.cpp b/plugins/NewXstatusNotify/src/options.cpp index 2e602a4586..3d2de9a971 100644 --- a/plugins/NewXstatusNotify/src/options.cpp +++ b/plugins/NewXstatusNotify/src/options.cpp @@ -112,20 +112,20 @@ void LoadOptions() void SaveTemplates() { - db_set_ts(0, MODULE, "TPopupChanged", templates.PopupXstatusChanged); - db_set_ts(0, MODULE, "TPopupRemoved", templates.PopupXstatusRemoved); - db_set_ts(0, MODULE, "TPopupXMsgChanged", templates.PopupXMsgChanged); - db_set_ts(0, MODULE, "TPopupXMsgRemoved", templates.PopupXMsgRemoved); + db_set_ws(0, MODULE, "TPopupChanged", templates.PopupXstatusChanged); + db_set_ws(0, MODULE, "TPopupRemoved", templates.PopupXstatusRemoved); + db_set_ws(0, MODULE, "TPopupXMsgChanged", templates.PopupXMsgChanged); + db_set_ws(0, MODULE, "TPopupXMsgRemoved", templates.PopupXMsgRemoved); - db_set_ts(0, MODULE, "TLogXChanged", templates.LogXstatusChanged); - db_set_ts(0, MODULE, "TLogXRemoved", templates.LogXstatusRemoved); - db_set_ts(0, MODULE, "TLogXMsgChanged", templates.LogXMsgChanged); - db_set_ts(0, MODULE, "TLogXMsgRemoved", templates.LogXMsgRemoved); - db_set_ts(0, MODULE, "TLogXOpening", templates.LogXstatusOpening); + db_set_ws(0, MODULE, "TLogXChanged", templates.LogXstatusChanged); + db_set_ws(0, MODULE, "TLogXRemoved", templates.LogXstatusRemoved); + db_set_ws(0, MODULE, "TLogXMsgChanged", templates.LogXMsgChanged); + db_set_ws(0, MODULE, "TLogXMsgRemoved", templates.LogXMsgRemoved); + db_set_ws(0, MODULE, "TLogXOpening", templates.LogXstatusOpening); - db_set_ts(0, MODULE, "TLogSMsgChanged", templates.LogSMsgChanged); - db_set_ts(0, MODULE, "TLogSMsgRemoved", templates.LogSMsgRemoved); - db_set_ts(0, MODULE, "TLogSMsgOpening", templates.LogSMsgOpening); + db_set_ws(0, MODULE, "TLogSMsgChanged", templates.LogSMsgChanged); + db_set_ws(0, MODULE, "TLogSMsgRemoved", templates.LogSMsgRemoved); + db_set_ws(0, MODULE, "TLogSMsgOpening", templates.LogSMsgOpening); db_set_b(0, MODULE, "TPopupXFlags", templates.PopupXFlags); db_set_b(0, MODULE, "TPopupSMsgFlags", templates.PopupSMsgFlags); @@ -136,9 +136,9 @@ void SaveTemplates() PROTOTEMPLATE *prototemplate = ProtoTemplates[i]; char str[MAX_PATH]; mir_snprintf(str, "%s_TPopupSMsgChanged", prototemplate->ProtoName); - db_set_ts(0, MODULE, str, prototemplate->ProtoTemplateMsg); + db_set_ws(0, MODULE, str, prototemplate->ProtoTemplateMsg); mir_snprintf(str, "%s_TPopupSMsgRemoved", prototemplate->ProtoName); - db_set_ts(0, MODULE, str, prototemplate->ProtoTemplateRemoved); + db_set_ws(0, MODULE, str, prototemplate->ProtoTemplateRemoved); } } @@ -337,8 +337,8 @@ INT_PTR CALLBACK DlgProcPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM //Mouse actions for (int i = 0; i < _countof(PopupActions); i++) { - SendDlgItemMessage(hwndDlg, IDC_STATUS_LC, CB_SETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_STATUS_LC, CB_ADDSTRING, 0, (LPARAM)TranslateTS(PopupActions[i].Text)), PopupActions[i].Action); - SendDlgItemMessage(hwndDlg, IDC_STATUS_RC, CB_SETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_STATUS_RC, CB_ADDSTRING, 0, (LPARAM)TranslateTS(PopupActions[i].Text)), PopupActions[i].Action); + SendDlgItemMessage(hwndDlg, IDC_STATUS_LC, CB_SETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_STATUS_LC, CB_ADDSTRING, 0, (LPARAM)TranslateW(PopupActions[i].Text)), PopupActions[i].Action); + SendDlgItemMessage(hwndDlg, IDC_STATUS_RC, CB_SETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_STATUS_RC, CB_ADDSTRING, 0, (LPARAM)TranslateW(PopupActions[i].Text)), PopupActions[i].Action); } SendDlgItemMessage(hwndDlg, IDC_STATUS_LC, CB_SETCURSEL, opt.LeftClickAction, 0); @@ -391,7 +391,7 @@ INT_PTR CALLBACK DlgProcPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM if (opt.ShowPreviousStatus) { wchar_t buff[MAX_STATUSTEXT]; - mir_snwprintf(buff, TranslateTS(STRING_SHOWPREVIOUSSTATUS), StatusList[Index(i)].lpzStandardText); + mir_snwprintf(buff, TranslateW(STRING_SHOWPREVIOUSSTATUS), StatusList[Index(i)].lpzStandardText); mir_wstrcat(str, L" "); mir_wstrcat(str, buff); } @@ -557,12 +557,12 @@ INT_PTR CALLBACK DlgProcXPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM EnableWindow(GetDlgItem(hwndDlg, IDC_ED_TREMOVEMSG), templates.PopupXFlags & NOTIFY_REMOVE_MESSAGE); // Buttons - SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Show available variables"), BATF_TCHAR); + SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Show available variables"), BATF_UNICODE); HICON hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_VARIABLES)); SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon); DestroyIcon(hIcon); - SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Reset all templates to default"), BATF_TCHAR); + SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Reset all templates to default"), BATF_UNICODE); hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_RESET)); SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon); DestroyIcon(hIcon); @@ -691,12 +691,12 @@ INT_PTR CALLBACK DlgProcSMPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA EnableWindow(GetDlgItem(hwndDlg, IDC_ED_TSMSGREMOVE), templates.PopupSMsgFlags & NOTIFY_REMOVE_MESSAGE); // Buttons - SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Show available variables"), BATF_TCHAR); + SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Show available variables"), BATF_UNICODE); HICON hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_VARIABLES)); SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon); DestroyIcon(hIcon); - SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Reset all templates to default"), BATF_TCHAR); + SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Reset all templates to default"), BATF_UNICODE); hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_RESET)); SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon); DestroyIcon(hIcon); @@ -730,7 +730,7 @@ INT_PTR CALLBACK DlgProcSMPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA DBVARIANT dbVar = { 0 }; char protoname[MAX_PATH] = { 0 }; mir_snprintf(protoname, "%s_TPopupSMsgChanged", protos[i]->szModuleName); - if (db_get_ts(NULL, MODULE, protoname, &dbVar)) + if (db_get_ws(NULL, MODULE, protoname, &dbVar)) wcsncpy(prototemplate->ProtoTemplateMsg, DEFAULT_POPUP_SMSGCHANGED, _countof(prototemplate->ProtoTemplateMsg)); else { wcsncpy(prototemplate->ProtoTemplateMsg, dbVar.ptszVal, _countof(prototemplate->ProtoTemplateMsg)); @@ -738,7 +738,7 @@ INT_PTR CALLBACK DlgProcSMPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA } mir_snprintf(protoname, "%s_TPopupSMsgRemoved", protos[i]->szModuleName); - if (db_get_ts(NULL, MODULE, protoname, &dbVar)) + if (db_get_ws(NULL, MODULE, protoname, &dbVar)) wcsncpy(prototemplate->ProtoTemplateRemoved, DEFAULT_POPUP_SMSGREMOVED, _countof(prototemplate->ProtoTemplateRemoved)); else { wcsncpy(prototemplate->ProtoTemplateRemoved, dbVar.ptszVal, _countof(prototemplate->ProtoTemplateRemoved)); @@ -915,12 +915,12 @@ INT_PTR CALLBACK DlgProcXLogOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l SetDlgItemText(hwndDlg, IDC_ED_TXSTATUSOPENING, templates.LogXstatusOpening); // Buttons - SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Show available variables"), BATF_TCHAR); + SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Show available variables"), BATF_UNICODE); HICON hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_VARIABLES)); SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon); DestroyIcon(hIcon); - SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Reset all templates to default"), BATF_TCHAR); + SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Reset all templates to default"), BATF_UNICODE); hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_RESET)); SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon); DestroyIcon(hIcon); @@ -1082,12 +1082,12 @@ INT_PTR CALLBACK DlgProcLogOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP SetDlgItemText(hwndDlg, IDC_LOG_TSMSGOPENING, templates.LogSMsgOpening); // Buttons - SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Show available variables"), BATF_TCHAR); + SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Show available variables"), BATF_UNICODE); HICON hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_VARIABLES)); SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon); DestroyIcon(hIcon); - SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Reset all templates to default"), BATF_TCHAR); + SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Reset all templates to default"), BATF_UNICODE); hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_RESET)); SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon); DestroyIcon(hIcon); diff --git a/plugins/NewXstatusNotify/src/popup.cpp b/plugins/NewXstatusNotify/src/popup.cpp index 2f7e702036..fe70659bfa 100644 --- a/plugins/NewXstatusNotify/src/popup.cpp +++ b/plugins/NewXstatusNotify/src/popup.cpp @@ -26,11 +26,11 @@ void ShowChangePopup(MCONTACT hContact, HICON hIcon, WORD newStatus, const wchar POPUPDATAT ppd = { 0 }; ppd.lchContact = hContact; ppd.lchIcon = hIcon; - CMString buf(pcli->pfnGetContactDisplayName(hContact, 0)); + CMStringW buf(pcli->pfnGetContactDisplayName(hContact, 0)); // add group name to popup title if (opt.ShowGroup) { - ptrW tszGroup(db_get_tsa(hContact, "CList", "Group")); + ptrW tszGroup(db_get_wsa(hContact, "CList", "Group")); if (tszGroup) buf.AppendFormat(L" (%s)", tszGroup); } @@ -77,7 +77,7 @@ static int AwayMsgHook(WPARAM, LPARAM lParam, LPARAM pObj) return 0; MCONTACT hContact = PUGetContact(pdp->hWnd); - ptrW pstzLast(db_get_tsa(hContact, MODULE, "LastPopupText")); + ptrW pstzLast(db_get_wsa(hContact, MODULE, "LastPopupText")); wchar_t *tszStatus = (wchar_t *)ack->lParam; if (tszStatus == NULL || *tszStatus == 0) @@ -117,7 +117,7 @@ void PopupAction(HWND hWnd, BYTE action) if (hContact && hContact != INVALID_CONTACT_ID) { switch (action) { case PCA_OPENMESSAGEWND: - CallServiceSync(MS_MSG_SENDMESSAGET, hContact, 0); + CallServiceSync(MS_MSG_SENDMESSAGEW, hContact, 0); break; case PCA_OPENMENU: diff --git a/plugins/NewXstatusNotify/src/utils.cpp b/plugins/NewXstatusNotify/src/utils.cpp index f06b12914c..88a457b780 100644 --- a/plugins/NewXstatusNotify/src/utils.cpp +++ b/plugins/NewXstatusNotify/src/utils.cpp @@ -44,7 +44,7 @@ bool CheckMsgWnd(MCONTACT hContact) int DBGetStringDefault(MCONTACT hContact, const char *szModule, const char *szSetting, wchar_t *setting, int size, const wchar_t *defaultValue) { DBVARIANT dbv; - if (!db_get_ts(hContact, szModule, szSetting, &dbv)) { + if (!db_get_ws(hContact, szModule, szSetting, &dbv)) { wcsncpy(setting, dbv.ptszVal, size); db_free(&dbv); return 0; @@ -92,12 +92,12 @@ void LogToFile(wchar_t *stzText) } } -void AddCR(CMString &str, const wchar_t *stzText) +void AddCR(CMStringW &str, const wchar_t *stzText) { if (stzText == NULL) return; - CMString res(stzText); + CMStringW res(stzText); res.Replace(L"\n", L"\r\n"); res.Replace(L"\r\r\n", L"\r\n"); str.Append(res); diff --git a/plugins/NewXstatusNotify/src/utils.h b/plugins/NewXstatusNotify/src/utils.h index bdc32806fb..03f2105a87 100644 --- a/plugins/NewXstatusNotify/src/utils.h +++ b/plugins/NewXstatusNotify/src/utils.h @@ -27,6 +27,6 @@ int DBGetStringDefault(MCONTACT hContact, const char *szModule, const char *szSe void ShowLog(wchar_t *file); BOOL StatusHasAwayMessage(char *szProto, int status); void LogToFile(wchar_t *stzText); -void AddCR(CMString &str, const wchar_t *statusmsg); +void AddCR(CMStringW &str, const wchar_t *statusmsg); #endif diff --git a/plugins/NewXstatusNotify/src/xstatus.cpp b/plugins/NewXstatusNotify/src/xstatus.cpp index ec650d1775..42a705852d 100644 --- a/plugins/NewXstatusNotify/src/xstatus.cpp +++ b/plugins/NewXstatusNotify/src/xstatus.cpp @@ -90,13 +90,13 @@ wchar_t* GetStatusTypeAsString(int type, wchar_t *buff) } } -CMString ReplaceVars(XSTATUSCHANGE *xsc, const wchar_t *tmplt) +CMStringW ReplaceVars(XSTATUSCHANGE *xsc, const wchar_t *tmplt) { if (xsc == NULL || tmplt == NULL || tmplt[0] == '\0') - return CMString(); + return CMStringW(); size_t len = mir_wstrlen(tmplt); - CMString res; + CMStringW res; for (size_t i = 0; i < len; i++) { if (tmplt[i] == '%') { @@ -288,7 +288,7 @@ void LogChangeToDB(XSTATUSCHANGE *xsc) } wchar_t stzLastLog[2 * MAX_TEXT_LEN]; - CMString stzLogText(ReplaceVars(xsc, Template)); + CMStringW stzLogText(ReplaceVars(xsc, Template)); DBGetStringDefault(xsc->hContact, MODULE, DB_LASTLOG, stzLastLog, _countof(stzLastLog), L""); if (opt.XLogToDB) { @@ -416,11 +416,11 @@ wchar_t* GetDefaultXstatusName(int statusID, char *szProto, wchar_t *buff, int b CUSTOM_STATUS xstatus = { 0 }; xstatus.cbSize = sizeof(CUSTOM_STATUS); - xstatus.flags = CSSF_MASK_NAME | CSSF_DEFAULT_NAME | CSSF_TCHAR; + xstatus.flags = CSSF_MASK_NAME | CSSF_DEFAULT_NAME | CSSF_UNICODE; xstatus.ptszName = nameBuff; xstatus.wParam = (WPARAM*)&statusID; if (!CallProtoService(szProto, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus)) - wcsncpy_s(buff, bufflen, TranslateTS(nameBuff), _TRUNCATE); + wcsncpy_s(buff, bufflen, TranslateW(nameBuff), _TRUNCATE); return buff; } @@ -432,7 +432,7 @@ wchar_t* GetIcqXStatus(MCONTACT hContact, char *szProto, char *szValue, wchar_t int statusID = db_get_b(hContact, szProto, "XStatusId", -1); if (statusID != -1) { - if (!db_get_ts(hContact, szProto, szValue, &dbv)) { + if (!db_get_ws(hContact, szProto, szValue, &dbv)) { if ((mir_strcmp(szValue, "XStatusName") == 0) && dbv.ptszVal[0] == 0) GetDefaultXstatusName(statusID, szProto, buff, bufflen); else @@ -453,7 +453,7 @@ wchar_t* GetJabberAdvStatusText(MCONTACT hContact, char *szProto, char *szSlot, buff[0] = 0; mir_snprintf(szSetting, "%s/%s/%s", szProto, szSlot, szValue); - if (!db_get_ts(hContact, "AdvStatus", szSetting, &dbv)) { + if (!db_get_ws(hContact, "AdvStatus", szSetting, &dbv)) { wcsncpy(buff, dbv.ptszVal, bufflen); buff[bufflen - 1] = 0; db_free(&dbv); @@ -511,7 +511,7 @@ void AddSMsgEventThread(void *arg) if (smi.proto == NULL) return; - smi.newstatusmsg = db_get_tsa(smi.hContact, "CList", "StatusMsg"); + smi.newstatusmsg = db_get_wsa(smi.hContact, "CList", "StatusMsg"); LogSMsgToDB(&smi, templates.LogSMsgOpening); mir_free(smi.newstatusmsg); } -- cgit v1.2.3