summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-04-19 20:38:29 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-04-19 20:38:29 +0300
commit693d04baec34aaf899822dc8d1180ab43ebda518 (patch)
treed3e171f29d54b63cab1c8469a5499f4b18f85d95 /src
parenta573f9a562e0ac0b1ae93560e6fdb8b941265c26 (diff)
code simplification
Diffstat (limited to 'src')
-rw-r--r--src/mir_app/src/options.cpp8
-rw-r--r--src/mir_app/src/pluginopts.cpp13
2 files changed, 9 insertions, 12 deletions
diff --git a/src/mir_app/src/options.cpp b/src/mir_app/src/options.cpp
index 7c36c04fb3..c6780393f2 100644
--- a/src/mir_app/src/options.cpp
+++ b/src/mir_app/src/options.cpp
@@ -842,6 +842,9 @@ public:
PSHNOTIFY pshn = {};
pshn.hdr.code = PSN_APPLY;
for (auto &p : m_arOpd) {
+ if (p == nullptr)
+ continue;
+
if (p->getHwnd() == nullptr || !p->bChanged)
continue;
@@ -1087,7 +1090,6 @@ public:
delete it;
m_arOpd.remove(idx);
}
- m_arDeleted.destroy();
RebuildPageTree();
}
@@ -1133,8 +1135,10 @@ public:
}
m_arDeleted.insert(opd);
- m_timerRebuild.Start(50);
}
+
+ if (m_arDeleted.getCount())
+ m_timerRebuild.Start(50);
}
};
diff --git a/src/mir_app/src/pluginopts.cpp b/src/mir_app/src/pluginopts.cpp
index 9ace80867a..2776b4635d 100644
--- a/src/mir_app/src/pluginopts.cpp
+++ b/src/mir_app/src/pluginopts.cpp
@@ -227,7 +227,6 @@ class CPluginOptDlg : public CDlgBase
CMStringW m_szFilter;
bool needRestart = false;
- CMStringW wszMsgRestart;
CMStringA szUrl;
public:
@@ -356,16 +355,10 @@ public:
LoadStdPlugins();
ShowWindow(GetDlgItem(m_hwnd, IDC_RESTART), needRestart);
- if (needRestart)
- wszMsgRestart = bufRestart;
- }
-
- virtual void OnClose() override
- {
if (needRestart) {
- wszMsgRestart.AppendChar('\n');
- wszMsgRestart.Append(TranslateT("Do you want to restart it now?"));
- if (MessageBox(m_hwnd, wszMsgRestart, L"Miranda NG", MB_ICONWARNING | MB_YESNO) == IDYES)
+ bufRestart.AppendChar('\n');
+ bufRestart.Append(TranslateT("Do you want to restart it now?"));
+ if (MessageBox(m_hwnd, bufRestart, L"Miranda NG", MB_ICONWARNING | MB_YESNO) == IDYES)
CallService(MS_SYSTEM_RESTART, 1, 0);
}
}