Skip to content
Snippets Groups Projects
Commit 1e7c7c9c authored by Emmanuel Lepage Vallee's avatar Emmanuel Lepage Vallee Committed by Guillaume Roguez
Browse files

ciphers: Fix the default cipher option

 * Also add a 'modified' signal to make it easier to the clients
   to track the property change
 * Add a missing comment (for conformance with the coding guidelines)

Refs #72494

(cherry picked from commit 721a1548)
parent 16342e62
Branches release-0.3.x
Tags 0.3.0
No related merge requests found
...@@ -60,8 +60,10 @@ CipherModelPrivate::CipherModelPrivate(Account* parent) : m_pAccount(parent),m_U ...@@ -60,8 +60,10 @@ CipherModelPrivate::CipherModelPrivate(Account* parent) : m_pAccount(parent),m_U
m_lChecked = new bool[m_slSupportedCiphers.size()]{}; m_lChecked = new bool[m_slSupportedCiphers.size()]{};
foreach(const QString& cipher, parent->d_ptr->accountDetail(DRing::Account::ConfProperties::TLS::CIPHERS).split(' ')) { foreach(const QString& cipher, parent->d_ptr->accountDetail(DRing::Account::ConfProperties::TLS::CIPHERS).split(' ')) {
m_lChecked[m_shMapping[cipher]] = true; if (!cipher.trimmed().isEmpty()) {
m_UseDefault = false; m_lChecked[m_shMapping[cipher]] = true;
m_UseDefault = false;
}
} }
} }
...@@ -131,6 +133,9 @@ bool CipherModel::setData( const QModelIndex& index, const QVariant &value, int ...@@ -131,6 +133,9 @@ bool CipherModel::setData( const QModelIndex& index, const QVariant &value, int
ciphers << d_ptr->m_slSupportedCiphers[i]; ciphers << d_ptr->m_slSupportedCiphers[i];
} }
d_ptr->m_pAccount->d_ptr->setAccountProperty(DRing::Account::ConfProperties::TLS::CIPHERS,ciphers.join(QString(' '))); d_ptr->m_pAccount->d_ptr->setAccountProperty(DRing::Account::ConfProperties::TLS::CIPHERS,ciphers.join(QString(' ')));
emit modified();
return true; return true;
} }
return false; return false;
......
...@@ -42,6 +42,7 @@ class LIB_EXPORT CipherModel : public QAbstractListModel { ...@@ -42,6 +42,7 @@ class LIB_EXPORT CipherModel : public QAbstractListModel {
public: public:
//Property
Q_PROPERTY(bool useDefault READ useDefault WRITE setUseDefault) Q_PROPERTY(bool useDefault READ useDefault WRITE setUseDefault)
//Model functions //Model functions
...@@ -66,6 +67,9 @@ private: ...@@ -66,6 +67,9 @@ private:
CipherModelPrivate* d_ptr; CipherModelPrivate* d_ptr;
Q_DECLARE_PRIVATE(CipherModel) Q_DECLARE_PRIVATE(CipherModel)
Q_SIGNALS:
void modified();
}; };
Q_DECLARE_METATYPE(CipherModel*) Q_DECLARE_METATYPE(CipherModel*)
#endif #endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment