diff options
author | George Hazan <ghazan@miranda.im> | 2018-05-11 21:22:17 +0200 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-05-11 21:22:17 +0200 |
commit | 3f1628f127d35aa14da97e50c2a94cfd61ad52dd (patch) | |
tree | e9f1d8a1282e3c5ee0139003f4aac0e932a99213 /plugins/StatusManager/src/confirmdialog.cpp | |
parent | 6a6f2b9e3b2749f16b513dfc98d5d5038b5628fb (diff) |
merge from master to
fixes #1349 (Miranda crashes on coming back from auto away)
Diffstat (limited to 'plugins/StatusManager/src/confirmdialog.cpp')
-rw-r--r-- | plugins/StatusManager/src/confirmdialog.cpp | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/plugins/StatusManager/src/confirmdialog.cpp b/plugins/StatusManager/src/confirmdialog.cpp index a833408839..63c13658e0 100644 --- a/plugins/StatusManager/src/confirmdialog.cpp +++ b/plugins/StatusManager/src/confirmdialog.cpp @@ -27,27 +27,7 @@ static HWND win; static int timeOut; -struct TConfirmSetting : public PROTOCOLSETTINGEX -{ - TConfirmSetting(const PROTOCOLSETTINGEX &x) - { - memcpy(this, &x, sizeof(PROTOCOLSETTINGEX)); - if (m_szMsg) - m_szMsg = mir_wstrdup(m_szMsg); - } - - ~TConfirmSetting() - { - mir_free(m_szMsg); - } -}; - -static int CompareSettings(const TConfirmSetting* p1, const TConfirmSetting* p2) -{ - return mir_strcmp(p1->m_szName, p2->m_szName); -} - -static OBJLIST<TConfirmSetting> *confirmSettings; +static TProtoSettings *confirmSettings; static INT_PTR CALLBACK StatusMessageDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { @@ -385,7 +365,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP break; case UM_CLOSECONFIRMDLG: - CallService(MS_CS_SETSTATUSEX, (WPARAM)confirmSettings, 0); + SetStatusEx(*confirmSettings); DestroyWindow(hwndDlg); break; @@ -400,11 +380,11 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP HWND ShowConfirmDialogEx(TProtoSettings *params, int _timeout) { delete confirmSettings; - confirmSettings = new OBJLIST<TConfirmSetting>(10, CompareSettings); + confirmSettings = new TProtoSettings(); for (auto &it : *params) if (it->m_status != ID_STATUS_DISABLED) - confirmSettings->insert(new TConfirmSetting(*it)); + confirmSettings->insert(new SMProto(*it)); timeOut = _timeout; if (timeOut < 0) |