From 2f261839b60692e33d0e160344d0d636d49c90ba Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 27 Jul 2016 14:23:31 +0000 Subject: less TCHARs git-svn-id: http://svn.miranda-ng.org/main/trunk@17138 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Import/src/import.cpp | 20 ++++++++++---------- plugins/Import/src/miranda.cpp | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) (limited to 'plugins/Import/src') diff --git a/plugins/Import/src/import.cpp b/plugins/Import/src/import.cpp index c19816d33c..2db83b8a7c 100644 --- a/plugins/Import/src/import.cpp +++ b/plugins/Import/src/import.cpp @@ -29,14 +29,14 @@ struct AccountMap AccountMap(const char *_src, int _origIdx, const wchar_t *_srcName) : szSrcAcc(mir_strdup(_src)), iSrcIndex(_origIdx), - tszSrcName(mir_tstrdup(_srcName)), + tszSrcName(mir_wstrdup(_srcName)), pa(NULL) {} ~AccountMap() {} ptrA szSrcAcc, szBaseProto; - ptrT tszSrcName; + ptrW tszSrcName; int iSrcIndex; PROTOACCOUNT *pa; }; @@ -77,7 +77,7 @@ void AddMessage(const wchar_t* fmt, ...) va_list args; wchar_t msgBuf[4096]; va_start(args, fmt); - mir_vsntprintf(msgBuf, _countof(msgBuf), TranslateTS(fmt), args); + mir_vsnwprintf(msgBuf, _countof(msgBuf), TranslateTS(fmt), args); SendMessage(hdlgProgress, PROGM_ADDMESSAGE, 0, (LPARAM)msgBuf); } @@ -144,7 +144,7 @@ static MCONTACT HContactFromID(char *pszProtoName, char *pszSetting, wchar_t *pw char *szProto = GetContactProto(hContact); if (!mir_strcmp(szProto, pszProtoName)) { ptrW id(db_get_tsa(hContact, pszProtoName, pszSetting)); - if (!mir_tstrcmp(pwszID, id)) + if (!mir_wstrcmp(pwszID, id)) return hContact; } } @@ -259,7 +259,7 @@ static LRESULT CALLBACK ListWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM int idx = SendMessage(hwndCombo, CB_ADDSTRING, 0, (LPARAM)accs[i]->tszAccountName); SendMessage(hwndCombo, CB_SETITEMDATA, idx, (LPARAM)accs[i]); - if (!mir_tstrcmpi(accs[i]->tszAccountName, tszText)) + if (!mir_wstrcmpi(accs[i]->tszAccountName, tszText)) iSel = idx; } @@ -390,7 +390,7 @@ static PROTOACCOUNT* FindMyAccount(const char *szProto, const char *szBaseProto, if (pa->bOldProto || pa->bIsVirtual || pa->bDynDisabled) return pa; - if (ptszName && !mir_tstrcmp(pa->tszAccountName, ptszName)) + if (ptszName && !mir_wstrcmp(pa->tszAccountName, ptszName)) return pa; char *pszUniqueSetting = (char*)CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0); @@ -430,7 +430,7 @@ bool ImportAccounts(OBJLIST &arSkippedModules) continue; itoa(800 + i, szSetting, 10); - ptrT tszName(myGetWs(NULL, "Protocols", szSetting)); + ptrW tszName(myGetWs(NULL, "Protocols", szSetting)); AccountMap *pNew = new AccountMap(szProto, i, tszName); arAccountMap.insert(pNew); @@ -498,7 +498,7 @@ bool ImportAccounts(OBJLIST &arSkippedModules) p.pa->bIsEnabled = iVal != 0; if (p.tszSrcName == NULL) { - p.pa->tszAccountName = mir_a2t(p.pa->szModuleName); + p.pa->tszAccountName = mir_a2u(p.pa->szModuleName); itoa(800 + p.pa->iOrder, szSetting, 10); db_set_ts(NULL, "Protocols", szSetting, p.pa->tszAccountName); } @@ -663,7 +663,7 @@ void ImportMeta(DBCachedContact *ccSrc) return; } - ptrT tszGroup(myGetWs(ccSrc->contactID, "CList", "Group")), tszNick(myGetWs(ccSrc->contactID, "CList", "MyHandle")); + ptrW tszGroup(myGetWs(ccSrc->contactID, "CList", "Group")), tszNick(myGetWs(ccSrc->contactID, "CList", "MyHandle")); if (tszNick == NULL) tszNick = myGetWs(ccSrc->contactID, ccSrc->szProto, "Nick"); @@ -795,7 +795,7 @@ static MCONTACT ImportContact(MCONTACT hSrc) return NULL; } - ptrT tszGroup(myGetWs(hSrc, "CList", "Group")), tszNick(myGetWs(hSrc, "CList", "MyHandle")); + ptrW tszGroup(myGetWs(hSrc, "CList", "Group")), tszNick(myGetWs(hSrc, "CList", "MyHandle")); if (tszNick == NULL) tszNick = myGetWs(hSrc, cc->szProto, "Nick"); diff --git a/plugins/Import/src/miranda.cpp b/plugins/Import/src/miranda.cpp index dc4c5c86f8..bed803d016 100644 --- a/plugins/Import/src/miranda.cpp +++ b/plugins/Import/src/miranda.cpp @@ -33,7 +33,7 @@ static void SearchForLists(HWND hwndDlg, const wchar_t *mirandaPath, const wchar { // find in Miranda profile subfolders wchar_t searchspec[MAX_PATH]; - mir_sntprintf(searchspec, L"%s\\*.*", mirandaPath); + mir_snwprintf(searchspec, L"%s\\*.*", mirandaPath); WIN32_FIND_DATA fd; HANDLE hFind = FindFirstFile(searchspec, &fd); @@ -42,20 +42,20 @@ static void SearchForLists(HWND hwndDlg, const wchar_t *mirandaPath, const wchar do { // find all subfolders except "." and ".." - if (!(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) || !mir_tstrcmp(fd.cFileName, L".") || !mir_tstrcmp(fd.cFileName, L"..")) + if (!(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) || !mir_wstrcmp(fd.cFileName, L".") || !mir_wstrcmp(fd.cFileName, L"..")) continue; // skip the current profile too - if (mirandaProf != NULL && !mir_tstrcmpi(mirandaProf, fd.cFileName)) + if (mirandaProf != NULL && !mir_wstrcmpi(mirandaProf, fd.cFileName)) continue; wchar_t buf[MAX_PATH], profile[MAX_PATH]; - mir_sntprintf(buf, L"%s\\%s\\%s.dat", mirandaPath, fd.cFileName, fd.cFileName); + mir_snwprintf(buf, L"%s\\%s\\%s.dat", mirandaPath, fd.cFileName, fd.cFileName); if (_waccess(buf, 0) == 0) { - mir_sntprintf(profile, L"%s.dat", fd.cFileName); + mir_snwprintf(profile, L"%s.dat", fd.cFileName); int i = SendDlgItemMessage(hwndDlg, IDC_LIST, LB_ADDSTRING, 0, (LPARAM)profile); - SendDlgItemMessage(hwndDlg, IDC_LIST, LB_SETITEMDATA, i, (LPARAM)mir_tstrdup(buf)); + SendDlgItemMessage(hwndDlg, IDC_LIST, LB_SETITEMDATA, i, (LPARAM)mir_wstrdup(buf)); } } while (FindNextFile(hFind, &fd)); @@ -78,7 +78,7 @@ INT_PTR CALLBACK MirandaPageProc(HWND hwndDlg, UINT message, WPARAM wParam, LPAR SearchForLists(hwndDlg, pfd2, pfn); SearchForLists(hwndDlg, pfd1, NULL); - if (mir_tstrcmpi(pfd, pfd2)) + if (mir_wstrcmpi(pfd, pfd2)) SearchForLists(hwndDlg, pfd, NULL); } SendDlgItemMessage(hwndDlg, IDC_LIST, LB_SETCURSEL, 0, 0); @@ -100,7 +100,7 @@ INT_PTR CALLBACK MirandaPageProc(HWND hwndDlg, UINT message, WPARAM wParam, LPAR MessageBox(hwndDlg, TranslateT("The given file does not exist. Please check that you have entered the name correctly."), TranslateT("Miranda Import"), MB_OK); break; } - mir_tstrcpy(importFile, filename); + mir_wstrcpy(importFile, filename); PostMessage(GetParent(hwndDlg), WIZM_GOTOPAGE, IDD_OPTIONS, (LPARAM)MirandaOptionsPageProc); break; @@ -119,11 +119,11 @@ INT_PTR CALLBACK MirandaPageProc(HWND hwndDlg, UINT message, WPARAM wParam, LPAR break; case IDC_OTHER: - ptrT pfd(Utils_ReplaceVarsT(L"%miranda_profilesdir%")); + ptrW pfd(Utils_ReplaceVarsT(L"%miranda_profilesdir%")); wchar_t str[MAX_PATH], text[256]; GetDlgItemText(hwndDlg, IDC_FILENAME, str, _countof(str)); - mir_sntprintf(text, L"%s (*.dat, *.bak)%c*.dat;*.bak%c%s (*.*)%c*.*%c%c", TranslateT("Miranda NG database"), 0, 0, TranslateT("All Files"), 0, 0, 0); + mir_snwprintf(text, L"%s (*.dat, *.bak)%c*.dat;*.bak%c%s (*.*)%c*.*%c%c", TranslateT("Miranda NG database"), 0, 0, TranslateT("All Files"), 0, 0, 0); OPENFILENAME ofn = { 0 }; ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400; -- cgit v1.2.3