mirror of
https://github.com/nextcloud/desktop.git
synced 2024-12-17 19:31:48 +03:00
Account: Add a scoped pointer to the ownCloud theme.
This commit is contained in:
parent
a7d251f8fc
commit
5597ebe455
1 changed files with 13 additions and 2 deletions
|
@ -18,6 +18,7 @@
|
||||||
#include "mirall/mirallconfigfile.h"
|
#include "mirall/mirallconfigfile.h"
|
||||||
#include "mirall/mirallaccessmanager.h"
|
#include "mirall/mirallaccessmanager.h"
|
||||||
#include "mirall/quotainfo.h"
|
#include "mirall/quotainfo.h"
|
||||||
|
#include "mirall/owncloudtheme.h"
|
||||||
#include "creds/abstractcredentials.h"
|
#include "creds/abstractcredentials.h"
|
||||||
#include "creds/credentialsfactory.h"
|
#include "creds/credentialsfactory.h"
|
||||||
|
|
||||||
|
@ -113,9 +114,19 @@ void Account::save()
|
||||||
Account* Account::restore()
|
Account* Account::restore()
|
||||||
{
|
{
|
||||||
QScopedPointer<QSettings> settings(settingsWithGroup(Theme::instance()->appName()));
|
QScopedPointer<QSettings> settings(settingsWithGroup(Theme::instance()->appName()));
|
||||||
|
QScopedPointer<ownCloudTheme> ocTheme(new ownCloudTheme);
|
||||||
|
|
||||||
|
Account *acc = 0;
|
||||||
|
MirallConfigFile cfg;
|
||||||
|
|
||||||
|
if( settings->childKeys().isEmpty() ) {
|
||||||
|
// Now try to open the original ownCloud settings to see if they exist.
|
||||||
|
cfg.setTheme(ocTheme.data());
|
||||||
|
}
|
||||||
|
|
||||||
if (!settings->childKeys().isEmpty()) {
|
if (!settings->childKeys().isEmpty()) {
|
||||||
Account *acc = new Account;
|
acc = new Account;
|
||||||
MirallConfigFile cfg;
|
|
||||||
acc->setApprovedCerts(QSslCertificate::fromData(cfg.caCerts()));
|
acc->setApprovedCerts(QSslCertificate::fromData(cfg.caCerts()));
|
||||||
acc->setUrl(settings->value(QLatin1String(urlC)).toUrl());
|
acc->setUrl(settings->value(QLatin1String(urlC)).toUrl());
|
||||||
acc->setCredentials(CredentialsFactory::create(settings->value(QLatin1String(authTypeC)).toString()));
|
acc->setCredentials(CredentialsFactory::create(settings->value(QLatin1String(authTypeC)).toString()));
|
||||||
|
|
Loading…
Reference in a new issue