diff --git a/src/ciphermodel.cpp b/src/ciphermodel.cpp index 38f7430abe95eb2c96be81d9d14d20c7a7b1509b..2da3db30f98eec8b586445ac0f260977ca326afa 100644 --- a/src/ciphermodel.cpp +++ b/src/ciphermodel.cpp @@ -60,8 +60,10 @@ CipherModelPrivate::CipherModelPrivate(Account* parent) : m_pAccount(parent),m_U m_lChecked = new bool[m_slSupportedCiphers.size()]{}; foreach(const QString& cipher, parent->d_ptr->accountDetail(DRing::Account::ConfProperties::TLS::CIPHERS).split(' ')) { - m_lChecked[m_shMapping[cipher]] = true; - m_UseDefault = false; + if (!cipher.trimmed().isEmpty()) { + m_lChecked[m_shMapping[cipher]] = true; + m_UseDefault = false; + } } } @@ -131,6 +133,9 @@ bool CipherModel::setData( const QModelIndex& index, const QVariant &value, int ciphers << d_ptr->m_slSupportedCiphers[i]; } d_ptr->m_pAccount->d_ptr->setAccountProperty(DRing::Account::ConfProperties::TLS::CIPHERS,ciphers.join(QString(' '))); + + emit modified(); + return true; } return false; diff --git a/src/ciphermodel.h b/src/ciphermodel.h index c340071e77a350c24ba79e1d9d46569b8ebcdbdc..5e0690fa5337b9ccc7f7cf881caf1771a19eb2e4 100644 --- a/src/ciphermodel.h +++ b/src/ciphermodel.h @@ -42,6 +42,7 @@ class LIB_EXPORT CipherModel : public QAbstractListModel { public: + //Property Q_PROPERTY(bool useDefault READ useDefault WRITE setUseDefault) //Model functions @@ -66,6 +67,9 @@ private: CipherModelPrivate* d_ptr; Q_DECLARE_PRIVATE(CipherModel) +Q_SIGNALS: + void modified(); + }; Q_DECLARE_METATYPE(CipherModel*) #endif