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 /protocols/Steam | |
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 'protocols/Steam')
-rw-r--r-- | protocols/Steam/src/steam_avatars.cpp | 4 | ||||
-rw-r--r-- | protocols/Steam/src/steam_contacts.cpp | 38 | ||||
-rw-r--r-- | protocols/Steam/src/steam_dialogs.cpp | 2 | ||||
-rw-r--r-- | protocols/Steam/src/steam_events.cpp | 2 | ||||
-rw-r--r-- | protocols/Steam/src/steam_login.cpp | 4 | ||||
-rw-r--r-- | protocols/Steam/src/steam_menus.cpp | 4 | ||||
-rw-r--r-- | protocols/Steam/src/steam_messages.cpp | 2 | ||||
-rw-r--r-- | protocols/Steam/src/steam_polling.cpp | 18 | ||||
-rw-r--r-- | protocols/Steam/src/steam_proto.cpp | 14 | ||||
-rw-r--r-- | protocols/Steam/src/steam_xstatus.cpp | 4 |
10 files changed, 46 insertions, 46 deletions
diff --git a/protocols/Steam/src/steam_avatars.cpp b/protocols/Steam/src/steam_avatars.cpp index 0ebd7d1c8b..2faa102476 100644 --- a/protocols/Steam/src/steam_avatars.cpp +++ b/protocols/Steam/src/steam_avatars.cpp @@ -3,11 +3,11 @@ wchar_t* CSteamProto::GetAvatarFilePath(MCONTACT hContact)
{
wchar_t path[MAX_PATH];
- mir_snwprintf(path, L"%s\\%S", VARST(L"%miranda_avatarcache%"), m_szModuleName);
+ mir_snwprintf(path, L"%s\\%S", VARSW(L"%miranda_avatarcache%"), m_szModuleName);
DWORD dwAttributes = GetFileAttributes(path);
if (dwAttributes == 0xffffffff || (dwAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0)
- CreateDirectoryTreeT(path);
+ CreateDirectoryTreeW(path);
ptrA steamId(getStringA(hContact, "SteamID"));
if (steamId != NULL)
diff --git a/protocols/Steam/src/steam_contacts.cpp b/protocols/Steam/src/steam_contacts.cpp index 1477b2d19f..a6a8c0668e 100644 --- a/protocols/Steam/src/steam_contacts.cpp +++ b/protocols/Steam/src/steam_contacts.cpp @@ -14,7 +14,7 @@ void CSteamProto::SetContactStatus(MCONTACT hContact, WORD status) { // Contact is looking to play, save it to as status message if (hContact) - db_set_ts(hContact, "CList", "StatusMsg", TranslateT("Looking to play")); + db_set_ws(hContact, "CList", "StatusMsg", TranslateT("Looking to play")); } break; @@ -22,7 +22,7 @@ void CSteamProto::SetContactStatus(MCONTACT hContact, WORD status) { // Contact is looking to trade, save it to as status message if (hContact) - db_set_ts(hContact, "CList", "StatusMsg", TranslateT("Looking to trade")); + db_set_ws(hContact, "CList", "StatusMsg", TranslateT("Looking to trade")); } break; @@ -98,7 +98,7 @@ void CSteamProto::UpdateContact(MCONTACT hContact, JSONNode *data) { // set common data JSONNode *node = json_get(data, "personaname"); - setTString(hContact, "Nick", ptrW(json_as_string(node))); + setWString(hContact, "Nick", ptrW(json_as_string(node))); node = json_get(data, "profileurl"); setString(hContact, "Homepage", _T2A(ptrW(json_as_string(node)))); @@ -116,12 +116,12 @@ void CSteamProto::UpdateContact(MCONTACT hContact, JSONNode *data) size_t pos = realname.find(L' ', 1); if (pos != std::wstring::npos) { - setTString(hContact, "FirstName", realname.substr(0, pos).c_str()); - setTString(hContact, "LastName", realname.substr(pos + 1).c_str()); + setWString(hContact, "FirstName", realname.substr(0, pos).c_str()); + setWString(hContact, "LastName", realname.substr(pos + 1).c_str()); } else { - setTString(hContact, "FirstName", realname.c_str()); + setWString(hContact, "FirstName", realname.c_str()); delSetting(hContact, "LastName"); } } @@ -186,23 +186,23 @@ void CSteamProto::UpdateContact(MCONTACT hContact, JSONNode *data) // nothing special, either standard client or in different status (only online, I want to play, I want to trade statuses support this flags) WORD status = getWord(hContact, "Status", ID_STATUS_OFFLINE); if (status == ID_STATUS_ONLINE || status == ID_STATUS_OUTTOLUNCH || status == ID_STATUS_FREECHAT) - setTString(hContact, "MirVer", L"Steam"); + setWString(hContact, "MirVer", L"Steam"); } else if (stateflags & 2) { // game - setTString(hContact, "MirVer", L"Steam (in game)"); + setWString(hContact, "MirVer", L"Steam (in game)"); } else if (stateflags & 256) { // on website - setTString(hContact, "MirVer", L"Steam (website)"); + setWString(hContact, "MirVer", L"Steam (website)"); } else if (stateflags & 512) { // on mobile - setTString(hContact, "MirVer", L"Steam (mobile)"); + setWString(hContact, "MirVer", L"Steam (mobile)"); } else if (stateflags & 1024) { // big picture mode - setTString(hContact, "MirVer", L"Steam (Big Picture)"); + setWString(hContact, "MirVer", L"Steam (Big Picture)"); } else { // none/unknown (e.g. when contact is offline) @@ -228,15 +228,15 @@ void CSteamProto::UpdateContact(MCONTACT hContact, JSONNode *data) setString(hContact, "ServerIP", _T2A(serverIP)); setString(hContact, "ServerID", _T2A(serverID)); - CMString message(gameInfo); + CMStringW message(gameInfo); if (!gameId) message.Append(TranslateT(" (Non-Steam)")); if (serverIP[0] != '\0') message.AppendFormat(TranslateT(" on server %s"), serverIP); setDword(hContact, "XStatusId", gameId); - setTString(hContact, "XStatusName", TranslateT("Playing")); - setTString(hContact, "XStatusMsg", message); + setWString(hContact, "XStatusName", TranslateT("Playing")); + setWString(hContact, "XStatusMsg", message); SetContactExtraIcon(hContact, gameId); } @@ -264,7 +264,7 @@ void CSteamProto::ContactIsRemoved(MCONTACT hContact) setDword(hContact, "DeletedTS", ::time(NULL)); SetContactStatus(hContact, ID_STATUS_OFFLINE); - ptrW nick(getTStringA(hContact, "Nick")); + ptrW nick(getWStringA(hContact, "Nick")); wchar_t message[MAX_PATH]; mir_snwprintf(message, MAX_PATH, TranslateT("%s has been removed from your contact list"), nick); @@ -282,7 +282,7 @@ void CSteamProto::ContactIsFriend(MCONTACT hContact) delSetting(hContact, "DeletedTS"); delSetting(hContact, "Grant"); - ptrW nick(getTStringA(hContact, "Nick")); + ptrW nick(getWStringA(hContact, "Nick")); wchar_t message[MAX_PATH]; mir_snwprintf(message, MAX_PATH, TranslateT("%s is back in your contact list"), nick); @@ -374,10 +374,10 @@ MCONTACT CSteamProto::AddContact(const char *steamId, bool isTemporary) // move to default group DBVARIANT dbv; - if (!getTString("DefaultGroup", &dbv)) + if (!getWString("DefaultGroup", &dbv)) { if(Clist_GroupExists(dbv.ptszVal)) - db_set_ts(hContact, "CList", "Group", dbv.ptszVal); + db_set_ws(hContact, "CList", "Group", dbv.ptszVal); db_free(&dbv); } } @@ -760,7 +760,7 @@ void CSteamProto::OnSearchResults(const HttpResponse *response, void *arg) STEAM_SEARCH_RESULT ssr = { 0 }; ssr.hdr.cbSize = sizeof(STEAM_SEARCH_RESULT); - ssr.hdr.flags = PSR_TCHAR; + ssr.hdr.flags = PSR_UNICODE; node = json_get(child, "steamid"); ssr.hdr.id.w = mir_wstrdup(ptrW(json_as_string(node))); diff --git a/protocols/Steam/src/steam_dialogs.cpp b/protocols/Steam/src/steam_dialogs.cpp index a51193f9cf..c3099c67c6 100644 --- a/protocols/Steam/src/steam_dialogs.cpp +++ b/protocols/Steam/src/steam_dialogs.cpp @@ -24,7 +24,7 @@ void CSteamPasswordEditor::OnOk(CCtrlButton*) mir_free(m_proto->password);
m_proto->password = m_password.GetText();
if (m_savePermanently.Enabled())
- m_proto->setTString("Password", m_proto->password);
+ m_proto->setWString("Password", m_proto->password);
EndDialog(m_hwnd, DIALOG_RESULT_OK);
}
diff --git a/protocols/Steam/src/steam_events.cpp b/protocols/Steam/src/steam_events.cpp index 9caa7091b9..0303a9a08a 100644 --- a/protocols/Steam/src/steam_events.cpp +++ b/protocols/Steam/src/steam_events.cpp @@ -35,7 +35,7 @@ int CSteamProto::OnOptionsInit(WPARAM wParam, LPARAM) OPTIONSDIALOGPAGE odp = { 0 }; odp.hInstance = g_hInstance; odp.pwszTitle = m_tszUserName; - odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR; + odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE; odp.pwszGroup = LPGENW("Network"); odp.pwszTab = LPGENW("Account"); diff --git a/protocols/Steam/src/steam_login.cpp b/protocols/Steam/src/steam_login.cpp index 8bf65f6f30..f399eb0195 100644 --- a/protocols/Steam/src/steam_login.cpp +++ b/protocols/Steam/src/steam_login.cpp @@ -92,7 +92,7 @@ void CSteamProto::OnGotRsaKey(const HttpResponse *response) mir_free(encryptedPassword); // run authorization request - T2Utf username(getTStringA("Username")); + T2Utf username(getWStringA("Username")); ptrA twoFactorCode(getStringA("TwoFactorCode")); if (!twoFactorCode) twoFactorCode = mir_strdup(""); @@ -159,7 +159,7 @@ void CSteamProto::OnAuthorizationError(const JSONNode &node) return; } - T2Utf username(getTStringA("Username")); + T2Utf username(getWStringA("Username")); if (node["requires_twofactor"].as_bool()) { diff --git a/protocols/Steam/src/steam_menus.cpp b/protocols/Steam/src/steam_menus.cpp index c6252dc81b..9a4430882d 100644 --- a/protocols/Steam/src/steam_menus.cpp +++ b/protocols/Steam/src/steam_menus.cpp @@ -97,7 +97,7 @@ int CSteamProto::PrebuildContactMenu(WPARAM wParam, LPARAM lParam) void CSteamProto::OnInitStatusMenu()
{
CMenuItem mi;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.root = Menu_GetProtocolRoot(this);
// Show block list
@@ -115,7 +115,7 @@ void CSteamProto::InitMenus() //////////////////////////////////////////////////////////////////////////////////////
// Contact menu initialization
CMenuItem mi;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
// "Request authorization"
SET_UID(mi, 0x36375a1f, 0xc142, 0x4d6e, 0xa6, 0x57, 0xe4, 0x76, 0x5d, 0xbc, 0x59, 0x8e);
diff --git a/protocols/Steam/src/steam_messages.cpp b/protocols/Steam/src/steam_messages.cpp index d399f7ff47..e5f6665a6f 100644 --- a/protocols/Steam/src/steam_messages.cpp +++ b/protocols/Steam/src/steam_messages.cpp @@ -39,7 +39,7 @@ void CSteamProto::OnMessageSent(const HttpResponse *response, void *arg) SendMessageParam *param = (SendMessageParam*)arg;
ptrW error(mir_wstrdup(TranslateT("Unknown error")));
- ptrW steamId(getTStringA(param->hContact, "SteamID"));
+ ptrW steamId(getWStringA(param->hContact, "SteamID"));
time_t timestamp = NULL;
if (ResponseHttpOk(response))
diff --git a/protocols/Steam/src/steam_polling.cpp b/protocols/Steam/src/steam_polling.cpp index 6774bb60ab..eb5db69c3c 100644 --- a/protocols/Steam/src/steam_polling.cpp +++ b/protocols/Steam/src/steam_polling.cpp @@ -61,14 +61,14 @@ void CSteamProto::ParsePollData(JSONNode *data) if (IsMe(steamId)) { node = json_get(item, "persona_name"); - setTString("Nick", ptrW(json_as_string(node))); + setWString("Nick", ptrW(json_as_string(node))); if (status == -1 || status == ID_STATUS_OFFLINE) continue; if (status != m_iStatus) { - debugLog(L"CSteamProto::ParsePollData: Change own status to %i", status); + debugLogW(L"CSteamProto::ParsePollData: Change own status to %i", status); int oldStatus = m_iStatus; m_iStatus = m_iDesiredStatus = status; ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, m_iStatus); @@ -85,7 +85,7 @@ void CSteamProto::ParsePollData(JSONNode *data) SetContactStatus(hContact, status); node = json_get(item, "persona_name"); - setTString(hContact, "Nick", ptrW(json_as_string(node))); + setWString(hContact, "Nick", ptrW(json_as_string(node))); // todo: find difference between state changing and info changing steamIds.append(steamId).append(","); @@ -185,7 +185,7 @@ void CSteamProto::ParsePollData(JSONNode *data) void CSteamProto::PollingThread(void*) { - debugLog(L"CSteamProto::PollingThread: entering"); + debugLogW(L"CSteamProto::PollingThread: entering"); ptrA token(getStringA("TokenSecret")); ptrA umqId(getStringA("UMQID")); @@ -251,7 +251,7 @@ void CSteamProto::PollingThread(void*) else if (!lstrcmpi(error, L"Not Logged On")) // 'else' below will handle this error, we don't need this particular check right now { // need to relogin - debugLog(L"CSteamProto::PollingThread: Not Logged On"); + debugLogW(L"CSteamProto::PollingThread: Not Logged On"); // try to reconnect only when we're actually online (during normal logout we will still got this error anyway, but in that case our status is already offline) if (IsOnline() && Relogin()) @@ -269,7 +269,7 @@ void CSteamProto::PollingThread(void*) else { // something wrong - debugLog(L"CSteamProto::PollingThread: %s (%d)", error, response->resultCode); + debugLogW(L"CSteamProto::PollingThread: %s (%d)", error, response->resultCode); // token has expired if (response->resultCode == HTTP_CODE_UNAUTHORIZED) @@ -279,7 +279,7 @@ void CSteamProto::PollingThread(void*) node = json_get(root, "sectimeout"); int timeout = json_as_int(node); if (timeout < STEAM_API_TIMEOUT) - debugLog(L"CSteamProto::PollingThread: Timeout is too low (%d)", timeout); + debugLogW(L"CSteamProto::PollingThread: Timeout is too low (%d)", timeout); // let it jump out of further processing errors = errorsLimit; @@ -295,10 +295,10 @@ void CSteamProto::PollingThread(void*) if (IsOnline()) { - debugLog(L"CSteamProto::PollingThread: unexpected termination; switching protocol to offline"); + debugLogW(L"CSteamProto::PollingThread: unexpected termination; switching protocol to offline"); SetStatus(ID_STATUS_OFFLINE); } m_hPollingThread = NULL; - debugLog(L"CSteamProto::PollingThread: leaving"); + debugLogW(L"CSteamProto::PollingThread: leaving"); }
\ No newline at end of file diff --git a/protocols/Steam/src/steam_proto.cpp b/protocols/Steam/src/steam_proto.cpp index 964225abcc..107c086f08 100644 --- a/protocols/Steam/src/steam_proto.cpp +++ b/protocols/Steam/src/steam_proto.cpp @@ -24,7 +24,7 @@ CSteamProto::CSteamProto(const char* protoName, const wchar_t* userName) mir_snprintf(settingName, "%s_%s", MODULE, "main"); SKINICONDESC sid = { 0 }; - sid.flags = SIDF_ALL_TCHAR; + sid.flags = SIDF_ALL_UNICODE; sid.defaultFile.w = filePath; sid.pszName = settingName; sid.section.w = sectionName; @@ -69,7 +69,7 @@ CSteamProto::CSteamProto(const char* protoName, const wchar_t* userName) mir_snwprintf(name, TranslateT("%s connection"), m_tszUserName); NETLIBUSER nlu = { sizeof(nlu) }; - nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR; + nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE; nlu.ptszDescriptiveName = name; nlu.szSettingsModule = m_szModuleName; m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu); @@ -296,7 +296,7 @@ int CSteamProto::SetStatus(int new_status) if (new_status == m_iDesiredStatus) return 0; - debugLog(L"CSteamProto::SetStatus: changing status from %i to %i", m_iStatus, new_status); + debugLogW(L"CSteamProto::SetStatus: changing status from %i to %i", m_iStatus, new_status); int old_status = m_iStatus; m_iDesiredStatus = new_status; @@ -338,7 +338,7 @@ int CSteamProto::SetStatus(int new_status) } else { - ptrA username(mir_urlEncode(ptrA(mir_utf8encodeW(getTStringA("Username"))))); + ptrA username(mir_urlEncode(ptrA(mir_utf8encodeW(getWStringA("Username"))))); if (username == NULL || username[0] == '\0') { m_iStatus = m_iDesiredStatus = ID_STATUS_OFFLINE; @@ -366,13 +366,13 @@ void __cdecl CSteamProto::GetAwayMsgThread(void *arg) Sleep(50); MCONTACT hContact = (UINT_PTR)arg; - CMString message(db_get_tsa(hContact, "CList", "StatusMsg")); + CMStringW message(db_get_wsa(hContact, "CList", "StatusMsg")); // if contact has no status message, get xstatus message if (message.IsEmpty()) { - ptrW xStatusName(getTStringA(hContact, "XStatusName")); - ptrW xStatusMsg(getTStringA(hContact, "XStatusMsg")); + ptrW xStatusName(getWStringA(hContact, "XStatusName")); + ptrW xStatusMsg(getWStringA(hContact, "XStatusMsg")); if (xStatusName) message.AppendFormat(L"%s: %s", xStatusName, xStatusMsg); diff --git a/protocols/Steam/src/steam_xstatus.cpp b/protocols/Steam/src/steam_xstatus.cpp index 8f8cdd015c..ea8796448a 100644 --- a/protocols/Steam/src/steam_xstatus.cpp +++ b/protocols/Steam/src/steam_xstatus.cpp @@ -48,7 +48,7 @@ INT_PTR CSteamProto::OnGetXStatusEx(WPARAM wParam, LPARAM lParam) if (pData->flags & CSSF_DEFAULT_NAME) title = mir_wstrdup(TranslateT("Playing")); else - title = getTStringA(hContact, "XStatusName"); + title = getWStringA(hContact, "XStatusName"); if (pData->flags & CSSF_UNICODE) mir_wstrncpy(pData->ptszName, title, STATUS_TITLE_MAX); @@ -58,7 +58,7 @@ INT_PTR CSteamProto::OnGetXStatusEx(WPARAM wParam, LPARAM lParam) // fill status message member if (pData->flags & CSSF_MASK_MESSAGE) { - ptrW message(getTStringA(hContact, "XStatusMsg")); + ptrW message(getWStringA(hContact, "XStatusMsg")); if (pData->flags & CSSF_UNICODE) mir_wstrncpy(pData->ptszMessage, message, STATUS_DESC_MAX); |