New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure "Open last/previous" point to existing files #4367

Merged
merged 1 commit into from Nov 28, 2018

Conversation

Projects
None yet
2 participants
@poire-z
Contributor

poire-z commented Nov 28, 2018

In reader, after having opened doc1.html and doc2.html, being in doc2.html, going to History (where Delete on current book doc2.html is forbidden) and deleting doc1.html, we would still see in the top right menu: Previous: doc1.html, and taping on it would show the Opening dialog, an error, and KOReader would exit (UIManager: no widget left to show).
This fixes this by ensuring we alway refresh the previous document in that menu item to the previous still existing document.

I also ensured it globally for any Delete from FileManager or History invoked from FileManager, to fix: Reading doc1.html > File browser > delete doc1.html > Exiting Koreader > Opening Koreader > Cannot open last file. This could be because it was deleted or because external storage is still being mounted. Do you want to retry?

Deleted files still stay in History (for those that don't have the option to not do that enabled), they are just not candidates for the Open last/Open previous menu items.

@Frenzie

lgtm

@Frenzie Frenzie merged commit 2b9694d into koreader:master Nov 28, 2018

@poire-z poire-z deleted the poire-z:ensureLastFileExists branch Nov 28, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment