Mercurial > trustbridge
diff ui/certificatetablemodel.cpp @ 376:9731d28b95af
Implemented 'remove certificate' in administrator app.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Tue, 15 Apr 2014 12:32:34 +0200 |
parents | 9ba7b4b4c1de |
children | 31079bd54036 |
line wrap: on
line diff
--- a/ui/certificatetablemodel.cpp Tue Apr 15 09:44:54 2014 +0200 +++ b/ui/certificatetablemodel.cpp Tue Apr 15 12:32:34 2014 +0200 @@ -20,6 +20,22 @@ endInsertRows(); } +bool CertificateTabelModel::removeRows(int row, int count, + const QModelIndex &index) +{ + beginRemoveRows(QModelIndex(), row, row + count - 1); + if ((row + count - 1) > certificates.size()) { + return false; + } + for (int i = row + count - 1; i >= row; i--) { + if (!certificates.at(i).isEditable()) { + certificates.removeAt(i); + } + } + endRemoveRows(); + return true; +} + QVariant CertificateTabelModel::data(const QModelIndex &index, int role) const {