diff options
| author | Linus Nielsen Feltzing <linus@haxx.se> | 2005-09-14 09:07:05 +0000 |
|---|---|---|
| committer | Linus Nielsen Feltzing <linus@haxx.se> | 2005-09-14 09:07:05 +0000 |
| commit | 74353a7fe46c5d6973bffb2488f7c8276e088e80 (patch) | |
| tree | 807383a9bb7b21b9dcd4850307f2f1ff861a7bc8 /apps/misc.c | |
| parent | 7b86bade5963dc47d3368e9a6e4fc002db79159e (diff) | |
| download | rockbox-74353a7fe46c5d6973bffb2488f7c8276e088e80.zip rockbox-74353a7fe46c5d6973bffb2488f7c8276e088e80.tar.gz rockbox-74353a7fe46c5d6973bffb2488f7c8276e088e80.tar.bz2 rockbox-74353a7fe46c5d6973bffb2488f7c8276e088e80.tar.xz | |
The database is now always synched when entering USB mode or shutting down, and not only in the tree browser
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7516 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/misc.c')
| -rw-r--r-- | apps/misc.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/apps/misc.c b/apps/misc.c index ddf8d06..d1b5c22 100644 --- a/apps/misc.c +++ b/apps/misc.c @@ -46,6 +46,7 @@ #ifdef HAVE_MMC #include "ata_mmc.h" #endif +#include "tree.h" #ifdef HAVE_LCD_BITMAP #include "bmp.h" @@ -381,6 +382,16 @@ bool settings_parseline(char* line, char** name, char** value) return true; } +static void system_flush(void) +{ + tree_flush(); +} + +static void system_restore(void) +{ + tree_restore(); +} + static bool clean_shutdown(void (*callback)(void *), void *parameter) { #ifdef SIMULATOR @@ -396,6 +407,9 @@ static bool clean_shutdown(void (*callback)(void *), void *parameter) splash(0, true, str(LANG_SHUTTINGDOWN)); if (callback != NULL) callback(parameter); + + system_flush(); + shutdown_hw(); } #endif @@ -467,7 +481,11 @@ long default_event_handler_ex(long event, void (*callback)(void *), void *parame #ifdef HAVE_MMC if (!mmc_touched() || (mmc_remove_request() == SYS_MMC_EXTRACTED)) #endif + { + system_flush(); usb_screen(); + system_restore(); + } return SYS_USB_CONNECTED; case SYS_POWEROFF: if (!clean_shutdown(callback, parameter)) |