summaryrefslogtreecommitdiff
path: root/plugins/BuddyExpectator
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-03-06 22:12:20 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-03-06 22:12:20 +0000
commit9de0202a0b12838d505825413c3cbcce5edabc11 (patch)
tree6f1f707f3e17c19e5cd08745e76c5299f9ba827b /plugins/BuddyExpectator
parent4e3088029101cc1e9bbc46984910a47bc0530e8f (diff)
cleanup of the unnecessary UnhookEvent() calls
git-svn-id: http://svn.miranda-ng.org/main/trunk@3909 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/BuddyExpectator')
-rw-r--r--plugins/BuddyExpectator/src/BuddyExpectator.cpp52
-rw-r--r--plugins/BuddyExpectator/src/options.cpp8
-rw-r--r--plugins/BuddyExpectator/src/options.h1
3 files changed, 12 insertions, 49 deletions
diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp
index e57d69045b..65c2cbbfbd 100644
--- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp
+++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp
@@ -26,21 +26,8 @@ int hLangpack;
DWORD timer_id = 0;
-HANDLE hEventContactSetting = NULL;
-HANDLE hEventContactAdded = NULL;
-HANDLE hEventUserInfoInit = NULL;
-HANDLE hPrebuildContactMenu = NULL;
-HANDLE hContactMenu = NULL;
-HANDLE hIcoLibIconsChanged = NULL;
-HANDLE hContactReturnedAction = NULL;
-HANDLE hContactStillAbsentAction = NULL;
-HANDLE hMissYouAction = NULL;
-HANDLE hMenuMissYouClick = NULL;
-HANDLE hModulesLoaded = NULL;
-HANDLE hModulesLoaded2 = NULL;
-HANDLE hSystemOKToExit = NULL;
-HANDLE hHookExtraIconsRebuild = NULL;
-HANDLE hHookExtraIconsApply = NULL;
+HANDLE hContactReturnedAction, hContactStillAbsentAction, hMissYouAction, hMenuMissYouClick;
+HANDLE hContactMenu;
HICON hIcon;
HANDLE hExtraIcon;
@@ -663,7 +650,7 @@ int ModulesLoaded2(WPARAM wParam, LPARAM lParam)
int ModulesLoaded(WPARAM wParam, LPARAM lParam)
{
- hEventUserInfoInit = HookEvent(ME_USERINFO_INITIALISE, UserinfoInit);
+ HookEvent(ME_USERINFO_INITIALISE, UserinfoInit);
// add sounds support
SkinAddNewSoundExT("buddyExpectatorReturn", LPGENT("BuddyExpectator"), LPGENT("Contact returned"));
@@ -673,7 +660,7 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam)
timer_id = SetTimer(0, 0, 1000 * 60 * 60 * 4, TimerProc); // check every 4 hours
- hModulesLoaded2 = HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded2);
+ HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded2);
if (options.MissYouIcon)
hExtraIcon = ExtraIcon_Register("buddy_exp", "Buddy Expectator", "enabled_icon");
@@ -681,12 +668,12 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam)
Icon_Register(hInst, "BuddyExpectator", iconList, SIZEOF(iconList));
- hIcoLibIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, onIconsChanged);
+ HookEvent(ME_SKIN2_ICONSCHANGED, onIconsChanged);
onIconsChanged(0,0);
if (options.enableMissYou) {
- hPrebuildContactMenu = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, onPrebuildContactMenu);
+ HookEvent(ME_CLIST_PREBUILDCONTACTMENU, onPrebuildContactMenu);
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_ICONFROMICOLIB | CMIF_TCHAR;
@@ -728,29 +715,12 @@ int ContactAdded(WPARAM wParam, LPARAM lParam)
int onSystemOKToExit(WPARAM wParam,LPARAM lParam)
{
- UnhookEvent(hEventContactSetting);
- UnhookEvent(hEventContactAdded);
- UnhookEvent(hEventUserInfoInit);
- if (hPrebuildContactMenu) UnhookEvent(hPrebuildContactMenu);
- UnhookEvent(hIcoLibIconsChanged);
- UnhookEvent(hModulesLoaded);
- UnhookEvent(hModulesLoaded2);
- UnhookEvent(hSystemOKToExit);
- UnhookEvent(hHookExtraIconsRebuild);
- UnhookEvent(hHookExtraIconsApply);
-
DestroyServiceFunction(hContactReturnedAction);
DestroyServiceFunction(hContactStillAbsentAction);
DestroyServiceFunction(hMissYouAction);
DestroyServiceFunction(hMenuMissYouClick);
- DeinitOptions();
-
- if (hIcoLibIconsChanged)
- Skin_ReleaseIcon(hIcon);
- else
- DestroyIcon(hIcon);
-
+ Skin_ReleaseIcon(hIcon);
return 0;
}
@@ -767,11 +737,11 @@ extern "C" int __declspec(dllexport) Load(void)
hMissYouAction = CreateServiceFunction("BuddyExpectator/actionMissYou", MissYouAction);
hMenuMissYouClick = CreateServiceFunction("BuddyExpectator/actionMissYouClick", MenuMissYouClick);
- hEventContactSetting = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, SettingChanged);
- hModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
- hSystemOKToExit = HookEvent(ME_SYSTEM_OKTOEXIT,onSystemOKToExit);
+ HookEvent(ME_DB_CONTACT_SETTINGCHANGED, SettingChanged);
+ HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
+ HookEvent(ME_SYSTEM_OKTOEXIT,onSystemOKToExit);
- hEventContactAdded = HookEvent(ME_DB_CONTACT_ADDED, ContactAdded);
+ HookEvent(ME_DB_CONTACT_ADDED, ContactAdded);
// ensure all contacts are timestamped
DBVARIANT dbv;
diff --git a/plugins/BuddyExpectator/src/options.cpp b/plugins/BuddyExpectator/src/options.cpp
index badcc23d47..078d699eb4 100644
--- a/plugins/BuddyExpectator/src/options.cpp
+++ b/plugins/BuddyExpectator/src/options.cpp
@@ -560,14 +560,8 @@ int UserinfoInit(WPARAM wparam, LPARAM lparam)
}
-HANDLE hEventOptInitialise;
void InitOptions()
{
LoadOptions();
- hEventOptInitialise = HookEvent(ME_OPT_INITIALISE, OptionsInit);
-}
-
-void DeinitOptions()
-{
- UnhookEvent(hEventOptInitialise);
+ HookEvent(ME_OPT_INITIALISE, OptionsInit);
}
diff --git a/plugins/BuddyExpectator/src/options.h b/plugins/BuddyExpectator/src/options.h
index ade65c50e6..87e1f5e931 100644
--- a/plugins/BuddyExpectator/src/options.h
+++ b/plugins/BuddyExpectator/src/options.h
@@ -59,6 +59,5 @@ typedef struct {
extern Options options;
void InitOptions();
-void DeinitOptions();
#endif