Skip to content
Snippets Groups Projects
Commit 0fe26da1 authored by Emmanuel Lepage Vallee's avatar Emmanuel Lepage Vallee Committed by Emmanuel Lepage Vallée
Browse files

cipher: Fix deserialization

A line of code was downright missing

This commit also update account rolestates to disable
more settings (including ciphers) for Ring-DHT accounts

Refs #76885

Change-Id: Ic3d64f5e7db752cdc98cbdf39655b0e7863afe09
parent a4d1ad95
No related branches found
No related tags found
No related merge requests found
...@@ -1998,8 +1998,12 @@ Account::RoleState Account::roleState(Account::Role role) const ...@@ -1998,8 +1998,12 @@ Account::RoleState Account::roleState(Account::Role role) const
case Account::Role::HasCustomUserAgent: case Account::Role::HasCustomUserAgent:
case Account::Role::HasProxy : case Account::Role::HasProxy :
case Account::Role::Proxy : case Account::Role::Proxy :
case Account::Role::CipherModel :
return Account::RoleState::UNAVAILABLE; return Account::RoleState::UNAVAILABLE;
case Account::Role::Username : case Account::Role::Username :
case Account::Role::TlsCaListCertificate :
case Account::Role::TlsCertificate :
case Account::Role::TlsPrivateKeyCertificate:
return Account::RoleState::READ_ONLY; return Account::RoleState::READ_ONLY;
default: default:
break; break;
......
...@@ -37,7 +37,7 @@ public: ...@@ -37,7 +37,7 @@ public:
bool* m_lChecked ; bool* m_lChecked ;
Account* m_pAccount ; Account* m_pAccount ;
static QVector<QByteArray> m_slSupportedCiphers; static QVector<QByteArray> m_slSupportedCiphers;
static QHash<QString,int> m_shMapping ; static QHash<const QString,int> m_shMapping ;
static bool m_sIsLoaded ; static bool m_sIsLoaded ;
bool m_UseDefault ; bool m_UseDefault ;
...@@ -46,14 +46,16 @@ public: ...@@ -46,14 +46,16 @@ public:
bool CipherModelPrivate::m_sIsLoaded = false; bool CipherModelPrivate::m_sIsLoaded = false;
QVector<QByteArray> CipherModelPrivate::m_slSupportedCiphers; QVector<QByteArray> CipherModelPrivate::m_slSupportedCiphers;
QHash<QString,int> CipherModelPrivate::m_shMapping; QHash<const QString,int> CipherModelPrivate::m_shMapping;
CipherModelPrivate::CipherModelPrivate(Account* parent) : m_pAccount(parent),m_UseDefault(true) CipherModelPrivate::CipherModelPrivate(Account* parent) : m_pAccount(parent),m_UseDefault(true)
{ {
if (!CipherModelPrivate::m_sIsLoaded) { if (!CipherModelPrivate::m_sIsLoaded) {
const QStringList cs = DBus::ConfigurationManager::instance().getSupportedCiphers(DRing::Account::ProtocolNames::IP2IP); const QStringList cs = DBus::ConfigurationManager::instance().getSupportedCiphers(DRing::Account::ProtocolNames::IP2IP);
foreach(const QString& c, cs) foreach(const QString& c, cs) {
m_shMapping[c] = m_slSupportedCiphers.size();
m_slSupportedCiphers << c.toLatin1(); m_slSupportedCiphers << c.toLatin1();
}
m_sIsLoaded = true; m_sIsLoaded = true;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment