diff options
author | George Hazan <ghazan@miranda.im> | 2018-03-13 23:03:44 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-03-13 23:03:44 +0300 |
commit | b29028f8d4f97741a45994b773d31dc84d70c4f9 (patch) | |
tree | 1e6d6bf82a217770f51c130796703615740e615c | |
parent | e9cb7ff7a1c115d63ed4e6af5f8fbd29f29459fe (diff) |
old hotkey saving code restored
-rw-r--r-- | src/mir_app/src/hotkey_opts.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/mir_app/src/hotkey_opts.cpp b/src/mir_app/src/hotkey_opts.cpp index e86751c501..28b852993d 100644 --- a/src/mir_app/src/hotkey_opts.cpp +++ b/src/mir_app/src/hotkey_opts.cpp @@ -755,10 +755,13 @@ static INT_PTR CALLBACK sttOptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, UnregisterHotkeys(); - for (auto &it : hotkeys) - if (it->OptNew && it->OptDeleted || it->rootHotkey && !it->OptHotkey || (lpnmhdr->code == PSN_APPLY) && it->OptDeleted || (lpnmhdr->code == PSN_RESET) && it->OptNew) - FreeHotkey(it); - hotkeys.destroy(); + for (int i = hotkeys.getCount()-1; i--;) { + THotkeyItem *p = hotkeys[i]; + if (p->OptNew && p->OptDeleted || p->rootHotkey && !p->OptHotkey || (lpnmhdr->code == PSN_APPLY) && p->OptDeleted || (lpnmhdr->code == PSN_RESET) && p->OptNew) { + FreeHotkey(p); + hotkeys.remove(i); + } + } if (lpnmhdr->code == PSN_APPLY) { LVITEM lvi = { 0 }; |