Skip to content
This repository
Browse code

[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 2 changed files with 17 additions and 12 deletions. Show diff stats Hide diff stats

  1. +9 4 wiki-app/history.c
  2. +8 8 wiki-app/wikilib.c
13 wiki-app/history.c
@@ -145,16 +145,21 @@ int history_list_save(int level)
145 145 int fd_hst;
146 146 int rc = 0;
147 147
  148 + if (history_changed != HISTORY_SAVE_NONE)
  149 + {
148 150 if (level == HISTORY_SAVE_POWER_OFF || history_changed == HISTORY_SAVE_NORMAL)
149 151 {
150 152 fd_hst = wl_open("pedia.hst", WL_O_CREATE);
151 153 if (fd_hst >= 0)
152 154 {
153   - wl_write(fd_hst, (void *)history_list, sizeof(HISTORY) * history_count);
154   - wl_close(fd_hst);
  155 + wl_write(fd_hst, (void *)history_list, sizeof(HISTORY) * history_count);
  156 + wl_close(fd_hst);
  157 + }
  158 + history_changed = HISTORY_SAVE_NONE;
  159 + rc = 1;
155 160 }
156   - history_changed = HISTORY_SAVE_NONE;
157   - rc = 1;
  161 + else
  162 + rc = -1;
158 163 }
159 164 return rc;
160 165 }
16 wiki-app/wikilib.c
@@ -781,17 +781,17 @@ int wikilib_run(void)
781 781 sleep = 0;
782 782 else
783 783 sleep = 1;
784   - if (display_mode == DISPLAY_MODE_ARTICLE && render_article_with_pcf())
  784 + if (!more_events && display_mode == DISPLAY_MODE_ARTICLE && render_article_with_pcf())
785 785 sleep = 0;
786   - else if (display_mode == DISPLAY_MODE_INDEX && render_search_result_with_pcf())
  786 + else if (!more_events && display_mode == DISPLAY_MODE_INDEX && render_search_result_with_pcf())
787 787 sleep = 0;
788   - else if (display_mode == DISPLAY_MODE_HISTORY && render_history_with_pcf())
  788 + else if (!more_events && display_mode == DISPLAY_MODE_HISTORY && render_history_with_pcf())
789 789 sleep = 0;
790   - if (article_offset != 0)
791   - {
792   - scroll_article();
793   - sleep = 0;
794   - }
  790 + //if (article_offset != 0)
  791 + //{
  792 + // scroll_article();
  793 + // sleep = 0;
  794 + //}
795 795
796 796 #ifdef INCLUDED_FROM_KERNEL
797 797 time_now = get_time_ticks();

0 comments on commit 2361231

Please sign in to comment.
Something went wrong with that request. Please try again.