From 10aaf104c7ad7f89fbc1a9eda713c99b21fdcfa2 Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Sun, 30 Aug 2015 10:31:02 +0000 Subject: Toaster: fixes git-svn-id: http://svn.miranda-ng.org/main/trunk@15115 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Toaster/src/services.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'plugins/Toaster/src/services.cpp') diff --git a/plugins/Toaster/src/services.cpp b/plugins/Toaster/src/services.cpp index a2747758e8..9c3d4b12bd 100644 --- a/plugins/Toaster/src/services.cpp +++ b/plugins/Toaster/src/services.cpp @@ -111,14 +111,7 @@ static INT_PTR PopupQuery(WPARAM wParam, LPARAM) { bool enabled = db_get_b(0, "Popup", "ModuleIsEnabled", 1) != 0; if (enabled) db_set_b(0, "Popup", "ModuleIsEnabled", 0); - - mir_cslock lck(csNotifications); - while (lstNotifications.getCount()) - { - lstNotifications[0].Hide(); - lstNotifications.remove(0); - } - + HideAllToasts(); return enabled; } break; @@ -131,6 +124,16 @@ static INT_PTR PopupQuery(WPARAM wParam, LPARAM) } } +void HideAllToasts() +{ + mir_cslock lck(csNotifications); + while (lstNotifications.getCount()) + { + lstNotifications[0].Hide(); + lstNotifications.remove(0); + } +} + void InitServices() { CreateServiceFunction(MS_POPUP_ADDPOPUP, CreatePopup); -- cgit v1.2.3