From 634ded759c8208a62ea1ce4dd9bb5fa708ff0c33 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 29 Aug 2018 19:28:37 +0300 Subject: fixes #1555 (Import shouldn't import .bak second time in service mode) --- plugins/Import/src/main.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'plugins/Import/src') diff --git a/plugins/Import/src/main.cpp b/plugins/Import/src/main.cpp index 0cf5f42e70..108ce1cee8 100644 --- a/plugins/Import/src/main.cpp +++ b/plugins/Import/src/main.cpp @@ -91,17 +91,19 @@ static int OnExit(WPARAM, LPARAM) return 0; } -static INT_PTR ServiceMode(WPARAM, LPARAM) +static INT_PTR ServiceMode(WPARAM wParam, LPARAM) { g_bServiceMode = true; - ptrW wszFullName(Utils_ReplaceVarsW(L"%miranda_userdata%\\%miranda_profilename%.dat.bak")); - if (!_waccess(wszFullName, 0)) { - g_iImportOptions = IOPT_ADDUNKNOWN + IOPT_COMPLETE + IOPT_CHECKDUPS; - wcsncpy_s(importFile, MAX_PATH, wszFullName, _TRUNCATE); + if (wParam == 1) { + ptrW wszFullName(Utils_ReplaceVarsW(L"%miranda_userdata%\\%miranda_profilename%.dat.bak")); + if (!_waccess(wszFullName, 0)) { + g_iImportOptions = IOPT_ADDUNKNOWN + IOPT_COMPLETE + IOPT_CHECKDUPS; + wcsncpy_s(importFile, MAX_PATH, wszFullName, _TRUNCATE); - WizardDlgParam param = { IDD_PROGRESS, (LPARAM)ProgressPageProc }; - DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_WIZARD), nullptr, WizardDlgProc, LPARAM(¶m)); + WizardDlgParam param = { IDD_PROGRESS, (LPARAM)ProgressPageProc }; + DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_WIZARD), nullptr, WizardDlgProc, LPARAM(¶m)); + } return SERVICE_CONTINUE; } -- cgit v1.2.3