diff options
author | George Hazan <george.hazan@gmail.com> | 2016-07-27 14:23:31 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-07-27 14:23:31 +0000 |
commit | 2f261839b60692e33d0e160344d0d636d49c90ba (patch) | |
tree | 187921722698b681d29df3f6e60fb18394a5e9d5 /plugins/NewAwaySysMod/src | |
parent | 2e931a0b2780587d85f3902468c935f5adba70c8 (diff) |
less TCHARs
git-svn-id: http://svn.miranda-ng.org/main/trunk@17138 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/NewAwaySysMod/src')
-rw-r--r-- | plugins/NewAwaySysMod/src/AwaySys.cpp | 36 | ||||
-rw-r--r-- | plugins/NewAwaySysMod/src/CString.cpp | 2 | ||||
-rw-r--r-- | plugins/NewAwaySysMod/src/Client.cpp | 2 | ||||
-rw-r--r-- | plugins/NewAwaySysMod/src/GroupCheckbox.cpp | 4 | ||||
-rw-r--r-- | plugins/NewAwaySysMod/src/Notification.cpp | 6 | ||||
-rw-r--r-- | plugins/NewAwaySysMod/src/ReadAwayMsg.cpp | 4 | ||||
-rw-r--r-- | plugins/NewAwaySysMod/src/Services.cpp | 4 | ||||
-rw-r--r-- | plugins/NewAwaySysMod/src/SetAwayMsg.cpp | 6 |
8 files changed, 32 insertions, 32 deletions
diff --git a/plugins/NewAwaySysMod/src/AwaySys.cpp b/plugins/NewAwaySysMod/src/AwaySys.cpp index 7a86594b43..e80fa4c2c7 100644 --- a/plugins/NewAwaySysMod/src/AwaySys.cpp +++ b/plugins/NewAwaySysMod/src/AwaySys.cpp @@ -325,11 +325,11 @@ int PreBuildContactMenu(WPARAM hContact, LPARAM) // the protocol supports status message sending for current status, or autoreplying
if ((Flag1 & PF1_MODEMSGSEND && CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(iMode)) ||
((Flag1 & PF1_IM) == PF1_IM && (i < 0 || !g_AutoreplyOptPage.GetDBValueCopy(StatusModeList[i].DisableReplyCtlID))))
- mir_sntprintf(szSetStr, TranslateT("Set %s message for the contact"), pcli->pfnGetStatusModeDescription(iMode, 0), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_snwprintf(szSetStr, TranslateT("Set %s message for the contact"), pcli->pfnGetStatusModeDescription(iMode, 0), pcli->pfnGetContactDisplayName(hContact, 0));
// the protocol supports status message reading for contact's status
if (Flag1 & PF1_MODEMSGRECV && CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(iContactMode)) {
- mir_sntprintf(szReadStr, TranslateT("Re&ad %s message"), pcli->pfnGetStatusModeDescription(iContactMode, 0));
+ mir_snwprintf(szReadStr, TranslateT("Re&ad %s message"), pcli->pfnGetStatusModeDescription(iContactMode, 0));
hReadMsgIcon = Skin_LoadProtoIcon(szProto, iContactMode);
}
}
@@ -488,18 +488,18 @@ INT_PTR srvVariablesHandler(WPARAM, LPARAM lParam) ARGUMENTSINFO *ai = (ARGUMENTSINFO*)lParam;
ai->flags = AIF_DONTPARSE;
TCString Result;
- if (!mir_tstrcmp(ai->targv[0], VAR_AWAYSINCE_TIME)) {
+ if (!mir_wstrcmp(ai->targv[0], VAR_AWAYSINCE_TIME)) {
GetTimeFormat(LOCALE_USER_DEFAULT, 0, g_ProtoStates[VarParseData.szProto].m_awaySince, (ai->argc > 1 && *ai->targv[1]) ? ai->targv[1] : L"H:mm", Result.GetBuffer(256), 256);
Result.ReleaseBuffer();
}
- else if (!mir_tstrcmp(ai->targv[0], VAR_AWAYSINCE_DATE)) {
+ else if (!mir_wstrcmp(ai->targv[0], VAR_AWAYSINCE_DATE)) {
GetDateFormat(LOCALE_USER_DEFAULT, 0, g_ProtoStates[VarParseData.szProto].m_awaySince, (ai->argc > 1 && *ai->targv[1]) ? ai->targv[1] : NULL, Result.GetBuffer(256), 256);
Result.ReleaseBuffer();
}
- else if (!mir_tstrcmp(ai->targv[0], VAR_STATDESC)) {
+ else if (!mir_wstrcmp(ai->targv[0], VAR_STATDESC)) {
Result = (VarParseData.Flags & VPF_XSTATUS) ? STR_XSTATUSDESC : pcli->pfnGetStatusModeDescription(g_ProtoStates[VarParseData.szProto].m_status, 0);
}
- else if (!mir_tstrcmp(ai->targv[0], VAR_MYNICK)) {
+ else if (!mir_wstrcmp(ai->targv[0], VAR_MYNICK)) {
if (g_MoreOptPage.GetDBValueCopy(IDC_MOREOPTDLG_MYNICKPERPROTO) && VarParseData.szProto)
Result = db_get_s(NULL, VarParseData.szProto, "Nick", (wchar_t*)NULL);
@@ -509,15 +509,15 @@ INT_PTR srvVariablesHandler(WPARAM, LPARAM lParam) if (Result == NULL)
Result = TranslateT("Stranger");
}
- else if (!mir_tstrcmp(ai->targv[0], VAR_REQUESTCOUNT)) {
- mir_sntprintf(Result.GetBuffer(16), 16, L"%d", db_get_w(ai->fi->hContact, MOD_NAME, DB_REQUESTCOUNT, 0));
+ else if (!mir_wstrcmp(ai->targv[0], VAR_REQUESTCOUNT)) {
+ mir_snwprintf(Result.GetBuffer(16), 16, L"%d", db_get_w(ai->fi->hContact, MOD_NAME, DB_REQUESTCOUNT, 0));
Result.ReleaseBuffer();
}
- else if (!mir_tstrcmp(ai->targv[0], VAR_MESSAGENUM)) {
- mir_sntprintf(Result.GetBuffer(16), 16, L"%d", db_get_w(ai->fi->hContact, MOD_NAME, DB_MESSAGECOUNT, 0));
+ else if (!mir_wstrcmp(ai->targv[0], VAR_MESSAGENUM)) {
+ mir_snwprintf(Result.GetBuffer(16), 16, L"%d", db_get_w(ai->fi->hContact, MOD_NAME, DB_MESSAGECOUNT, 0));
Result.ReleaseBuffer();
}
- else if (!mir_tstrcmp(ai->targv[0], VAR_TIMEPASSED)) {
+ else if (!mir_wstrcmp(ai->targv[0], VAR_TIMEPASSED)) {
ULARGE_INTEGER ul_AwaySince, ul_Now;
SYSTEMTIME st;
GetLocalTime(&st);
@@ -527,14 +527,14 @@ INT_PTR srvVariablesHandler(WPARAM, LPARAM lParam) ul_Now.QuadPart /= 10000000; // now it's in seconds
Result.GetBuffer(256);
if (ul_Now.LowPart >= 7200) // more than 2 hours
- mir_sntprintf(Result, 256, TranslateT("%d hours"), ul_Now.LowPart / 3600);
+ mir_snwprintf(Result, 256, TranslateT("%d hours"), ul_Now.LowPart / 3600);
else if (ul_Now.LowPart >= 120) // more than 2 minutes
- mir_sntprintf(Result, 256, TranslateT("%d minutes"), ul_Now.LowPart / 60);
+ mir_snwprintf(Result, 256, TranslateT("%d minutes"), ul_Now.LowPart / 60);
else
- mir_sntprintf(Result, 256, TranslateT("%d seconds"), ul_Now.LowPart);
+ mir_snwprintf(Result, 256, TranslateT("%d seconds"), ul_Now.LowPart);
Result.ReleaseBuffer();
}
- else if (!mir_tstrcmp(ai->targv[0], VAR_PREDEFINEDMESSAGE)) {
+ else if (!mir_wstrcmp(ai->targv[0], VAR_PREDEFINEDMESSAGE)) {
ai->flags = 0; // reset AIF_DONTPARSE flag
if (ai->argc != 2)
return NULL;
@@ -544,7 +544,7 @@ INT_PTR srvVariablesHandler(WPARAM, LPARAM lParam) TreeCtrl->DBToMem(CString(MOD_NAME));
for (int i = 0; i < TreeCtrl->m_value.GetSize(); i++) {
- if (!(TreeCtrl->m_value[i].Flags & TIF_GROUP) && !mir_tstrcmpi(TreeCtrl->m_value[i].Title, ai->targv[1])) {
+ if (!(TreeCtrl->m_value[i].Flags & TIF_GROUP) && !mir_wstrcmpi(TreeCtrl->m_value[i].Title, ai->targv[1])) {
Result = TreeCtrl->m_value[i].User_Str1;
break;
}
@@ -552,7 +552,7 @@ INT_PTR srvVariablesHandler(WPARAM, LPARAM lParam) if (Result == NULL) // if we didn't find a message with specified title
return NULL; // return it now, as later we change NULL to ""
}
- else if (!mir_tstrcmp(ai->targv[0], VAR_PROTOCOL)) {
+ else if (!mir_wstrcmp(ai->targv[0], VAR_PROTOCOL)) {
if (VarParseData.szProto) {
CString AnsiResult;
CallProtoService(VarParseData.szProto, PS_GETNAME, 256, (LPARAM)AnsiResult.GetBuffer(256));
@@ -566,7 +566,7 @@ INT_PTR srvVariablesHandler(WPARAM, LPARAM lParam) if (!szResult)
return NULL;
- mir_tstrcpy(szResult, (Result != NULL) ? Result : L"");
+ mir_wstrcpy(szResult, (Result != NULL) ? Result : L"");
return (INT_PTR)szResult;
}
diff --git a/plugins/NewAwaySysMod/src/CString.cpp b/plugins/NewAwaySysMod/src/CString.cpp index 58a8826ed9..83c9717ee5 100644 --- a/plugins/NewAwaySysMod/src/CString.cpp +++ b/plugins/NewAwaySysMod/src/CString.cpp @@ -279,7 +279,7 @@ CString db_get_s(MCONTACT hContact, const char *szModule, const char *szSetting, TCString db_get_s(MCONTACT hContact, const char *szModule, const char *szSetting, const wchar_t *szDefaultValue)
{
- ptrT p( db_get_tsa(hContact, szModule, szSetting));
+ ptrW p( db_get_tsa(hContact, szModule, szSetting));
return TCString(p == NULL ? szDefaultValue : p);
}
diff --git a/plugins/NewAwaySysMod/src/Client.cpp b/plugins/NewAwaySysMod/src/Client.cpp index dbee9f8da2..a571f7f2b1 100644 --- a/plugins/NewAwaySysMod/src/Client.cpp +++ b/plugins/NewAwaySysMod/src/Client.cpp @@ -149,7 +149,7 @@ int GetRecentGroupID(int iMode) return g_Messages_RecentRootID;
for (int Order = 0; Order < TreeCtrl->m_value.GetSize(); Order++) // find a group named accordingly to the current status
- if (TreeCtrl->m_value[Order].ParentID == g_Messages_RecentRootID && TreeCtrl->m_value[Order].Flags & TIF_GROUP && !mir_tstrcmpi(TreeCtrl->m_value[Order].Title, iMode ? pcli->pfnGetStatusModeDescription(iMode, 0) : MSGTREE_RECENT_OTHERGROUP))
+ if (TreeCtrl->m_value[Order].ParentID == g_Messages_RecentRootID && TreeCtrl->m_value[Order].Flags & TIF_GROUP && !mir_wstrcmpi(TreeCtrl->m_value[Order].Title, iMode ? pcli->pfnGetStatusModeDescription(iMode, 0) : MSGTREE_RECENT_OTHERGROUP))
return TreeCtrl->m_value[Order].ID;
return -1;
diff --git a/plugins/NewAwaySysMod/src/GroupCheckbox.cpp b/plugins/NewAwaySysMod/src/GroupCheckbox.cpp index 913edfe261..4ec48644bb 100644 --- a/plugins/NewAwaySysMod/src/GroupCheckbox.cpp +++ b/plugins/NewAwaySysMod/src/GroupCheckbox.cpp @@ -96,7 +96,7 @@ static int CALLBACK CheckboxWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM l SIZE size;
wchar_t *szText = (wchar_t*)_alloca(Len * sizeof(wchar_t));
GetWindowText(hWnd, szText, Len);
- GetTextExtentPoint32(hdc, szText, (int)mir_tstrlen(szText), &size);
+ GetTextExtentPoint32(hdc, szText, (int)mir_wstrlen(szText), &size);
rcText.right = size.cx;
rcText.bottom = size.cy;
}
@@ -290,7 +290,7 @@ static int CALLBACK CheckboxWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM l GetThemeTextExtent(hTheme, hdcMem, BP_GROUPBOX, IsWindowEnabled(hWnd) ? GBS_NORMAL : GBS_DISABLED, szTextT, -1, DT_CALCRECT | DT_LEFT | DT_VCENTER | DT_SINGLELINE, 0, &rcText);
else {
SIZE size;
- GetTextExtentPoint32(hdcMem, szTextT, (int)mir_tstrlen(szTextT), &size);
+ GetTextExtentPoint32(hdcMem, szTextT, (int)mir_wstrlen(szTextT), &size);
rcText.right = size.cx;
rcText.bottom = size.cy;
}
diff --git a/plugins/NewAwaySysMod/src/Notification.cpp b/plugins/NewAwaySysMod/src/Notification.cpp index 3aaee466f0..e52cdeff3d 100644 --- a/plugins/NewAwaySysMod/src/Notification.cpp +++ b/plugins/NewAwaySysMod/src/Notification.cpp @@ -26,8 +26,8 @@ void ShowMsg(wchar_t *FirstLine, wchar_t *SecondLine, bool IsErrorMsg, int Timeo if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
POPUPDATAT ppd = { 0 };
ppd.lchIcon = LoadIcon(NULL, IsErrorMsg ? IDI_EXCLAMATION : IDI_INFORMATION);
- mir_tstrncpy(ppd.lptzContactName, FirstLine, MAX_CONTACTNAME);
- mir_tstrncpy(ppd.lptzText, SecondLine, MAX_SECONDLINE);
+ mir_wstrncpy(ppd.lptzContactName, FirstLine, MAX_CONTACTNAME);
+ mir_wstrncpy(ppd.lptzText, SecondLine, MAX_SECONDLINE);
ppd.colorBack = IsErrorMsg ? 0x0202E3 : 0xE8F1FD;
ppd.colorText = IsErrorMsg ? 0xE8F1FD : 0x000000;
ppd.iSeconds = Timeout;
@@ -69,7 +69,7 @@ void ShowLog(TCString &LogFilePath) INT_PTR Result = (INT_PTR)ShellExecute(NULL, L"open", LogFilePath, NULL, NULL, SW_SHOW);
if (Result <= 32) {
wchar_t szError[64];
- mir_sntprintf(szError, TranslateT("Error #%d"), Result);
+ mir_snwprintf(szError, TranslateT("Error #%d"), Result);
ShowMsg(szError, TranslateT("Can't open log file ") + LogFilePath, true);
}
}
diff --git a/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp b/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp index bc8398e62e..13cf39c03b 100644 --- a/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp +++ b/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp @@ -67,10 +67,10 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam char *szProto = GetContactProto(awayData->hContact);
wchar_t *status = pcli->pfnGetStatusModeDescription(db_get_w(awayData->hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
GetWindowText(hwndDlg, format, _countof(format));
- mir_sntprintf(str, format, status, contactName);
+ mir_snwprintf(str, format, status, contactName);
SetWindowText(hwndDlg, str);
GetDlgItemText(hwndDlg, IDC_READAWAYMSG_RETRIEVE, format, _countof(format));
- mir_sntprintf(str, format, status);
+ mir_snwprintf(str, format, status);
SetDlgItemText(hwndDlg, IDC_READAWAYMSG_RETRIEVE, str);
}
return true;
diff --git a/plugins/NewAwaySysMod/src/Services.cpp b/plugins/NewAwaySysMod/src/Services.cpp index f961e23d84..36ecd5a7ab 100644 --- a/plugins/NewAwaySysMod/src/Services.cpp +++ b/plugins/NewAwaySysMod/src/Services.cpp @@ -53,7 +53,7 @@ __inline void PSSetStatus(char *szProto, WORD Status, int bNoClistSetStatusMode INT_PTR GetStatusMsgW(WPARAM wParam, LPARAM)
{
LogMessage("MS_AWAYMSG_GETSTATUSMSGW called. status=%d", wParam);
- WCHAR *szMsg = mir_t2u(GetDynamicStatMsg(INVALID_CONTACT_ID, NULL, 0, wParam));
+ WCHAR *szMsg = mir_wstrdup(GetDynamicStatMsg(INVALID_CONTACT_ID, NULL, 0, wParam));
LogMessage("returned szMsgW:\n%S", szMsg ? szMsg : L"NULL");
return (INT_PTR)szMsg;
}
@@ -90,7 +90,7 @@ int GetState(WPARAM wParam, LPARAM lParam, int Widechar) TCString Msg(pi->status ? CProtoSettings(pi->szProto, pi->status).GetMsgFormat(GMF_LASTORDEFAULT) : CProtoSettings(pi->szProto).GetMsgFormat(((Flags & PIF_NOTTEMPORARY) ? 0 : GMF_TEMPORARY) | GMF_PERSONAL));
if (Msg != NULL) {
if (Widechar)
- pi->tszMsg = mir_tstrdup(Msg);
+ pi->tszMsg = mir_wstrdup(Msg);
else
pi->szMsg = mir_strdup(_T2A(Msg));
}
diff --git a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp index 9d0346a124..e2ec9e24a0 100644 --- a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp +++ b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp @@ -80,7 +80,7 @@ static LRESULT CALLBACK MsgEditSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, int nLen = GetWindowTextLength(hWnd);
wchar_t *text = (wchar_t*)_alloca((nLen + 1) * sizeof(wchar_t));
GetWindowText(hWnd, text, nLen + 1);
- memmove(text + start, text + end, sizeof(wchar_t)* (mir_tstrlen(text) + 1 - end));
+ memmove(text + start, text + end, sizeof(wchar_t)* (mir_wstrlen(text) + 1 - end));
SetWindowText(hWnd, text);
SendMessage(hWnd, EM_SETSEL, start, start);
@@ -368,7 +368,7 @@ void ApplySelContactsMessage(SetAwayMsgData* dat, CCList *CList, PTREEITEMARRAY HWND hwndDlg = g_SetAwayMsgPage.GetWnd();
GetDlgItemText(hwndDlg, IDC_SAWAYMSG_MSGDATA, Message.GetBuffer(AWAY_MSGDATA_MAX), AWAY_MSGDATA_MAX);
Message.ReleaseBuffer();
- if (!mir_tstrlen(Message))
+ if (!mir_wstrlen(Message))
Message = NULL; // delete personal message if it's empty
if (CList) {
@@ -843,7 +843,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA return true;
}
wchar_t BtnTitle[64];
- mir_sntprintf(BtnTitle, TranslateT("Closing in %d"), Countdown);
+ mir_snwprintf(BtnTitle, TranslateT("Closing in %d"), Countdown);
SetDlgItemText(hwndDlg, IDC_OK, BtnTitle);
Countdown--;
}
|