summaryrefslogtreecommitdiff
path: root/plugins/Toaster/src
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-08-30 10:31:02 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-08-30 10:31:02 +0000
commit10aaf104c7ad7f89fbc1a9eda713c99b21fdcfa2 (patch)
treef32fac989959bab724bacd6d437a838d0410661e /plugins/Toaster/src
parent5a18a53b28d4fa486069208d2f50a7216091e6e8 (diff)
Toaster: fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@15115 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Toaster/src')
-rw-r--r--plugins/Toaster/src/main.cpp7
-rw-r--r--plugins/Toaster/src/services.cpp19
-rw-r--r--plugins/Toaster/src/stdafx.h1
3 files changed, 13 insertions, 14 deletions
diff --git a/plugins/Toaster/src/main.cpp b/plugins/Toaster/src/main.cpp
index 66db53929e..007391119b 100644
--- a/plugins/Toaster/src/main.cpp
+++ b/plugins/Toaster/src/main.cpp
@@ -61,11 +61,6 @@ extern "C" int __declspec(dllexport) Unload(void)
int OnPreShutdown(WPARAM, LPARAM)
{
- mir_cslock lck(csNotifications);
- for (int i = 0; i < lstNotifications.getCount(); i++)
- lstNotifications[i].Hide();
-
- lstNotifications.destroy();
-
+ HideAllToasts();
return 0;
} \ No newline at end of file
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);
diff --git a/plugins/Toaster/src/stdafx.h b/plugins/Toaster/src/stdafx.h
index d198146e97..f763765039 100644
--- a/plugins/Toaster/src/stdafx.h
+++ b/plugins/Toaster/src/stdafx.h
@@ -43,4 +43,5 @@ struct callbackArg
void InitServices();
int OnPreShutdown(WPARAM, LPARAM);
+void HideAllToasts();
#endif //_COMMON_H_