mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 23:28:14 +03:00
Run initial check on creation of FileProviderSettingsController
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
5f059a23ce
commit
f5b80e9ec1
1 changed files with 14 additions and 0 deletions
|
@ -50,6 +50,8 @@ public:
|
|||
{
|
||||
q = parent;
|
||||
_userDefaults = NSUserDefaults.standardUserDefaults;
|
||||
|
||||
initialCheck();
|
||||
};
|
||||
|
||||
~MacImplementation() = default;
|
||||
|
@ -129,6 +131,18 @@ private:
|
|||
return (NSArray<NSString *> *)[_userDefaults objectForKey:accsKey];
|
||||
}
|
||||
|
||||
void initialCheck()
|
||||
{
|
||||
NSArray<NSString *> *const vfsEnabledAccounts = nsEnabledAccounts();
|
||||
if (vfsEnabledAccounts != nil) {
|
||||
return;
|
||||
}
|
||||
|
||||
qCDebug(lcFileProviderSettingsController) << "Initial check for file provider settings found nil enabled vfs accounts array."
|
||||
<< "Enabling all accounts on initial setup.";
|
||||
[[maybe_unused]] const auto result = enableVfsForAllAccounts();
|
||||
}
|
||||
|
||||
FileProviderSettingsController *q = nullptr;
|
||||
NSUserDefaults *_userDefaults = nil;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue