keeping with the refactoring

This commit is contained in:
Blue 2023-02-03 21:43:13 +03:00
parent edf1ee60cd
commit bf11d8a74e
Signed by untrusted user: blue
GPG key ID: 9B203B252A63EE38
8 changed files with 298 additions and 6 deletions

View file

@ -89,6 +89,22 @@ Qt::ItemFlags Models::EMails::flags(const QModelIndex& index) const {
return f;
}
bool Models::EMails::setEditable(bool editable) {
if (edit != editable) {
edit = editable;
if (deque.size() > 0) {
int lastRow = deque.size() - 1;
QModelIndex begin = createIndex(0, 0, &(deque[0]));
QModelIndex end = createIndex(lastRow, columnCount() - 1, &(deque[lastRow]));
emit dataChanged(begin, end);
}
return true;
}
return false;
}
bool Models::EMails::setData(const QModelIndex& index, const QVariant& value, int role) {
if (role == Qt::EditRole && checkIndex(index)) {
Shared::VCard::Email& item = deque[index.row()];