Skip to content
Christian Kamm edited this page Jul 17, 2019 · 7 revisions

This document is not up to date, but still somewhat applicable. Prefer in-source documentation where possible.

Account and State Handling

The key is the Account class, which represents an account. The accounts are held by the the AccountManager class. It's main features are:

  • Saving and restoring itself from config file
  • Holding the current state
  • Holding the current URL
  • Holding the credentials (currently: HTTP Basic, Shibboleth, Dummy)
  • Holding a QNetworkAccessManager instance (with convenience methods to create QNetworkReplys.
  • Access the current quota info

State handling

The classes that contribute to state changes are:

  • Application: Set Signed Out on explicit sign out. When the credentials have been fetched, but have not been provided, set SignedOut, if they are wrong (set to InvalidCredentials), set to Disconnected and try again.
  • ConnectionValidator: Keep SignedOut or set Disconnected if authentication fails. Set Disconnected if status.php could not be found in the first place. When in disconnected state, runs every 32 seconds and attempt to connect when the network is available again. If the authentication succeeds, it's set to Connected.
  • Folder: Switch to Disconnected if E-Tag request fails
  • AbstractNetworkJob: Switch to InvalidCredentials state if the credentials are invalid and they job needs to run authenticated.
  • QuotaInfo: Switch associated Account to Disconnected in failure.

Network Jobs

Network Jobs are based on the AbstractNetworkJob class, which provides convenience functions. They require an Account object.