summaryrefslogtreecommitdiff
path: root/plugins/PluginUpdater
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2016-04-15 16:41:50 +0000
committerKirill Volinsky <mataes2007@gmail.com>2016-04-15 16:41:50 +0000
commit7d578de07fdd3ea97e94268836035af5cbbbf094 (patch)
tree1c5b4133043c15d90fdf7408cf12d3d7c17afb45 /plugins/PluginUpdater
parent754a624c980798b77476f3f1e1de64a5ab2f97f1 (diff)
PluginUpdater: platform change fix
git-svn-id: http://svn.miranda-ng.org/main/trunk@16663 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/PluginUpdater')
-rw-r--r--plugins/PluginUpdater/src/DlgUpdate.cpp1
-rw-r--r--plugins/PluginUpdater/src/Options.cpp46
2 files changed, 8 insertions, 39 deletions
diff --git a/plugins/PluginUpdater/src/DlgUpdate.cpp b/plugins/PluginUpdater/src/DlgUpdate.cpp
index ca93241e54..ad291a44ae 100644
--- a/plugins/PluginUpdater/src/DlgUpdate.cpp
+++ b/plugins/PluginUpdater/src/DlgUpdate.cpp
@@ -635,6 +635,7 @@ static int ScanFolder(const TCHAR *tszFolder, size_t cbBaseLen, const TCHAR *tsz
if (!mir_tstrcmpi(ffd.cFileName, _T("miranda64.exe")))
_tcsncpy_s(tszNewName, _T("miranda32.exe"), _TRUNCATE);
}
+ _tcsncpy_s(tszNewName, ffd.cFileName, _TRUNCATE);
}
else
mir_sntprintf(tszNewName, _T("%s\\%s"), tszFolder + cbBaseLen, ffd.cFileName);
diff --git a/plugins/PluginUpdater/src/Options.cpp b/plugins/PluginUpdater/src/Options.cpp
index ac21c2e356..c5e85faee7 100644
--- a/plugins/PluginUpdater/src/Options.cpp
+++ b/plugins/PluginUpdater/src/Options.cpp
@@ -118,21 +118,21 @@ static INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wPar
ComboBox_InsertString(GetDlgItem(hwndDlg, IDC_PERIODMEASURE), 1, TranslateT("days"));
ComboBox_SetCurSel(GetDlgItem(hwndDlg, IDC_PERIODMEASURE), opts.bPeriodMeasure);
- TCHAR url[MAX_PATH];
+ TCHAR defurl[MAX_PATH];
switch (GetUpdateMode()) {
case UPDATE_MODE_STABLE:
- mir_sntprintf(url, _T(DEFAULT_UPDATE_URL), DEFAULT_BITS);
- SetDlgItemText(hwndDlg, IDC_CUSTOMURL, url);
+ mir_sntprintf(defurl, _T(DEFAULT_UPDATE_URL), DEFAULT_BITS);
+ SetDlgItemText(hwndDlg, IDC_CUSTOMURL, defurl);
CheckDlgButton(hwndDlg, IDC_STABLE, BST_CHECKED);
break;
case UPDATE_MODE_TRUNK:
- mir_sntprintf(url, _T(DEFAULT_UPDATE_URL_TRUNK), DEFAULT_BITS);
- SetDlgItemText(hwndDlg, IDC_CUSTOMURL, url);
+ mir_sntprintf(defurl, _T(DEFAULT_UPDATE_URL_TRUNK), DEFAULT_BITS);
+ SetDlgItemText(hwndDlg, IDC_CUSTOMURL, defurl);
CheckDlgButton(hwndDlg, IDC_TRUNK, BST_CHECKED);
break;
case UPDATE_MODE_TRUNK_SYMBOLS:
- mir_sntprintf(url, _T(DEFAULT_UPDATE_URL_TRUNK_SYMBOLS), DEFAULT_BITS);
- SetDlgItemText(hwndDlg, IDC_CUSTOMURL, url);
+ mir_sntprintf(defurl, _T(DEFAULT_UPDATE_URL_TRUNK_SYMBOLS), DEFAULT_BITS);
+ SetDlgItemText(hwndDlg, IDC_CUSTOMURL, defurl);
CheckDlgButton(hwndDlg, IDC_TRUNK_SYMBOLS, BST_CHECKED);
break;
default:
@@ -161,7 +161,6 @@ static INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wPar
case WM_COMMAND:
switch (LOWORD(wParam)) {
- TCHAR defurl[MAX_PATH];
case IDC_UPDATEONSTARTUP:
EnableWindow(GetDlgItem(hwndDlg, IDC_ONLYONCEADAY), IsDlgButtonChecked(hwndDlg, IDC_UPDATEONSTARTUP));
// fall through
@@ -250,37 +249,6 @@ static INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wPar
break;
case IDC_X86:
- EnableWindow(GetDlgItem(hwndDlg, IDC_TRUNK_SYMBOLS), FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_TRUNK), FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_STABLE), FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_CUSTOM), FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_CUSTOMURL), FALSE);
- db_set_b(NULL, MODNAME, DB_SETTING_REDOWNLOAD, opts.bForceRedownload = 1);
- db_set_b(NULL, MODNAME, DB_SETTING_CHANGEPLATFORM, opts.bChangePlatform = 1);
- switch (GetUpdateMode()) {
- case UPDATE_MODE_STABLE:
- CheckDlgButton(hwndDlg, IDC_STABLE, BST_CHECKED);
- break;
- case UPDATE_MODE_TRUNK:
- CheckDlgButton(hwndDlg, IDC_TRUNK, BST_CHECKED);
- break;
- case UPDATE_MODE_TRUNK_SYMBOLS:
- CheckDlgButton(hwndDlg, IDC_TRUNK_SYMBOLS, BST_CHECKED);
- break;
- default:
- CheckDlgButton(hwndDlg, IDC_CUSTOM, BST_CHECKED);
- EnableWindow(GetDlgItem(hwndDlg, IDC_CUSTOMURL), TRUE);
-
- ptrT url(db_get_tsa(NULL, MODNAME, DB_SETTING_UPDATE_URL));
- if (url == NULL)
- url = GetDefaultUrl();
- SetDlgItemText(hwndDlg, IDC_CUSTOMURL, url);
- }
- mir_sntprintf(defurl, _T(DEFAULT_UPDATE_URL_TRUNK), DEFAULT_OPP_BITS);
- SetDlgItemText(hwndDlg, IDC_CUSTOMURL, defurl);
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
-
case IDC_X64:
EnableWindow(GetDlgItem(hwndDlg, IDC_TRUNK_SYMBOLS), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_TRUNK), FALSE);