summaryrefslogtreecommitdiff
path: root/plugins/TooltipNotify/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-11-12 20:12:53 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-11-12 20:12:53 +0300
commit488214ac8af0c4aeb1a5c1d8fd48368daaf4c4c7 (patch)
tree96b0db981b4f5054f24d484902b597ba7da1c1a5 /plugins/TooltipNotify/src
parent9b35784c5042984fbb60785f0a4a41a64af545f6 (diff)
end of ME_OPT_INITIALISE related zoo in another plugins
Diffstat (limited to 'plugins/TooltipNotify/src')
-rw-r--r--plugins/TooltipNotify/src/TooltipNotify.h7
-rw-r--r--plugins/TooltipNotify/src/main.cpp25
2 files changed, 7 insertions, 25 deletions
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;
@@ -33,11 +33,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;
}