Check if hiding notes by default is enabled, hide text if it is

- Check if hide notes setting is enabled and update EntryModel notes'
  data if so
- Fixes #4412
This commit is contained in:
Ojas Anand 2020-04-04 03:41:40 -04:00 committed by Jonathan White
parent e316a09a79
commit f0709d187d

View File

@ -185,8 +185,12 @@ QVariant EntryModel::data(const QModelIndex& index, int role) const
} }
return result; return result;
case Notes: case Notes:
// Display only first line of notes in simplified format // Display only first line of notes in simplified format if not hidden
if (config()->get("security/hidenotes").toBool()) {
result = EntryModel::HiddenContentDisplay;
} else {
result = entry->notes().section("\n", 0, 0).simplified(); result = entry->notes().section("\n", 0, 0).simplified();
}
if (attr->isReference(EntryAttributes::NotesKey)) { if (attr->isReference(EntryAttributes::NotesKey)) {
result.prepend(tr("Ref: ", "Reference abbreviation")); result.prepend(tr("Ref: ", "Reference abbreviation"));
} }