Update edit entry widget when backing entry changes

* Fixes #4060
* Also fix not emitting entryModified() when history is truncated. This possibly fixes other crashes with apply button when the history is truncated and then the history page is shown with a deleted entry.
This commit is contained in:
Jonathan White 2020-05-31 10:00:11 -04:00
parent 2073f2ddc3
commit 9d10792640
4 changed files with 25 additions and 2 deletions

View file

@ -663,6 +663,7 @@ void Entry::truncateHistory()
return;
}
bool changed = false;
int histMaxItems = db->metadata()->historyMaxItems();
if (histMaxItems > -1) {
int historyCount = 0;
@ -674,6 +675,7 @@ void Entry::truncateHistory()
if (historyCount > histMaxItems) {
delete entry;
i.remove();
changed = true;
}
}
}
@ -697,9 +699,14 @@ void Entry::truncateHistory()
if (size > histMaxSize) {
delete historyItem;
i.remove();
changed = true;
}
}
}
if (changed) {
emit entryModified();
}
}
bool Entry::equals(const Entry* other, CompareItemOptions options) const