From 8ae3679aa1339ce9abee53adb69902bd6b7513dc Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 25 Jul 2016 10:31:04 +0000 Subject: hello, Unix. phase 1: removing _T() git-svn-id: http://svn.miranda-ng.org/main/trunk@17127 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/AvatarHistory/src/AvatarDlg.cpp | 14 +++++------ plugins/AvatarHistory/src/AvatarHistory.cpp | 16 ++++++------ plugins/AvatarHistory/src/popup.cpp | 4 +-- plugins/AvatarHistory/src/utils.cpp | 38 ++++++++++++++--------------- 4 files changed, 36 insertions(+), 36 deletions(-) (limited to 'plugins/AvatarHistory/src') diff --git a/plugins/AvatarHistory/src/AvatarDlg.cpp b/plugins/AvatarHistory/src/AvatarDlg.cpp index dc9d874f4e..481fea0fac 100644 --- a/plugins/AvatarHistory/src/AvatarDlg.cpp +++ b/plugins/AvatarHistory/src/AvatarDlg.cpp @@ -320,7 +320,7 @@ static INT_PTR CALLBACK AvatarDlgProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM l TCHAR avfolder[MAX_PATH]; MCONTACT hContact = (MCONTACT)GetWindowLongPtr(hwnd, GWLP_USERDATA); GetContactFolder(avfolder, hContact); - ShellExecute(NULL, db_get_b(NULL, MODULE_NAME, "OpenFolderMethod", 0) ? _T("explore") : _T("open"), avfolder, NULL, NULL, SW_SHOWNORMAL); + ShellExecute(NULL, db_get_b(NULL, MODULE_NAME, "OpenFolderMethod", 0) ? L"explore" : L"open", avfolder, NULL, NULL, SW_SHOWNORMAL); return TRUE; } break; @@ -374,7 +374,7 @@ int FillAvatarListFromFiles(HWND list, MCONTACT hContact) WIN32_FIND_DATA finddata; GetContactFolder(dir, hContact); - mir_sntprintf(path, _T("%s\\*.*"), dir); + mir_sntprintf(path, L"%s\\*.*", dir); HANDLE hFind = FindFirstFile(path, &finddata); if (hFind == INVALID_HANDLE_VALUE) @@ -384,7 +384,7 @@ int FillAvatarListFromFiles(HWND list, MCONTACT hContact) { if (finddata.cFileName[0] != '.') { - mir_sntprintf(path, _T("%s\\%s"), dir, finddata.cFileName); + mir_sntprintf(path, L"%s\\%s", dir, finddata.cFileName); max_pos = AddFileToList(path,finddata.cFileName,finddata.cFileName,list); } } @@ -401,7 +401,7 @@ int FillAvatarListFromFolder(HWND list, MCONTACT hContact) WIN32_FIND_DATA finddata; GetContactFolder(dir, hContact); - mir_sntprintf(path, _T("%s\\*.lnk"), dir); + mir_sntprintf(path, L"%s\\*.lnk", dir); HANDLE hFind = FindFirstFile(path, &finddata); if (hFind == INVALID_HANDLE_VALUE) @@ -412,7 +412,7 @@ int FillAvatarListFromFolder(HWND list, MCONTACT hContact) if (finddata.cFileName[0] != '.') { TCHAR lnk[MAX_PATH]; - mir_sntprintf(lnk, _T("%s\\%s"), dir, finddata.cFileName); + mir_sntprintf(lnk, L"%s\\%s", dir, finddata.cFileName); if (ResolveShortcut(lnk, path)) max_pos = AddFileToList(path,lnk,finddata.cFileName,list); } @@ -436,7 +436,7 @@ int FillAvatarListFromDB(HWND list, MCONTACT hContact) // Get time TCHAR date[64]; - TimeZone_ToStringT(dbei.timestamp, _T("d s"), date, _countof(date)); + TimeZone_ToStringT(dbei.timestamp, L"d s", date, _countof(date)); // Get file in disk TCHAR path[MAX_PATH]; @@ -569,7 +569,7 @@ int ShowSaveDialog(HWND hwnd, TCHAR* fn, MCONTACT hContact) } else { - ofn.lpstrInitialDir = _T("."); + ofn.lpstrInitialDir = L"."; } if (GetSaveFileName(&ofn)) { diff --git a/plugins/AvatarHistory/src/AvatarHistory.cpp b/plugins/AvatarHistory/src/AvatarHistory.cpp index e12e54d4f2..3f833d86f0 100644 --- a/plugins/AvatarHistory/src/AvatarHistory.cpp +++ b/plugins/AvatarHistory/src/AvatarHistory.cpp @@ -120,7 +120,7 @@ static int AvatarChanged(WPARAM hContact, LPARAM lParam) CONTACTAVATARCHANGEDNOTIFICATION* avatar = (CONTACTAVATARCHANGEDNOTIFICATION*)lParam; if (avatar == NULL) { - if (!ret || !mir_tstrcmp(dbvOldHash.ptszVal, _T("-"))) { + if (!ret || !mir_tstrcmp(dbvOldHash.ptszVal, L"-")) { //avoid duplicate "removed avatar" notifications //do not notify on an empty profile ShowDebugPopup(hContact, TranslateT("AVH Debug"), TranslateT("Removed avatar, no avatar before... skipping")); @@ -130,7 +130,7 @@ static int AvatarChanged(WPARAM hContact, LPARAM lParam) SkinPlaySound("avatar_removed"); // Is a flash avatar or avs could not load it - db_set_ts(hContact, MODULE_NAME, "AvatarHash", _T("-")); + db_set_ts(hContact, MODULE_NAME, "AvatarHash", L"-"); if (ContactEnabled(hContact, "AvatarPopups", AVH_DEF_AVPOPUPS) && opts.popup_show_removed) ShowPopup(hContact, NULL, opts.popup_removed); @@ -145,7 +145,7 @@ static int AvatarChanged(WPARAM hContact, LPARAM lParam) SkinPlaySound("avatar_changed"); db_set_ts(hContact, "AvatarHistory", "AvatarHash", avatar->hash); - TCHAR history_filename[MAX_PATH] = _T(""); + TCHAR history_filename[MAX_PATH] = L""; if (ContactEnabled(hContact, "LogToDisk", AVH_DEF_LOGTODISK)) { if (!opts.log_store_as_hash) { @@ -158,7 +158,7 @@ static int AvatarChanged(WPARAM hContact, LPARAM lParam) MCONTACT hMetaContact = db_mc_getMeta(hContact); if (hMetaContact && ContactEnabled(hMetaContact, "LogToDisk", AVH_DEF_LOGTOHISTORY)) { - TCHAR filename[MAX_PATH] = _T(""); + TCHAR filename[MAX_PATH] = L""; GetOldStyleAvatarName(filename, hMetaContact); if (CopyImageFile(avatar->filename, filename)) @@ -188,7 +188,7 @@ static int AvatarChanged(WPARAM hContact, LPARAM lParam) GetProtocolFolder(history_filename, proto); mir_sntprintf(history_filename, - _T("%s\\%s"), history_filename, hash); + L"%s\\%s", history_filename, hash); if (CopyImageFile(avatar->filename, history_filename)) ShowPopup(hContact, TranslateT("Avatar History: Unable to save avatar"), history_filename); @@ -236,10 +236,10 @@ static int PreShutdown(WPARAM, LPARAM) static int ModulesLoaded(WPARAM, LPARAM) { - mir_sntprintf(basedir, _T("%s\\Avatars History"), profilePath); + mir_sntprintf(basedir, L"%s\\Avatars History", profilePath); hFolder = FoldersRegisterCustomPathT( LPGEN("Avatars"), LPGEN("Avatar History"), - PROFILE_PATHT _T("\\") CURRENT_PROFILET _T("\\Avatars History")); + PROFILE_PATHT L"\\" CURRENT_PROFILET L"\\Avatars History"); InitPopups(); @@ -344,7 +344,7 @@ extern "C" __declspec(dllexport) int Load(void) CreateServiceFunction(MS_AVATARHISTORY_GET_CACHED_AVATAR, GetCachedAvatar); if (CallService(MS_DB_GETPROFILEPATHT, MAX_PATH, (LPARAM)profilePath) != 0) - mir_tstrcpy(profilePath, _T(".")); // Failed, use current dir + mir_tstrcpy(profilePath, L"."); // Failed, use current dir SkinAddNewSoundExT("avatar_changed",LPGENT("Avatar History"),LPGENT("Contact changed avatar")); SkinAddNewSoundExT("avatar_removed",LPGENT("Avatar History"),LPGENT("Contact removed avatar")); diff --git a/plugins/AvatarHistory/src/popup.cpp b/plugins/AvatarHistory/src/popup.cpp index fad3e5ad56..b0ad399afb 100644 --- a/plugins/AvatarHistory/src/popup.cpp +++ b/plugins/AvatarHistory/src/popup.cpp @@ -41,7 +41,7 @@ static LRESULT CALLBACK DumbPopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, void InitPopups() { // window needed for popup commands - hPopupWindow = CreateWindowEx(WS_EX_TOOLWINDOW, _T("static"), _T(MODULE_NAME) _T("_PopupWindow"), + hPopupWindow = CreateWindowEx(WS_EX_TOOLWINDOW, L"static", _T(MODULE_NAME) L"_PopupWindow", 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP, NULL, hInst, NULL); SetWindowLongPtr(hPopupWindow, GWLP_WNDPROC, (LONG_PTR)PopupWndProc); @@ -57,7 +57,7 @@ void DeInitPopups() // Show an error popup void ShowErrPopup(const TCHAR *description, const TCHAR *title) { - ShowPopupEx(NULL, title == NULL ? _T(MODULE_NAME) _T(" Error") : title, description, + ShowPopupEx(NULL, title == NULL ? _T(MODULE_NAME) L" Error" : title, description, NULL, POPUP_TYPE_ERROR, NULL); } diff --git a/plugins/AvatarHistory/src/utils.cpp b/plugins/AvatarHistory/src/utils.cpp index 39b4db8534..c062534c32 100644 --- a/plugins/AvatarHistory/src/utils.cpp +++ b/plugins/AvatarHistory/src/utils.cpp @@ -79,12 +79,12 @@ void ConvertToFilename(TCHAR *str, size_t size) TCHAR* GetExtension(TCHAR *file) { - if (file == NULL) return _T(""); + if (file == NULL) return L""; TCHAR *ext = _tcsrchr(file, _T('.')); if (ext != NULL) ext++; else - ext = _T(""); + ext = L""; return ext; } @@ -104,7 +104,7 @@ TCHAR* GetProtocolFolder(TCHAR *fn, char *proto) if (proto == NULL) proto = Translate("Unknown Protocol"); - mir_sntprintf(fn, MAX_PATH, _T("%s\\%S"), fn, proto); + mir_sntprintf(fn, MAX_PATH, L"%s\\%S", fn, proto); CreateDirectoryTreeT(fn); return fn; } @@ -118,13 +118,13 @@ TCHAR* GetContactFolder(TCHAR *fn, MCONTACT hContact) ptrT id(Contact_GetInfo(CNF_UNIQUEID, hContact, proto)); _tcsncpy_s(uin, (id == NULL) ? TranslateT("Unknown UIN") : id, _TRUNCATE); ConvertToFilename(uin, MAX_PATH); //added so that weather id's like "yw/CI0000" work - mir_sntprintf(fn, MAX_PATH, _T("%s\\%s"), fn, uin); + mir_sntprintf(fn, MAX_PATH, L"%s\\%s", fn, uin); CreateDirectoryTreeT(fn); #ifdef DBGPOPUPS TCHAR log[1024]; - mir_sntprintf(log, _T("Path: %s\nProto: %S\nUIN: %s"), fn, proto, uin); - ShowPopup(hContact, _T("AVH Debug: GetContactFolder"), log); + mir_sntprintf(log, L"Path: %s\nProto: %S\nUIN: %s", fn, proto, uin); + ShowPopup(hContact, L"AVH Debug: GetContactFolder", log); #endif return fn; @@ -137,7 +137,7 @@ TCHAR* GetOldStyleAvatarName(TCHAR *fn, MCONTACT hContact) SYSTEMTIME curtime; GetLocalTime(&curtime); mir_sntprintf(fn, MAX_PATH, - _T("%s\\%04d-%02d-%02d %02dh%02dm%02ds"), fn, + L"%s\\%04d-%02d-%02d %02dh%02dm%02ds", fn, curtime.wYear, curtime.wMonth, curtime.wDay, curtime.wHour, curtime.wMinute, curtime.wSecond); ShowDebugPopup(hContact,TranslateT("AVH Debug: GetOldStyleAvatarName"),fn); @@ -146,11 +146,11 @@ TCHAR* GetOldStyleAvatarName(TCHAR *fn, MCONTACT hContact) void CreateOldStyleShortcut(MCONTACT hContact, TCHAR *history_filename) { - TCHAR shortcut[MAX_PATH] = _T(""); + TCHAR shortcut[MAX_PATH] = L""; GetOldStyleAvatarName(shortcut, hContact); - mir_sntprintf(shortcut, _T("%s.%s.lnk"), shortcut, + mir_sntprintf(shortcut, L"%s.%s.lnk", shortcut, GetExtension(history_filename)); if (!CreateShortcut(history_filename, shortcut)) @@ -166,21 +166,21 @@ void CreateOldStyleShortcut(MCONTACT hContact, TCHAR *history_filename) BOOL CopyImageFile(TCHAR *old_file, TCHAR *new_file) { TCHAR *ext = GetExtension(old_file); - mir_sntprintf(new_file, MAX_PATH, _T("%s.%s"), new_file, ext); + mir_sntprintf(new_file, MAX_PATH, L"%s.%s", new_file, ext); return !CopyFile(old_file, new_file, TRUE); } TCHAR * GetCachedAvatar(char *proto, TCHAR *hash) { TCHAR *ret = NULL; - TCHAR file[1024] = _T(""); - TCHAR search[1024] = _T(""); + TCHAR file[1024] = L""; + TCHAR search[1024] = L""; if (opts.log_keep_same_folder) GetHistoryFolder(file); else GetProtocolFolder(file, proto); - mir_sntprintf(search, _T("%s\\%s.*"), file, hash); + mir_sntprintf(search, L"%s\\%s.*", file, hash); WIN32_FIND_DATA finddata; HANDLE hFind = FindFirstFile(search, &finddata); @@ -191,13 +191,13 @@ TCHAR * GetCachedAvatar(char *proto, TCHAR *hash) { size_t len = mir_tstrlen(finddata.cFileName); if (len > 4 - && (!mir_tstrcmpi(&finddata.cFileName[len-4], _T(".png")) - || !mir_tstrcmpi(&finddata.cFileName[len-4], _T(".bmp")) - || !mir_tstrcmpi(&finddata.cFileName[len-4], _T(".gif")) - || !mir_tstrcmpi(&finddata.cFileName[len-4], _T(".jpg")) - || !mir_tstrcmpi(&finddata.cFileName[len-5], _T(".jpeg")))) + && (!mir_tstrcmpi(&finddata.cFileName[len-4], L".png") + || !mir_tstrcmpi(&finddata.cFileName[len-4], L".bmp") + || !mir_tstrcmpi(&finddata.cFileName[len-4], L".gif") + || !mir_tstrcmpi(&finddata.cFileName[len-4], L".jpg") + || !mir_tstrcmpi(&finddata.cFileName[len-5], L".jpeg"))) { - mir_sntprintf(file, _T("%s\\%s"), file, finddata.cFileName); + mir_sntprintf(file, L"%s\\%s", file, finddata.cFileName); ret = mir_tstrdup(file); break; } -- cgit v1.2.3