diff options
author | George Hazan <george.hazan@gmail.com> | 2016-07-26 09:20:25 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-07-26 09:20:25 +0000 |
commit | 6e53dfca72b932c4bdcd7aa02ca62bf8b2630eac (patch) | |
tree | 2e8bb660c908b54914abd562af8aafa4a486c846 /plugins/PackUpdater | |
parent | a61c8728b379057fe7f0a0d86fe0b037598229dd (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/PackUpdater')
-rw-r--r-- | plugins/PackUpdater/Src/Events.cpp | 4 | ||||
-rw-r--r-- | plugins/PackUpdater/Src/Notifications.cpp | 16 | ||||
-rw-r--r-- | plugins/PackUpdater/Src/Notifications.h | 6 | ||||
-rw-r--r-- | plugins/PackUpdater/Src/Options.cpp | 8 | ||||
-rw-r--r-- | plugins/PackUpdater/Src/PackUpdater.cpp | 8 | ||||
-rw-r--r-- | plugins/PackUpdater/Src/Utils.cpp | 20 | ||||
-rw-r--r-- | plugins/PackUpdater/Src/stdafx.h | 20 |
7 files changed, 41 insertions, 41 deletions
diff --git a/plugins/PackUpdater/Src/Events.cpp b/plugins/PackUpdater/Src/Events.cpp index ad126ec69b..bc12d5359b 100644 --- a/plugins/PackUpdater/Src/Events.cpp +++ b/plugins/PackUpdater/Src/Events.cpp @@ -29,8 +29,8 @@ int ModulesLoaded(WPARAM, LPARAM) hkd.cbSize = sizeof(hkd);
hkd.dwFlags = HKD_TCHAR;
hkd.pszName = "Check for pack updates";
- hkd.ptszDescription = LPGENT("Check for pack updates");
- hkd.ptszSection = LPGENT("Pack Updater");
+ hkd.ptszDescription = LPGENW("Check for pack updates");
+ hkd.ptszSection = LPGENW("Pack Updater");
hkd.pszService = MODNAME"/CheckUpdates";
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, VK_F10) | HKF_MIRANDA_LOCAL;
hkd.lParam = FALSE;
diff --git a/plugins/PackUpdater/Src/Notifications.cpp b/plugins/PackUpdater/Src/Notifications.cpp index 9bb3df6958..b22066e480 100644 --- a/plugins/PackUpdater/Src/Notifications.cpp +++ b/plugins/PackUpdater/Src/Notifications.cpp @@ -326,8 +326,8 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam {
vector<FILEINFO> &todo = *(vector<FILEINFO> *)GetWindowLongPtr(hDlg, GWLP_USERDATA);
ShowWindow(hDlg, SW_HIDE);
- TCHAR tszBuff[2048] = { 0 }, tszFileDest[MAX_PATH] = { 0 }, tszFilePathDest[MAX_PATH] = { 0 }, tszFilePathBack[MAX_PATH] = { 0 }, tszFileName[MAX_PATH] = { 0 };
- TCHAR* tszExt = NULL;
+ wchar_t tszBuff[2048] = { 0 }, tszFileDest[MAX_PATH] = { 0 }, tszFilePathDest[MAX_PATH] = { 0 }, tszFilePathBack[MAX_PATH] = { 0 }, tszFileName[MAX_PATH] = { 0 };
+ wchar_t* tszExt = NULL;
char szKey[64] = { 0 };
vector<int> arFileType;
vector<tString> arFilePath;
@@ -426,10 +426,10 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam rc = MessageBox(NULL, tszBuff, Title, MB_YESNO | MB_ICONQUESTION);
if (rc == IDYES) {
for (int i = 0; i < UpdatesCount; i++) {
- TCHAR* tszUtilRootPlug = NULL;
- TCHAR* tszUtilRootIco = NULL;
- TCHAR* tszUtilRoot = NULL;
- TCHAR tszCurrentDir[MAX_PATH];
+ wchar_t* tszUtilRootPlug = NULL;
+ wchar_t* tszUtilRootIco = NULL;
+ wchar_t* tszUtilRoot = NULL;
+ wchar_t tszCurrentDir[MAX_PATH];
switch (arFileType[i]) {
case 0:
@@ -441,8 +441,8 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam memset(&pi, 0, sizeof(PROCESS_INFORMATION));
si.cb = sizeof(STARTUPINFO);
{
- _tcsncpy_s(tszCurrentDir, arFilePath[i].c_str(), _TRUNCATE);
- TCHAR *p = _tcsrchr(tszCurrentDir, '\\');
+ wcsncpy_s(tszCurrentDir, arFilePath[i].c_str(), _TRUNCATE);
+ wchar_t *p = wcsrchr(tszCurrentDir, '\\');
if (p) *p = 0;
}
CreateProcess(arFilePath[i].c_str(), L"", NULL, NULL, FALSE, NULL, NULL, tszCurrentDir, &si, &pi);
diff --git a/plugins/PackUpdater/Src/Notifications.h b/plugins/PackUpdater/Src/Notifications.h index 6a92fb41b9..125e77f98b 100644 --- a/plugins/PackUpdater/Src/Notifications.h +++ b/plugins/PackUpdater/Src/Notifications.h @@ -64,9 +64,9 @@ typedef struct tagMYOPTIONS { } MYOPTIONS;
static struct {
- TCHAR *Text;
+ wchar_t *Text;
int Action;
} PopupActions[] = {
- LPGENT("Close popup"), PCA_CLOSEPOPUP,
- LPGENT("Do nothing"), PCA_DONOTHING
+ LPGENW("Close popup"), PCA_CLOSEPOPUP,
+ LPGENW("Do nothing"), PCA_DONOTHING
};
diff --git a/plugins/PackUpdater/Src/Options.cpp b/plugins/PackUpdater/Src/Options.cpp index 143cde8828..ef4e41fd39 100644 --- a/plugins/PackUpdater/Src/Options.cpp +++ b/plugins/PackUpdater/Src/Options.cpp @@ -390,15 +390,15 @@ int OptInit(WPARAM wParam, LPARAM) odp.hInstance = hInst;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_UPDATENOTIFY);
- odp.ptszGroup = LPGENT("Services");
- odp.ptszTitle = LPGENT("Pack Updater");
+ odp.pwszGroup = LPGENW("Services");
+ odp.pwszTitle = LPGENW("Pack Updater");
odp.pfnDlgProc = UpdateNotifyOptsProc;
Options_AddPage(wParam, &odp);
if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
odp.pszTemplate = MAKEINTRESOURCEA(IDD_POPUP);
- odp.ptszGroup = LPGENT("Popups");
- odp.ptszTitle = LPGENT("Pack Updater");
+ odp.pwszGroup = LPGENW("Popups");
+ odp.pwszTitle = LPGENW("Pack Updater");
odp.pfnDlgProc = DlgPopupOpts;
Options_AddPage(wParam, &odp);
}
diff --git a/plugins/PackUpdater/Src/PackUpdater.cpp b/plugins/PackUpdater/Src/PackUpdater.cpp index c4e3a97cad..eabc12dbba 100644 --- a/plugins/PackUpdater/Src/PackUpdater.cpp +++ b/plugins/PackUpdater/Src/PackUpdater.cpp @@ -22,7 +22,7 @@ Boston, MA 02111-1307, USA. HINSTANCE hInst = NULL;
HANDLE hPackUpdaterFolder = NULL;
-TCHAR tszRoot[MAX_PATH] = { 0 };
+wchar_t tszRoot[MAX_PATH] = { 0 };
int hLangpack;
PLUGININFOEX pluginInfoEx = {
@@ -54,7 +54,7 @@ extern "C" __declspec(dllexport) int Load(void) {
mir_getLP(&pluginInfoEx);
- TCHAR *tszFolder = Utils_ReplaceVarsT(L"%miranda_userdata%\\" DEFAULT_UPDATES_FOLDER);
+ wchar_t *tszFolder = Utils_ReplaceVarsT(L"%miranda_userdata%\\" DEFAULT_UPDATES_FOLDER);
mir_tstrncpy(tszRoot, tszFolder, _countof(tszRoot));
hPackUpdaterFolder = FoldersRegisterCustomPathT(MODULEA, LPGEN("Pack Updater"), MIRANDA_USERDATAT L"\\" DEFAULT_UPDATES_FOLDER);
@@ -75,7 +75,7 @@ extern "C" __declspec(dllexport) int Load(void) mi.position = -0x7FFFFFFF;
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = IcoLib_GetIcon("check_update");
- mi.name.t = LPGENT("Check for pack updates");
+ mi.name.w = LPGENW("Check for pack updates");
mi.pszService = MODNAME"/CheckUpdates";
Menu_AddMainMenuItem(&mi);
// Add empty updates folder menu item
@@ -85,7 +85,7 @@ extern "C" __declspec(dllexport) int Load(void) mi.position = -0x7FFFFFFF;
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = IcoLib_GetIcon("empty_folder");
- mi.name.t = LPGENT("Clear pack updates folder");
+ mi.name.w = LPGENW("Clear pack updates folder");
mi.pszService = MODNAME"/EmptyFolder";
Menu_AddMainMenuItem(&mi);
diff --git a/plugins/PackUpdater/Src/Utils.cpp b/plugins/PackUpdater/Src/Utils.cpp index 622ee25cab..62fa5d83e1 100644 --- a/plugins/PackUpdater/Src/Utils.cpp +++ b/plugins/PackUpdater/Src/Utils.cpp @@ -25,7 +25,7 @@ INT FileCount = 0, CurrentFile = 0, Number = 0; BYTE Reminder, AutoUpdate;
BYTE UpdateOnStartup, UpdateOnPeriod, OnlyOnceADay, PeriodMeasure;
INT Period;
-TCHAR tszDialogMsg[2048] = { 0 };
+wchar_t tszDialogMsg[2048] = { 0 };
FILEINFO* pFileInfo = NULL;
FILEURL* pFileUrl = NULL;
HANDLE hCheckThread = NULL, hNetlibUser = NULL;
@@ -162,7 +162,7 @@ BOOL Exists(LPCTSTR strName) return GetFileAttributes(strName) != INVALID_FILE_ATTRIBUTES;
}
-BOOL IsPluginDisabled(TCHAR* filename)
+BOOL IsPluginDisabled(wchar_t* filename)
{
char* fname = mir_t2a(filename);
int res = db_get_b(NULL, "PluginDisable", fname, 0);
@@ -170,16 +170,16 @@ BOOL IsPluginDisabled(TCHAR* filename) return res;
}
-size_t getVer(const TCHAR* verStr)
+size_t getVer(const wchar_t* verStr)
{
int v1 = 0, v2 = 0, v3 = 0, v4 = 0;
- _stscanf(verStr, L"%d.%d.%d.%d", &v1, &v2, &v3, &v4);
+ swscanf(verStr, L"%d.%d.%d.%d", &v1, &v2, &v3, &v4);
return v1 * 10000000 + v2 * 100000 + v3 * 1000 + v4;
}
static void CheckUpdates(void *)
{
- TCHAR tszBuff[2048] = { 0 }, tszFileInfo[30] = { 0 }, tszTmpIni[MAX_PATH] = { 0 };
+ wchar_t tszBuff[2048] = { 0 }, tszFileInfo[30] = { 0 }, tszTmpIni[MAX_PATH] = { 0 };
char szKey[64] = { 0 };
vector<FILEINFO> UpdateFiles;
@@ -246,7 +246,7 @@ static void CheckUpdates(void *) GetPrivateProfileString(tszFileInfo, L"Descr", L"", Files[CurrentFile].tszDescr, _countof(Files[CurrentFile].tszDescr), tszTmpIni);
GetPrivateProfileString(tszFileInfo, L"DiskFileName", L"", tszBuff, MAX_PATH, tszTmpIni);
- if (_tcsstr(tszBuff, L"\\")) { //check update name
+ if (wcsstr(tszBuff, L"\\")) { //check update name
Title = TranslateT("Pack Updater");
Text = TranslateT("Name of Update's file is not supported.");
if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, "Popup", "ModuleIsEnabled", 1) && db_get_b(NULL, MODNAME, "Popups1", DEFAULT_POPUP_ENABLED)) {
@@ -268,7 +268,7 @@ static void CheckUpdates(void *) mir_sntprintf(tszBuff, L"Plugins\\%s", Files[CurrentFile].File.tszDiskPath);
else
mir_sntprintf(tszBuff, L"Plugins\\%s\\%s", Files[CurrentFile].tszAdvFolder, Files[CurrentFile].File.tszDiskPath);
- TCHAR pluginFolderName[MAX_PATH];
+ wchar_t pluginFolderName[MAX_PATH];
PathToAbsoluteT(tszBuff, pluginFolderName);
if (!Files[CurrentFile].Force && (IsPluginDisabled(Files[CurrentFile].File.tszDiskPath) || !Exists(pluginFolderName))) //check if plugin disabled or not exists
continue;
@@ -278,7 +278,7 @@ static void CheckUpdates(void *) VARST tszSysRoot(L"%SystemRoot%");
VARST tszProgFiles(L"%ProgramFiles%");
- if (Files[CurrentFile].FileType != 1 && !IsUserAnAdmin() && (_tcsstr(tszRoot, tszSysRoot) || _tcsstr(tszRoot, tszProgFiles))) {
+ if (Files[CurrentFile].FileType != 1 && !IsUserAnAdmin() && (wcsstr(tszRoot, tszSysRoot) || wcsstr(tszRoot, tszProgFiles))) {
MessageBox(NULL, TranslateT("Update is not possible!\nYou have no Administrator's rights.\nPlease run Miranda NG with Administrator's rights."), Title, MB_ICONINFORMATION);
DeleteFile(tszTmpIni);
hCheckThread = NULL;
@@ -286,7 +286,7 @@ static void CheckUpdates(void *) } // user have not admin's rights
//добавить проверку на существование файла
- TCHAR tszFilePathDest[MAX_PATH] = { 0 };
+ wchar_t tszFilePathDest[MAX_PATH] = { 0 };
switch (Files[CurrentFile].FileType) {
case 0:
case 1:
@@ -309,7 +309,7 @@ static void CheckUpdates(void *) break;
case 4:
case 5: {
- TCHAR *tszUtilRoot = VARST(L"%miranda_path%");
+ wchar_t *tszUtilRoot = VARST(L"%miranda_path%");
if (mir_tstrcmp(Files[CurrentFile].tszAdvFolder, L"") == 0)
mir_sntprintf(tszFilePathDest, L"%s\\%s", tszUtilRoot, Files[CurrentFile].File.tszDiskPath);
else
diff --git a/plugins/PackUpdater/Src/stdafx.h b/plugins/PackUpdater/Src/stdafx.h index 4c8786e114..e1c681cc64 100644 --- a/plugins/PackUpdater/Src/stdafx.h +++ b/plugins/PackUpdater/Src/stdafx.h @@ -51,19 +51,19 @@ typedef std::wstring tString; struct FILEURL
{
- TCHAR tszDownloadURL[2048];
- TCHAR tszDiskPath[MAX_PATH];
+ wchar_t tszDownloadURL[2048];
+ wchar_t tszDiskPath[MAX_PATH];
};
struct FILEINFO
{
- TCHAR tszCurVer[16];
- TCHAR tszNewVer[16];
- TCHAR tszLastVer[16];
- TCHAR tszAdvFolder[256];
- TCHAR tszInfoURL[2048];
- TCHAR tszMessage[5000];
- TCHAR tszDescr[256];
+ wchar_t tszCurVer[16];
+ wchar_t tszNewVer[16];
+ wchar_t tszLastVer[16];
+ wchar_t tszAdvFolder[256];
+ wchar_t tszInfoURL[2048];
+ wchar_t tszMessage[5000];
+ wchar_t tszDescr[256];
FILEURL File;
BOOL enabled;
BYTE FileType;
@@ -91,7 +91,7 @@ extern HINSTANCE hInst; extern INT FileCount, CurrentFile, Number, UpdatesCount, Period;
extern BOOL Silent, DlgDld;
extern BYTE Reminder, UpdateOnStartup, UpdateOnPeriod, OnlyOnceADay, PeriodMeasure;
-extern TCHAR tszRoot[MAX_PATH], tszDialogMsg[2048];
+extern wchar_t tszRoot[MAX_PATH], tszDialogMsg[2048];
extern FILEINFO* pFileInfo;
extern FILEURL* pFileUrl;
extern HANDLE hCheckThread;
|