Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[wiki-app] article positioning save at auto shutdown

Fixed from Symbio

Signed-off-by: Christopher Hall <hsw@openmoko.com>
  • Loading branch information...
commit 2361231fea9e5438778f74aa0060f19268674a44 1 parent dc4aae5
Christopher Hall hxw authored
Showing with 17 additions and 12 deletions.
  1. +9 −4 wiki-app/history.c
  2. +8 −8 wiki-app/wikilib.c
13 wiki-app/history.c
View
@@ -145,16 +145,21 @@ int history_list_save(int level)
int fd_hst;
int rc = 0;
+ if (history_changed != HISTORY_SAVE_NONE)
+ {
if (level == HISTORY_SAVE_POWER_OFF || history_changed == HISTORY_SAVE_NORMAL)
{
fd_hst = wl_open("pedia.hst", WL_O_CREATE);
if (fd_hst >= 0)
{
- wl_write(fd_hst, (void *)history_list, sizeof(HISTORY) * history_count);
- wl_close(fd_hst);
+ wl_write(fd_hst, (void *)history_list, sizeof(HISTORY) * history_count);
+ wl_close(fd_hst);
+ }
+ history_changed = HISTORY_SAVE_NONE;
+ rc = 1;
}
- history_changed = HISTORY_SAVE_NONE;
- rc = 1;
+ else
+ rc = -1;
}
return rc;
}
16 wiki-app/wikilib.c
View
@@ -781,17 +781,17 @@ int wikilib_run(void)
sleep = 0;
else
sleep = 1;
- if (display_mode == DISPLAY_MODE_ARTICLE && render_article_with_pcf())
+ if (!more_events && display_mode == DISPLAY_MODE_ARTICLE && render_article_with_pcf())
sleep = 0;
- else if (display_mode == DISPLAY_MODE_INDEX && render_search_result_with_pcf())
+ else if (!more_events && display_mode == DISPLAY_MODE_INDEX && render_search_result_with_pcf())
sleep = 0;
- else if (display_mode == DISPLAY_MODE_HISTORY && render_history_with_pcf())
+ else if (!more_events && display_mode == DISPLAY_MODE_HISTORY && render_history_with_pcf())
sleep = 0;
- if (article_offset != 0)
- {
- scroll_article();
- sleep = 0;
- }
+ //if (article_offset != 0)
+ //{
+ // scroll_article();
+ // sleep = 0;
+ //}
#ifdef INCLUDED_FROM_KERNEL
time_now = get_time_ticks();
Please sign in to comment.
Something went wrong with that request. Please try again.