From 3ddbe63ff50dbf882e7c1bd4a2b23bdf8713765e Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Tue, 20 Oct 2009 23:29:13 +0000 Subject: Remove all update event callbacks if the custom statusbar is unused. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23306 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/statusbar-skinned.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/gui/statusbar-skinned.c b/apps/gui/statusbar-skinned.c index 7b2aae81f5..9756401ccb 100644 --- a/apps/gui/statusbar-skinned.c +++ b/apps/gui/statusbar-skinned.c @@ -118,13 +118,19 @@ void sb_skin_set_state(int state, enum screen_type screen) #if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) add_event(LCD_EVENT_ACTIVATION, false, do_update_callback); #endif + add_event(PLAYBACK_EVENT_TRACK_CHANGE, false, + do_update_callback); + add_event(PLAYBACK_EVENT_NEXTTRACKID3_AVAILABLE, false, + do_update_callback); add_event(GUI_EVENT_ACTIONUPDATE, false, sb_skin_update); } else { #if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) - add_event(LCD_EVENT_ACTIVATION, false, do_update_callback); + remove_event(LCD_EVENT_ACTIVATION, do_update_callback); #endif + remove_event(PLAYBACK_EVENT_TRACK_CHANGE, do_update_callback); + remove_event(PLAYBACK_EVENT_NEXTTRACKID3_AVAILABLE, do_update_callback); remove_event(GUI_EVENT_ACTIONUPDATE, sb_skin_update); } @@ -182,6 +188,4 @@ void sb_skin_init(void) sb_skin_sync_data.statusbars = VP_SB_HIDE_ALL; sb_skin[i].sync_data = &sb_skin_sync_data; } - add_event(PLAYBACK_EVENT_TRACK_CHANGE, false, do_update_callback); - add_event(PLAYBACK_EVENT_NEXTTRACKID3_AVAILABLE, false, do_update_callback); } -- cgit v1.2.3