Add UserInfo class and fetch quota via API instead of PropfindJob
authorMichael Schuster <michael@schuster.ms>
Fri, 14 Feb 2020 01:10:01 +0000 (02:10 +0100)
committerMichael Schuster <michael@schuster.ms>
Fri, 14 Feb 2020 01:10:01 +0000 (02:10 +0100)
commitabfebcf2917e971a4e8c279d3f2871c79e64583a
tree871350d0f6759b440e57e80ae2d96f068d0f1317
parentbbb310a853b930692dd69dd1f9b6038dece0479a
Add UserInfo class and fetch quota via API instead of PropfindJob

The PropfindJob quota includes the size of shares and thus leads to confusion
in regard of the real space available, as shown in the UI.
This commit aims to streamline the behaviour with the Android and iOS apps,
which also utilize the API.

Details:
- Refactor the QuotaInfo class into UserInfo
- Use JsonApiJob (ocs/v1.php/cloud/user) instead of PropfindJob
- Let ConnectionValidator use the new UserInfo class to fetch
  the user and the avatar image (to avoid code duplication)
- Allow updating the avatar image upon AccountSettings visibility,
  using UserInfo's quota fetching

Signed-off-by: Michael Schuster <michael@schuster.ms>
src/gui/CMakeLists.txt
src/gui/accountsettings.cpp
src/gui/accountsettings.h
src/gui/accountstate.cpp
src/gui/connectionvalidator.cpp
src/gui/connectionvalidator.h
src/gui/quotainfo.cpp [deleted file]
src/gui/quotainfo.h [deleted file]
src/gui/userinfo.cpp [new file with mode: 0644]
src/gui/userinfo.h [new file with mode: 0644]