mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-25 05:45:42 +03:00
Add some additional converters for domain and account identifiers in FileProviderDomainManager
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
fd87bffeef
commit
9dfa3d76a7
1 changed files with 13 additions and 1 deletions
|
@ -23,6 +23,8 @@
|
|||
#include "gui/accountmanager.h"
|
||||
#include "libsync/account.h"
|
||||
|
||||
// Ensure that conversion to/from domain identifiers and display names
|
||||
// are consistent throughout these classes
|
||||
namespace {
|
||||
|
||||
QString domainIdentifierForAccount(const OCC::Account * const account)
|
||||
|
@ -47,9 +49,19 @@ QString domainDisplayNameForAccount(const OCC::AccountPtr account)
|
|||
return domainDisplayNameForAccount(account.get());
|
||||
}
|
||||
|
||||
QString accountIdFromDomainId(const QString &domainId)
|
||||
{
|
||||
return domainId;
|
||||
}
|
||||
|
||||
QString accountIdFromDomainId(NSString * const domainId)
|
||||
{
|
||||
return accountIdFromDomainId(QString::fromNSString(domainId));
|
||||
}
|
||||
|
||||
QString accountIdFromDomain(NSFileProviderDomain * const domain)
|
||||
{
|
||||
return QString::fromNSString(domain.identifier);
|
||||
return accountIdFromDomainId(domain.identifier);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue