diff options
author | George Hazan <george.hazan@gmail.com> | 2016-07-25 10:31:04 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-07-25 10:31:04 +0000 |
commit | 8ae3679aa1339ce9abee53adb69902bd6b7513dc (patch) | |
tree | 94ef8927e12043ed6dcc15e1e640d68a8add520e /protocols/Steam | |
parent | 1e273e28d89b5838e3d0f0cafac9676577cb71ce (diff) |
hello, Unix.
phase 1: removing _T()
git-svn-id: http://svn.miranda-ng.org/main/trunk@17127 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 | 16 | ||||
-rw-r--r-- | protocols/Steam/src/steam_login.cpp | 10 | ||||
-rw-r--r-- | protocols/Steam/src/steam_messages.cpp | 2 | ||||
-rw-r--r-- | protocols/Steam/src/steam_options.cpp | 8 | ||||
-rw-r--r-- | protocols/Steam/src/steam_polling.cpp | 34 | ||||
-rw-r--r-- | protocols/Steam/src/steam_proto.cpp | 8 |
7 files changed, 41 insertions, 41 deletions
diff --git a/protocols/Steam/src/steam_avatars.cpp b/protocols/Steam/src/steam_avatars.cpp index 77382eb5c4..ad2348463d 100644 --- a/protocols/Steam/src/steam_avatars.cpp +++ b/protocols/Steam/src/steam_avatars.cpp @@ -3,7 +3,7 @@ TCHAR* CSteamProto::GetAvatarFilePath(MCONTACT hContact)
{
TCHAR path[MAX_PATH];
- mir_sntprintf(path, _T("%s\\%S"), VARST(_T("%miranda_avatarcache%")), m_szModuleName);
+ mir_sntprintf(path, L"%s\\%S", VARST(L"%miranda_avatarcache%"), m_szModuleName);
DWORD dwAttributes = GetFileAttributes(path);
if (dwAttributes == 0xffffffff || (dwAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0)
@@ -11,7 +11,7 @@ TCHAR* CSteamProto::GetAvatarFilePath(MCONTACT hContact) ptrA steamId(getStringA(hContact, "SteamID"));
if (steamId != NULL)
- mir_sntprintf(path, MAX_PATH, _T("%s\\%s.jpg"), path, _A2T(steamId));
+ mir_sntprintf(path, MAX_PATH, L"%s\\%s.jpg", path, _A2T(steamId));
else
return NULL;
diff --git a/protocols/Steam/src/steam_contacts.cpp b/protocols/Steam/src/steam_contacts.cpp index 9d3c9a88f8..de1253ad2e 100644 --- a/protocols/Steam/src/steam_contacts.cpp +++ b/protocols/Steam/src/steam_contacts.cpp @@ -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", _T("Steam")); + setTString(hContact, "MirVer", L"Steam"); } else if (stateflags & 2) { // game - setTString(hContact, "MirVer", _T("Steam (in game)")); + setTString(hContact, "MirVer", L"Steam (in game)"); } else if (stateflags & 256) { // on website - setTString(hContact, "MirVer", _T("Steam (website)")); + setTString(hContact, "MirVer", L"Steam (website)"); } else if (stateflags & 512) { // on mobile - setTString(hContact, "MirVer", _T("Steam (mobile)")); + setTString(hContact, "MirVer", L"Steam (mobile)"); } else if (stateflags & 1024) { // big picture mode - setTString(hContact, "MirVer", _T("Steam (Big Picture)")); + setTString(hContact, "MirVer", L"Steam (Big Picture)"); } else { // none/unknown (e.g. when contact is offline) @@ -268,7 +268,7 @@ void CSteamProto::ContactIsRemoved(MCONTACT hContact) TCHAR message[MAX_PATH]; mir_sntprintf(message, MAX_PATH, TranslateT("%s has been removed from your contact list"), nick); - ShowNotification(_T("Steam"), message); + ShowNotification(L"Steam", message); } } @@ -286,7 +286,7 @@ void CSteamProto::ContactIsFriend(MCONTACT hContact) TCHAR message[MAX_PATH]; mir_sntprintf(message, MAX_PATH, TranslateT("%s is back in your contact list"), nick); - ShowNotification(_T("Steam"), message); + ShowNotification(L"Steam", message); } } @@ -602,7 +602,7 @@ void CSteamProto::OnGotAvatar(const HttpResponse *response, void *arg) return; } - FILE *fp = _tfopen(ai.filename, _T("wb")); + FILE *fp = _tfopen(ai.filename, L"wb"); if (fp) { fwrite(response->pData, sizeof(char), response->dataLength, fp); diff --git a/protocols/Steam/src/steam_login.cpp b/protocols/Steam/src/steam_login.cpp index 979fc03c7e..fd8d7399f7 100644 --- a/protocols/Steam/src/steam_login.cpp +++ b/protocols/Steam/src/steam_login.cpp @@ -31,7 +31,7 @@ bool CSteamProto::Relogin() JSONNode *node = json_get(root, "error"); ptrT error(json_as_string(node)); - if (!mir_tstrcmpi(error, _T("OK"))) + if (!mir_tstrcmpi(error, L"OK")) { node = json_get(root, "umqid"); setString("UMQID", ptrA(mir_u2a(ptrT(json_as_string(node))))); @@ -151,7 +151,7 @@ void CSteamProto::OnAuthorizationError(const JSONNode &node) ptrT messageT(mir_utf8decodeT(message.c_str())); debugLogA("CSteamProto::OnAuthorizationError: %s", message.c_str()); - if (!mir_tstrcmpi(messageT, _T("Incorrect login."))) + if (!mir_tstrcmpi(messageT, L"Incorrect login.")) { // We can't continue with incorrect login/password DeleteAuthSettings(); @@ -325,7 +325,7 @@ void CSteamProto::HandleTokenExpired() // Try to relogin automatically (but only once) if (isLoginAgain) { // Notify error to user - ShowNotification(_T("Steam"), TranslateT("Cannot obtain connection token.")); + ShowNotification(L"Steam", TranslateT("Cannot obtain connection token.")); // Just go offline; it also resets the isLoginAgain to false SetStatus(ID_STATUS_OFFLINE); @@ -358,7 +358,7 @@ void CSteamProto::OnLoggedOn(const HttpResponse *response) } // Probably timeout or no connection, we can do nothing here - ShowNotification(_T("Steam"), TranslateT("Unknown login error.")); + ShowNotification(L"Steam", TranslateT("Unknown login error.")); SetStatus(ID_STATUS_OFFLINE); return; @@ -368,7 +368,7 @@ void CSteamProto::OnLoggedOn(const HttpResponse *response) JSONNode *node = json_get(root, "error"); ptrT error(json_as_string(node)); - if (mir_tstrcmpi(error, _T("OK"))) + if (mir_tstrcmpi(error, L"OK")) { // Probably expired TokenSecret HandleTokenExpired(); diff --git a/protocols/Steam/src/steam_messages.cpp b/protocols/Steam/src/steam_messages.cpp index 56cb5f2f62..bfcde18b1d 100644 --- a/protocols/Steam/src/steam_messages.cpp +++ b/protocols/Steam/src/steam_messages.cpp @@ -58,7 +58,7 @@ void CSteamProto::OnMessageSent(const HttpResponse *response, void *arg) }
}
- if (mir_tstrcmpi(error, _T("OK")) != 0)
+ if (mir_tstrcmpi(error, L"OK") != 0)
{
ptrA errorA(mir_t2a(error));
debugLogA("CSteamProto::OnMessageSent: failed to send message for %s (%s)", steamId, errorA);
diff --git a/protocols/Steam/src/steam_options.cpp b/protocols/Steam/src/steam_options.cpp index 666e206978..66bc247ea8 100644 --- a/protocols/Steam/src/steam_options.cpp +++ b/protocols/Steam/src/steam_options.cpp @@ -7,9 +7,9 @@ CSteamOptionsMain::CSteamOptionsMain(CSteamProto *proto, int idDialog, HWND hwnd {
SetParent(hwndParent);
- CreateLink(m_username, "Username", _T(""));
- CreateLink(m_password, "Password", _T(""));
- CreateLink(m_group, "DefaultGroup", _T("Steam"));
+ CreateLink(m_username, "Username", L"");
+ CreateLink(m_password, "Password", L"");
+ CreateLink(m_group, "DefaultGroup", L"Steam");
CreateLink(m_biggerAvatars, "UseBigAvatars", DBVT_BYTE, FALSE);
CreateLink(m_showChatEvents, "ShowChatEvents", DBVT_BYTE, TRUE);
}
@@ -62,7 +62,7 @@ void CSteamOptionsBlockList::OnInitDialog() m_list.SetExtendedListViewStyle(LVS_EX_SUBITEMIMAGES | LVS_EX_FULLROWSELECT | LVS_EX_LABELTIP);
m_list.AddColumn(0, TranslateT("Name"), 220);
- m_list.AddColumn(1, _T(""), 32 - GetSystemMetrics(SM_CXVSCROLL));
+ m_list.AddColumn(1, L"", 32 - GetSystemMetrics(SM_CXVSCROLL));
}
void CSteamOptionsBlockList::OnBlock(CCtrlButton*)
diff --git a/protocols/Steam/src/steam_polling.cpp b/protocols/Steam/src/steam_polling.cpp index 6b53d31763..9958bd334c 100644 --- a/protocols/Steam/src/steam_polling.cpp +++ b/protocols/Steam/src/steam_polling.cpp @@ -21,8 +21,8 @@ void CSteamProto::ParsePollData(JSONNode *data) node = json_get(item, "type"); ptrT type(json_as_string(node)); - if (!lstrcmpi(type, _T("saytext")) || !lstrcmpi(type, _T("emote")) || - !lstrcmpi(type, _T("my_saytext")) || !lstrcmpi(type, _T("my_emote"))) + if (!lstrcmpi(type, L"saytext") || !lstrcmpi(type, L"emote") || + !lstrcmpi(type, L"my_saytext") || !lstrcmpi(type, L"my_emote")) { MCONTACT hContact = FindContact(steamId); if (!hContact) @@ -35,7 +35,7 @@ void CSteamProto::ParsePollData(JSONNode *data) PROTORECVEVENT recv = { 0 }; recv.timestamp = timestamp; recv.szMessage = szMessage; - if (_tcsstr(type, _T("my_")) == NULL) + if (_tcsstr(type, L"my_") == NULL) { ProtoChainRecvMsg(hContact, &recv); } @@ -45,7 +45,7 @@ void CSteamProto::ParsePollData(JSONNode *data) Proto_RecvMessage(hContact, &recv); } } - else if (!lstrcmpi(type, _T("typing"))) + else if (!lstrcmpi(type, L"typing")) { MCONTACT hContact = FindContact(steamId); if (hContact) @@ -53,7 +53,7 @@ void CSteamProto::ParsePollData(JSONNode *data) CallService(MS_PROTO_CONTACTISTYPING, hContact, (LPARAM)STEAM_TYPING_TIME); } } - else if (!lstrcmpi(type, _T("personastate"))) + else if (!lstrcmpi(type, L"personastate")) { node = json_get(item, "persona_state"); int status = node ? SteamToMirandaStatus(json_as_int(node)) : -1; @@ -68,7 +68,7 @@ void CSteamProto::ParsePollData(JSONNode *data) if (status != m_iStatus) { - debugLog(_T("CSteamProto::ParsePollData: Change own status to %i"), status); + debugLog(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); @@ -90,7 +90,7 @@ void CSteamProto::ParsePollData(JSONNode *data) // todo: find difference between state changing and info changing steamIds.append(steamId).append(","); } - else if (!lstrcmpi(type, _T("personarelationship"))) + else if (!lstrcmpi(type, L"personarelationship")) { node = json_get(item, "persona_state"); int state = json_as_int(node); @@ -146,7 +146,7 @@ void CSteamProto::ParsePollData(JSONNode *data) default: continue; } } - else if (!lstrcmpi(type, _T("leftconversation"))) + else if (!lstrcmpi(type, L"leftconversation")) { if (!getBool("ShowChatEvents", true)) continue; @@ -185,7 +185,7 @@ void CSteamProto::ParsePollData(JSONNode *data) void CSteamProto::PollingThread(void*) { - debugLog(_T("CSteamProto::PollingThread: entering")); + debugLog(L"CSteamProto::PollingThread: entering"); ptrA token(getStringA("TokenSecret")); ptrA umqId(getStringA("UMQID")); @@ -219,7 +219,7 @@ void CSteamProto::PollingThread(void*) if (node) { ptrT error(json_as_string(node)); - if (!lstrcmpi(error, _T("OK"))) + if (!lstrcmpi(error, L"OK")) { // Remember last message timestamp node = json_get(root, "utc_timestamp"); @@ -244,14 +244,14 @@ void CSteamProto::PollingThread(void*) // m_pollingConnection = response->nlc; } - else if (!lstrcmpi(error, _T("Timeout"))) + else if (!lstrcmpi(error, L"Timeout")) { // Do nothing as this is not necessarily an error } - else if (!lstrcmpi(error, _T("Not Logged On"))) // 'else' below will handle this error, we don't need this particular check right now + 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(_T("CSteamProto::PollingThread: Not Logged On")); + debugLog(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(_T("CSteamProto::PollingThread: %s (%d)"), error, response->resultCode); + debugLog(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(_T("CSteamProto::PollingThread: Timeout is too low (%d)"), timeout); + debugLog(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(_T("CSteamProto::PollingThread: unexpected termination; switching protocol to offline")); + debugLog(L"CSteamProto::PollingThread: unexpected termination; switching protocol to offline"); SetStatus(ID_STATUS_OFFLINE); } m_hPollingThread = NULL; - debugLog(_T("CSteamProto::PollingThread: leaving")); + debugLog(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 e0ec091bee..a6aacedd65 100644 --- a/protocols/Steam/src/steam_proto.cpp +++ b/protocols/Steam/src/steam_proto.cpp @@ -18,7 +18,7 @@ CSteamProto::CSteamProto(const char* protoName, const TCHAR* userName) GetModuleFileName(g_hInstance, filePath, MAX_PATH); wchar_t sectionName[100]; - mir_sntprintf(sectionName, _T("%s/%s"), LPGENT("Protocols"), LPGENT(MODULE)); + mir_sntprintf(sectionName, L"%s/%s", LPGENT("Protocols"), LPGENT(MODULE)); char settingName[100]; mir_snprintf(settingName, "%s_%s", MODULE, "main"); @@ -245,7 +245,7 @@ HANDLE CSteamProto::SearchByName(const TCHAR* nick, const TCHAR* firstName, cons // Combine all fields to single text TCHAR keywordsT[200]; - mir_sntprintf(keywordsT, _T("%s %s %s"), nick, firstName, lastName); + mir_sntprintf(keywordsT, L"%s %s %s", nick, firstName, lastName); ptrA token(getStringA("TokenSecret")); ptrA keywords(mir_utf8encodeW(keywordsT)); @@ -296,7 +296,7 @@ int CSteamProto::SetStatus(int new_status) if (new_status == m_iDesiredStatus) return 0; - debugLog(_T("CSteamProto::SetStatus: changing status from %i to %i"), m_iStatus, new_status); + debugLog(L"CSteamProto::SetStatus: changing status from %i to %i", m_iStatus, new_status); int old_status = m_iStatus; m_iDesiredStatus = new_status; @@ -375,7 +375,7 @@ void __cdecl CSteamProto::GetAwayMsgThread(void *arg) ptrT xStatusMsg(getTStringA(hContact, "XStatusMsg")); if (xStatusName) - message.AppendFormat(_T("%s: %s"), xStatusName, xStatusMsg); + message.AppendFormat(L"%s: %s", xStatusName, xStatusMsg); else message.Append(xStatusMsg); } |