summaryrefslogtreecommitdiff
path: root/plugins/SeenPlugin
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-07-27 14:23:31 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-07-27 14:23:31 +0000
commit2f261839b60692e33d0e160344d0d636d49c90ba (patch)
tree187921722698b681d29df3f6e60fb18394a5e9d5 /plugins/SeenPlugin
parent2e931a0b2780587d85f3902468c935f5adba70c8 (diff)
less TCHARs
git-svn-id: http://svn.miranda-ng.org/main/trunk@17138 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SeenPlugin')
-rw-r--r--plugins/SeenPlugin/src/file.cpp10
-rw-r--r--plugins/SeenPlugin/src/history.cpp2
-rw-r--r--plugins/SeenPlugin/src/menu.cpp4
-rw-r--r--plugins/SeenPlugin/src/missed.cpp14
-rw-r--r--plugins/SeenPlugin/src/userinfo.cpp4
-rw-r--r--plugins/SeenPlugin/src/utils.cpp16
6 files changed, 24 insertions, 26 deletions
diff --git a/plugins/SeenPlugin/src/file.cpp b/plugins/SeenPlugin/src/file.cpp
index 5337d2ecb5..bd61b7a820 100644
--- a/plugins/SeenPlugin/src/file.cpp
+++ b/plugins/SeenPlugin/src/file.cpp
@@ -30,18 +30,18 @@ static wchar_t *g_ptszFileStamp, *g_ptszFileName;
void InitFileOutput(void)
{
- ptrT tszFileName(db_get_tsa(NULL, S_MOD, "FileName"));
+ ptrW tszFileName(db_get_tsa(NULL, S_MOD, "FileName"));
if (tszFileName == NULL)
- tszFileName = mir_tstrdup(DEFAULT_FILENAME);
- replaceStrT(g_ptszFileName, VARST(tszFileName));
+ tszFileName = mir_wstrdup(DEFAULT_FILENAME);
+ replaceStrW(g_ptszFileName, VARST(tszFileName));
wchar_t *tszPath = NEWWSTR_ALLOCA(g_ptszFileName);
wchar_t *p = wcsrchr(tszPath, '\\');
if (p) *p = 0;
CreateDirectoryTreeT(tszPath);
- ptrT tszFileStamp(db_get_tsa(NULL, S_MOD, "FileStamp"));
- replaceStrT(g_ptszFileStamp, (tszFileStamp == NULL) ? DEFAULT_FILESTAMP : tszFileStamp);
+ ptrW tszFileStamp(db_get_tsa(NULL, S_MOD, "FileStamp"));
+ replaceStrW(g_ptszFileStamp, (tszFileStamp == NULL) ? DEFAULT_FILESTAMP : tszFileStamp);
}
void UninitFileOutput()
diff --git a/plugins/SeenPlugin/src/history.cpp b/plugins/SeenPlugin/src/history.cpp
index 4aa5d23d1b..a89a7f2ce3 100644
--- a/plugins/SeenPlugin/src/history.cpp
+++ b/plugins/SeenPlugin/src/history.cpp
@@ -174,7 +174,7 @@ INT_PTR CALLBACK HistoryDlgProc(HWND hwndDlg, UINT Message, WPARAM wparam, LPARA
TranslateDialogDefault(hwndDlg);
hContact = (MCONTACT)lparam;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lparam);
- mir_sntprintf(sztemp, L"%s: %s",
+ mir_snwprintf(sztemp, L"%s: %s",
pcli->pfnGetContactDisplayName(hContact, 0),
TranslateT("last seen history"));
SetWindowText(hwndDlg, sztemp);
diff --git a/plugins/SeenPlugin/src/menu.cpp b/plugins/SeenPlugin/src/menu.cpp
index a5fec18486..b2728560d2 100644
--- a/plugins/SeenPlugin/src/menu.cpp
+++ b/plugins/SeenPlugin/src/menu.cpp
@@ -43,7 +43,7 @@ int BuildContactMenu(WPARAM hContact, LPARAM)
}
LPCTSTR ptszName;
- ptrT tszStamp(db_get_tsa(NULL, S_MOD, "MenuStamp"));
+ ptrW tszStamp(db_get_tsa(NULL, S_MOD, "MenuStamp"));
if (tszStamp != NULL)
ptszName = ParseString(tszStamp , hContact);
else
@@ -51,7 +51,7 @@ int BuildContactMenu(WPARAM hContact, LPARAM)
int flags = 0;
HICON hIcon = NULL;
- if (!mir_tstrcmp(ptszName, TranslateT("<unknown>"))) {
+ if (!mir_wstrcmp(ptszName, TranslateT("<unknown>"))) {
if (IsWatchedProtocol(szProto))
flags |= CMIF_GRAYED;
else
diff --git a/plugins/SeenPlugin/src/missed.cpp b/plugins/SeenPlugin/src/missed.cpp
index 5288c204f5..a3ce568a16 100644
--- a/plugins/SeenPlugin/src/missed.cpp
+++ b/plugins/SeenPlugin/src/missed.cpp
@@ -105,18 +105,16 @@ int ShowMissed(void)
if (!mcs.count)
return 0;
- wchar_t sztemp[1024], szcount[7];
+ CMStringW buf;
for (int loop = 0; loop < mcs.count; loop++) {
- mir_tstrncat(sztemp, (wchar_t*)pcli->pfnGetContactDisplayName(mcs.wpcontact[loop], 0), _countof(sztemp) - mir_tstrlen(sztemp));
- if (db_get_b(NULL, S_MOD, "MissedOnes_Count", 0)) {
- mir_sntprintf(szcount, L" [%i]", mcs.times[loop]);
- mir_tstrcat(sztemp, szcount);
- }
+ buf.Append(pcli->pfnGetContactDisplayName(mcs.wpcontact[loop], 0));
+ if (db_get_b(NULL, S_MOD, "MissedOnes_Count", 0))
+ buf.AppendFormat(L" [%i]", mcs.times[loop]);
- mir_tstrcat(sztemp, L"\n");
+ buf.AppendChar('\n');
}
- CreateDialogParam(hInstance, MAKEINTRESOURCE(IDD_MISSED), NULL, MissedDlgProc, (LPARAM)sztemp);
+ CreateDialogParam(hInstance, MAKEINTRESOURCE(IDD_MISSED), NULL, MissedDlgProc, (LPARAM)buf.c_str());
return 0;
}
diff --git a/plugins/SeenPlugin/src/userinfo.cpp b/plugins/SeenPlugin/src/userinfo.cpp
index 318e336278..4fb56ce9f7 100644
--- a/plugins/SeenPlugin/src/userinfo.cpp
+++ b/plugins/SeenPlugin/src/userinfo.cpp
@@ -41,11 +41,11 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lpar
case WM_REFRESH_UI:
{
- ptrT szout(db_get_tsa(NULL, S_MOD, "UserStamp"));
+ ptrW szout(db_get_tsa(NULL, S_MOD, "UserStamp"));
wchar_t *str = ParseString((szout != NULL) ? szout : DEFAULT_USERSTAMP, wparam);
SetDlgItemText(hdlg, IDC_INFOTEXT, str);
- if (!mir_tstrcmp(str, TranslateT("<unknown>")))
+ if (!mir_wstrcmp(str, TranslateT("<unknown>")))
EnableWindow(GetDlgItem(hdlg, IDC_INFOTEXT), FALSE);
}
break;
diff --git a/plugins/SeenPlugin/src/utils.cpp b/plugins/SeenPlugin/src/utils.cpp
index e820fa97b6..8ff36e51f0 100644
--- a/plugins/SeenPlugin/src/utils.cpp
+++ b/plugins/SeenPlugin/src/utils.cpp
@@ -161,12 +161,12 @@ wchar_t* ParseString(wchar_t *szstring, MCONTACT hcontact)
SYSTEMTIME st;
if (!isSeen(hcontact, &st)) {
- mir_tstrcat(sztemp, TranslateT("<never seen>"));
+ mir_wstrcat(sztemp, TranslateT("<never seen>"));
return sztemp;
}
char *szProto = hcontact ? GetContactProto(hcontact) : courProtoName;
- ptrT info;
+ ptrW info;
wchar_t *d = sztemp;
for (wchar_t *p = szstring; *p; p++) {
@@ -209,7 +209,7 @@ wchar_t* ParseString(wchar_t *szstring, MCONTACT hcontact)
}
charPtr = TranslateTS(weekdays[isetting]);
LBL_charPtr:
- d += mir_sntprintf(d, MAXSIZE - (d - sztemp), L"%s", charPtr);
+ d += mir_snwprintf(d, MAXSIZE - (d - sztemp), L"%s", charPtr);
break;
case 'w':
@@ -282,8 +282,8 @@ wchar_t* ParseString(wchar_t *szstring, MCONTACT hcontact)
if (isetting = db_get_w(hcontact, S_MOD, hcontact ? "StatusTriger" : courProtoName, 0)) {
wcsncpy(szdbsetting, pcli->pfnGetStatusModeDescription(isetting | 0x8000, 0), _countof(szdbsetting));
if (!(isetting & 0x8000)) {
- mir_tstrncat(szdbsetting, L"/", _countof(szdbsetting) - mir_tstrlen(szdbsetting));
- mir_tstrncat(szdbsetting, TranslateT("Idle"), _countof(szdbsetting) - mir_tstrlen(szdbsetting));
+ mir_wstrncat(szdbsetting, L"/", _countof(szdbsetting) - mir_wstrlen(szdbsetting));
+ mir_wstrncat(szdbsetting, TranslateT("Idle"), _countof(szdbsetting) - mir_wstrlen(szdbsetting));
}
charPtr = szdbsetting;
goto LBL_charPtr;
@@ -294,7 +294,7 @@ wchar_t* ParseString(wchar_t *szstring, MCONTACT hcontact)
if (db_get_ts(hcontact, "CList", "StatusMsg", &dbv))
goto LBL_noData;
- d += mir_sntprintf(d, MAXSIZE - (d - sztemp), L"%s", dbv.ptszVal);
+ d += mir_snwprintf(d, MAXSIZE - (d - sztemp), L"%s", dbv.ptszVal);
db_free(&dbv);
break;
@@ -302,8 +302,8 @@ wchar_t* ParseString(wchar_t *szstring, MCONTACT hcontact)
if (isetting = db_get_w(hcontact, S_MOD, hcontact ? "OldStatus" : courProtoName, 0)) {
wcsncpy(szdbsetting, pcli->pfnGetStatusModeDescription(isetting, 0), _countof(szdbsetting));
if (includeIdle && hcontact && db_get_b(hcontact, S_MOD, "OldIdle", 0)) {
- mir_tstrncat(szdbsetting, L"/", _countof(szdbsetting) - mir_tstrlen(szdbsetting));
- mir_tstrncat(szdbsetting, TranslateT("Idle"), _countof(szdbsetting) - mir_tstrlen(szdbsetting));
+ mir_wstrncat(szdbsetting, L"/", _countof(szdbsetting) - mir_wstrlen(szdbsetting));
+ mir_wstrncat(szdbsetting, TranslateT("Idle"), _countof(szdbsetting) - mir_wstrlen(szdbsetting));
}
charPtr = szdbsetting;
goto LBL_charPtr;