mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 15:06:08 +03:00
Fetch and store user info for accounts in file provider settings controller
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
7d229b569f
commit
f68965a241
2 changed files with 16 additions and 0 deletions
|
@ -19,6 +19,8 @@
|
|||
|
||||
namespace OCC {
|
||||
|
||||
class UserInfo;
|
||||
|
||||
namespace Mac {
|
||||
|
||||
class FileProviderSettingsController : public QObject
|
||||
|
@ -50,6 +52,8 @@ private:
|
|||
|
||||
class MacImplementation;
|
||||
std::unique_ptr<MacImplementation> d;
|
||||
|
||||
QHash<QString, UserInfo*> _userInfos;
|
||||
};
|
||||
|
||||
} // Mac
|
||||
|
|
|
@ -264,6 +264,18 @@ FileProviderSettingsController::FileProviderSettingsController(QObject *parent)
|
|||
: QObject{parent}
|
||||
{
|
||||
d = std::make_unique<FileProviderSettingsController::MacImplementation>(this);
|
||||
|
||||
const auto accManager = AccountManager::instance();
|
||||
const auto accountsList = accManager->accounts();
|
||||
|
||||
for (const auto &accountState : accountsList) {
|
||||
const auto userInfo = new UserInfo(accountState.data(), false, false, this);
|
||||
const auto account = accountState->account();
|
||||
const auto accountUserIdAtHost = account->userIdAtHostWithPort();
|
||||
|
||||
_userInfos.insert(accountUserIdAtHost, userInfo);
|
||||
userInfo->setActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
QQuickWidget *FileProviderSettingsController::settingsViewWidget(const QString &accountUserIdAtHost,
|
||||
|
|
Loading…
Reference in a new issue