diff options
author | George Hazan <george.hazan@gmail.com> | 2015-12-13 10:44:36 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-12-13 10:44:36 +0000 |
commit | 5030140545cd8c78119ccf9dde845d1cbb470b92 (patch) | |
tree | 930c9068f2fb28b033976b0db698e1aa64535614 /plugins/Clist_modern/src | |
parent | 404dab3daf772c3686070fcfec1e3a4315e21935 (diff) |
- no need to allocate static array dynamically
- useless variable removed
git-svn-id: http://svn.miranda-ng.org/main/trunk@15848 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern/src')
-rw-r--r-- | plugins/Clist_modern/src/modern_clistmenus.cpp | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/plugins/Clist_modern/src/modern_clistmenus.cpp b/plugins/Clist_modern/src/modern_clistmenus.cpp index 837eb91cf0..44d67c1bc3 100644 --- a/plugins/Clist_modern/src/modern_clistmenus.cpp +++ b/plugins/Clist_modern/src/modern_clistmenus.cpp @@ -62,12 +62,6 @@ int InitCustomMenus(void) #define CLUI_FAVSETRATE "CLUI/SetContactRate" //LParam is rate, Wparam is contact handle
#define CLUI_FAVTOGGLESHOWOFFLINE "CLUI/ToggleContactShowOffline"
-static HGENMENU hFavoriteContactMenu = NULL;
-static HGENMENU *hFavoriteContactMenuItems = NULL;
-
-static HGENMENU hShowIfOflineItem = NULL;
-static HANDLE hOnContactMenuBuild_FAV = NULL;
-
static TCHAR *FAVMENUROOTNAME = LPGENT("&Contact rate");
static TCHAR *rates[] = {
@@ -77,6 +71,9 @@ static TCHAR *rates[] = { LPGENT("High")
};
+static HGENMENU hFavoriteContactMenu = NULL, hShowIfOflineItem = NULL;
+static HGENMENU hFavoriteContactMenuItems[_countof(rates)];
+
static IconItem iconList[] =
{
{ LPGEN("Contact rate: none"), "Rate1", IDI_FAVORITE_0 },
@@ -127,9 +124,7 @@ int LoadFavoriteContactMenu() CreateServiceFunction(CLUI_FAVSETRATE, FAV_SetRate);
CreateServiceFunction(CLUI_FAVTOGGLESHOWOFFLINE, FAV_ToggleShowOffline);
- hOnContactMenuBuild_FAV = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, FAV_OnContactMenuBuild);
-
- hFavoriteContactMenuItems = (HGENMENU*)calloc(_countof(rates), sizeof(HANDLE));
+ HookEvent(ME_CLIST_PREBUILDCONTACTMENU, FAV_OnContactMenuBuild);
CMenuItem mi;
SET_UID(mi, 0xf99a2320, 0xc024, 0x48bd, 0x81, 0xf7, 0x9f, 0xa2, 0x5, 0xb0, 0x7f, 0xdc);
@@ -155,15 +150,11 @@ int LoadFavoriteContactMenu() mi.name.t = LPGENT("Show even if offline");
hShowIfOflineItem = Menu_AddContactMenuItem(&mi);
Menu_ConfigureItem(hShowIfOflineItem, MCI_OPT_EXECPARAM, _countof(rates) + 100000000);
-
return 0;
}
int UnloadFavoriteContactMenu()
{
- free(hFavoriteContactMenuItems);
- hFavoriteContactMenuItems = NULL;
-
Menu_RemoveItem(hFavoriteContactMenu); hFavoriteContactMenu = NULL;
return 0;
}
|