-
Notifications
You must be signed in to change notification settings - Fork 665
Design
Olivier Goffart edited this page May 27, 2014
·
7 revisions
The key is the Account
class, which represents an account. Currently, only a single account is possible, but the class was designed such that there could easily be more. The main account is held by the the AccountManager
class, which again is designed to hold multiple accounts in the future. It's main featurs 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
QAbstractNetworkManager
instance (with convenience methods to createQNetworkReply
s. - Access the current quota info
In the future, some of these functions could further be divided into separate classes.
Note: The Account
constructor expects an SSLErrorHandler
. This is because it creates and holds a QAbstractNetworkManager
that could throw SSL errors.
The classes that contribute to state changes are:
-
Application
: SetSigned Out
on explicit sign out. When the credentials have been fetched, but have not been provided, setSignedOut
, if they are wrong (set toInvalidCredentials
), set toDisconnected
and try again. -
ConnectionValidator
: KeepSignedOut
or setDisconnected
if authentication fails. SetDisconnected
ifstatus.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. -
Folder
: Switch toDisconnected
if E-Tag request fails -
AbstractNetworkJob
: Switch toInvalidCredentials
state if the credentials are invalid and they job needs to run authenticated. -
QuotaInfo
: Switch associated Account toDisconnected
in failure.
Network Jobs are based on the AbstractNetworkJob
class, which provides convenience functions. They require an Account
object.
☁️