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/NewEventNotify | |
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/NewEventNotify')
-rw-r--r-- | plugins/NewEventNotify/src/popup.cpp | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/plugins/NewEventNotify/src/popup.cpp b/plugins/NewEventNotify/src/popup.cpp index 41b792d5c6..0e4cc47692 100644 --- a/plugins/NewEventNotify/src/popup.cpp +++ b/plugins/NewEventNotify/src/popup.cpp @@ -180,22 +180,22 @@ static wchar_t* GetEventPreview(DBEVENTINFO *dbei) if (dbei->pBlob) {
if (dbei->flags & DBEF_UTF) {
// utf-8 in blob
- comment1 = mir_utf8decodeT((char*)dbei->pBlob);
+ comment1 = mir_utf8decodeW((char*)dbei->pBlob);
}
- else if (dbei->cbBlob == (mir_tstrlen((wchar_t *)dbei->pBlob)+1)*(sizeof(wchar_t)+1)) {
+ else if (dbei->cbBlob == (mir_wstrlen((wchar_t *)dbei->pBlob)+1)*(sizeof(wchar_t)+1)) {
// wchar in blob (the old hack)
- comment1 = mir_tstrdup((wchar_t*)dbei->pBlob);
+ comment1 = mir_wstrdup((wchar_t*)dbei->pBlob);
}
- else comment1 = mir_a2t((char *)dbei->pBlob);
+ else comment1 = mir_a2u((char *)dbei->pBlob);
}
commentFix = POPUP_COMMENT_MESSAGE;
break;
case EVENTTYPE_URL:
// url
- if (dbei->pBlob) comment2 = mir_a2t((char *)dbei->pBlob);
+ if (dbei->pBlob) comment2 = mir_a2u((char *)dbei->pBlob);
// comment
- if (dbei->pBlob) comment1 = mir_a2t((char *)dbei->pBlob + mir_strlen((char *)dbei->pBlob) + 1);
+ if (dbei->pBlob) comment1 = mir_a2u((char *)dbei->pBlob + mir_strlen((char *)dbei->pBlob) + 1);
commentFix = POPUP_COMMENT_URL;
break;
@@ -203,10 +203,10 @@ static wchar_t* GetEventPreview(DBEVENTINFO *dbei) if (dbei->pBlob) {
char *p = (char*)dbei->pBlob + sizeof(DWORD);
// filenames
- comment2 = (dbei->flags & DBEF_UTF) ? mir_utf8decodeT(p) : mir_a2t(p);
+ comment2 = (dbei->flags & DBEF_UTF) ? mir_utf8decodeW(p) : mir_a2u(p);
p += mir_strlen(p) + 1;
// description
- comment1 = (dbei->flags & DBEF_UTF) ? mir_utf8decodeT(p) : mir_a2t(p);
+ comment1 = (dbei->flags & DBEF_UTF) ? mir_utf8decodeW(p) : mir_a2u(p);
}
commentFix = POPUP_COMMENT_FILE;
break;
@@ -231,8 +231,8 @@ static wchar_t* GetEventPreview(DBEVENTINFO *dbei) if (pcBlob >= pcEnd)
break;
}
- mir_sntprintf(szBuf, TranslateT("Received %d contacts."), nContacts);
- comment1 = mir_tstrdup(szBuf);
+ mir_snwprintf(szBuf, TranslateT("Received %d contacts."), nContacts);
+ comment1 = mir_wstrdup(szBuf);
}
commentFix = POPUP_COMMENT_CONTACTS;
break;
@@ -257,24 +257,24 @@ static wchar_t* GetEventPreview(DBEVENTINFO *dbei) mir_snprintf(szUin, "%d", *((DWORD*)dbei->pBlob));
if (mir_strlen(pszNick) > 0) {
if (dbei->flags & DBEF_UTF)
- szNick = mir_utf8decodeT(pszNick);
+ szNick = mir_utf8decodeW(pszNick);
else
- szNick = mir_a2t(pszNick);
+ szNick = mir_a2u(pszNick);
}
else if (mir_strlen(pszEmail) > 0) {
if (dbei->flags & DBEF_UTF)
- szNick = mir_utf8decodeT(pszEmail);
+ szNick = mir_utf8decodeW(pszEmail);
else
- szNick = mir_a2t(pszEmail);
+ szNick = mir_a2u(pszEmail);
}
else if (*((DWORD*)dbei->pBlob) > 0)
- szNick = mir_a2t(szUin);
+ szNick = mir_a2u(szUin);
if (szNick) {
- mir_tstrcpy(szBuf, szNick);
- mir_tstrcat(szBuf, TranslateT(" added you to the contact list"));
+ mir_wstrcpy(szBuf, szNick);
+ mir_wstrcat(szBuf, TranslateT(" added you to the contact list"));
mir_free(szNick);
- comment1 = mir_tstrdup(szBuf);
+ comment1 = mir_wstrdup(szBuf);
}
}
commentFix = POPUP_COMMENT_ADDED;
@@ -293,24 +293,24 @@ static wchar_t* GetEventPreview(DBEVENTINFO *dbei) mir_snprintf(szUin, "%d", *((DWORD*)dbei->pBlob));
if (mir_strlen(pszNick) > 0) {
if (dbei->flags & DBEF_UTF)
- szNick = mir_utf8decodeT(pszNick);
+ szNick = mir_utf8decodeW(pszNick);
else
- szNick = mir_a2t(pszNick);
+ szNick = mir_a2u(pszNick);
}
else if (mir_strlen(pszEmail) > 0) {
if (dbei->flags & DBEF_UTF)
- szNick = mir_utf8decodeT(pszEmail);
+ szNick = mir_utf8decodeW(pszEmail);
else
- szNick = mir_a2t(pszEmail);
+ szNick = mir_a2u(pszEmail);
}
else if (*((DWORD*)dbei->pBlob) > 0)
- szNick = mir_a2t(szUin);
+ szNick = mir_a2u(szUin);
if (szNick) {
- mir_tstrcpy(szBuf, szNick);
- mir_tstrcat(szBuf, TranslateT(" requested authorization"));
+ mir_wstrcpy(szBuf, szNick);
+ mir_wstrcat(szBuf, TranslateT(" requested authorization"));
mir_free(szNick);
- comment1 = mir_tstrdup(szBuf);
+ comment1 = mir_wstrdup(szBuf);
}
}
commentFix = POPUP_COMMENT_AUTH;
@@ -321,7 +321,7 @@ static wchar_t* GetEventPreview(DBEVENTINFO *dbei) //ASCIIZ from name
//ASCIIZ from e-mail
case ICQEVENTTYPE_WEBPAGER:
- if (dbei->pBlob) comment1 = mir_a2t((const char *)dbei->pBlob);
+ if (dbei->pBlob) comment1 = mir_a2u((const char *)dbei->pBlob);
commentFix = POPUP_COMMENT_WEBPAGER;
break;
@@ -330,7 +330,7 @@ static wchar_t* GetEventPreview(DBEVENTINFO *dbei) //ASCIIZ from name
//ASCIIZ from e-mail
case ICQEVENTTYPE_EMAILEXPRESS:
- if (dbei->pBlob) comment1 = mir_a2t((const char *)dbei->pBlob);
+ if (dbei->pBlob) comment1 = mir_a2u((const char *)dbei->pBlob);
commentFix = POPUP_COMMENT_EMAILEXP;
break;
@@ -340,13 +340,13 @@ static wchar_t* GetEventPreview(DBEVENTINFO *dbei) if (dbei->pBlob) {
if (dbei->flags & DBEF_UTF) {
// utf-8 in blob
- comment1 = mir_utf8decodeT((char*)dbei->pBlob);
+ comment1 = mir_utf8decodeW((char*)dbei->pBlob);
}
- else if (dbei->cbBlob == (mir_tstrlen((wchar_t *)dbei->pBlob)+1)*(sizeof(wchar_t)+1)) {
+ else if (dbei->cbBlob == (mir_wstrlen((wchar_t *)dbei->pBlob)+1)*(sizeof(wchar_t)+1)) {
// wchar in blob (the old hack)
- comment1 = mir_tstrdup((wchar_t*)dbei->pBlob);
+ comment1 = mir_wstrdup((wchar_t*)dbei->pBlob);
}
- else comment1 = mir_a2t((char *)dbei->pBlob);
+ else comment1 = mir_a2u((char *)dbei->pBlob);
}
commentFix = POPUP_COMMENT_SMS;
break;
@@ -357,13 +357,13 @@ static wchar_t* GetEventPreview(DBEVENTINFO *dbei) if (dbei->pBlob) {
if (dbei->flags & DBEF_UTF) {
// utf-8 in blob
- comment1 = mir_utf8decodeT((char*)dbei->pBlob);
+ comment1 = mir_utf8decodeW((char*)dbei->pBlob);
}
- else if (dbei->cbBlob == (mir_tstrlen((wchar_t *)dbei->pBlob)+1)*(sizeof(wchar_t)+1)) {
+ else if (dbei->cbBlob == (mir_wstrlen((wchar_t *)dbei->pBlob)+1)*(sizeof(wchar_t)+1)) {
// wchar in blob (the old hack)
- comment1 = mir_tstrdup((wchar_t*)dbei->pBlob);
+ comment1 = mir_wstrdup((wchar_t*)dbei->pBlob);
}
- else comment1 = mir_a2t((char *)dbei->pBlob);
+ else comment1 = mir_a2u((char *)dbei->pBlob);
}
commentFix = POPUP_COMMENT_SMSCONFIRMATION;
break;
@@ -377,7 +377,7 @@ static wchar_t* GetEventPreview(DBEVENTINFO *dbei) wchar_t *pet = (wchar_t*)CallService(MS_DB_EVENT_GETTEXT, 0, (LPARAM)&svc);
if (pet) {
// we've got event text, move to our memory space
- comment1 = mir_tstrdup(pet);
+ comment1 = mir_wstrdup(pet);
mir_free(pet);
}
commentFix = pei->descr;
@@ -387,17 +387,17 @@ static wchar_t* GetEventPreview(DBEVENTINFO *dbei) else commentFix = POPUP_COMMENT_OTHER;
}
- if ( mir_tstrlen(comment1) > 0) {
+ if ( mir_wstrlen(comment1) > 0) {
mir_free(comment2);
return comment1;
}
- if ( mir_tstrlen(comment2) > 0) {
+ if ( mir_wstrlen(comment2) > 0) {
mir_free(comment1);
return comment2;
}
mir_free(comment1);
mir_free(comment2);
- return TranslateTS( mir_a2t(commentFix));
+ return TranslateTS( mir_a2u(commentFix));
}
int PopupShow(PLUGIN_OPTIONS* pluginOptions, MCONTACT hContact, MEVENT hEvent, UINT eventType)
@@ -495,7 +495,7 @@ int PopupShow(PLUGIN_OPTIONS* pluginOptions, MCONTACT hContact, MEVENT hEvent, U }
else { // get the needed event data
wcsncpy(pudw.lptzContactName, (wchar_t*)pcli->pfnGetContactDisplayName(hContact, 0), MAX_CONTACTNAME);
- wcsncpy(pudw.lptzText, ptrT(GetEventPreview(&dbe)), MAX_SECONDLINE);
+ wcsncpy(pudw.lptzText, ptrW(GetEventPreview(&dbe)), MAX_SECONDLINE);
}
PopupCount++;
@@ -540,12 +540,12 @@ int PopupUpdate(MCONTACT hContact, MEVENT hEvent) wchar_t lpzText[MAX_SECONDLINE*2] = L"\0\0";
if (pdata->pluginOptions->bShowHeaders)
- mir_sntprintf(lpzText, TranslateT("[b]Number of new message(s): %d[/b]\n"), pdata->countEvent);
+ mir_snwprintf(lpzText, TranslateT("[b]Number of new message(s): %d[/b]\n"), pdata->countEvent);
int doReverse = pdata->pluginOptions->bShowON;
if ((pdata->firstShowEventData != pdata->firstEventData && doReverse) || (pdata->firstShowEventData != pdata->lastEventData && !doReverse))
- mir_sntprintf(lpzText, L"%s...\n", lpzText);
+ mir_snwprintf(lpzText, L"%s...\n", lpzText);
//take the active event as starting one
EVENT_DATA_EX *eventData = pdata->firstShowEventData;
@@ -575,15 +575,15 @@ int PopupUpdate(MCONTACT hContact, MEVENT hEvent) if (pdata->pluginOptions->bShowDate)
wcsncpy(formatTime, L"%Y.%m.%d", _countof(formatTime));
else if (pdata->pluginOptions->bShowTime)
- mir_tstrncat(formatTime, L" %H:%M", _countof(formatTime) - mir_tstrlen(formatTime));
+ mir_wstrncat(formatTime, L" %H:%M", _countof(formatTime) - mir_wstrlen(formatTime));
time_t localTime = dbe.timestamp;
wcsftime(timestamp, _countof(timestamp), formatTime, localtime(&localTime));
- mir_sntprintf(lpzText, L"%s[b][i]%s[/i][/b]\n", lpzText, timestamp);
+ mir_snwprintf(lpzText, L"%s[b][i]%s[/i][/b]\n", lpzText, timestamp);
}
// prepare event preview
wchar_t* szEventPreview = GetEventPreview(&dbe);
- mir_sntprintf(lpzText, L"%s%s", lpzText, szEventPreview);
+ mir_snwprintf(lpzText, L"%s%s", lpzText, szEventPreview);
mir_free(szEventPreview);
if (dbe.pBlob)
@@ -595,11 +595,11 @@ int PopupUpdate(MCONTACT hContact, MEVENT hEvent) else if ((iEvent >= pdata->pluginOptions->iNumberMsg && pdata->pluginOptions->iNumberMsg) || !eventData->prev)
break;
- mir_sntprintf(lpzText, L"%s\n", lpzText);
+ mir_snwprintf(lpzText, L"%s\n", lpzText);
}
if ((doReverse && eventData->next) || (!doReverse && eventData->prev))
- mir_sntprintf(lpzText, L"%s\n...", lpzText);
+ mir_snwprintf(lpzText, L"%s\n...", lpzText);
PUChangeTextT(pdata->hWnd, lpzText);
return 0;
|