Mercurial > trustbridge
diff ui/certificatetablemodel.cpp @ 353:666abcfab229
Implemented setData in certificate table model.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Thu, 10 Apr 2014 15:56:59 +0200 |
parents | e6aa82466420 |
children | 9ba7b4b4c1de |
line wrap: on
line diff
--- a/ui/certificatetablemodel.cpp Thu Apr 10 15:55:47 2014 +0200 +++ b/ui/certificatetablemodel.cpp Thu Apr 10 15:56:59 2014 +0200 @@ -45,7 +45,16 @@ bool CertificateTabelModel::setData(const QModelIndex &index, const QVariant &value, int role) { - //TODO + if (index.row() > certificates.size() || index.row() < 0) { + return false; + } + + bool newValue = value.toBool(); + Certificate &cert = certificates[index.row()]; + cert.setInstallCert(newValue); + + emit dataChanged(index, index); + return true; }