summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeruaki Kawashima <teru@rockbox.org>2009-08-29 15:38:08 +0000
committerTeruaki Kawashima <teru@rockbox.org>2009-08-29 15:38:08 +0000
commit2659aa7f924f66d533018dd60bfe33b72bf08e00 (patch)
treef512ceefaa233d957262f367edcaedc97173b618
parent1dec3e6772877164abbae713ab7fd992e4e37393 (diff)
downloadrockbox-2659aa7f924f66d533018dd60bfe33b72bf08e00.tar.gz
rockbox-2659aa7f924f66d533018dd60bfe33b72bf08e00.tar.bz2
rockbox-2659aa7f924f66d533018dd60bfe33b72bf08e00.zip
Calendar: change directory to store .memo file from /.rockbox/ to /.rockbox/rocks/apps/ for the consistency with other plugins. move the file manually if you use the calendar plugin.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22536 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugins/calendar.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/apps/plugins/calendar.c b/apps/plugins/calendar.c
index 20b7fa9226..43a71e908c 100644
--- a/apps/plugins/calendar.c
+++ b/apps/plugins/calendar.c
@@ -237,6 +237,9 @@ CONFIG_KEYPAD == SANSA_M200_PAD
#endif
#endif
+#define MEMO_FILE PLUGIN_APPS_DIR "/.memo"
+#define TEMP_FILE PLUGIN_APPS_DIR "/~temp"
+
#define X_OFFSET ((LCD_WIDTH%7)/2)
#if LCD_HEIGHT <= 80
#define Y_OFFSET 1
@@ -435,7 +438,7 @@ static void load_memo(struct shown *shown)
for (k = 0; k < 7; k++)
wday_has_memo[k] = false;
memos_in_memory = 0;
- fp = rb->open(ROCKBOX_DIR "/.memo",O_RDONLY);
+ fp = rb->open(MEMO_FILE, O_RDONLY);
if (fp > -1)
{
rb->lseek(fp, 0, SEEK_SET);
@@ -523,8 +526,8 @@ static bool save_memo(int changed, bool new_mod, struct shown *shown)
{
int fp,fq;
/* use O_RDWR|O_CREAT so that file is created if it doesn't exist. */
- fp = rb->open(ROCKBOX_DIR "/.memo", O_RDWR|O_CREAT);
- fq = rb->creat(ROCKBOX_DIR "/~temp");
+ fp = rb->open(MEMO_FILE, O_RDWR|O_CREAT);
+ fq = rb->creat(TEMP_FILE);
if ( (fq > -1) && (fp > -1) )
{
int i;
@@ -552,8 +555,8 @@ static bool save_memo(int changed, bool new_mod, struct shown *shown)
}
rb->close(fp);
rb->close(fq);
- rb->remove(ROCKBOX_DIR "/.memo");
- rb->rename(ROCKBOX_DIR "/~temp", ROCKBOX_DIR "/.memo");
+ rb->remove(MEMO_FILE);
+ rb->rename(TEMP_FILE, MEMO_FILE);
load_memo(shown);
return true;
}
@@ -824,7 +827,8 @@ enum plugin_status plugin_start(const void* parameter)
switch (button)
{
case CALENDAR_QUIT:
- return PLUGIN_OK;
+ exit = true;
+ break;
case CALENDAR_NEXT_MONTH:
case CALENDAR_NEXT_MONTH | BUTTON_REPEAT: