diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2014-12-14 15:03:45 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2014-12-14 15:03:45 +0000 |
commit | 100f19d51ba640c183c651426555145e8f9f2014 (patch) | |
tree | b47835f718f0d4b428023d962929107c58326a64 /plugins/Db_autobackups | |
parent | a6fa2268edcd1ec211ef101762232c97e9bb2833 (diff) |
Db_autobackups: changed warning lavel to w4
git-svn-id: http://svn.miranda-ng.org/main/trunk@11412 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Db_autobackups')
-rw-r--r-- | plugins/Db_autobackups/db_autobackups_12.vcxproj | 8 | ||||
-rw-r--r-- | plugins/Db_autobackups/src/backup.cpp | 32 | ||||
-rw-r--r-- | plugins/Db_autobackups/src/headers.h | 2 | ||||
-rw-r--r-- | plugins/Db_autobackups/src/main.cpp | 31 | ||||
-rw-r--r-- | plugins/Db_autobackups/src/options.cpp | 150 | ||||
-rw-r--r-- | plugins/Db_autobackups/src/options.h | 4 |
6 files changed, 113 insertions, 114 deletions
diff --git a/plugins/Db_autobackups/db_autobackups_12.vcxproj b/plugins/Db_autobackups/db_autobackups_12.vcxproj index 5be649d905..8e8ec91606 100644 --- a/plugins/Db_autobackups/db_autobackups_12.vcxproj +++ b/plugins/Db_autobackups/db_autobackups_12.vcxproj @@ -81,7 +81,7 @@ <MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>Level4</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>headers.h</PrecompiledHeaderFile>
@@ -107,7 +107,7 @@ <PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>Level4</WarningLevel>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>headers.h</PrecompiledHeaderFile>
<ExceptionHandling>false</ExceptionHandling>
@@ -128,7 +128,7 @@ <ClCompile>
<AdditionalIncludeDirectories>..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>Level4</WarningLevel>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<Optimization>Full</Optimization>
<PrecompiledHeader>Use</PrecompiledHeader>
@@ -153,7 +153,7 @@ <ClCompile>
<AdditionalIncludeDirectories>..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>Level4</WarningLevel>
<Optimization>Full</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
diff --git a/plugins/Db_autobackups/src/backup.cpp b/plugins/Db_autobackups/src/backup.cpp index f9c6331ab2..77209be000 100644 --- a/plugins/Db_autobackups/src/backup.cpp +++ b/plugins/Db_autobackups/src/backup.cpp @@ -41,7 +41,7 @@ void ShowPopup(TCHAR* ptszText, TCHAR* ptszHeader, TCHAR* ptszPath) PUAddPopupT(&ppd);
}
-INT_PTR CALLBACK DlgProcProgress(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK DlgProcProgress(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM)
{
switch (msg) {
case WM_INITDIALOG:
@@ -65,7 +65,7 @@ TCHAR* DoubleSlash(TCHAR *sorce) ret = (TCHAR*)mir_alloc((MAX_PATH * sizeof(TCHAR)));
if (ret == NULL)
return NULL;
- for (s = sorce, r = ret; *s && (r - ret) < (MAX_PATH - 1); s ++, r ++) {
+ for (s = sorce, r = ret; *s && (r - ret) < (MAX_PATH - 1); s++, r++) {
if (*s != _T('\\'))
*r = *s;
else {
@@ -115,7 +115,7 @@ bool MakeZip(TCHAR *tszSource, TCHAR *tszDest, TCHAR *dbname, HWND progress_dial fi.tmz_date.tm_mon = (st.wMonth - 1);
fi.tmz_date.tm_year = st.wYear;
- if (zipOpenNewFileInZip(hZip, szSourceName, &fi, NULL, 0, NULL, 0, "", Z_DEFLATED, Z_BEST_COMPRESSION) == ZIP_OK) {
+ if (zipOpenNewFileInZip(hZip, szSourceName, &fi, NULL, 0, NULL, 0, "", Z_DEFLATED, Z_BEST_COMPRESSION) == ZIP_OK) {
hProgBar = GetDlgItem(progress_dialog, IDC_PROGRESS);
while (GetWindowLongPtr(progress_dialog, GWLP_USERDATA) != 1) {
if (!ReadFile(hSrc, buf, sizeof(buf), &dwRead, NULL))
@@ -140,8 +140,9 @@ bool MakeZip(TCHAR *tszSource, TCHAR *tszDest, TCHAR *dbname, HWND progress_dial if (ret) {
mir_snprintf(buf, SIZEOF(buf), "%s\r\n%s %s %d.%d.%d.%d\r\n",
Translate("Miranda NG database"), Translate("Created by:"),
- __PLUGIN_NAME, __MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM);
- } else {
+ __PLUGIN_NAME, __MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM);
+ }
+ else {
buf[0] = 0;
}
zipClose(hZip, buf);
@@ -165,7 +166,7 @@ int Comp(const void *i, const void *j) backupFile *pj = (backupFile*)j;
if (pi->CreationTime.dwHighDateTime > pj->CreationTime.dwHighDateTime ||
- (pi->CreationTime.dwHighDateTime == pj->CreationTime.dwHighDateTime && pi->CreationTime.dwLowDateTime > pj->CreationTime.dwLowDateTime))
+ (pi->CreationTime.dwHighDateTime == pj->CreationTime.dwHighDateTime && pi->CreationTime.dwLowDateTime > pj->CreationTime.dwLowDateTime))
return -1;
else
return 1;
@@ -195,7 +196,7 @@ int RotateBackups(TCHAR *backupfolder, TCHAR *dbname) if (i > 0)
qsort(bf, i, sizeof(backupFile), Comp); //Sort the list of found files by date in descending order
- for (i --; i >= (options.num_backups - 1); i --) {
+ for (i--; i >= (options.num_backups - 1); i--) {
mir_sntprintf(backupfolderTmp, MAX_PATH, _T("%s\\%s"), backupfolder, bf[i].Name);
DeleteFile(backupfolderTmp);
}
@@ -206,11 +207,11 @@ int RotateBackups(TCHAR *backupfolder, TCHAR *dbname) }
-int Backup(TCHAR* backup_filename)
+int Backup(TCHAR *backup_filename)
{
bool bZip = false;
TCHAR dbname[MAX_PATH], source_file[MAX_PATH] = { 0 }, dest_file[MAX_PATH];
- HWND progress_dialog;
+ HWND progress_dialog = NULL;
SYSTEMTIME st;
CallService(MS_DB_GETPROFILENAMET, SIZEOF(dbname), (LPARAM)dbname);
@@ -234,7 +235,8 @@ int Backup(TCHAR* backup_filename) GetComputerName(buffer, &size);
mir_sntprintf(dest_file, SIZEOF(dest_file), _T("%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 ? _T("zip") : _T("dat"));
mir_free(backupfolder);
- } else {
+ }
+ else {
_tcsncpy_s(dest_file, backup_filename, _TRUNCATE);
if (!_tcscmp(_tcsrchr(backup_filename, _T('.')), _T(".zip")))
bZip = true;
@@ -278,17 +280,19 @@ int Backup(TCHAR* backup_filename) mir_tstrncpy(puText, dest_file, (i + 2));
mir_tstrcat(puText, _T("\n"));
mir_tstrcat(puText, (dest_file + i + 1));
- } else
+ }
+ else
puText = mir_tstrdup(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'\\')
+ while (dest_file[--dest_file_len] != L'\\')
;
dest_file[dest_file_len] = 0;
ShowPopup(puText, TranslateT("Database backed up"), dest_file);
mir_free(puText);
}
- } else
+ }
+ else
DeleteFile(dest_file);
mir_free(pathtmp);
@@ -321,7 +325,7 @@ void BackupStart(TCHAR *backup_filename) }
}
-VOID CALLBACK TimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
+VOID CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD)
{
time_t t = time(NULL);
time_t diff = t - (time_t)db_get_dw(0, "AutoBackups", "LastBackupTimestamp", 0);
diff --git a/plugins/Db_autobackups/src/headers.h b/plugins/Db_autobackups/src/headers.h index cb03254a30..77fdd86a14 100644 --- a/plugins/Db_autobackups/src/headers.h +++ b/plugins/Db_autobackups/src/headers.h @@ -42,7 +42,7 @@ extern TCHAR *profilePath; static IconItem iconList[] = {
- { LPGEN("Backup profile"), "backup", IDI_ICON1 },
+ { LPGEN("Backup profile"), "backup", IDI_ICON1 },
{ LPGEN("Save profile as..."), "saveas", IDI_ICON1 }
};
diff --git a/plugins/Db_autobackups/src/main.cpp b/plugins/Db_autobackups/src/main.cpp index 2f9f0d58b0..3488432561 100644 --- a/plugins/Db_autobackups/src/main.cpp +++ b/plugins/Db_autobackups/src/main.cpp @@ -5,7 +5,7 @@ HINSTANCE g_hInstance; TCHAR *profilePath;
HANDLE hFolder;
-PLUGININFOEX pluginInfo={
+PLUGININFOEX pluginInfo = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -16,29 +16,20 @@ PLUGININFOEX pluginInfo={ __AUTHORWEB,
UNICODE_AWARE,
// {81C220A6-0226-4Ad6-BFCA-217B17A16053}
- {0x81c220a6, 0x226, 0x4ad6, {0xbf, 0xca, 0x21, 0x7b, 0x17, 0xa1, 0x60, 0x53}}
+ { 0x81c220a6, 0x226, 0x4ad6, { 0xbf, 0xca, 0x21, 0x7b, 0x17, 0xa1, 0x60, 0x53 } }
};
int ModulesLoad(WPARAM, LPARAM);
int PreShutdown(WPARAM, LPARAM);
-BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID Reserved)
+BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD, LPVOID)
{
- switch (dwReason) {
- case DLL_PROCESS_ATTACH:
- g_hInstance = hInstance;
- DisableThreadLibraryCalls(hInstance);
- break;
- case DLL_PROCESS_DETACH:
- /* Nothink to do. */
- break;
- }
-
+ g_hInstance = hInstance;
return TRUE;
}
-extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfo;
}
@@ -67,20 +58,20 @@ static int FoldersGetBackupPath(WPARAM, LPARAM) FoldersGetCustomPathT(hFolder, options.folder, SIZEOF(options.folder), DIR SUB_DIR);
return 0;
}
-INT_PTR ABService(WPARAM wParam, LPARAM lParam)
+INT_PTR ABService(WPARAM, LPARAM)
{
BackupStart(NULL);
return 0;
}
-INT_PTR DBSaveAs(WPARAM wParam, LPARAM lParam)
+INT_PTR DBSaveAs(WPARAM, LPARAM)
{
TCHAR fname_buff[MAX_PATH], tszFilter[200];
- OPENFILENAME ofn = {0};
+ OPENFILENAME ofn = { 0 };
CallService(MS_DB_GETPROFILENAMET, SIZEOF(fname_buff), (LPARAM)fname_buff);
- mir_sntprintf(tszFilter, SIZEOF(tszFilter), _T("%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,
+ mir_sntprintf(tszFilter, SIZEOF(tszFilter), _T("%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);
ofn.lStructSize = sizeof(ofn);
diff --git a/plugins/Db_autobackups/src/options.cpp b/plugins/Db_autobackups/src/options.cpp index 4f246787cd..35e3b01844 100644 --- a/plugins/Db_autobackups/src/options.cpp +++ b/plugins/Db_autobackups/src/options.cpp @@ -22,10 +22,10 @@ HWND CreateToolTip(HWND hwndParent, LPTSTR ptszText, LPTSTR ptszTitle) ti.hwnd = hwndParent;
ti.hinst = g_hInstance;
ti.lpszText = ptszText;
- GetClientRect (hwndParent, &ti.rect);
+ GetClientRect(hwndParent, &ti.rect);
ti.rect.left = -80;
- SendMessage(hwndTT, TTM_ADDTOOL, 0, (LPARAM) (LPTOOLINFO) &ti);
+ SendMessage(hwndTT, TTM_ADDTOOL, 0, (LPARAM)(LPTOOLINFO)&ti);
SendMessage(hwndTT, TTM_SETTITLE, 1, (LPARAM)ptszTitle);
SendMessage(hwndTT, TTM_SETMAXTIPWIDTH, 0, (LPARAM)650);
@@ -52,7 +52,8 @@ int LoadOptions(void) db_free(&dbv);
mir_free(tmp);
- } else
+ }
+ else
mir_sntprintf(options.folder, SIZEOF(options.folder), _T("%s%s"), DIR, SUB_DIR);
}
options.num_backups = (unsigned int)db_get_w(0, "AutoBackups", "NumBackups", 3);
@@ -81,7 +82,8 @@ int SaveOptions(void) if (opt_len > prof_len && _tcsncmp(options.folder, prof_dir, prof_len) == 0) {
db_set_ts(0, "AutoBackups", "Folder", (options.folder + prof_len));
- } else
+ }
+ else
db_set_ts(0, "AutoBackups", "Folder", options.folder);
TCHAR *tmp = Utils_ReplaceVarsT(options.folder);
@@ -121,7 +123,8 @@ int SetDlgState(HWND hwndDlg) CheckDlgButton(hwndDlg, IDC_RAD_START, BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_RAD_EXIT, BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_RAD_PERIODIC, BST_UNCHECKED);
- } else {
+ }
+ else {
EnableWindow(GetDlgItem(hwndDlg, IDC_RAD_DISABLED), TRUE);
EnableWindow(GetDlgItem(hwndDlg, IDC_ED_NUMBACKUPS), TRUE);
EnableWindow(GetDlgItem(hwndDlg, IDC_ED_FOLDER), TRUE);
@@ -150,35 +153,35 @@ int SetDlgState(HWND hwndDlg) CheckDlgButton(hwndDlg, IDC_CHK_NOPROG, new_options.disable_progress ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_CHK_NOPOPUP, new_options.disable_popups ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_CHK_USEZIP, new_options.use_zip ? BST_CHECKED : BST_UNCHECKED);
- if ( !ServiceExists(MS_POPUP_ADDPOPUPT))
+ if (!ServiceExists(MS_POPUP_ADDPOPUPT))
ShowWindow(GetDlgItem(hwndDlg, IDC_CHK_NOPOPUP), SW_HIDE);
return 0;
}
-int CALLBACK BrowseProc(HWND hwnd,UINT uMsg, LPARAM lParam, LPARAM lpData)
+int CALLBACK BrowseProc(HWND hwnd, UINT uMsg, LPARAM, LPARAM)
{
- switch(uMsg)
+ switch (uMsg)
{
- case BFFM_INITIALIZED:
- TCHAR *folder = Utils_ReplaceVarsT(options.folder);
- SendMessage(hwnd, BFFM_SETSELECTION, TRUE, (LPARAM)folder);
- mir_free(folder);
- break;
+ case BFFM_INITIALIZED:
+ TCHAR *folder = Utils_ReplaceVarsT(options.folder);
+ SendMessage(hwnd, BFFM_SETSELECTION, TRUE, (LPARAM)folder);
+ mir_free(folder);
+ break;
}
return 0;
}
INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- TCHAR folder_buff[MAX_PATH] = {0};
+ TCHAR folder_buff[MAX_PATH] = { 0 };
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
memcpy(&new_options, &options, sizeof(Options));
- if ( ServiceExists(MS_FOLDERS_GET_PATH)) {
+ if (ServiceExists(MS_FOLDERS_GET_PATH)) {
ShowWindow(GetDlgItem(hwndDlg, IDC_ED_FOLDER), SW_HIDE);
ShowWindow(GetDlgItem(hwndDlg, IDC_BUT_BROWSE), SW_HIDE);
ShowWindow(GetDlgItem(hwndDlg, IDC_LNK_FOLDERS), SW_SHOW);
@@ -186,28 +189,28 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP else {
TCHAR tszTooltipText[4096];
mir_sntprintf(tszTooltipText, SIZEOF(tszTooltipText), _T("%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"),
- _T("%miranda_path%"), TranslateT("path to Miranda root folder"),
- _T("%miranda_profilesdir%"), TranslateT("path to folder containing Miranda profiles"),
- _T("%miranda_profilename%"), TranslateT("name of current Miranda profile (filename, without extension)"),
- _T("%miranda_userdata%"), TranslateT("will return parsed string %miranda_profilesdir%\\%miranda_profilename%"),
- _T("%appdata%"), TranslateT("same as environment variable %APPDATA% for currently logged-on Windows user"),
- _T("%username%"), TranslateT("username for currently logged-on Windows user"),
- _T("%mydocuments%"), TranslateT("\"My Documents\" folder for currently logged-on Windows user"),
- _T("%desktop%"), TranslateT("\"Desktop\" folder for currently logged-on Windows user"),
- _T("%xxxxxxx%"), TranslateT("any environment variable defined in current Windows session (like %systemroot%, %allusersprofile%, etc.)")
+ _T("%miranda_path%"), TranslateT("path to Miranda root folder"),
+ _T("%miranda_profilesdir%"), TranslateT("path to folder containing Miranda profiles"),
+ _T("%miranda_profilename%"), TranslateT("name of current Miranda profile (filename, without extension)"),
+ _T("%miranda_userdata%"), TranslateT("will return parsed string %miranda_profilesdir%\\%miranda_profilename%"),
+ _T("%appdata%"), TranslateT("same as environment variable %APPDATA% for currently logged-on Windows user"),
+ _T("%username%"), TranslateT("username for currently logged-on Windows user"),
+ _T("%mydocuments%"), TranslateT("\"My Documents\" folder for currently logged-on Windows user"),
+ _T("%desktop%"), TranslateT("\"Desktop\" folder for currently logged-on Windows user"),
+ _T("%xxxxxxx%"), TranslateT("any environment variable defined in current Windows session (like %systemroot%, %allusersprofile%, etc.)")
);
hPathTip = CreateToolTip(GetDlgItem(hwndDlg, IDC_ED_FOLDER), tszTooltipText, TranslateT("Variables"));
}
SetDlgState(hwndDlg);
- SendDlgItemMessage(hwndDlg, IDC_PT, CB_ADDSTRING, 0, (LPARAM) TranslateT("days"));
- SendDlgItemMessage(hwndDlg, IDC_PT, CB_ADDSTRING, 0, (LPARAM) TranslateT("hours"));
- SendDlgItemMessage(hwndDlg, IDC_PT, CB_ADDSTRING, 0, (LPARAM) TranslateT("minutes"));
+ SendDlgItemMessage(hwndDlg, IDC_PT, CB_ADDSTRING, 0, (LPARAM)TranslateT("days"));
+ SendDlgItemMessage(hwndDlg, IDC_PT, CB_ADDSTRING, 0, (LPARAM)TranslateT("hours"));
+ SendDlgItemMessage(hwndDlg, IDC_PT, CB_ADDSTRING, 0, (LPARAM)TranslateT("minutes"));
switch (new_options.period_type) {
- case PT_DAYS: SendDlgItemMessage(hwndDlg, IDC_PT, CB_SETCURSEL, 0, 0); break;
- case PT_HOURS: SendDlgItemMessage(hwndDlg, IDC_PT, CB_SETCURSEL, 1, 0); break;
- case PT_MINUTES: SendDlgItemMessage(hwndDlg, IDC_PT, CB_SETCURSEL, 2, 0); break;
+ case PT_DAYS: SendDlgItemMessage(hwndDlg, IDC_PT, CB_SETCURSEL, 0, 0); break;
+ case PT_HOURS: SendDlgItemMessage(hwndDlg, IDC_PT, CB_SETCURSEL, 1, 0); break;
+ case PT_MINUTES: SendDlgItemMessage(hwndDlg, IDC_PT, CB_SETCURSEL, 2, 0); break;
}
if (hPathTip)
@@ -215,19 +218,19 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP return TRUE;
case WM_COMMAND:
- if ( HIWORD( wParam ) == EN_CHANGE && ( HWND )lParam == GetFocus()) {
- switch( LOWORD( wParam )) {
+ if (HIWORD(wParam) == EN_CHANGE && (HWND)lParam == GetFocus()) {
+ switch (LOWORD(wParam)) {
case IDC_ED_PERIOD:
case IDC_ED_FOLDER:
case IDC_ED_NUMBACKUPS:
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
}
- if ( HIWORD( wParam ) == CBN_SELCHANGE)
+ if (HIWORD(wParam) == CBN_SELCHANGE)
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- if ( HIWORD( wParam ) == BN_CLICKED ) {
- switch( LOWORD( wParam )) {
+ if (HIWORD(wParam) == BN_CLICKED) {
+ switch (LOWORD(wParam)) {
case IDC_RAD_DISABLED:
if (IsDlgButtonChecked(hwndDlg, IDC_RAD_DISABLED))
new_options.backup_types = BT_DISABLED;
@@ -264,29 +267,29 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP break;
case IDC_BUT_BROWSE:
- {
- BROWSEINFO bi;
- bi.hwndOwner = hwndDlg;
- bi.pidlRoot = 0;
- bi.pszDisplayName = folder_buff;
- bi.lpszTitle = TranslateT("Select backup folder");
- bi.ulFlags = BIF_NEWDIALOGSTYLE;
- bi.lpfn = BrowseProc;
- bi.lParam = 0;
- bi.iImage = 0;
-
- LPCITEMIDLIST pidl = SHBrowseForFolder(&bi);
- if (pidl != 0) {
- SHGetPathFromIDList(pidl, folder_buff);
-
- SetDlgItemText(hwndDlg, IDC_ED_FOLDER, folder_buff);
-
- SendMessage( GetParent( hwndDlg ), PSM_CHANGED, 0, 0 );
-
- CoTaskMemFree((void *)pidl);
- }
- break;
+ {
+ BROWSEINFO bi;
+ bi.hwndOwner = hwndDlg;
+ bi.pidlRoot = 0;
+ bi.pszDisplayName = folder_buff;
+ bi.lpszTitle = TranslateT("Select backup folder");
+ bi.ulFlags = BIF_NEWDIALOGSTYLE;
+ bi.lpfn = BrowseProc;
+ bi.lParam = 0;
+ bi.iImage = 0;
+
+ LPCITEMIDLIST pidl = SHBrowseForFolder(&bi);
+ if (pidl != 0) {
+ SHGetPathFromIDList(pidl, folder_buff);
+
+ SetDlgItemText(hwndDlg, IDC_ED_FOLDER, folder_buff);
+
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+
+ CoTaskMemFree((void *)pidl);
}
+ break;
+ }
case IDC_BUT_NOW:
BackupStart(NULL);
break;
@@ -303,14 +306,14 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
case IDC_LNK_FOLDERS:
- {
- OPENOPTIONSDIALOG ood = {0};
- ood.cbSize = sizeof(ood);
- ood.pszGroup = "Customize";
- ood.pszPage = "Folders";
- Options_Open(&ood);
- break;
- }
+ {
+ OPENOPTIONSDIALOG ood = { 0 };
+ ood.cbSize = sizeof(ood);
+ ood.pszGroup = "Customize";
+ ood.pszPage = "Folders";
+ Options_Open(&ood);
+ break;
+ }
}
}
break;
@@ -321,22 +324,22 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP break;
case WM_NOTIFY:
- if (((LPNMHDR)lParam)->code == PSN_APPLY ) {
+ if (((LPNMHDR)lParam)->code == PSN_APPLY) {
TCHAR buff[10];
GetDlgItemText(hwndDlg, IDC_ED_PERIOD, buff, SIZEOF(buff));
new_options.period = _ttoi(buff);
GetDlgItemText(hwndDlg, IDC_ED_NUMBACKUPS, buff, SIZEOF(buff));
new_options.num_backups = _ttoi(buff);
- switch(SendDlgItemMessage(hwndDlg, IDC_PT, CB_GETCURSEL, 0, 0)) {
- case 0: new_options.period_type = PT_DAYS; break;
- case 1: new_options.period_type = PT_HOURS; break;
- case 2: new_options.period_type = PT_MINUTES; break;
+ switch (SendDlgItemMessage(hwndDlg, IDC_PT, CB_GETCURSEL, 0, 0)) {
+ case 0: new_options.period_type = PT_DAYS; break;
+ case 1: new_options.period_type = PT_HOURS; break;
+ case 2: new_options.period_type = PT_MINUTES; break;
}
GetDlgItemText(hwndDlg, IDC_ED_FOLDER, folder_buff, SIZEOF(folder_buff));
{
- TCHAR backupfolder[MAX_PATH] = {0};
+ TCHAR backupfolder[MAX_PATH] = { 0 };
BOOL folder_ok = TRUE;
TCHAR *tmp = Utils_ReplaceVarsT(folder_buff);
@@ -358,7 +361,8 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP _tcsncpy_s(new_options.folder, folder_buff, _TRUNCATE);
memcpy(&options, &new_options, sizeof(Options));
SaveOptions();
- } else {
+ }
+ else {
memcpy(&new_options, &options, sizeof(Options));
SetDlgState(hwndDlg);
}
@@ -380,7 +384,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP return FALSE;
}
-int OptionsInit(WPARAM wParam, LPARAM lParam)
+int OptionsInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { sizeof(odp) };
diff --git a/plugins/Db_autobackups/src/options.h b/plugins/Db_autobackups/src/options.h index 27ddff4eef..f25b072704 100644 --- a/plugins/Db_autobackups/src/options.h +++ b/plugins/Db_autobackups/src/options.h @@ -22,8 +22,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-typedef enum { BT_DISABLED = 0, BT_START = 1, BT_EXIT = 2, BT_PERIODIC = 4} BackupType;
-typedef enum { PT_DAYS, PT_HOURS, PT_MINUTES} PeriodType;
+typedef enum { BT_DISABLED = 0, BT_START = 1, BT_EXIT = 2, BT_PERIODIC = 4 } BackupType;
+typedef enum { PT_DAYS, PT_HOURS, PT_MINUTES } PeriodType;
typedef struct Options_tag {
int backup_types;
|