documents: Thumbnail SkydriveDocuments once they are loaded
Historically, unlike GoogleDocuments, we were unable to fetch
server-side thumbnails for SkydriveDocuments due to limitations of
OneDrive's REST API. Newer versions of the REST API do support it [1],
but it is not implemented in libzapojit.
Some ways to work around these limitations:
- Create the thumbnail from the EvDocument when it is loaded for
previewing
- Use a cached copy of the document as source for the thumbnail
Even if we can fetch thumbnails from the server in future, these would
still be nice optimizations to have — reduces network consumption and
offers a cheap way to jump ahead in the thumbnailing queue.
documents: Tie the catch blocks more tightly to the failure sites
Having a lot of code inside a try statement makes it harder to follow
the error handling logic. The catch statements are far away from the
code that can throw an exception, so it is difficult to match them
together. Let's reduce the size of the try blocks by only using them
for fallible operations.
documents, pdf-loader: Fix previewing of ODFs and OOXMLs on OneDrive
OneDrive documents were being converted to PDFs via GdPdfLoader, but
LOKDocView was being used instead of EvView to render them. LOKDocView
uses the document's URI property, and in this case it is not a valid
URI that it can use. As a result the preview would fail and sometimes
crash the application.
Solve all that by removing the PDF conversion, and passing the correct
URI to LOKDocView.
This effectively reverts 0bfb23786dc84d390c4bd6bde5f20987874e1e9b
documents: Let everybody provide their own download implementation
This is meant to reduce our reliance on GdPdfLoader for loading remote
documents. We can open ODFs and OOXMLs in LOKDocView, so we don't need
to convert everything to PDFs. In the future, remote sub-classes will
provider their own implementation to download a document, and this will
help unify the loading across the various sub-classes.