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
Storage class #1225
Merged
Merged
Storage class #1225
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
This PR adds a storage class that sits between the project class and the disk storage of a novelWriter project. It has been untangled from within the project class. The main reasons for doing this is to both reduce the complexity of the project class, and to make it possible to modify how projects are stored to include single file storage as an option.
The storage class doesn't handle the I/O as it is now written. The idea is to keep the current model for reading and writing individual files even when a single file storage options is added. The storage class instead provides a ruintime path to the various files in the case of meta data files, and for project content it provides an object for I/O to the component file.
The idea for single file storage is to use an archive format between sessions, and extract the archive to a sensible location when the project is open. I currently do not want to set up an in-memory model, however the storage class can in principle be extended to such a feature by re-implementing how meta data files are accessed. For project content, the change could be handled internally in the storage class.
This PR also:
Related Issue(s):
Resolves #1152
Resolves #1222
Reviewer's Checklist: