2
0
mirror of https://github.com/koreader/koreader synced 2024-10-31 21:20:20 +00:00
Commit Graph

44 Commits

Author SHA1 Message Date
NiLuJe
bf6c0cdd6c
LuaSettings: Add a method to initialize a setting properly (#7371)
* LuaSettings/DocSettings: Updated readSetting API to allow proper initialization to default.
Use it to initialize tables, e.g., fixing corner-cases in readerFooter that could prevent settings from being saved.
(Fixes an issue reported on Gitter).
* LuaSettings/DocSettings: Add simpler API than the the flip* ones to toggle boolean settings.
* Update LuaSettings/DocSettigns usage throughout the codebase to use the dedicated boolean methods wher appropriate, and clean up some of the more mind-bending uses.
* FileChooser: Implement an extended default exclusion list (fix #2360)
* ScreenSaver: Refactor to avoid the pile of kludges this was threatening to become. Code should be easier to follow and use, and fallbacks now behave as expected (fix #4418).
2021-03-06 22:44:18 +01:00
poire-z
cfa45f8d88 History: show last read date instead of file size
In classic and list display modes.
2020-08-29 20:07:26 +02:00
poire-z
5a4f5b4d59 bump crengine, migrate books to normalized xpointers
Enable new rendering feature COMPLETE_INCOMPLETE_TABLES
on all enhanced rendering mode, but have it disabled for
earlier cre_dom_version.
Also increase default_cre_storage_size_factor from 20 to 40.
2020-02-24 23:36:13 +01:00
poire-z
04d9a557aa Use fsync() for more robust setting files saving
Bump base for util.fsyncOpenedFile() and util.fsyncDirectory().

Use these to force flush to storage device when
saving luasetting, docsetting, and history.lua.
Also dont rotate them to .old until they are at least
60 seconds old.
Also make auto_save_paging_count count right.

Also bump crengine: open (as text) small or empty files
2019-12-10 23:57:32 +01:00
Frans de Jonge
a2dcfe9aec
[doc] Tag @todo, @fixme and @warning (#5244)
This commit standardizes the various todos around the code a bit in a manner recognized by LDoc.

Besides drawing more attention by being displayed in the developer docs, they're also extractable with LDoc on the command line:

```sh
ldoc --tags todo,fixme *.lua
```

However, whether that particular usage offers any advantage over other search tools is questionable at best.

* and some random beautification
2019-08-23 19:53:53 +02:00
poire-z
bb949afb7f
Fix crash and History with books in read-only directories (#4138)
docsettings can be stored either as a sidecar file (prefered, when
possible), or as a .lua file in the koreader/history/ folder (good,
when book is in a read-only directory where we can't create the
.sdr/ directory).
They are managed correctly if for some reason, the book directory
becomes writable: the docsettings in history/ is read, used, and
removed when a docsetting in a .sdr/ can be saved.
These docsettings in koreader/history/ contribute to the History
list build: they are put it in history.lua, and the duplicates
on followups history.lua builds are removed.

This fix a crash when a book is in a read-only directory.
Also fix History containing strange entries like "Book.epub.lua",
that came from the koreader/history/book.epub.lua.old backup,
that weren't removed as they are not a duplicate.
2018-08-06 21:30:05 +02:00
Hzj_jie
7461e396dd [chore] Ignore empty files and tables in DocSettings (#3348) 2017-10-12 19:52:01 +02:00
Zijie He
2ba079e3eb Reserve last good docsetting 2017-08-17 08:50:15 +02:00
Frans de Jonge
96d4adb34c Docs: DocSettings (#2763) 2017-04-13 21:11:10 -07:00
Hzj_jie
0b29e73e2e BatteryStat plugin and instruction of KoboLight plugin (#2643)
* Start battery stat plugin

* BatteryStat & kobolight

* Several minor improvements

* Remove a useless function

* flush settings

* Some review feedbacks

* Resolve review comments

* Remaining Minutes -> Remaining Hours

* Add dump_file

* typo

* realpath

* realpath on folder

* Remove useless os.time()

* Resolve review comments

* warning

* Add BatteryStat.debugging flag

* treat log as txt

* Minor improvement

* Charging hour should be positive

* Use warn instead of info

* onSuspend in Kobo

* Charging events for kobo and kindle

* More events

* dumpOrLog

* Warnings

* Typo

* More space

* Singleton

* slightly format change

* BatteryStat singleton

* Init

* Remove debugging flag

* sleeping percentage is still negative

* Read settings

* Do not need to change was_suspending and was_charging

* Typo

* Remove debugging flag

* Not charging should happen before suspend

* Resolve review comments

* was_suspend and was_charging should be updated each time in onCallback()
2017-03-23 23:36:15 -07:00
Qingping Hou
2aa9d5d64e test: add unit tests for docsettings 2017-03-06 07:47:20 +01:00
Zijie He
83d8606270 Crash on directory 2017-02-08 10:46:55 -08:00
Zijie He
b502047635 Removing metadata file instead of purging .sdr folder 2017-02-08 10:38:24 -08:00
poire-z
8f6a38db69 Fix sidecar file name
Get back "metadata." part forgotten while refactoring.
2017-01-22 02:42:34 -08:00
Hzj_jie
529d1b3d33 evernote: ReadHistory integration and text file output (#2498) 2017-01-21 01:32:42 -08:00
poire-z
0aa19d72a0 FileManager: show files with sidecar dir in bold (#2391)
docsettings : added hasSidecarDir() and made getSidecarDir() more robust
widget/menu : allow items to specify themselves to be displayed in bold
2016-12-04 15:51:12 -08:00
Zijie He
ced671bc69 Add readhistory_spec / docsettings_spec 2016-09-12 20:04:13 -07:00
Hzj_jie
7493fc89f6 Add removed item name in "Remove this item from history" and fix wrong items deleted issue. (#2164)
* Add removed item name in "Remove this item from history".

* Fix #2162, wrong history items deleted.
2016-07-18 22:37:57 -07:00
Qingping Hou
20eb36a03d feat: add network management UI for kobo 2016-07-11 23:50:19 -07:00
Hzj_jie
cf8c0aa81f Add docsettings unittest 2016-06-06 10:05:16 -07:00
Hzj_jie
016aaa92b9 Merge remote-tracking branch 'upstream/master'
Conflicts:
	frontend/docsettings.lua
2016-06-06 08:56:07 -07:00
Hzj_jie
2085b774e2 Remove legacy document settings after flushing. 2016-06-04 12:26:05 -07:00
Qingping Hou
2e417cfbd8 filemanager(refactor): use purge method from docsettings 2016-06-03 22:06:02 -07:00
Zijie He
4f897acc67 Refine docsettings, does not write history folder if it's not necessary. 2016-06-02 18:01:14 -07:00
Zijie He
667e8834ad Migrate history folder, FileManagerHistory uses own history.lua file and ReadHistory component 2016-04-20 22:44:44 -07:00
Frans de Jonge
5638819f25 Removed a bunch of "successfully", replaced an ellipsis, and some deviant spellings of KOReader. 2016-04-16 12:37:08 +02:00
Zijie He
ccd95b80fa Prefer sdr folder to history folder 2016-04-14 12:50:02 -07:00
Qingping Hou
e5c1ff1ef6 test(bookmark): purge doc settings before test 2016-03-27 17:17:46 -07:00
Qingping Hou
11ee8d6fcc refactor: use new KeyValuePage widget for displaying statistics 2016-02-14 21:54:17 -08:00
Qingping Hou
9bd2d42834 build: enforce luacheck in travis build 2016-02-09 23:01:52 -08:00
Qingping Hou
722eaed4b2 feat: docsettings:getSidecarDir 2016-01-09 12:12:10 -08:00
chrox
a60544b1ad Koreader Ubuntu-touch port
Currently only tested on Ubuntu-touch emulator with framework
ubuntu-sdk-14.10 for armhf.
The ubuntu-touch port is binary compatible with the Kobo port
major changes in this PR are:
1. rename the emulator device to sdl device since both the emulator
and the ubuntu-touch target use libsdl to handle input/output.
2. ubuntu-touch app has no write access to the installation dir so
all write-outs should be in a seperate dir definded in `datastorage`.
2015-10-03 14:48:51 +08:00
chrox
34ea9ac574 add datastorage module to handle data directory on various platform
On kindle, kobo and pocketbook the data directory is the current
running directory but on Android the app is installed in system
defined location and users may have no access to that location.
The same circumstances should be true for the upcoming Koreader for
Ubuntu touch, so the data directory (in which tessdata, dictionaries,
global settings, persistant defaults and probably history data are
stored) could be stored in another place.
2015-06-15 16:56:27 +08:00
Hans-Werner Hilse
5b48c165b3 factor out dump() function, handle reference loops 2014-11-14 16:33:52 +01:00
chrox
6ee8f22d73 add clear api for DocSettings
to remove both history settings and sidecar settings
2014-10-07 13:06:52 +08:00
WS64
d47af7e368 minor code optimizing optimizing 2014-09-18 19:04:00 +02:00
WS64
f7c640e550 Code optimization 2014-09-18 10:17:40 +02:00
chrox
b7c7287bab remove more global variables 2014-08-14 19:52:30 +08:00
chrox
3b25af4f4d protected call to open sidecar history file
This should fix #724.
2014-07-15 10:14:57 +08:00
chrox
a3a4e7f7fb fix dofile of nil filename 2014-07-04 01:41:24 +08:00
chrox
2900432efb read/save document settings in document sidecar too 2014-07-03 20:42:48 +08:00
Qingping Hou
8162192a9d fix(setting): handle empty setting files properly
empty reader setting evalues to nil
2014-06-04 14:56:04 -04:00
chrox
92219a1f1e cleanup: expand tab to 4 spaces 2014-03-13 21:52:43 +08:00
HW
ef111b99c6 Refactored to use strictly locals 2013-10-18 22:38:07 +02:00