diff options
author | Christian Kamm <mail@ckamm.de> | 2016-03-01 18:08:23 +0300 |
---|---|---|
committer | Christian Kamm <mail@ckamm.de> | 2016-03-01 18:08:23 +0300 |
commit | d521232587bca2b01afb1b2174b26788d10408dc (patch) | |
tree | 652e4826f668daedff6dd33aefe2445dab107110 /src/gui/accountstate.h | |
parent | 10e8f03ea4e1bbc63a99526b7c56f777c3a81c67 (diff) |
AccountState: Allow storing state in settings
This will be useful if we ever want to store account-level gui state.
I built this originally because I thought a paused account would be
this kind of state.
Diffstat (limited to 'src/gui/accountstate.h')
-rw-r--r-- | src/gui/accountstate.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/gui/accountstate.h b/src/gui/accountstate.h index 61a8dc1fb..d06262a56 100644 --- a/src/gui/accountstate.h +++ b/src/gui/accountstate.h @@ -64,9 +64,21 @@ public: typedef ConnectionValidator::Status ConnectionStatus; /// Use the account as parent - AccountState(AccountPtr account); + explicit AccountState(AccountPtr account); ~AccountState(); + /** Creates an account state from settings and an Account object. + * + * Use from AccountManager with a prepared QSettings object only. + */ + static AccountState* loadFromSettings(AccountPtr account, QSettings& settings); + + /** Writes account state information to settings. + * + * It does not write the Account data. + */ + void writeToSettings(QSettings& settings); + AccountPtr account() const; ConnectionStatus connectionStatus() const; |