From 488214ac8af0c4aeb1a5c1d8fd48368daaf4c4c7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 12 Nov 2018 20:12:53 +0300 Subject: end of ME_OPT_INITIALISE related zoo in another plugins --- plugins/TooltipNotify/src/TooltipNotify.h | 7 +------ plugins/TooltipNotify/src/main.cpp | 25 ++++++------------------- 2 files changed, 7 insertions(+), 25 deletions(-) (limited to 'plugins/TooltipNotify/src') diff --git a/plugins/TooltipNotify/src/TooltipNotify.h b/plugins/TooltipNotify/src/TooltipNotify.h index 40aaac0db6..9a0e36b17d 100644 --- a/plugins/TooltipNotify/src/TooltipNotify.h +++ b/plugins/TooltipNotify/src/TooltipNotify.h @@ -6,7 +6,7 @@ class CTooltip; -class CTooltipNotify +class CTooltipNotify : public MNonCopyable { private: struct STooltipData; @@ -32,11 +32,6 @@ public: static CTooltipNotify *GetObjInstance() { return s_pInstance; } -private: - // prohibit copying - CTooltipNotify(const CTooltipNotify& rhs); - CTooltipNotify& operator= (const CTooltipNotify& rhs); - private: static CTooltipNotify *s_pInstance; static const char *s_szModuleNameOld; diff --git a/plugins/TooltipNotify/src/main.cpp b/plugins/TooltipNotify/src/main.cpp index 608fcb4e18..ba385624bc 100644 --- a/plugins/TooltipNotify/src/main.cpp +++ b/plugins/TooltipNotify/src/main.cpp @@ -4,12 +4,6 @@ #include "stdafx.h" -static HANDLE g_hContactSettingChanged = nullptr; -static HANDLE g_hOptionsInitialize = nullptr; -static HANDLE g_hModulesLoaded = nullptr; -static HANDLE g_hProtoAck = nullptr; -static HANDLE g_hProtoContactIsTyping = nullptr; - // Main global object static CTooltipNotify *g_pTooltipNotify = nullptr; @@ -59,20 +53,19 @@ static int InitializeOptions(WPARAM wParam, LPARAM lParam) static int ModulesLoaded(WPARAM wParam, LPARAM lParam) { - g_hContactSettingChanged = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, ContactSettingChanged); - g_hProtoAck = HookEvent(ME_PROTO_ACK, ProtoAck); - g_hProtoContactIsTyping = HookEvent(ME_PROTO_CONTACTISTYPING, ProtoContactIsTyping); - g_hOptionsInitialize = HookEvent(ME_OPT_INITIALISE, InitializeOptions); - return CTooltipNotify::GetObjInstance()->ModulesLoaded(wParam, lParam); } int CMPlugin::Load() { g_pTooltipNotify = new CTooltipNotify(); - assert(g_pTooltipNotify!=nullptr); + assert(g_pTooltipNotify != nullptr); - g_hModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded); + HookEvent(ME_DB_CONTACT_SETTINGCHANGED, ContactSettingChanged); + HookEvent(ME_OPT_INITIALISE, InitializeOptions); + HookEvent(ME_PROTO_ACK, ProtoAck); + HookEvent(ME_PROTO_CONTACTISTYPING, ProtoContactIsTyping); + HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded); return 0; } @@ -80,12 +73,6 @@ int CMPlugin::Load() int CMPlugin::Unload() { - if (g_hContactSettingChanged) UnhookEvent(g_hContactSettingChanged); - if (g_hProtoContactIsTyping) UnhookEvent(g_hProtoContactIsTyping); - if (g_hProtoAck) UnhookEvent(g_hProtoAck); - if (g_hOptionsInitialize) UnhookEvent(g_hOptionsInitialize); - if (g_hModulesLoaded) UnhookEvent(g_hModulesLoaded); delete g_pTooltipNotify; - return 0; } -- cgit v1.2.3