diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/menus/plugin_menu.c | 17 | ||||
-rw-r--r-- | apps/tree.c | 1 |
2 files changed, 14 insertions, 4 deletions
diff --git a/apps/menus/plugin_menu.c b/apps/menus/plugin_menu.c index 7f29e61af4..7edfc7acc6 100644 --- a/apps/menus/plugin_menu.c +++ b/apps/menus/plugin_menu.c | |||
@@ -29,7 +29,6 @@ | |||
29 | #include "rbpaths.h" | 29 | #include "rbpaths.h" |
30 | #include "root_menu.h" | 30 | #include "root_menu.h" |
31 | #include "tree.h" | 31 | #include "tree.h" |
32 | static int reenter = 0; | ||
33 | 32 | ||
34 | enum { | 33 | enum { |
35 | GAMES, | 34 | GAMES, |
@@ -46,6 +45,12 @@ static const struct { | |||
46 | { PLUGIN_DEMOS_DIR, LANG_PLUGIN_DEMOS }, | 45 | { PLUGIN_DEMOS_DIR, LANG_PLUGIN_DEMOS }, |
47 | }; | 46 | }; |
48 | 47 | ||
48 | /* if handler is active we are waiting to reenter menu */ | ||
49 | static void pm_handler(unsigned short id, void *data) | ||
50 | { | ||
51 | remove_event(id, data); | ||
52 | } | ||
53 | |||
49 | static int plugins_menu(void* param) | 54 | static int plugins_menu(void* param) |
50 | { | 55 | { |
51 | intptr_t item = (intptr_t)param; | 56 | intptr_t item = (intptr_t)param; |
@@ -60,7 +65,8 @@ static int plugins_menu(void* param) | |||
60 | if (ret == GO_TO_PREVIOUS) | 65 | if (ret == GO_TO_PREVIOUS) |
61 | return 0; | 66 | return 0; |
62 | if (ret == GO_TO_PLUGIN) | 67 | if (ret == GO_TO_PLUGIN) |
63 | reenter = 1; | 68 | add_event(SYS_EVENT_USB_INSERTED, pm_handler); |
69 | |||
64 | return ret; | 70 | return ret; |
65 | } | 71 | } |
66 | 72 | ||
@@ -74,8 +80,11 @@ static int menu_callback(int action, | |||
74 | if (action == ACTION_ENTER_MENUITEM) | 80 | if (action == ACTION_ENTER_MENUITEM) |
75 | { | 81 | { |
76 | this_list->selected_item = selected; | 82 | this_list->selected_item = selected; |
77 | if (reenter-- > 0) | 83 | if (!add_event(SYS_EVENT_USB_INSERTED, pm_handler)) |
78 | action = ACTION_STD_OK; | 84 | { |
85 | action = ACTION_STD_OK; /* event exists -- reenter menu */ | ||
86 | } | ||
87 | remove_event(SYS_EVENT_USB_INSERTED, pm_handler); | ||
79 | } | 88 | } |
80 | else if (action == ACTION_STD_OK) | 89 | else if (action == ACTION_STD_OK) |
81 | { | 90 | { |
diff --git a/apps/tree.c b/apps/tree.c index e35f769a14..63363422ba 100644 --- a/apps/tree.c +++ b/apps/tree.c | |||
@@ -1196,6 +1196,7 @@ static int ft_play_filename(char *dir, char *file, int attr) | |||
1196 | /* These two functions are called by the USB and shutdown handlers */ | 1196 | /* These two functions are called by the USB and shutdown handlers */ |
1197 | void tree_flush(void) | 1197 | void tree_flush(void) |
1198 | { | 1198 | { |
1199 | tc.browse = NULL; /* clear browse to prevent reentry to a possibly missing file */ | ||
1199 | #ifdef HAVE_TAGCACHE | 1200 | #ifdef HAVE_TAGCACHE |
1200 | tagcache_shutdown(); | 1201 | tagcache_shutdown(); |
1201 | #endif | 1202 | #endif |