summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorHardeep Sidhu <dyp@pobox.com>2006-06-04 16:36:49 +0000
committerHardeep Sidhu <dyp@pobox.com>2006-06-04 16:36:49 +0000
commitab3e71cad9dbc43eb407e7dc6e287efe0a4f4282 (patch)
treebc68c628f64780ca48ba448757c8dccb290267e4 /apps
parentae4560f3881e1220722072be450fe30cf688f5f9 (diff)
downloadrockbox-ab3e71cad9dbc43eb407e7dc6e287efe0a4f4282.tar.gz
rockbox-ab3e71cad9dbc43eb407e7dc6e287efe0a4f4282.tar.bz2
rockbox-ab3e71cad9dbc43eb407e7dc6e287efe0a4f4282.zip
Added reload_directory() to plugin api and modified text editor and sudoku plugins to call it when saving a new file. Fixes B#5360.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10053 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/plugin.c1
-rw-r--r--apps/plugin.h3
-rw-r--r--apps/plugins/sudoku/sudoku.c1
-rw-r--r--apps/plugins/text_editor.c4
4 files changed, 8 insertions, 1 deletions
diff --git a/apps/plugin.c b/apps/plugin.c
index f332850565..1b1c406af4 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -441,6 +441,7 @@ static const struct plugin_api rockbox_api = {
utf8seek,
set_int,
+ reload_directory,
};
int plugin_load(const char* plugin, void* parameter)
diff --git a/apps/plugin.h b/apps/plugin.h
index 2821beeab9..de8f267ec8 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -104,7 +104,7 @@
#define PLUGIN_MAGIC 0x526F634B /* RocK */
/* increase this every time the api struct changes */
-#define PLUGIN_API_VERSION 21
+#define PLUGIN_API_VERSION 22
/* update this to latest version if a change to the api struct breaks
backwards compatibility (and please take the opportunity to sort in any
@@ -520,6 +520,7 @@ struct plugin_api {
bool (*set_int)(const unsigned char* string, const char* unit, int voice_unit,
int* variable, void (*function)(int), int step, int min,
int max, void (*formatter)(char*, int, int, const char*) );
+ void (*reload_directory)(void);
};
/* plugin header */
diff --git a/apps/plugins/sudoku/sudoku.c b/apps/plugins/sudoku/sudoku.c
index 0c39c463ef..12924e8fe6 100644
--- a/apps/plugins/sudoku/sudoku.c
+++ b/apps/plugins/sudoku/sudoku.c
@@ -689,6 +689,7 @@ bool save_sudoku(struct sudoku_state_t* state)
/* Add a blank line at end */
rb->write(fd,"\r\n",2);
rb->close(fd);
+ rb->reload_directory();
/* Save a copy of the saved state - so we can reload without
using the disk */
rb->memcpy(state->savedboard,state->currentboard,81);
diff --git a/apps/plugins/text_editor.c b/apps/plugins/text_editor.c
index e86606344d..f98194b151 100644
--- a/apps/plugins/text_editor.c
+++ b/apps/plugins/text_editor.c
@@ -223,6 +223,10 @@ void save_changes(int overwrite)
return;
}
+ if (!overwrite)
+ /* current directory may have changed */
+ rb->reload_directory();
+
rb->lcd_clear_display();
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
rb->cpu_boost(1);