summaryrefslogtreecommitdiff
path: root/plugins/PluginUpdater/src/DlgListNew.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-07-26 09:20:25 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-07-26 09:20:25 +0000
commit6e53dfca72b932c4bdcd7aa02ca62bf8b2630eac (patch)
tree2e8bb660c908b54914abd562af8aafa4a486c846 /plugins/PluginUpdater/src/DlgListNew.cpp
parenta61c8728b379057fe7f0a0d86fe0b037598229dd (diff)
less TCHARs:
- TCHAR is replaced with wchar_t everywhere; - LPGENT replaced with either LPGENW or LPGEN; - fixes for ANSI plugins that improperly used _t functions; - TCHAR *t removed from MAllStrings; - ptszGroup, ptszTitle & ptszTab in OPTIONSDIALOGPAGE replaced with pwsz* git-svn-id: http://svn.miranda-ng.org/main/trunk@17133 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/PluginUpdater/src/DlgListNew.cpp')
-rw-r--r--plugins/PluginUpdater/src/DlgListNew.cpp62
1 files changed, 31 insertions, 31 deletions
diff --git a/plugins/PluginUpdater/src/DlgListNew.cpp b/plugins/PluginUpdater/src/DlgListNew.cpp
index 3d6b7ed772..89ccf41904 100644
--- a/plugins/PluginUpdater/src/DlgListNew.cpp
+++ b/plugins/PluginUpdater/src/DlgListNew.cpp
@@ -53,7 +53,7 @@ static void ApplyDownloads(void *param)
HWND hwndList = GetDlgItem(hDlg, IDC_LIST_UPDATES);
OBJLIST<FILEINFO> &todo = *(OBJLIST<FILEINFO> *)GetWindowLongPtr(hDlg, GWLP_USERDATA);
//create needed folders after escalating priviledges. Folders creates when we actually install updates
- TCHAR tszFileTemp[MAX_PATH], tszFileBack[MAX_PATH];
+ wchar_t tszFileTemp[MAX_PATH], tszFileBack[MAX_PATH];
mir_sntprintf(tszFileBack, L"%s\\Backups", g_tszRoot);
SafeCreateDirectory(tszFileBack);
@@ -111,11 +111,11 @@ static LRESULT CALLBACK PluginListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LP
if (ListView_GetItem(hwnd, &lvi) && lvi.iGroupId == 1) {
FILEINFO *info = (FILEINFO *)lvi.lParam;
- TCHAR tszFileName[MAX_PATH];
- _tcscpy(tszFileName, _tcsrchr(info->tszNewName, L'\\') + 1);
- TCHAR *p = _tcschr(tszFileName, L'.'); *p = 0;
+ wchar_t tszFileName[MAX_PATH];
+ wcscpy(tszFileName, wcsrchr(info->tszNewName, L'\\') + 1);
+ wchar_t *p = wcschr(tszFileName, L'.'); *p = 0;
- TCHAR link[MAX_PATH];
+ wchar_t link[MAX_PATH];
mir_sntprintf(link, PLUGIN_INFO_URL, tszFileName);
Utils_OpenUrlT(link);
}
@@ -165,10 +165,10 @@ INT_PTR CALLBACK DlgList(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
if (GetVersionEx(&osver) && osver.dwMajorVersion >= 6) {
wchar_t szPath[MAX_PATH];
GetModuleFileName(NULL, szPath, _countof(szPath));
- TCHAR *ext = _tcsrchr(szPath, '.');
+ wchar_t *ext = wcsrchr(szPath, '.');
if (ext != NULL)
*ext = '\0';
- _tcscat(szPath, L".test");
+ wcscat(szPath, L".test");
HANDLE hFile = CreateFile(szPath, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE)
// Running Windows Vista or later (major version >= 6).
@@ -229,8 +229,8 @@ INT_PTR CALLBACK DlgList(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
lvi.mask = LVIF_PARAM | LVIF_GROUPID | LVIF_TEXT | LVIF_IMAGE;
int groupId = 4;
- if (_tcschr(todo[i].tszOldName, L'\\') != NULL)
- groupId = (_tcsstr(todo[i].tszOldName, L"Plugins") != NULL) ? 1 : ((_tcsstr(todo[i].tszOldName, L"Languages") != NULL) ? 3 : 2);
+ if (wcschr(todo[i].tszOldName, L'\\') != NULL)
+ groupId = (wcsstr(todo[i].tszOldName, L"Plugins") != NULL) ? 1 : ((wcsstr(todo[i].tszOldName, L"Languages") != NULL) ? 3 : 2);
lvi.iItem = i;
lvi.lParam = (LPARAM)&todo[i];
@@ -344,27 +344,27 @@ static void __stdcall LaunchListDialog(void *param)
hwndDialog = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_LIST), GetDesktopWindow(), DlgList, (LPARAM)param);
}
-static FILEINFO* ServerEntryToFileInfo(const ServListEntry &hash, const TCHAR* tszBaseUrl, const TCHAR* tszPath)
+static FILEINFO* ServerEntryToFileInfo(const ServListEntry &hash, const wchar_t* tszBaseUrl, const wchar_t* tszPath)
{
FILEINFO *FileInfo = new FILEINFO;
FileInfo->bDeleteOnly = FALSE;
// copy the relative old name
- _tcsncpy(FileInfo->tszOldName, hash.m_name, _countof(FileInfo->tszOldName));
- _tcsncpy(FileInfo->tszNewName, hash.m_name, _countof(FileInfo->tszNewName));
+ wcsncpy(FileInfo->tszOldName, hash.m_name, _countof(FileInfo->tszOldName));
+ wcsncpy(FileInfo->tszNewName, hash.m_name, _countof(FileInfo->tszNewName));
- TCHAR tszFileName[MAX_PATH];
- _tcsncpy(tszFileName, _tcsrchr(tszPath, L'\\') + 1, _countof(tszFileName));
- TCHAR *tp = _tcschr(tszFileName, L'.'); if (tp) *tp = 0;
+ wchar_t tszFileName[MAX_PATH];
+ wcsncpy(tszFileName, wcsrchr(tszPath, L'\\') + 1, _countof(tszFileName));
+ wchar_t *tp = wcschr(tszFileName, L'.'); if (tp) *tp = 0;
- TCHAR tszRelFileName[MAX_PATH];
- _tcsncpy(tszRelFileName, hash.m_name, MAX_PATH);
- tp = _tcsrchr(tszRelFileName, L'.'); if (tp) *tp = 0;
- tp = _tcschr(tszRelFileName, L'\\'); if (tp) tp++; else tp = tszRelFileName;
- _tcslwr(tp);
+ wchar_t tszRelFileName[MAX_PATH];
+ wcsncpy(tszRelFileName, hash.m_name, MAX_PATH);
+ tp = wcsrchr(tszRelFileName, L'.'); if (tp) *tp = 0;
+ tp = wcschr(tszRelFileName, L'\\'); if (tp) tp++; else tp = tszRelFileName;
+ wcslwr(tp);
mir_sntprintf(FileInfo->File.tszDiskPath, L"%s\\Temp\\%s.zip", g_tszRoot, tszFileName);
mir_sntprintf(FileInfo->File.tszDownloadURL, L"%s/%s.zip", tszBaseUrl, tszRelFileName);
- for (tp = _tcschr(FileInfo->File.tszDownloadURL, '\\'); tp != 0; tp = _tcschr(tp, '\\'))
+ for (tp = wcschr(FileInfo->File.tszDownloadURL, '\\'); tp != 0; tp = wcschr(tp, '\\'))
*tp++ = '/';
FileInfo->File.CRCsum = hash.m_crc;
// Load list of checked Plugins from database
@@ -380,7 +380,7 @@ static void GetList(void *)
{
Thread_SetName("PluginUpdater: GetList");
- TCHAR tszTempPath[MAX_PATH];
+ wchar_t tszTempPath[MAX_PATH];
DWORD dwLen = GetTempPath(_countof(tszTempPath), tszTempPath);
if (tszTempPath[dwLen-1] == '\\')
tszTempPath[dwLen-1] = 0;
@@ -398,7 +398,7 @@ static void GetList(void *)
for (int i=0; i < hashes.getCount(); i++) {
ServListEntry &hash = hashes[i];
- TCHAR tszPath[MAX_PATH];
+ wchar_t tszPath[MAX_PATH];
mir_sntprintf(tszPath, L"%s\\%s", dirname, hash.m_name);
if (GetFileAttributes(tszPath) == INVALID_FILE_ATTRIBUTES) {
@@ -450,21 +450,21 @@ void UnloadListNew()
static INT_PTR ParseUriService(WPARAM, LPARAM lParam)
{
- TCHAR *arg = (TCHAR *)lParam;
+ wchar_t *arg = (wchar_t *)lParam;
if (arg == NULL)
return 1;
- TCHAR uri[1024];
- _tcsncpy_s(uri, arg, _TRUNCATE);
+ wchar_t uri[1024];
+ wcsncpy_s(uri, arg, _TRUNCATE);
- TCHAR *p = _tcschr(uri, _T(':'));
+ wchar_t *p = wcschr(uri, ':');
if (p == NULL)
return 1;
- TCHAR pluginPath[MAX_PATH];
+ wchar_t pluginPath[MAX_PATH];
mir_tstrcpy(pluginPath, p + 1);
- p = _tcschr(pluginPath, _T('/'));
- if (p) *p = _T('\\');
+ p = wcschr(pluginPath, '/');
+ if (p) *p = '\\';
if (GetFileAttributes(pluginPath) != INVALID_FILE_ATTRIBUTES)
return 0;
@@ -481,7 +481,7 @@ static INT_PTR ParseUriService(WPARAM, LPARAM lParam)
return 0;
VARST dirName(L"%miranda_path%");
- TCHAR tszPath[MAX_PATH];
+ wchar_t tszPath[MAX_PATH];
mir_sntprintf(tszPath, L"%s\\%s", dirName, hash->m_name);
FILEINFO *fileInfo = ServerEntryToFileInfo(*hash, baseUrl, tszPath);