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 --- src/core/stduserinfo/src/contactinfo.cpp | 18 +++++++++--------- src/core/stduserinfo/src/stdinfo.cpp | 16 ++++++++-------- src/core/stduserinfo/src/userinfo.cpp | 12 ++++++------ 3 files changed, 23 insertions(+), 23 deletions(-) (limited to 'src/core/stduserinfo') 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); -- cgit v1.2.3