From 6e53dfca72b932c4bdcd7aa02ca62bf8b2630eac Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 26 Jul 2016 09:20:25 +0000 Subject: less TCHARs: - TCHAR is replaced with wchar_t everywhere; - LPGENT replaced with either LPGENW or LPGEN; - fixes for ANSI plugins that improperly used _t functions; - TCHAR *t removed from MAllStrings; - ptszGroup, ptszTitle & ptszTab in OPTIONSDIALOGPAGE replaced with pwsz* git-svn-id: http://svn.miranda-ng.org/main/trunk@17133 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/FacebookRM/src/avatars.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'protocols/FacebookRM/src/avatars.cpp') diff --git a/protocols/FacebookRM/src/avatars.cpp b/protocols/FacebookRM/src/avatars.cpp index b85699b520..c41c7026d5 100644 --- a/protocols/FacebookRM/src/avatars.cpp +++ b/protocols/FacebookRM/src/avatars.cpp @@ -33,19 +33,19 @@ bool FacebookProto::GetDbAvatarInfo(PROTO_AVATAR_INFORMATION &pai, std::string * utils::text::replace_first(url, "%s", std::string(id)); } - std::tstring filename = GetAvatarFolder() + _T('\\') + std::tstring(_A2T(id)) + L".jpg"; + std::wstring filename = GetAvatarFolder() + L'\\' + std::wstring(_A2T(id)) + L".jpg"; - _tcsncpy_s(pai.filename, filename.c_str(), _TRUNCATE); + wcsncpy_s(pai.filename, filename.c_str(), _TRUNCATE); pai.format = ProtoGetAvatarFormat(pai.filename); return true; } void FacebookProto::CheckAvatarChange(MCONTACT hContact, const std::string &image_url) { - std::tstring::size_type pos = image_url.rfind("/"); + std::wstring::size_type pos = image_url.rfind("/"); // Facebook contacts always have some avatar - keep avatar in database even if we have loaded empty one (e.g. for 'On Mobile' contacts) - if (image_url.empty() || pos == std::tstring::npos) + if (image_url.empty() || pos == std::wstring::npos) return; // Get name of image @@ -53,7 +53,7 @@ void FacebookProto::CheckAvatarChange(MCONTACT hContact, const std::string &imag // Remove eventual parameters from name pos = image_name.rfind("?"); - if (pos != std::tstring::npos) + if (pos != std::wstring::npos) image_name = image_name.substr(0, pos); // Append our parameters to allow comparing for avatar/settings change @@ -123,9 +123,9 @@ void FacebookProto::UpdateAvatarWorker(void *) Netlib_CloseHandle(nlc); } -std::tstring FacebookProto::GetAvatarFolder() +std::wstring FacebookProto::GetAvatarFolder() { - TCHAR path[MAX_PATH]; + wchar_t path[MAX_PATH]; mir_sntprintf(path, L"%s\\%s", VARST(L"%miranda_avatarcache%"), m_tszUserName); return path; } @@ -180,7 +180,7 @@ INT_PTR FacebookProto::GetAvatarInfo(WPARAM wParam, LPARAM lParam) PROTO_AVATAR_INFORMATION* pai = (PROTO_AVATAR_INFORMATION*)lParam; if (GetDbAvatarInfo(*pai, NULL)) { - bool fileExist = _taccess(pai->filename, 0) == 0; + bool fileExist = _waccess(pai->filename, 0) == 0; bool needLoad; if (pai->hContact) @@ -216,13 +216,13 @@ INT_PTR FacebookProto::GetMyAvatar(WPARAM wParam, LPARAM lParam) if (!wParam || !lParam) return -3; - TCHAR* buf = (TCHAR*)wParam; + wchar_t* buf = (wchar_t*)wParam; int size = (int)lParam; PROTO_AVATAR_INFORMATION ai = { 0 }; switch (GetAvatarInfo(0, (LPARAM)&ai)) { case GAIR_SUCCESS: - _tcsncpy(buf, ai.filename, size); + wcsncpy(buf, ai.filename, size); buf[size - 1] = 0; return 0; -- cgit v1.2.3