summaryrefslogtreecommitdiff
path: root/plugins/WhenWasIt
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/WhenWasIt
parent2e931a0b2780587d85f3902468c935f5adba70c8 (diff)
less TCHARs
git-svn-id: http://svn.miranda-ng.org/main/trunk@17138 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/WhenWasIt')
-rw-r--r--plugins/WhenWasIt/src/dlg_handlers.cpp36
-rw-r--r--plugins/WhenWasIt/src/notifiers.cpp28
-rw-r--r--plugins/WhenWasIt/src/services.cpp10
-rw-r--r--plugins/WhenWasIt/src/utils.cpp4
4 files changed, 39 insertions, 39 deletions
diff --git a/plugins/WhenWasIt/src/dlg_handlers.cpp b/plugins/WhenWasIt/src/dlg_handlers.cpp
index 3b269468c9..24af71cc3d 100644
--- a/plugins/WhenWasIt/src/dlg_handlers.cpp
+++ b/plugins/WhenWasIt/src/dlg_handlers.cpp
@@ -124,7 +124,7 @@ SIZE GetControlTextSize(HWND hCtrl)
wchar_t buffer[maxSize];
SIZE size;
GetWindowText(hCtrl, buffer, _countof(buffer));
- GetTextExtentPoint32(hDC, buffer, (int)mir_tstrlen(buffer), &size);
+ GetTextExtentPoint32(hDC, buffer, (int)mir_wstrlen(buffer), &size);
SelectObject(hDC, oldFont);
ReleaseDC(hCtrl, hDC);
return size;
@@ -144,7 +144,7 @@ int EnlargeControl(HWND hCtrl, HWND, SIZE oldSize)
wchar_t *strtrim(wchar_t *str)
{
size_t i = 0;
- size_t len = mir_tstrlen(str);
+ size_t len = mir_wstrlen(str);
while ((i < len) && (str[i] == ' ')) { i++; }
if (i) {
memmove(str, str + i, len - i + 1);
@@ -195,7 +195,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara
SetDlgItemText(hWnd, IDC_DAYS_IN_ADVANCE, buffer);
_itow(commonData.checkInterval, buffer, 10);
SetDlgItemText(hWnd, IDC_CHECK_INTERVAL, buffer);
- mir_sntprintf(buffer, L"%d|%d", commonData.popupTimeout, commonData.popupTimeoutToday);
+ mir_snwprintf(buffer, L"%d|%d", commonData.popupTimeout, commonData.popupTimeoutToday);
SetDlgItemText(hWnd, IDC_POPUP_TIMEOUT, buffer);
_itow(commonData.cSoundNearDays, buffer, 10);
SetDlgItemText(hWnd, IDC_SOUND_NEAR_DAYS_EDIT, buffer);
@@ -327,11 +327,11 @@ INT_PTR CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara
if (pos) {
wchar_t tmp[128];
*pos = 0;
- mir_tstrcpy(tmp, buffer);
+ mir_wstrcpy(tmp, buffer);
strtrim(tmp);
commonData.popupTimeout = _wtol(tmp);
- mir_tstrcpy(tmp, pos + 1);
+ mir_wstrcpy(tmp, pos + 1);
strtrim(tmp);
commonData.popupTimeoutToday = _wtol(tmp);
@@ -417,7 +417,7 @@ INT_PTR CALLBACK DlgProcAddBirthday(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l
char *szProto = GetContactProto(hContact);
wchar_t buffer[2048];
- mir_sntprintf(buffer, TranslateT("Set birthday for %s:"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_snwprintf(buffer, TranslateT("Set birthday for %s:"), pcli->pfnGetContactDisplayName(hContact, 0));
SetWindowText(hWnd, buffer);
HWND hDate = GetDlgItem(hWnd, IDC_DATE);
@@ -441,7 +441,7 @@ INT_PTR CALLBACK DlgProcAddBirthday(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l
case DOB_PROTOCOL:
DateTime_SetMonthCalColor(hDate, MCSC_TITLEBK, COLOR_PROTOCOL);
- mir_sntprintf(buffer, TranslateT("%S protocol"), szProto);
+ mir_snwprintf(buffer, TranslateT("%S protocol"), szProto);
szCurrentModuleTooltip = buffer;
break;
@@ -560,7 +560,7 @@ INT_PTR CALLBACK BirthdaysCompare(LPARAM lParam1, LPARAM lParam2, LPARAM myParam
else
res = (value1 != value2);
}
- else res = mir_tstrcmpi(text1, text2);
+ else res = mir_wstrcmpi(text1, text2);
res = (params.column == lastColumn) ? -res : res;
return res;
@@ -609,22 +609,22 @@ int UpdateBirthdayEntry(HWND hList, MCONTACT hContact, int entry, int bShowAll,
wchar_t buffer[2048];
if ((dtb <= 366) && (dtb >= 0))
- mir_sntprintf(buffer, L"%d", dtb);
+ mir_snwprintf(buffer, L"%d", dtb);
else
- mir_sntprintf(buffer, NA);
+ mir_snwprintf(buffer, NA);
ListView_SetItemText(hList, entry, 2, buffer);
if ((month != 0) && (day != 0))
- mir_sntprintf(buffer, L"%04d-%02d-%02d", year, month, day);
+ mir_snwprintf(buffer, L"%04d-%02d-%02d", year, month, day);
else
- mir_sntprintf(buffer, NA);
+ mir_snwprintf(buffer, NA);
ListView_SetItemText(hList, entry, 3, buffer);
if (age < 400 && age > 0) //hopefully noone lives longer than this :)
- mir_sntprintf(buffer, L"%d", age);
+ mir_snwprintf(buffer, L"%d", age);
else
- mir_sntprintf(buffer, NA);
+ mir_snwprintf(buffer, NA);
ListView_SetItemText(hList, entry, 4, buffer);
ListView_SetItemText(hList, entry, 5, GetBirthdayModule(module, hContact));
@@ -694,7 +694,7 @@ void SetBirthdaysCount(HWND hWnd)
{
int count = ListView_GetItemCount((GetDlgItem(hWnd, IDC_BIRTHDAYS_LIST)));
wchar_t title[512];
- mir_sntprintf(title, TranslateT("Birthday list (%d)"), count);
+ mir_snwprintf(title, TranslateT("Birthday list (%d)"), count);
SetWindowText(hWnd, title);
}
@@ -881,7 +881,7 @@ INT_PTR CALLBACK DlgProcUpcoming(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar
const int MAX_SIZE = 512;
wchar_t buffer[MAX_SIZE];
timeout--;
- mir_sntprintf(buffer, (timeout != 2) ? TranslateT("Closing in %d seconds") : TranslateT("Closing in %d second"), timeout);
+ mir_snwprintf(buffer, (timeout != 2) ? TranslateT("Closing in %d seconds") : TranslateT("Closing in %d second"), timeout);
SetDlgItemText(hWnd, IDC_CLOSE, buffer);
if (timeout <= 0)
@@ -914,9 +914,9 @@ INT_PTR CALLBACK DlgProcUpcoming(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar
ListView_InsertItem(hList, &item);
wchar_t buffer[512];
- mir_sntprintf(buffer, L"%d", data->age);
+ mir_snwprintf(buffer, L"%d", data->age);
ListView_SetItemText(hList, index, 1, buffer);
- mir_sntprintf(buffer, L"%d", data->dtb);
+ mir_snwprintf(buffer, L"%d", data->dtb);
ListView_SetItemText(hList, index, 2, buffer);
BirthdaysSortParams params = { 0 };
diff --git a/plugins/WhenWasIt/src/notifiers.cpp b/plugins/WhenWasIt/src/notifiers.cpp
index f7eeb0c150..c4869a53dd 100644
--- a/plugins/WhenWasIt/src/notifiers.cpp
+++ b/plugins/WhenWasIt/src/notifiers.cpp
@@ -43,11 +43,11 @@ void PopupNotifyNoBirthdays()
wchar_t *BuildDTBText(int dtb, wchar_t *name, wchar_t *text, int size)
{
if (dtb > 1)
- mir_sntprintf(text, size, TranslateT("%s has birthday in %d days."), name, dtb);
+ mir_snwprintf(text, size, TranslateT("%s has birthday in %d days."), name, dtb);
else if (dtb == 1)
- mir_sntprintf(text, size, TranslateT("%s has birthday tomorrow."), name);
+ mir_snwprintf(text, size, TranslateT("%s has birthday tomorrow."), name);
else
- mir_sntprintf(text, size, TranslateT("%s has birthday today."), name);
+ mir_snwprintf(text, size, TranslateT("%s has birthday today."), name);
return text;
}
@@ -55,11 +55,11 @@ wchar_t *BuildDTBText(int dtb, wchar_t *name, wchar_t *text, int size)
wchar_t *BuildDABText(int dab, wchar_t *name, wchar_t *text, int size)
{
if (dab > 1)
- mir_sntprintf(text, size, TranslateT("%s had birthday %d days ago."), name, dab);
+ mir_snwprintf(text, size, TranslateT("%s had birthday %d days ago."), name, dab);
else if (dab == 1)
- mir_sntprintf(text, size, TranslateT("%s had birthday yesterday."), name);
+ mir_snwprintf(text, size, TranslateT("%s had birthday yesterday."), name);
else
- mir_sntprintf(text, size, TranslateT("%s has birthday today (Should not happen, please report)."), name);
+ mir_snwprintf(text, size, TranslateT("%s has birthday today (Should not happen, please report)."), name);
return text;
}
@@ -81,7 +81,7 @@ int PopupNotifyBirthday(MCONTACT hContact, int dtb, int age)
pd.PluginWindowProc = DlgProcPopup;
pd.lchIcon = GetDTBIcon(dtb);
- mir_sntprintf(pd.lptzContactName, MAX_CONTACTNAME, TranslateT("Birthday - %s"), name);
+ mir_snwprintf(pd.lptzContactName, MAX_CONTACTNAME, TranslateT("Birthday - %s"), name);
wchar_t *sex;
switch (toupper(gender)) {
case 'M':
@@ -96,12 +96,12 @@ int PopupNotifyBirthday(MCONTACT hContact, int dtb, int age)
}
if (age > 0) {
if (dtb > 0)
- mir_sntprintf(pd.lptzText, MAX_SECONDLINE, TranslateT("%s\n%s will be %d years old."), text, sex, age);
+ mir_snwprintf(pd.lptzText, MAX_SECONDLINE, TranslateT("%s\n%s will be %d years old."), text, sex, age);
else
- mir_sntprintf(pd.lptzText, MAX_SECONDLINE, TranslateT("%s\n%s just turned %d."), text, sex, age);
+ mir_snwprintf(pd.lptzText, MAX_SECONDLINE, TranslateT("%s\n%s just turned %d."), text, sex, age);
}
else
- mir_tstrncpy(pd.lptzText, text, MAX_SECONDLINE - 1);
+ mir_wstrncpy(pd.lptzText, text, MAX_SECONDLINE - 1);
PUAddPopupT(&pd);
@@ -125,7 +125,7 @@ int PopupNotifyMissedBirthday(MCONTACT hContact, int dab, int age)
pd.PluginWindowProc = DlgProcPopup;
pd.lchIcon = GetDTBIcon(dab);
- mir_sntprintf(pd.lptzContactName, MAX_CONTACTNAME, TranslateT("Birthday - %s"), name);
+ mir_snwprintf(pd.lptzContactName, MAX_CONTACTNAME, TranslateT("Birthday - %s"), name);
wchar_t *sex;
switch (toupper(gender)) {
case 'M':
@@ -140,12 +140,12 @@ int PopupNotifyMissedBirthday(MCONTACT hContact, int dab, int age)
}
if (age > 0){
if (dab > 0)
- mir_sntprintf(pd.lptzText, MAX_SECONDLINE, TranslateT("%s\n%s just turned %d."), text, sex, age);
+ mir_snwprintf(pd.lptzText, MAX_SECONDLINE, TranslateT("%s\n%s just turned %d."), text, sex, age);
else
- mir_sntprintf(pd.lptzText, MAX_SECONDLINE, TranslateT("%s\n%s just turned %d."), text, sex, age);
+ mir_snwprintf(pd.lptzText, MAX_SECONDLINE, TranslateT("%s\n%s just turned %d."), text, sex, age);
}
else
- mir_tstrncpy(pd.lptzText, text, MAX_SECONDLINE - 1);
+ mir_wstrncpy(pd.lptzText, text, MAX_SECONDLINE - 1);
PUAddPopupT(&pd);
return 0;
diff --git a/plugins/WhenWasIt/src/services.cpp b/plugins/WhenWasIt/src/services.cpp
index a40f104f13..7ac4d016a5 100644
--- a/plugins/WhenWasIt/src/services.cpp
+++ b/plugins/WhenWasIt/src/services.cpp
@@ -217,7 +217,7 @@ INT_PTR ImportBirthdaysService(WPARAM, LPARAM)
of.lStructSize = sizeof(OPENFILENAME);
//of.hInstance = hInstance;
wchar_t filter[MAX_PATH];
- mir_sntprintf(filter, L"%s (*" BIRTHDAY_EXTENSION L")%c*" BIRTHDAY_EXTENSION L"%c", TranslateT("Birthdays files"), 0, 0);
+ mir_snwprintf(filter, L"%s (*" BIRTHDAY_EXTENSION L")%c*" BIRTHDAY_EXTENSION L"%c", TranslateT("Birthdays files"), 0, 0);
of.lpstrFilter = filter;
of.lpstrFile = fileName;
of.nMaxFile = _countof(fileName);
@@ -226,7 +226,7 @@ INT_PTR ImportBirthdaysService(WPARAM, LPARAM)
if (GetOpenFileName(&of)) {
wchar_t buffer[2048];
- mir_sntprintf(buffer, TranslateT("Importing birthdays from file: %s"), fileName);
+ mir_snwprintf(buffer, TranslateT("Importing birthdays from file: %s"), fileName);
ShowPopupMessage(TranslateT("WhenWasIt"), buffer, hImportBirthdays);
DoImport(fileName);
ShowPopupMessage(TranslateT("WhenWasIt"), TranslateT("Done importing birthdays"), hImportBirthdays);
@@ -242,7 +242,7 @@ INT_PTR ExportBirthdaysService(WPARAM, LPARAM)
of.lStructSize = sizeof(OPENFILENAME);
//of.hInstance = hInstance;
wchar_t filter[MAX_PATH];
- mir_sntprintf(filter, L"%s (*" BIRTHDAY_EXTENSION L")%c*" BIRTHDAY_EXTENSION L"%c%s (*.*)%c*.*%c", TranslateT("Birthdays files"), 0, 0, TranslateT("All Files"), 0, 0);
+ mir_snwprintf(filter, L"%s (*" BIRTHDAY_EXTENSION L")%c*" BIRTHDAY_EXTENSION L"%c%s (*.*)%c*.*%c", TranslateT("Birthdays files"), 0, 0, TranslateT("All Files"), 0, 0);
of.lpstrFilter = filter;
of.lpstrFile = fileName;
of.nMaxFile = _countof(fileName);
@@ -252,9 +252,9 @@ INT_PTR ExportBirthdaysService(WPARAM, LPARAM)
wchar_t buffer[2048];
wchar_t *fn = wcsrchr(fileName, '\\') + 1;
if (!wcschr(fn, '.'))
- mir_tstrcat(fileName, BIRTHDAY_EXTENSION);
+ mir_wstrcat(fileName, BIRTHDAY_EXTENSION);
- mir_sntprintf(buffer, TranslateT("Exporting birthdays to file: %s"), fileName);
+ mir_snwprintf(buffer, TranslateT("Exporting birthdays to file: %s"), fileName);
ShowPopupMessage(TranslateT("WhenWasIt"), buffer, hExportBirthdays);
DoExport(fileName);
ShowPopupMessage(TranslateT("WhenWasIt"), TranslateT("Done exporting birthdays"), hExportBirthdays);
diff --git a/plugins/WhenWasIt/src/utils.cpp b/plugins/WhenWasIt/src/utils.cpp
index 6c0c253a12..2b1a8e3551 100644
--- a/plugins/WhenWasIt/src/utils.cpp
+++ b/plugins/WhenWasIt/src/utils.cpp
@@ -145,7 +145,7 @@ wchar_t* GetContactID(MCONTACT hContact)
wchar_t* GetContactID(MCONTACT hContact, char *szProto)
{
- ptrT res(Contact_GetInfo(CNF_UNIQUEID, hContact, szProto));
+ ptrW res(Contact_GetInfo(CNF_UNIQUEID, hContact, szProto));
return (res) ? wcsdup(res) : NULL;
}
@@ -155,7 +155,7 @@ MCONTACT GetContactFromID(wchar_t *szID, char *szProto)
char *m_szProto = GetContactProto(hContact);
wchar_t *szHandle = GetContactID(hContact, szProto);
if (szHandle) {
- bool found = (!mir_tstrcmpi(szHandle, szID) && !_stricmp(szProto, m_szProto));
+ bool found = (!mir_wstrcmpi(szHandle, szID) && !_stricmp(szProto, m_szProto));
free(szHandle);
if (found)
return hContact;