From 88790eed4ffd9ca555c8f9b73cb014a93b57a34f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 22 Jun 2015 20:38:56 +0000 Subject: Menu_ModifyItem unbound from CLISTMENUITEM structure git-svn-id: http://svn.miranda-ng.org/main/trunk@14334 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/NewsAggregator/Src/Menus.cpp | 8 +------- plugins/NewsAggregator/Src/Services.cpp | 14 ++++---------- 2 files changed, 5 insertions(+), 17 deletions(-) (limited to 'plugins/NewsAggregator') diff --git a/plugins/NewsAggregator/Src/Menus.cpp b/plugins/NewsAggregator/Src/Menus.cpp index bf40363323..89fd65cdd1 100644 --- a/plugins/NewsAggregator/Src/Menus.cpp +++ b/plugins/NewsAggregator/Src/Menus.cpp @@ -74,11 +74,5 @@ void InitMenu() mi.pszService = MS_NEWSAGGREGATOR_CHANGEFEED; hService2[6] = Menu_AddContactMenuItem(&mi); - memset(&mi, 0, sizeof(mi)); - mi.flags = CMIM_ICON; - if (db_get_b(NULL, MODULE, "AutoUpdate", 1)) - mi.icolibItem = GetIconHandle("enabled"); - else - mi.icolibItem = GetIconHandle("disabled"); - Menu_ModifyItem(hService2[0], &mi); + Menu_ModifyItem(hService2[0], NULL, GetIconHandle(db_get_b(NULL, MODULE, "AutoUpdate", 1) ? "enabled" : "disabled")); } \ No newline at end of file diff --git a/plugins/NewsAggregator/Src/Services.cpp b/plugins/NewsAggregator/Src/Services.cpp index 444800f8db..a37fbf5ac0 100644 --- a/plugins/NewsAggregator/Src/Services.cpp +++ b/plugins/NewsAggregator/Src/Services.cpp @@ -231,17 +231,11 @@ void UpdateMenu(bool State) { CLISTMENUITEM mi = { 0 }; - if (!State) { // to enable auto-update - mi.ptszName = LPGENT("Auto Update Enabled"); - mi.icolibItem = GetIconHandle("enabled"); - } - else { // to disable auto-update - mi.ptszName = LPGENT("Auto Update Disabled"); - mi.icolibItem = GetIconHandle("disabled"); - } + if (!State) // to enable auto-update + Menu_ModifyItem(hService2[0], LPGENT("Auto Update Enabled"), GetIconHandle("enabled")); + else // to disable auto-update + Menu_ModifyItem(hService2[0], LPGENT("Auto Update Disabled"), GetIconHandle("disabled")); - mi.flags = CMIM_ICON | CMIM_NAME | CMIF_TCHAR; - Menu_ModifyItem(hService2[0], &mi); CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)hTBButton, State ? TTBST_PUSHED : 0); db_set_b(NULL, MODULE, "AutoUpdate", !State); } -- cgit v1.2.3