Architecture

Source map

Part Purpose
src/paperless/config.* Server URL, user name and TLS preference in ~/.config/org.frapps/harbour-paperiton/settings.conf
src/paperless/secretsstore.* The API token in a device-lock collection of Sailfish Secrets, with migration of tokens written by versions up to 0.6
src/paperless/api.* QNetworkAccessManager wrapper: token header, redirect retries, timeouts, downloads, uploads, permission probe
src/paperless/documentlistmodel.* Paginated list model for /api/documents/
src/paperless/lookupmodel.* Tags, correspondents and document types by id
src/paperless/customfieldsmodel.* The custom fields defined on the server
src/paperless/savedviewmodel.* Saved views, translated into query parameters
src/paperless/uploadqueue.* Multipart uploads and polling of the consumer task
src/paperless/filetypes.h The file kinds Paperless can consume, shared by picker, share target and upload queue
src/paperless/tasklistmodel.* /api/tasks/ and acknowledging failures
src/paperless/thumbimageprovider.* image://paperless/thumb/<id> and image://paperless/preview/<id>
qml/pages/* Silica UI

Networking rules

Networking lives in C++ because the Paperless endpoints for thumbnails and previews need an Authorization: Token … header, which QML’s Image cannot send.

All API paths keep their trailing slash: Django redirects slash-less URLs and the redirect drops the authorization header.

Sandbox layout

Sailjail gives the app three private directories, named after the OrganizationName and ApplicationName of the desktop file:

  • ~/.config/org.frapps/harbour-paperiton - settings
  • ~/.cache/org.frapps/harbour-paperiton - thumbnails, downloaded documents, camera captures and the web view profile
  • the matching ~/.local/share directory - unused

Documents that are opened are written to ~/Downloads/Paperiton under the server’s file name. Pictures are shown by qml/pages/ImageViewPage.qml; everything else is handed to the system with Qt.openUrlExternally. Camera captures live under captures/ in the cache and are removed when the app starts and when it quits; signing out also clears thumbnails and the web view profile.


This site uses Just the Docs, a documentation theme for Jekyll.