summaryrefslogtreecommitdiff
path: root/apps/plugins
diff options
context:
space:
mode:
authorTom Ross <midgey@rockbox.org>2007-01-18 23:37:51 +0000
committerTom Ross <midgey@rockbox.org>2007-01-18 23:37:51 +0000
commitfa6ed0d1f44420f813b1edbd77dd8cd0c7baed15 (patch)
treee97b908887e28477ff55aea838a72b3c4bc0303d /apps/plugins
parent11b06f042364e810f4ee5226dde2690682c66c4c (diff)
downloadrockbox-fa6ed0d1f44420f813b1edbd77dd8cd0c7baed15.zip
rockbox-fa6ed0d1f44420f813b1edbd77dd8cd0c7baed15.tar.gz
rockbox-fa6ed0d1f44420f813b1edbd77dd8cd0c7baed15.tar.bz2
rockbox-fa6ed0d1f44420f813b1edbd77dd8cd0c7baed15.tar.xz
Hopefully fix the menu leak I introduced in my last version. Also some whitespace changes.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12069 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins')
-rw-r--r--apps/plugins/disktidy.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/apps/plugins/disktidy.c b/apps/plugins/disktidy.c
index 53e322f..bbd573c 100644
--- a/apps/plugins/disktidy.c
+++ b/apps/plugins/disktidy.c
@@ -340,12 +340,13 @@ enum plugin_status tidy_do(enum tidy_system system)
int tidy_lcd_menu(void)
{
- int loc, ret;
+ int loc, ret = 2;
+ bool menu_quit = false;
static const struct menu_item items[] =
{
{ "Start Cleaning", NULL },
- { "Files to Clean", NULL},
+ { "Files to Clean", NULL },
{ "Quit", NULL }
};
@@ -353,33 +354,38 @@ int tidy_lcd_menu(void)
{
{ "Mac", -1 },
{ "Windows", -1 },
- { "Both", -1}
+ { "Both", -1 }
};
loc = rb->menu_init(items, sizeof(items) / sizeof(*items),
NULL, NULL, NULL, NULL);
- while (true)
+ while (!menu_quit)
{
switch(rb->menu_show(loc))
{
case 0:
- return ret;
+ menu_quit = true; /* start cleaning */
+ break;
case 1:
rb->set_option("Files to Clean", &ret, INT, system_option, 3, NULL);
- break;
+ break;
case 2:
- return 99;
+ ret = 99;
+ menu_quit = true;
+ break;
default:
- return 99;
+ ret = 99; /* exit plugin */
+ menu_quit = true;
+ break;
}
}
-
rb->menu_exit(loc);
+ return ret;
}
/* this is the plugin entry point */