summaryrefslogtreecommitdiff
path: root/plugins/StatusManager/src/confirmdialog.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-05-11 21:22:17 +0200
committerGeorge Hazan <ghazan@miranda.im>2018-05-11 21:22:17 +0200
commit3f1628f127d35aa14da97e50c2a94cfd61ad52dd (patch)
treee9f1d8a1282e3c5ee0139003f4aac0e932a99213 /plugins/StatusManager/src/confirmdialog.cpp
parent6a6f2b9e3b2749f16b513dfc98d5d5038b5628fb (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.cpp28
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)