Mercurial > trustbridge
comparison ui/certificatetablemodel.cpp @ 396:26651cc0cc47
Remove all certificates if a new list is loaded from file.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Tue, 15 Apr 2014 16:45:37 +0200 |
parents | 1220b741cd51 |
children | 8752aae8aad8 |
comparison
equal
deleted
inserted
replaced
395:a63601810211 | 396:26651cc0cc47 |
---|---|
29 beginRemoveRows(QModelIndex(), row, row + count - 1); | 29 beginRemoveRows(QModelIndex(), row, row + count - 1); |
30 if ((row + count - 1) > certificates.size()) { | 30 if ((row + count - 1) > certificates.size()) { |
31 return false; | 31 return false; |
32 } | 32 } |
33 for (int i = row + count - 1; i >= row; i--) { | 33 for (int i = row + count - 1; i >= row; i--) { |
34 if (!certificates.at(i).isEditable()) { | 34 certificates.removeAt(i); |
35 certificates.removeAt(i); | |
36 } | |
37 } | 35 } |
38 endRemoveRows(); | 36 endRemoveRows(); |
39 return true; | 37 return true; |
38 } | |
39 | |
40 bool CertificateTabelModel::removeAll() | |
41 { | |
42 return removeRows(0, certificates.size(), QModelIndex()); | |
40 } | 43 } |
41 | 44 |
42 QVariant CertificateTabelModel::data(const QModelIndex &index, | 45 QVariant CertificateTabelModel::data(const QModelIndex &index, |
43 int role) const | 46 int role) const |
44 { | 47 { |