From cabb63de79c7bf2b46ac97193eb69340fee2bd63 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 17 May 2021 21:05:59 +0300 Subject: Dbeditor++: fix for global settings removing --- plugins/DbEditorPP/src/main_window.cpp | 4 +--- plugins/DbEditorPP/src/settinglist.cpp | 6 ++++-- plugins/DbEditorPP/src/version.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'plugins/DbEditorPP/src') diff --git a/plugins/DbEditorPP/src/main_window.cpp b/plugins/DbEditorPP/src/main_window.cpp index 4c1b9af097..46c66b6afe 100644 --- a/plugins/DbEditorPP/src/main_window.cpp +++ b/plugins/DbEditorPP/src/main_window.cpp @@ -269,14 +269,12 @@ void CMainDlg::OnDestroy() } int pos = m_settings.GetSelectionMark(); - if (pos != -1) { char data[FLD_SIZE]; ListView_GetItemTextA(m_settings.GetHwnd(), pos, 0, data, _countof(data)); g_plugin.setString("LastSetting", data); } - else - g_plugin.delSetting("LastSetting"); + else g_plugin.delSetting("LastSetting"); } } diff --git a/plugins/DbEditorPP/src/settinglist.cpp b/plugins/DbEditorPP/src/settinglist.cpp index 207a5b95b6..0df1490230 100644 --- a/plugins/DbEditorPP/src/settinglist.cpp +++ b/plugins/DbEditorPP/src/settinglist.cpp @@ -94,9 +94,11 @@ void CMainDlg::DeleteSettingsFromList(MCONTACT hContact, const char *module, con if (!count) return; + bool isContacts = (hContact == 0 && mir_strlen(module) == 0); + if (g_plugin.bWarnOnDelete) { wchar_t text[MSG_SIZE]; - if (info.hContact == 0) + if (isContacts) mir_snwprintf(text, TranslateT("Are you sure you want to delete %d contact(s)?"), count); else mir_snwprintf(text, TranslateT("Are you sure you want to delete %d setting(s)?"), count); @@ -104,7 +106,7 @@ void CMainDlg::DeleteSettingsFromList(MCONTACT hContact, const char *module, con return; } - if (hContact == 0) { + if (isContacts) { int items = m_settings.GetItemCount(); for (int i = 0; i < items;) { if (m_settings.GetItemState(i, LVIS_SELECTED)) { diff --git a/plugins/DbEditorPP/src/version.h b/plugins/DbEditorPP/src/version.h index 3883913a11..cbcffdad69 100644 --- a/plugins/DbEditorPP/src/version.h +++ b/plugins/DbEditorPP/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 4 #define __MINOR_VERSION 1 #define __RELEASE_NUM 0 -#define __BUILD_NUM 1 +#define __BUILD_NUM 2 #include -- cgit v1.2.3