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/Db_autobackups | |
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/Db_autobackups')
-rw-r--r-- | plugins/Db_autobackups/src/backup.cpp | 26 | ||||
-rw-r--r-- | plugins/Db_autobackups/src/main.cpp | 2 | ||||
-rw-r--r-- | plugins/Db_autobackups/src/options.cpp | 22 |
3 files changed, 25 insertions, 25 deletions
diff --git a/plugins/Db_autobackups/src/backup.cpp b/plugins/Db_autobackups/src/backup.cpp index 82d06ad4bb..ea18899542 100644 --- a/plugins/Db_autobackups/src/backup.cpp +++ b/plugins/Db_autobackups/src/backup.cpp @@ -32,7 +32,7 @@ void ShowPopup(wchar_t* ptszText, wchar_t* ptszHeader, wchar_t* ptszPath) wcsncpy_s(ppd.lptzText, ptszText, _TRUNCATE);
wcsncpy_s(ppd.lptzContactName, ptszHeader, _TRUNCATE);
if (ptszPath != NULL)
- ppd.PluginData = (void*)mir_tstrdup(ptszPath);
+ ppd.PluginData = (void*)mir_wstrdup(ptszPath);
ppd.PluginWindowProc = DlgProcPopup;
ppd.lchIcon = IcoLib_GetIcon(iconList[0].szName);
@@ -112,7 +112,7 @@ bool MakeZip(wchar_t *tszSource, wchar_t *tszDest, wchar_t *dbname, HWND progres HWND hProgBar = GetDlgItem(progress_dialog, IDC_PROGRESS);
ptrA szSourceName(mir_u2a(dbname));
- ptrT tszDestPath(DoubleSlash(tszDest));
+ ptrW tszDestPath(DoubleSlash(tszDest));
OBJLIST<ZipFile> lstFiles(15);
lstFiles.insert(new ZipFile((char*)_T2A(tszSource), (char*)szSourceName));
@@ -149,7 +149,7 @@ int RotateBackups(wchar_t *backupfolder, wchar_t *dbname) if (options.num_backups == 0)
return 0; /* Roration disabled. */
- mir_sntprintf(backupfolderTmp, L"%s\\%s*", backupfolder, dbname);
+ mir_snwprintf(backupfolderTmp, L"%s\\%s*", backupfolder, dbname);
hFind = FindFirstFile(backupfolderTmp, &FindFileData);
if (hFind == INVALID_HANDLE_VALUE)
return 0;
@@ -169,7 +169,7 @@ int RotateBackups(wchar_t *backupfolder, wchar_t *dbname) if (i > 0)
qsort(bf, i, sizeof(backupFile), Comp); /* Sort the list of found files by date in descending order. */
for (; i >= options.num_backups; i --) {
- mir_sntprintf(backupfolderTmp, L"%s\\%s", backupfolder, bf[(i - 1)].Name);
+ mir_snwprintf(backupfolderTmp, L"%s\\%s", backupfolder, bf[(i - 1)].Name);
DeleteFile(backupfolderTmp);
}
err_out:
@@ -205,12 +205,12 @@ int Backup(wchar_t *backup_filename) GetLocalTime(&st);
GetComputerName(buffer, &size);
- mir_sntprintf(dest_file, L"%s\\%s_%02d.%02d.%02d@%02d-%02d-%02d_%s.%s", backupfolder, dbname, st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond, buffer, bZip ? L"zip" : L"dat");
+ mir_snwprintf(dest_file, L"%s\\%s_%02d.%02d.%02d@%02d-%02d-%02d_%s.%s", backupfolder, dbname, st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond, buffer, bZip ? L"zip" : L"dat");
mir_free(backupfolder);
}
else {
wcsncpy_s(dest_file, backup_filename, _TRUNCATE);
- if (!mir_tstrcmp(wcsrchr(backup_filename, '.'), L".zip"))
+ if (!mir_wstrcmp(wcsrchr(backup_filename, '.'), L".zip"))
bZip = true;
}
if (!options.disable_popups)
@@ -221,7 +221,7 @@ int Backup(wchar_t *backup_filename) SetDlgItemText(progress_dialog, IDC_PROGRESSMESSAGE, TranslateT("Copying database file..."));
- mir_sntprintf(source_file, L"%s\\%s", profilePath, dbname);
+ mir_snwprintf(source_file, L"%s\\%s", profilePath, dbname);
wchar_t *pathtmp = Utils_ReplaceVarsT(source_file);
BOOL res = 0;
if (bZip)
@@ -253,7 +253,7 @@ int Backup(wchar_t *backup_filename) }
if (!options.disable_popups) {
- size_t dest_file_len = mir_tstrlen(dest_file);
+ size_t dest_file_len = mir_wstrlen(dest_file);
wchar_t *puText;
if (dest_file_len > 50) {
@@ -262,12 +262,12 @@ int Backup(wchar_t *backup_filename) for (i = (dest_file_len - 1); dest_file[i] != '\\'; i--)
;
//wcsncpy_s(dest_file, backup_filename, _TRUNCATE);
- mir_tstrncpy(puText, dest_file, (i + 2));
- mir_tstrcat(puText, L"\n");
- mir_tstrcat(puText, (dest_file + i + 1));
+ mir_wstrncpy(puText, dest_file, (i + 2));
+ mir_wstrcat(puText, L"\n");
+ mir_wstrcat(puText, (dest_file + i + 1));
}
else
- puText = mir_tstrdup(dest_file);
+ puText = mir_wstrdup(dest_file);
// Now we need to know, which folder we made a backup. Let's break unnecessary variables :)
while (dest_file[--dest_file_len] != L'\\')
@@ -303,7 +303,7 @@ void BackupStart(wchar_t *backup_filename) return;
}
if (backup_filename != NULL)
- tm = mir_tstrdup(backup_filename);
+ tm = mir_wstrdup(backup_filename);
if (mir_forkthread(BackupThread, (void*)tm) == INVALID_HANDLE_VALUE) {
InterlockedExchange(&m_state, 0); /* Backup done. */
mir_free(tm);
diff --git a/plugins/Db_autobackups/src/main.cpp b/plugins/Db_autobackups/src/main.cpp index 52cc10aa91..4efd79dec5 100644 --- a/plugins/Db_autobackups/src/main.cpp +++ b/plugins/Db_autobackups/src/main.cpp @@ -38,7 +38,7 @@ static INT_PTR DBSaveAs(WPARAM, LPARAM) OPENFILENAME ofn = { 0 };
CallService(MS_DB_GETPROFILENAMET, _countof(fname_buff), (LPARAM)fname_buff);
- mir_sntprintf(tszFilter, L"%s (*.dat)%c*.dat%c%s (*.zip)%c*.zip%c%s (*.*)%c*%c",
+ mir_snwprintf(tszFilter, L"%s (*.dat)%c*.dat%c%s (*.zip)%c*.zip%c%s (*.*)%c*%c",
TranslateT("Miranda NG databases"), 0, 0,
TranslateT("Compressed Miranda NG databases"), 0, 0,
TranslateT("All files"), 0, 0);
diff --git a/plugins/Db_autobackups/src/options.cpp b/plugins/Db_autobackups/src/options.cpp index 046f777fd9..52ca03f8ad 100644 --- a/plugins/Db_autobackups/src/options.cpp +++ b/plugins/Db_autobackups/src/options.cpp @@ -45,15 +45,15 @@ int LoadOptions(void) if (!db_get_ts(0, "AutoBackups", "Folder", &dbv)) {
wchar_t *tmp = Utils_ReplaceVarsT(dbv.ptszVal);
- if (mir_tstrlen(tmp) >= 2 && tmp[1] == ':')
+ if (mir_wstrlen(tmp) >= 2 && tmp[1] == ':')
wcsncpy_s(options.folder, dbv.ptszVal, _TRUNCATE);
else
- mir_sntprintf(options.folder, L"%s\\%s", profilePath, dbv.ptszVal);
+ mir_snwprintf(options.folder, L"%s\\%s", profilePath, dbv.ptszVal);
db_free(&dbv);
mir_free(tmp);
}
- else mir_sntprintf(options.folder, L"%s%s", DIR, SUB_DIR);
+ else mir_snwprintf(options.folder, L"%s%s", DIR, SUB_DIR);
}
options.num_backups = db_get_w(0, "AutoBackups", "NumBackups", 3);
@@ -77,9 +77,9 @@ int SaveOptions(void) db_set_w(0, "AutoBackups", "Period", (WORD)options.period);
db_set_b(0, "AutoBackups", "PeriodType", (BYTE)options.period_type);
- mir_sntprintf(prof_dir, L"%s\\", profilePath);
- size_t prof_len = mir_tstrlen(prof_dir);
- size_t opt_len = mir_tstrlen(options.folder);
+ mir_snwprintf(prof_dir, L"%s\\", profilePath);
+ size_t prof_len = mir_wstrlen(prof_dir);
+ size_t opt_len = mir_wstrlen(options.folder);
if (opt_len > prof_len && wcsncmp(options.folder, prof_dir, prof_len) == 0) {
db_set_ts(0, "AutoBackups", "Folder", (options.folder + prof_len));
@@ -88,9 +88,9 @@ int SaveOptions(void) db_set_ts(0, "AutoBackups", "Folder", options.folder);
wchar_t *tmp = Utils_ReplaceVarsT(options.folder);
- if (mir_tstrlen(tmp) < 2 || tmp[1] != ':') {
+ if (mir_wstrlen(tmp) < 2 || tmp[1] != ':') {
wcsncpy_s(prof_dir, options.folder, _TRUNCATE);
- mir_sntprintf(options.folder, L"%s\\%s", profilePath, prof_dir);
+ mir_snwprintf(options.folder, L"%s\\%s", profilePath, prof_dir);
}
mir_free(tmp);
db_set_w(0, "AutoBackups", "NumBackups", options.num_backups);
@@ -195,7 +195,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP }
else {
wchar_t tszTooltipText[4096];
- mir_sntprintf(tszTooltipText, L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s",
+ mir_snwprintf(tszTooltipText, L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s",
L"%miranda_path%", TranslateT("path to Miranda root folder"),
L"%miranda_profilesdir%", TranslateT("path to folder containing Miranda profiles"),
L"%miranda_profilename%", TranslateT("name of current Miranda profile (filename, without extension)"),
@@ -359,10 +359,10 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP BOOL folder_ok = TRUE;
wchar_t *tmp = Utils_ReplaceVarsT(folder_buff);
- if (mir_tstrlen(tmp) >= 2 && tmp[1] == ':')
+ if (mir_wstrlen(tmp) >= 2 && tmp[1] == ':')
wcsncpy_s(backupfolder, tmp, _TRUNCATE);
else
- mir_sntprintf(backupfolder, L"%s\\%s", profilePath, tmp);
+ mir_snwprintf(backupfolder, L"%s\\%s", profilePath, tmp);
mir_free(tmp);
int err = CreateDirectoryTreeT(backupfolder);
|